From 175542288b3940a194b037540132d55f99e26215 Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Tue, 18 Oct 2022 11:14:53 +1300 Subject: [PATCH] Ethereum (#2) * rebase * pull latest changes * updating dependencies * Fix runtime exit * bug fixes * fix linter * fix linter * Rename node-avalanche to node * modify to index ethereum * bug fixes * bug fixes * lint fixes * Update CI, remove common-node dependency * Fix up releases CI workflow * Fix runtime issues, add support for api key * Bump versions to fix CI prerelease * [SKIP CI] Prerelease * Fix DI issues * [SKIP CI] Prerelease * Update sequelize * [SKIP CI] Prerelease * [release] 20220907 Avalanche (#6) * [release] 20220907 * Update changelog * Fix comparing chain id to genesis hash (#8) * Fix comparing chain id to genesis hash * Update changelog * [SKIP CI] Prerelease * [release] 20220908 (#9) * add custom ds (#7) * add custom ds * add gitpod dockerfile * setup postgresql in gitpod dockerfile * bug fixes * remove block reference from logs * check if topic exists in logs while filtering * fix log filter * [SKIP CI] Prerelease * bug fixes * gitpod config * add ethers to dependancy * add gitpod config * Update .gitpod.yml * change package names to ethereum * get full block details * get genesis block from eth call * Clean up, rename types-ethereum to types * Empty to test CI Co-authored-by: DeveloperInProgress --- .github/workflows/gh-release.yml | 33 +- .github/workflows/node-avalanche-docker.yml | 60 - .github/workflows/node-docker.yml | 4 +- .github/workflows/node-terra-docker.yml | 60 - .github/workflows/prerelease.yml | 83 +- .github/workflows/query-docker.yml | 60 - .github/workflows/release.yml | 96 +- .github/workflows/scripts/nodeTerraVersion.sh | 9 - .github/workflows/scripts/queryVersion.sh | 9 - .gitpod.dockerfile | 1 + .gitpod.yml | 9 + README.md | 2 +- jest.config.js | 12 +- package.json | 10 +- packages/cli/CHANGELOG.md | 291 - packages/cli/README.md | 313 - packages/cli/bin/run | 5 - packages/cli/bin/run.cmd | 3 - packages/cli/package.json | 88 - packages/cli/src/commands/build.ts | 64 - packages/cli/src/commands/codegen.ts | 31 - .../cli/src/commands/deployment/delete.ts | 38 - .../cli/src/commands/deployment/deploy.ts | 166 - packages/cli/src/commands/deployment/index.ts | 60 - .../cli/src/commands/deployment/promote.ts | 42 - packages/cli/src/commands/init.ts | 226 - packages/cli/src/commands/migrate.ts | 42 - .../src/commands/project/create-project.ts | 51 - .../src/commands/project/delete-project.ts | 33 - packages/cli/src/commands/project/index.ts | 56 - packages/cli/src/commands/publish.test.ts | 52 - packages/cli/src/commands/publish.ts | 58 - packages/cli/src/commands/validate.ts | 61 - packages/cli/src/constants.ts | 10 - .../cli/src/controller/build-controller.ts | 79 - .../src/controller/codegen-controller.spec.ts | 31 - .../src/controller/codegen-controller.test.ts | 27 - .../cli/src/controller/codegen-controller.ts | 317 - .../src/controller/deploy-controller.spec.ts | 198 - .../cli/src/controller/deploy-controller.ts | 249 - .../src/controller/init-controller.spec.ts | 46 - .../src/controller/init-controller.test.ts | 99 - .../cli/src/controller/init-controller.ts | 167 - .../cli/src/controller/migrate-controller.ts | 223 - .../src/controller/project-controller.spec.ts | 44 - .../cli/src/controller/project-controller.ts | 67 - .../src/controller/publish-controller.spec.ts | 165 - .../cli/src/controller/publish-controller.ts | 179 - packages/cli/src/index.ts | 4 - packages/cli/src/jsonrpc/client/http.ts | 31 - packages/cli/src/jsonrpc/client/index.ts | 5 - packages/cli/src/jsonrpc/client/types.ts | 32 - packages/cli/src/jsonrpc/client/ws.ts | 82 - packages/cli/src/jsonrpc/index.ts | 11 - packages/cli/src/jsonrpc/jsonrpc.test.ts | 21 - .../src/template/datasource-templates.ts.ejs | 8 - packages/cli/src/template/enum.ts.ejs | 11 - packages/cli/src/template/interface.ts.ejs | 11 - packages/cli/src/template/model.ts.ejs | 70 - packages/cli/src/template/models-index.ts.ejs | 6 - packages/cli/src/template/terramodel.ts.ejs | 70 - packages/cli/src/template/types-index.ts.ejs | 7 - packages/cli/src/types.ts | 117 - packages/cli/src/utils.ts | 70 - packages/cli/test/schemaTest1/project.yaml | 22 - packages/cli/test/schemaTest1/schema.graphql | 18 - .../cli/test/schemaTest2/badschema.graphql | 3 - packages/cli/test/schemaTest2/project.yaml | 21 - packages/cli/tsconfig.json | 20 - .../CHANGELOG.md | 8 - packages/{cli => common-ethereum}/LICENSE | 0 .../package.json | 21 +- .../src/index.ts | 0 .../src/project/index.ts | 0 .../src/project/load.spec.ts | 3 + packages/common-ethereum/src/project/load.ts | 109 + .../common-ethereum/src/project/models.ts | 196 + .../src/project/project.spec.ts | 95 + packages/common-ethereum/src/project/types.ts | 30 + packages/common-ethereum/src/project/utils.ts | 37 + .../versioned/ProjectManifestVersioned.ts | 85 + .../src/project/versioned/index.ts | 1 - .../src/project/versioned/v0_2_0/index.ts | 0 .../src/project/versioned/v0_2_0/types.ts | 29 + .../src/project/versioned/v0_2_1/index.ts | 0 .../src/project/versioned/v0_2_1/types.ts | 2 +- .../src/project/versioned/v0_3_0}/index.ts | 0 .../src/project/versioned/v0_3_0/model.ts | 133 + .../src/project/versioned/v0_3_0/types.ts | 45 + .../src/project/versioned/v1_0_0}/index.ts | 0 .../src/project/versioned/v1_0_0/model.ts | 72 +- .../src/project/versioned/v1_0_0/types.ts | 2 +- .../{common => common-ethereum}/tsconfig.json | 0 packages/common-substrate/CHANGELOG.md | 53 - packages/common-substrate/LICENSE | 201 - packages/common-substrate/src/project/load.ts | 42 - .../common-substrate/src/project/models.ts | 201 - .../src/project/project.spec.ts | 124 - .../common-substrate/src/project/types.ts | 32 - .../common-substrate/src/project/utils.ts | 49 - .../versioned/ProjectManifestVersioned.ts | 132 - .../src/project/versioned/v0_0_1/model.ts | 99 - .../src/project/versioned/v0_0_1/types.ts | 34 - .../src/project/versioned/v0_2_0/model.ts | 131 - .../src/project/versioned/v0_2_0/types.ts | 29 - .../src/project/versioned/v0_2_1/index.ts | 5 - .../src/project/versioned/v0_2_1/model.ts | 72 - .../src/project/versioned/v0_3_0/model.ts | 76 - .../src/project/versioned/v0_3_0/types.ts | 33 - .../src/project/versioned/v1_0_0/index.ts | 5 - packages/common-substrate/test/project.yaml | 48 - .../common-substrate/test/project_0.2.0.yaml | 31 - .../test/project_0.2.0_custom_ds.yaml | 28 - .../test/project_0.2.0_invalid_custom_ds.yaml | 25 - .../common-substrate/test/project_0.2.1.yaml | 84 - .../common-substrate/test/project_1.0.0.yaml | 91 - .../test/project_1.0.0_bad_runner.yaml | 91 - .../project_1.0.0_bad_runner_version.yaml | 91 - .../test/project_1.0.0_chainId.yaml | 91 - .../project_1.0.0_runner_ds_mismatch.yaml | 34 - .../common-substrate/test/project_falsy.yaml | 20 - .../test/project_falsy_array.yaml | 37 - .../test/project_invalid_version.yaml | 29 - packages/common-substrate/tsconfig.json | 11 - packages/common/CHANGELOG.md | 212 - packages/common/LICENSE | 201 - packages/common/fixtures/package.json | 28 - packages/common/fixtures/project.yaml | 24 - packages/common/package.json | 34 - packages/common/src/constants.ts | 35 - packages/common/src/index.ts | 7 - packages/common/src/project/index.ts | 8 - packages/common/src/project/load.ts | 54 - .../src/project/readers/github-reader.spec.ts | 24 - .../src/project/readers/github-reader.ts | 55 - packages/common/src/project/readers/index.ts | 7 - .../src/project/readers/ipfs-reader.spec.ts | 19 - .../common/src/project/readers/ipfs-reader.ts | 56 - .../src/project/readers/local-reader.spec.ts | 25 - .../src/project/readers/local-reader.ts | 39 - .../common/src/project/readers/reader.spec.ts | 54 - packages/common/src/project/readers/reader.ts | 45 - packages/common/src/project/types.ts | 21 - packages/common/src/project/utils.ts | 77 - packages/common/src/project/versioned/base.ts | 58 - .../common/src/project/versioned/index.ts | 7 - .../src/project/versioned/v0_2_0/types.ts | 24 - .../src/project/versioned/v0_2_1/types.ts | 15 - .../src/project/versioned/v1_0_0/index.ts | 5 - .../src/project/versioned/v1_0_0/models.ts | 15 - .../src/project/versioned/v1_0_0/types.ts | 35 - .../common/test/mockedSubqueryProject.tgz | Bin 2041 -> 0 bytes packages/common/test/project_0.2.0.yaml | 31 - .../common/test/project_0.2.0_custom_ds.yaml | 28 - .../test/project_0.2.0_invalid_custom_ds.yaml | 25 - packages/common/test/project_falsy.yaml | 20 - packages/common/test/project_falsy_array.yaml | 38 - .../common/test/project_invalid_version.yaml | 31 - packages/node-core/LICENSE | 201 - packages/node-core/package.json | 35 - packages/node-core/src/api.service.ts | 17 - .../src/configure/NodeConfig.spec.ts | 30 - .../node-core/src/configure/NodeConfig.ts | 161 - packages/node-core/src/db/db.module.test.ts | 55 - packages/node-core/src/db/db.module.ts | 83 - packages/node-core/src/db/index.ts | 4 - .../node-core/src/entities/Subquery.entity.ts | 73 - packages/node-core/src/entities/index.ts | 4 - packages/node-core/src/events.ts | 61 - packages/node-core/src/index.ts | 14 - packages/node-core/src/indexer/PoiBlock.ts | 84 - .../src/indexer/StoreOperations.spec.ts | 213 - .../node-core/src/indexer/StoreOperations.ts | 76 - .../src/indexer/benchmark.service.ts | 85 - .../src/indexer/entities/Metadata.entity.ts | 31 - .../src/indexer/entities/Poi.entity.ts | 66 - .../node-core/src/indexer/entities/index.ts | 5 - packages/node-core/src/indexer/index.ts | 12 - packages/node-core/src/indexer/mmr.service.ts | 243 - packages/node-core/src/indexer/poi.service.ts | 60 - .../src/indexer/store.service.spec.ts | 32 - .../node-core/src/indexer/store.service.ts | 730 -- packages/node-core/src/indexer/types.ts | 15 - .../node-core/src/indexer/worker/index.ts | 4 - .../src/indexer/worker/worker.builder.ts | 157 - packages/node-core/src/logger.ts | 48 - .../node-core/src/merkle-mountain-range.d.ts | 41 - packages/node-core/src/meta/event.listener.ts | 85 - .../node-core/src/meta/health.controller.ts | 29 - packages/node-core/src/meta/health.service.ts | 69 - packages/node-core/src/meta/index.ts | 9 - .../node-core/src/meta/mmrQuery.controller.ts | 39 - .../node-core/src/meta/ready.controller.ts | 23 - packages/node-core/src/meta/ready.service.ts | 24 - packages/node-core/src/profiler.ts | 71 - packages/node-core/src/utils/batch-size.ts | 37 - packages/node-core/src/utils/graphql.ts | 66 - packages/node-core/src/utils/index.ts | 9 - .../src/utils/mmr-exception.filter.ts | 28 - packages/node-core/src/utils/object.spec.ts | 18 - packages/node-core/src/utils/object.ts | 22 - packages/node-core/src/utils/promise.spec.ts | 22 - packages/node-core/src/utils/promise.ts | 20 - packages/node-core/src/utils/sync-helper.ts | 146 - packages/node-core/src/yargs.ts | 175 - packages/node-core/test/config.json | 4 - packages/node-core/test/config.toml | 4 - packages/node-core/test/config.yml | 2 - packages/node-core/tsconfig.json | 11 - packages/node/.gitignore | 34 - packages/node/.trigger | 1 - packages/node/CHANGELOG.md | 656 -- packages/node/Dockerfile | 6 +- packages/node/{docker => }/docker-compose.yml | 4 +- packages/node/docker/load-extensions.sh | 5 - packages/node/docker/pg-Dockerfile | 9 - packages/node/package.json | 27 +- .../src/configure/SubqueryProject.spec.ts | 106 - .../node/src/configure/SubqueryProject.ts | 105 +- .../node/src/configure/configure.module.ts | 4 +- packages/node/src/ethereum/api.ethereum.ts | 241 + .../node/src/ethereum/api.service.ethereum.ts | 58 + packages/node/src/ethereum/block.ethereum.ts | 126 + .../v0_3_0 => node/src/ethereum}/index.ts | 4 +- packages/node/src/ethereum/utils.ethereum.ts | 147 + packages/node/src/indexer/api.service.spec.ts | 95 - packages/node/src/indexer/api.service.test.ts | 393 - packages/node/src/indexer/api.service.ts | 204 - .../src/indexer/dictionary.service.test.ts | 195 - .../node/src/indexer/dictionary.service.ts | 148 +- .../src/indexer/ds-processor.service.spec.ts | 79 - .../node/src/indexer/ds-processor.service.ts | 79 +- .../node/src/indexer/dynamic-ds.service.ts | 6 +- packages/node/src/indexer/fetch.module.ts | 18 +- .../node/src/indexer/fetch.service.spec.ts | 710 -- .../node/src/indexer/fetch.service.test.ts | 712 -- packages/node/src/indexer/fetch.service.ts | 410 +- .../node/src/indexer/indexer.manager.spec.ts | 197 - packages/node/src/indexer/indexer.manager.ts | 202 +- packages/node/src/indexer/indexer.module.ts | 15 +- .../node/src/indexer/project.service.test.ts | 168 - packages/node/src/indexer/project.service.ts | 18 +- .../node/src/indexer/sandbox.service.spec.ts | 41 - packages/node/src/indexer/sandbox.service.ts | 27 +- packages/node/src/indexer/types.ts | 21 +- .../worker/block-dispatcher.service.ts | 76 +- .../node/src/indexer/worker/worker.service.ts | 47 +- packages/node/src/indexer/worker/worker.ts | 9 - packages/node/src/indexer/x-provider/http.ts | 249 - packages/node/src/main.ts | 8 +- packages/node/src/meta/meta.module.ts | 15 +- packages/node/src/meta/meta.service.ts | 2 + .../src/utils/autoQueue.ts | 11 +- packages/node/src/utils/project.ts | 119 +- packages/node/src/utils/string.ts | 29 + packages/node/src/utils/substrate.test.ts | 38 - packages/node/src/utils/substrate.ts | 361 - packages/node/test/jsonfy.js | 38 - .../template-v1.0.0/distMock/chaintypes.js | 3 - .../template-v1.0.0/distMock/index.js | 6 - .../template-v1.0.0/erc20.abi.json | 222 - .../template-v1.0.0/js/test1/project.yaml | 32 - .../template-v1.0.0/js/test1/types.js | 54 - .../template-v1.0.0/js/test2/project.yaml | 32 - .../template-v1.0.0/js/test2/types.js | 52 - .../template-v1.0.0/js/test3/project.yaml | 32 - .../template-v1.0.0/js/test3/types.js | 48 - .../template-v1.0.0/js/test4/project.yaml | 32 - .../template-v1.0.0/js/test4/types.js | 59 - .../template-v1.0.0/package.json | 30 - .../template-v1.0.0/project.yaml | 91 - .../projectFixture/template-v1.0.0/types.yaml | 28 - .../{v1.0.0 => v0.0.1}/package.json | 7 +- .../test/projectFixture/v0.0.1}/project.yaml | 33 +- .../schema.graphql | 0 .../projectFixture/v0.2.0/dist/chainTypes.js | 1 - .../test/projectFixture/v0.2.0/dist/index.js | 0 .../projectFixture/v0.2.0/dist/moonbeam.js | 2 - .../test/projectFixture/v0.2.0/package.json | 2 +- .../projectFixture/v0.3.0/dist/chainTypes.js | 1 - .../test/projectFixture/v0.3.0/dist/index.js | 0 .../projectFixture/v0.3.0/dist/moonbeam.js | 2 - .../test/projectFixture/v0.3.0/package.json | 2 +- .../v1.0.0/distMock/chaintypes.js | 3 - .../projectFixture/v1.0.0/distMock/index.js | 6 - .../test/projectFixture/v1.0.0/erc20.abi.json | 222 - .../v1.0.0/js/test1/project.yaml | 32 - .../projectFixture/v1.0.0/js/test1/types.js | 54 - .../v1.0.0/js/test2/project.yaml | 32 - .../projectFixture/v1.0.0/js/test2/types.js | 52 - .../v1.0.0/js/test3/project.yaml | 32 - .../projectFixture/v1.0.0/js/test3/types.js | 48 - .../v1.0.0/js/test4/project.yaml | 32 - .../projectFixture/v1.0.0/js/test4/types.js | 59 - .../test/projectFixture/v1.0.0/project.yaml | 57 - .../test/projectFixture/v1.0.0/schema.graphql | 11 - .../test/projectFixture/v1.0.0/types.yaml | 28 - packages/node/tsconfig.json | 11 +- packages/query/.env.example | 6 - packages/query/.gitignore | 36 - packages/query/CHANGELOG.md | 176 - packages/query/Dockerfile | 13 - packages/query/LICENSE | 201 - packages/query/README.md | 17 - packages/query/bin/run | 4 - packages/query/bin/run.cmd | 3 - packages/query/nest-cli.json | 4 - packages/query/nodemon.json | 6 - packages/query/package.json | 72 - packages/query/src/app.module.ts | 12 - packages/query/src/configure/config.ts | 12 - .../query/src/configure/configure.module.ts | 58 - packages/query/src/configure/index.ts | 4 - .../configure/x-postgraphile/debugClient.ts | 112 - packages/query/src/graphql/graphql.module.ts | 142 - packages/query/src/graphql/graphql.test.ts | 179 - packages/query/src/graphql/limit.test.ts | 126 - .../src/graphql/plugins/GetMetadataPlugin.ts | 156 - .../graphql/plugins/PgAggregationPlugin.ts | 57 - .../plugins/PgBackwardRelationPlugin.ts | 384 - .../graphql/plugins/PgBlockHeightPlugin.ts | 83 - .../PgConnectionArgFirstLastBeforeAfter.ts | 128 - .../plugins/PgOrderByAggregatesPlugin.ts | 167 - .../graphql/plugins/PgRowByVirtualIdPlugin.ts | 126 - .../graphql/plugins/PgSubscriptionPlugin.ts | 55 - .../graphql/plugins/QueryComplexityPlugin.ts | 36 - packages/query/src/graphql/plugins/index.ts | 133 - .../src/graphql/plugins/smartTagsPlugin.ts | 32 - packages/query/src/graphql/project.service.ts | 36 - packages/query/src/main.ts | 38 - packages/query/src/utils/asyncInterval.ts | 32 - packages/query/src/utils/logger.ts | 59 - packages/query/src/yargs.ts | 100 - packages/query/tsconfig.build.json | 4 - packages/query/tsconfig.json | 13 - packages/types/CHANGELOG.md | 131 - packages/types/package.json | 10 +- .../configure => types/src/ethereum}/index.ts | 2 +- packages/types/src/ethereum/interfaces.ts | 113 + packages/types/src/global.ts | 7 +- packages/types/src/index.ts | 1 + packages/types/src/interfaces.ts | 70 +- packages/types/src/project.ts | 214 +- packages/types/tsconfig.json | 2 - packages/utils/CHANGELOG.md | 27 - packages/utils/README.md | 1 - packages/utils/package.json | 32 - packages/utils/src/graphql/builder.spec.ts | 57 - packages/utils/src/graphql/builder.ts | 83 - packages/utils/src/graphql/constant.ts | 8 - packages/utils/src/graphql/entities.ts | 256 - packages/utils/src/graphql/graphql.spec.ts | 266 - packages/utils/src/graphql/index.ts | 7 - packages/utils/src/graphql/schema.ts | 26 - .../utils/src/graphql/schema/directives.ts | 11 - packages/utils/src/graphql/schema/scalas.ts | 12 - packages/utils/src/graphql/types.ts | 97 - packages/utils/src/index.ts | 7 - packages/utils/src/logger/colors.spec.ts | 16 - packages/utils/src/logger/colors.ts | 28 - packages/utils/src/logger/constants.ts | 22 - packages/utils/src/logger/index.ts | 5 - packages/utils/src/logger/logger.ts | 111 - packages/utils/src/logger/util.ts | 9 - packages/utils/src/query/index.ts | 4 - packages/utils/src/query/types.ts | 30 - packages/utils/src/types/TypeClass.ts | 33 - packages/utils/src/types/generalTypes.spec.ts | 16 - packages/utils/src/types/generalTypes.ts | 9 - packages/utils/src/types/index.ts | 6 - packages/utils/src/types/supported/BigInt.ts | 15 - packages/utils/src/types/supported/Boolean.ts | 15 - packages/utils/src/types/supported/Bytes.ts | 20 - packages/utils/src/types/supported/Date.ts | 17 - packages/utils/src/types/supported/Float.ts | 16 - packages/utils/src/types/supported/ID.ts | 14 - packages/utils/src/types/supported/Int.ts | 15 - packages/utils/src/types/supported/Json.ts | 15 - packages/utils/src/types/supported/String.ts | 14 - packages/utils/src/types/supported/index.ts | 12 - packages/utils/tsconfig.json | 14 - packages/validator/CHANGELOG.md | 106 - packages/validator/LICENSE | 201 - packages/validator/README.md | 1 - packages/validator/fixtures/package.json | 26 - packages/validator/fixtures/project.yaml | 24 - packages/validator/package.json | 31 - packages/validator/src/context.ts | 27 - packages/validator/src/index.ts | 5 - packages/validator/src/rules/index.ts | 9 - .../src/rules/require-build-script.ts | 15 - .../validator/src/rules/require-cli-dep.ts | 19 - .../src/rules/require-codegen-script.ts | 15 - .../src/rules/require-custom-ds-validation.ts | 53 - .../src/rules/require-valid-chaintypes.ts | 45 - .../src/rules/require-valid-manifest.ts | 23 - .../src/rules/require-valid-runner.ts | 23 - packages/validator/src/rules/rule.ts | 38 - packages/validator/src/validator.spec.ts | 50 - packages/validator/src/validator.ts | 115 - packages/validator/tsconfig.json | 11 - tsconfig.json | 23 +- yarn.lock | 9715 +++++------------ 403 files changed, 4664 insertions(+), 30828 deletions(-) delete mode 100644 .github/workflows/node-avalanche-docker.yml delete mode 100644 .github/workflows/node-terra-docker.yml delete mode 100644 .github/workflows/query-docker.yml delete mode 100644 .github/workflows/scripts/nodeTerraVersion.sh delete mode 100644 .github/workflows/scripts/queryVersion.sh create mode 100644 .gitpod.dockerfile create mode 100644 .gitpod.yml delete mode 100644 packages/cli/CHANGELOG.md delete mode 100644 packages/cli/README.md delete mode 100755 packages/cli/bin/run delete mode 100644 packages/cli/bin/run.cmd delete mode 100644 packages/cli/package.json delete mode 100644 packages/cli/src/commands/build.ts delete mode 100644 packages/cli/src/commands/codegen.ts delete mode 100644 packages/cli/src/commands/deployment/delete.ts delete mode 100644 packages/cli/src/commands/deployment/deploy.ts delete mode 100644 packages/cli/src/commands/deployment/index.ts delete mode 100644 packages/cli/src/commands/deployment/promote.ts delete mode 100644 packages/cli/src/commands/init.ts delete mode 100644 packages/cli/src/commands/migrate.ts delete mode 100644 packages/cli/src/commands/project/create-project.ts delete mode 100644 packages/cli/src/commands/project/delete-project.ts delete mode 100644 packages/cli/src/commands/project/index.ts delete mode 100644 packages/cli/src/commands/publish.test.ts delete mode 100644 packages/cli/src/commands/publish.ts delete mode 100644 packages/cli/src/commands/validate.ts delete mode 100644 packages/cli/src/constants.ts delete mode 100644 packages/cli/src/controller/build-controller.ts delete mode 100644 packages/cli/src/controller/codegen-controller.spec.ts delete mode 100644 packages/cli/src/controller/codegen-controller.test.ts delete mode 100644 packages/cli/src/controller/codegen-controller.ts delete mode 100644 packages/cli/src/controller/deploy-controller.spec.ts delete mode 100644 packages/cli/src/controller/deploy-controller.ts delete mode 100644 packages/cli/src/controller/init-controller.spec.ts delete mode 100644 packages/cli/src/controller/init-controller.test.ts delete mode 100644 packages/cli/src/controller/init-controller.ts delete mode 100644 packages/cli/src/controller/migrate-controller.ts delete mode 100644 packages/cli/src/controller/project-controller.spec.ts delete mode 100644 packages/cli/src/controller/project-controller.ts delete mode 100644 packages/cli/src/controller/publish-controller.spec.ts delete mode 100644 packages/cli/src/controller/publish-controller.ts delete mode 100644 packages/cli/src/index.ts delete mode 100644 packages/cli/src/jsonrpc/client/http.ts delete mode 100644 packages/cli/src/jsonrpc/client/index.ts delete mode 100644 packages/cli/src/jsonrpc/client/types.ts delete mode 100644 packages/cli/src/jsonrpc/client/ws.ts delete mode 100644 packages/cli/src/jsonrpc/index.ts delete mode 100644 packages/cli/src/jsonrpc/jsonrpc.test.ts delete mode 100644 packages/cli/src/template/datasource-templates.ts.ejs delete mode 100644 packages/cli/src/template/enum.ts.ejs delete mode 100644 packages/cli/src/template/interface.ts.ejs delete mode 100644 packages/cli/src/template/model.ts.ejs delete mode 100644 packages/cli/src/template/models-index.ts.ejs delete mode 100644 packages/cli/src/template/terramodel.ts.ejs delete mode 100644 packages/cli/src/template/types-index.ts.ejs delete mode 100644 packages/cli/src/types.ts delete mode 100644 packages/cli/src/utils.ts delete mode 100644 packages/cli/test/schemaTest1/project.yaml delete mode 100644 packages/cli/test/schemaTest1/schema.graphql delete mode 100644 packages/cli/test/schemaTest2/badschema.graphql delete mode 100644 packages/cli/test/schemaTest2/project.yaml delete mode 100644 packages/cli/tsconfig.json rename packages/{node-core => common-ethereum}/CHANGELOG.md (65%) rename packages/{cli => common-ethereum}/LICENSE (100%) rename packages/{common-substrate => common-ethereum}/package.json (59%) rename packages/{common-substrate => common-ethereum}/src/index.ts (100%) rename packages/{common-substrate => common-ethereum}/src/project/index.ts (100%) rename packages/{common-substrate => common-ethereum}/src/project/load.spec.ts (99%) create mode 100644 packages/common-ethereum/src/project/load.ts create mode 100644 packages/common-ethereum/src/project/models.ts create mode 100644 packages/common-ethereum/src/project/project.spec.ts create mode 100644 packages/common-ethereum/src/project/types.ts create mode 100644 packages/common-ethereum/src/project/utils.ts create mode 100644 packages/common-ethereum/src/project/versioned/ProjectManifestVersioned.ts rename packages/{common-substrate => common-ethereum}/src/project/versioned/index.ts (90%) rename packages/{common => common-ethereum}/src/project/versioned/v0_2_0/index.ts (100%) create mode 100644 packages/common-ethereum/src/project/versioned/v0_2_0/types.ts rename packages/{common => common-ethereum}/src/project/versioned/v0_2_1/index.ts (100%) rename packages/{common-substrate => common-ethereum}/src/project/versioned/v0_2_1/types.ts (90%) rename packages/{common-substrate/src/project/versioned/v0_0_1 => common-ethereum/src/project/versioned/v0_3_0}/index.ts (100%) create mode 100644 packages/common-ethereum/src/project/versioned/v0_3_0/model.ts create mode 100644 packages/common-ethereum/src/project/versioned/v0_3_0/types.ts rename packages/{common-substrate/src/project/versioned/v0_2_0 => common-ethereum/src/project/versioned/v1_0_0}/index.ts (100%) rename packages/{common-substrate => common-ethereum}/src/project/versioned/v1_0_0/model.ts (65%) rename packages/{common-substrate => common-ethereum}/src/project/versioned/v1_0_0/types.ts (86%) rename packages/{common => common-ethereum}/tsconfig.json (100%) delete mode 100644 packages/common-substrate/CHANGELOG.md delete mode 100644 packages/common-substrate/LICENSE delete mode 100644 packages/common-substrate/src/project/load.ts delete mode 100644 packages/common-substrate/src/project/models.ts delete mode 100644 packages/common-substrate/src/project/project.spec.ts delete mode 100644 packages/common-substrate/src/project/types.ts delete mode 100644 packages/common-substrate/src/project/utils.ts delete mode 100644 packages/common-substrate/src/project/versioned/ProjectManifestVersioned.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_0_1/model.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_0_1/types.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_2_0/model.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_2_0/types.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_2_1/index.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_2_1/model.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_3_0/model.ts delete mode 100644 packages/common-substrate/src/project/versioned/v0_3_0/types.ts delete mode 100644 packages/common-substrate/src/project/versioned/v1_0_0/index.ts delete mode 100644 packages/common-substrate/test/project.yaml delete mode 100644 packages/common-substrate/test/project_0.2.0.yaml delete mode 100644 packages/common-substrate/test/project_0.2.0_custom_ds.yaml delete mode 100644 packages/common-substrate/test/project_0.2.0_invalid_custom_ds.yaml delete mode 100644 packages/common-substrate/test/project_0.2.1.yaml delete mode 100644 packages/common-substrate/test/project_1.0.0.yaml delete mode 100644 packages/common-substrate/test/project_1.0.0_bad_runner.yaml delete mode 100644 packages/common-substrate/test/project_1.0.0_bad_runner_version.yaml delete mode 100644 packages/common-substrate/test/project_1.0.0_chainId.yaml delete mode 100644 packages/common-substrate/test/project_1.0.0_runner_ds_mismatch.yaml delete mode 100644 packages/common-substrate/test/project_falsy.yaml delete mode 100644 packages/common-substrate/test/project_falsy_array.yaml delete mode 100644 packages/common-substrate/test/project_invalid_version.yaml delete mode 100644 packages/common-substrate/tsconfig.json delete mode 100644 packages/common/CHANGELOG.md delete mode 100644 packages/common/LICENSE delete mode 100644 packages/common/fixtures/package.json delete mode 100644 packages/common/fixtures/project.yaml delete mode 100644 packages/common/package.json delete mode 100644 packages/common/src/constants.ts delete mode 100644 packages/common/src/index.ts delete mode 100644 packages/common/src/project/index.ts delete mode 100644 packages/common/src/project/load.ts delete mode 100644 packages/common/src/project/readers/github-reader.spec.ts delete mode 100644 packages/common/src/project/readers/github-reader.ts delete mode 100644 packages/common/src/project/readers/index.ts delete mode 100644 packages/common/src/project/readers/ipfs-reader.spec.ts delete mode 100644 packages/common/src/project/readers/ipfs-reader.ts delete mode 100644 packages/common/src/project/readers/local-reader.spec.ts delete mode 100644 packages/common/src/project/readers/local-reader.ts delete mode 100644 packages/common/src/project/readers/reader.spec.ts delete mode 100644 packages/common/src/project/readers/reader.ts delete mode 100644 packages/common/src/project/types.ts delete mode 100644 packages/common/src/project/utils.ts delete mode 100644 packages/common/src/project/versioned/base.ts delete mode 100644 packages/common/src/project/versioned/index.ts delete mode 100644 packages/common/src/project/versioned/v0_2_0/types.ts delete mode 100644 packages/common/src/project/versioned/v0_2_1/types.ts delete mode 100644 packages/common/src/project/versioned/v1_0_0/index.ts delete mode 100644 packages/common/src/project/versioned/v1_0_0/models.ts delete mode 100644 packages/common/src/project/versioned/v1_0_0/types.ts delete mode 100644 packages/common/test/mockedSubqueryProject.tgz delete mode 100644 packages/common/test/project_0.2.0.yaml delete mode 100644 packages/common/test/project_0.2.0_custom_ds.yaml delete mode 100644 packages/common/test/project_0.2.0_invalid_custom_ds.yaml delete mode 100644 packages/common/test/project_falsy.yaml delete mode 100644 packages/common/test/project_falsy_array.yaml delete mode 100644 packages/common/test/project_invalid_version.yaml delete mode 100644 packages/node-core/LICENSE delete mode 100644 packages/node-core/package.json delete mode 100644 packages/node-core/src/api.service.ts delete mode 100644 packages/node-core/src/configure/NodeConfig.spec.ts delete mode 100644 packages/node-core/src/configure/NodeConfig.ts delete mode 100644 packages/node-core/src/db/db.module.test.ts delete mode 100644 packages/node-core/src/db/db.module.ts delete mode 100644 packages/node-core/src/db/index.ts delete mode 100644 packages/node-core/src/entities/Subquery.entity.ts delete mode 100644 packages/node-core/src/entities/index.ts delete mode 100644 packages/node-core/src/events.ts delete mode 100644 packages/node-core/src/index.ts delete mode 100644 packages/node-core/src/indexer/PoiBlock.ts delete mode 100644 packages/node-core/src/indexer/StoreOperations.spec.ts delete mode 100644 packages/node-core/src/indexer/StoreOperations.ts delete mode 100644 packages/node-core/src/indexer/benchmark.service.ts delete mode 100644 packages/node-core/src/indexer/entities/Metadata.entity.ts delete mode 100644 packages/node-core/src/indexer/entities/Poi.entity.ts delete mode 100644 packages/node-core/src/indexer/entities/index.ts delete mode 100644 packages/node-core/src/indexer/index.ts delete mode 100644 packages/node-core/src/indexer/mmr.service.ts delete mode 100644 packages/node-core/src/indexer/poi.service.ts delete mode 100644 packages/node-core/src/indexer/store.service.spec.ts delete mode 100644 packages/node-core/src/indexer/store.service.ts delete mode 100644 packages/node-core/src/indexer/types.ts delete mode 100644 packages/node-core/src/indexer/worker/index.ts delete mode 100644 packages/node-core/src/indexer/worker/worker.builder.ts delete mode 100644 packages/node-core/src/logger.ts delete mode 100644 packages/node-core/src/merkle-mountain-range.d.ts delete mode 100644 packages/node-core/src/meta/event.listener.ts delete mode 100644 packages/node-core/src/meta/health.controller.ts delete mode 100644 packages/node-core/src/meta/health.service.ts delete mode 100644 packages/node-core/src/meta/index.ts delete mode 100644 packages/node-core/src/meta/mmrQuery.controller.ts delete mode 100644 packages/node-core/src/meta/ready.controller.ts delete mode 100644 packages/node-core/src/meta/ready.service.ts delete mode 100644 packages/node-core/src/profiler.ts delete mode 100644 packages/node-core/src/utils/batch-size.ts delete mode 100644 packages/node-core/src/utils/graphql.ts delete mode 100644 packages/node-core/src/utils/index.ts delete mode 100644 packages/node-core/src/utils/mmr-exception.filter.ts delete mode 100644 packages/node-core/src/utils/object.spec.ts delete mode 100644 packages/node-core/src/utils/object.ts delete mode 100644 packages/node-core/src/utils/promise.spec.ts delete mode 100644 packages/node-core/src/utils/promise.ts delete mode 100644 packages/node-core/src/utils/sync-helper.ts delete mode 100644 packages/node-core/src/yargs.ts delete mode 100644 packages/node-core/test/config.json delete mode 100644 packages/node-core/test/config.toml delete mode 100644 packages/node-core/test/config.yml delete mode 100644 packages/node-core/tsconfig.json delete mode 100644 packages/node/.gitignore delete mode 100644 packages/node/.trigger rename packages/node/{docker => }/docker-compose.yml (74%) delete mode 100644 packages/node/docker/load-extensions.sh delete mode 100644 packages/node/docker/pg-Dockerfile delete mode 100644 packages/node/src/configure/SubqueryProject.spec.ts create mode 100644 packages/node/src/ethereum/api.ethereum.ts create mode 100644 packages/node/src/ethereum/api.service.ethereum.ts create mode 100644 packages/node/src/ethereum/block.ethereum.ts rename packages/{common-substrate/src/project/versioned/v0_3_0 => node/src/ethereum}/index.ts (59%) create mode 100644 packages/node/src/ethereum/utils.ethereum.ts delete mode 100644 packages/node/src/indexer/api.service.spec.ts delete mode 100644 packages/node/src/indexer/api.service.test.ts delete mode 100644 packages/node/src/indexer/api.service.ts delete mode 100644 packages/node/src/indexer/dictionary.service.test.ts delete mode 100644 packages/node/src/indexer/ds-processor.service.spec.ts delete mode 100644 packages/node/src/indexer/fetch.service.spec.ts delete mode 100644 packages/node/src/indexer/fetch.service.test.ts delete mode 100644 packages/node/src/indexer/indexer.manager.spec.ts delete mode 100644 packages/node/src/indexer/project.service.test.ts delete mode 100644 packages/node/src/indexer/sandbox.service.spec.ts delete mode 100644 packages/node/src/indexer/x-provider/http.ts rename packages/{node-core => node}/src/utils/autoQueue.ts (94%) create mode 100644 packages/node/src/utils/string.ts delete mode 100644 packages/node/src/utils/substrate.test.ts delete mode 100644 packages/node/src/utils/substrate.ts delete mode 100644 packages/node/test/jsonfy.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/distMock/chaintypes.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/distMock/index.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/erc20.abi.json delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test1/project.yaml delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test1/types.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test2/project.yaml delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test2/types.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test3/project.yaml delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test3/types.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test4/project.yaml delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/js/test4/types.js delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/package.json delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/project.yaml delete mode 100644 packages/node/test/projectFixture/template-v1.0.0/types.yaml rename packages/node/test/projectFixture/{v1.0.0 => v0.0.1}/package.json (85%) rename packages/{common/test => node/test/projectFixture/v0.0.1}/project.yaml (74%) rename packages/node/test/projectFixture/{template-v1.0.0 => v0.0.1}/schema.graphql (100%) delete mode 100644 packages/node/test/projectFixture/v0.2.0/dist/chainTypes.js delete mode 100644 packages/node/test/projectFixture/v0.2.0/dist/index.js delete mode 100644 packages/node/test/projectFixture/v0.2.0/dist/moonbeam.js delete mode 100644 packages/node/test/projectFixture/v0.3.0/dist/chainTypes.js delete mode 100644 packages/node/test/projectFixture/v0.3.0/dist/index.js delete mode 100644 packages/node/test/projectFixture/v0.3.0/dist/moonbeam.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/distMock/chaintypes.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/distMock/index.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/erc20.abi.json delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test1/project.yaml delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test1/types.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test2/project.yaml delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test2/types.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test3/project.yaml delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test3/types.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test4/project.yaml delete mode 100644 packages/node/test/projectFixture/v1.0.0/js/test4/types.js delete mode 100644 packages/node/test/projectFixture/v1.0.0/project.yaml delete mode 100644 packages/node/test/projectFixture/v1.0.0/schema.graphql delete mode 100644 packages/node/test/projectFixture/v1.0.0/types.yaml delete mode 100644 packages/query/.env.example delete mode 100644 packages/query/.gitignore delete mode 100644 packages/query/CHANGELOG.md delete mode 100644 packages/query/Dockerfile delete mode 100644 packages/query/LICENSE delete mode 100644 packages/query/README.md delete mode 100755 packages/query/bin/run delete mode 100644 packages/query/bin/run.cmd delete mode 100644 packages/query/nest-cli.json delete mode 100644 packages/query/nodemon.json delete mode 100644 packages/query/package.json delete mode 100644 packages/query/src/app.module.ts delete mode 100644 packages/query/src/configure/config.ts delete mode 100644 packages/query/src/configure/configure.module.ts delete mode 100644 packages/query/src/configure/index.ts delete mode 100644 packages/query/src/configure/x-postgraphile/debugClient.ts delete mode 100644 packages/query/src/graphql/graphql.module.ts delete mode 100644 packages/query/src/graphql/graphql.test.ts delete mode 100644 packages/query/src/graphql/limit.test.ts delete mode 100644 packages/query/src/graphql/plugins/GetMetadataPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/PgAggregationPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/PgBackwardRelationPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/PgBlockHeightPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/PgConnectionArgFirstLastBeforeAfter.ts delete mode 100644 packages/query/src/graphql/plugins/PgOrderByAggregatesPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/PgRowByVirtualIdPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/QueryComplexityPlugin.ts delete mode 100644 packages/query/src/graphql/plugins/index.ts delete mode 100644 packages/query/src/graphql/plugins/smartTagsPlugin.ts delete mode 100644 packages/query/src/graphql/project.service.ts delete mode 100644 packages/query/src/main.ts delete mode 100644 packages/query/src/utils/asyncInterval.ts delete mode 100644 packages/query/src/utils/logger.ts delete mode 100644 packages/query/src/yargs.ts delete mode 100644 packages/query/tsconfig.build.json delete mode 100644 packages/query/tsconfig.json rename packages/{node-core/src/configure => types/src/ethereum}/index.ts (77%) create mode 100644 packages/types/src/ethereum/interfaces.ts delete mode 100644 packages/utils/CHANGELOG.md delete mode 100644 packages/utils/README.md delete mode 100644 packages/utils/package.json delete mode 100644 packages/utils/src/graphql/builder.spec.ts delete mode 100644 packages/utils/src/graphql/builder.ts delete mode 100644 packages/utils/src/graphql/constant.ts delete mode 100644 packages/utils/src/graphql/entities.ts delete mode 100644 packages/utils/src/graphql/graphql.spec.ts delete mode 100644 packages/utils/src/graphql/index.ts delete mode 100644 packages/utils/src/graphql/schema.ts delete mode 100644 packages/utils/src/graphql/schema/directives.ts delete mode 100644 packages/utils/src/graphql/schema/scalas.ts delete mode 100644 packages/utils/src/graphql/types.ts delete mode 100644 packages/utils/src/index.ts delete mode 100644 packages/utils/src/logger/colors.spec.ts delete mode 100644 packages/utils/src/logger/colors.ts delete mode 100644 packages/utils/src/logger/constants.ts delete mode 100644 packages/utils/src/logger/index.ts delete mode 100644 packages/utils/src/logger/logger.ts delete mode 100644 packages/utils/src/logger/util.ts delete mode 100644 packages/utils/src/query/index.ts delete mode 100644 packages/utils/src/query/types.ts delete mode 100644 packages/utils/src/types/TypeClass.ts delete mode 100644 packages/utils/src/types/generalTypes.spec.ts delete mode 100644 packages/utils/src/types/generalTypes.ts delete mode 100644 packages/utils/src/types/index.ts delete mode 100644 packages/utils/src/types/supported/BigInt.ts delete mode 100644 packages/utils/src/types/supported/Boolean.ts delete mode 100644 packages/utils/src/types/supported/Bytes.ts delete mode 100644 packages/utils/src/types/supported/Date.ts delete mode 100644 packages/utils/src/types/supported/Float.ts delete mode 100644 packages/utils/src/types/supported/ID.ts delete mode 100644 packages/utils/src/types/supported/Int.ts delete mode 100644 packages/utils/src/types/supported/Json.ts delete mode 100644 packages/utils/src/types/supported/String.ts delete mode 100644 packages/utils/src/types/supported/index.ts delete mode 100644 packages/utils/tsconfig.json delete mode 100644 packages/validator/CHANGELOG.md delete mode 100644 packages/validator/LICENSE delete mode 100644 packages/validator/README.md delete mode 100644 packages/validator/fixtures/package.json delete mode 100644 packages/validator/fixtures/project.yaml delete mode 100644 packages/validator/package.json delete mode 100644 packages/validator/src/context.ts delete mode 100644 packages/validator/src/index.ts delete mode 100644 packages/validator/src/rules/index.ts delete mode 100644 packages/validator/src/rules/require-build-script.ts delete mode 100644 packages/validator/src/rules/require-cli-dep.ts delete mode 100644 packages/validator/src/rules/require-codegen-script.ts delete mode 100644 packages/validator/src/rules/require-custom-ds-validation.ts delete mode 100644 packages/validator/src/rules/require-valid-chaintypes.ts delete mode 100644 packages/validator/src/rules/require-valid-manifest.ts delete mode 100644 packages/validator/src/rules/require-valid-runner.ts delete mode 100644 packages/validator/src/rules/rule.ts delete mode 100644 packages/validator/src/validator.spec.ts delete mode 100644 packages/validator/src/validator.ts delete mode 100644 packages/validator/tsconfig.json diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 85a77bc3..cae9fe50 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -22,23 +22,7 @@ jobs: #Create github releases - uses: ./.github/actions/create-release with: - package-path: packages/cli - repo-token: ${{ secrets.REPO_TOKEN }} - - - uses: ./.github/actions/create-release - with: - package-path: packages/common - repo-token: ${{ secrets.REPO_TOKEN }} - - - uses: ./.github/actions/create-release - with: - package-path: packages/common-substrate - repo-token: ${{ secrets.REPO_TOKEN }} - - - - uses: ./.github/actions/create-release - with: - package-path: packages/node-core + package-path: packages/common-ethereum repo-token: ${{ secrets.REPO_TOKEN }} - uses: ./.github/actions/create-release @@ -46,22 +30,7 @@ jobs: package-path: packages/node repo-token: ${{ secrets.REPO_TOKEN }} - - uses: ./.github/actions/create-release - with: - package-path: packages/query - repo-token: ${{ secrets.REPO_TOKEN }} - - uses: ./.github/actions/create-release with: package-path: packages/types repo-token: ${{ secrets.REPO_TOKEN }} - - - uses: ./.github/actions/create-release - with: - package-path: packages/utils - repo-token: ${{ secrets.REPO_TOKEN }} - - - uses: ./.github/actions/create-release - with: - package-path: packages/validator - repo-token: ${{ secrets.REPO_TOKEN }} diff --git a/.github/workflows/node-avalanche-docker.yml b/.github/workflows/node-avalanche-docker.yml deleted file mode 100644 index b0374083..00000000 --- a/.github/workflows/node-avalanche-docker.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Node-Avalanche-to-docker" -on: - workflow_dispatch: - inputs: - isLatest: - description: 'Add latest tag' - default: 'true' - required: true - -jobs: - node-build-push-docker: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 100 - token: ${{ secrets.REPO_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: onfinality - password: ${{ secrets.DOCKERHUB_TOKEN }} - - ## node - - name: Get updated node version - id: get-node-version - run: | #TODO - sh .github/workflows/scripts/nodeAvalancheVersion.sh - - - name: Build and push - if: github.event.inputs.isLatest == 'false' - uses: docker/build-push-action@v2 - with: - push: true - platforms: arm64,amd64 - file: ./packages/node-avalanche/Dockerfile - tags: onfinality/subql-node-avalanche:v${{ steps.get-node-version.outputs.NODE_VERSION }} - build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Build and push - if: github.event.inputs.isLatest == 'true' - uses: docker/build-push-action@v2 - with: - push: true - platforms: arm64,amd64 - file: ./packages/node-avalanche/Dockerfile - tags: onfinality/subql-node-avalanche:v${{ steps.get-node-version.outputs.NODE_VERSION }},onfinality/subql-node-avalanche:latest - build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - diff --git a/.github/workflows/node-docker.yml b/.github/workflows/node-docker.yml index badda9df..7d889a90 100644 --- a/.github/workflows/node-docker.yml +++ b/.github/workflows/node-docker.yml @@ -42,7 +42,7 @@ jobs: push: true platforms: arm64,amd64 file: ./packages/node/Dockerfile - tags: onfinality/subql-node:v${{ steps.get-node-version.outputs.NODE_VERSION }} + tags: onfinality/subql-node-ethereum:v${{ steps.get-node-version.outputs.NODE_VERSION }} build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }} - name: Build and push @@ -52,7 +52,7 @@ jobs: push: true platforms: arm64,amd64 file: ./packages/node/Dockerfile - tags: onfinality/subql-node:v${{ steps.get-node-version.outputs.NODE_VERSION }},onfinality/subql-node:latest + tags: onfinality/subql-node-ethereum:v${{ steps.get-node-version.outputs.NODE_VERSION }},onfinality/subql-node-ethereum:latest build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }} - name: Image digest diff --git a/.github/workflows/node-terra-docker.yml b/.github/workflows/node-terra-docker.yml deleted file mode 100644 index 6fc455bf..00000000 --- a/.github/workflows/node-terra-docker.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Node-Terra-to-docker" -on: - workflow_dispatch: - inputs: - isLatest: - description: 'Add latest tag' - default: 'true' - require: true - -jobs: - node-build-push-docker: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 100 - token: ${{ secrets.REPO_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: onfinality - password: ${{ secrets.DOCKERHUB_TOKEN }} - - ## node - - name: Get updated node version - id: get-node-version - run: | #TODO - sh .github/workflows/scripts/nodeTerraVersion.sh - - - name: Build and push - if: github.event.inputs.isLatest == 'false' - uses: docker/build-push-action@v2 - with: - push: true - platforms: arm64,amd64 - file: ./packages/node-terra/Dockerfile - tags: onfinality/subql-node-terra:v${{ steps.get-node-version.outputs.NODE_VERSION }} - build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Build and push - if: github.event.inputs.isLatest == 'true' - uses: docker/build-push-action@v2 - with: - push: true - platforms: arm64,amd64 - file: ./packages/node-terra/Dockerfile - tags: onfinality/subql-node-terra:v${{ steps.get-node-version.outputs.NODE_VERSION }},onfinality/subql-node-terra:latest - build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index de8011f8..c264fa19 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -22,7 +22,7 @@ jobs: Bump-Prerelease-Publish: name: Bump-Prerelease-Publish needs: pre-ci - if: "!startsWith(github.event.head_commit.message, '[SKIP CI]') && !startsWith(github.event.head_commit.message, '[release]') && github.repository == 'subquery/subql'" + if: "!startsWith(github.event.head_commit.message, '[SKIP CI]') && !startsWith(github.event.head_commit.message, '[release]') && github.repository == 'subquery/subql-ethereum'" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -36,50 +36,20 @@ jobs: node-version: 16 - uses: marceloprado/has-changed-path@v1 - id: changed-types + id: changed-types-ethereum with: paths: packages/types - uses: marceloprado/has-changed-path@v1 - id: changed-common + id: changed-common-ethereum with: - paths: packages/common - - - uses: marceloprado/has-changed-path@v1 - id: changed-common-substrate - with: - paths: packages/common-substrate - - - uses: marceloprado/has-changed-path@v1 - id: changed-cli - with: - paths: packages/cli - - - uses: marceloprado/has-changed-path@v1 - id: changed-node-core - with: - paths: packages/node-core + paths: packages/common-ethereum - uses: marceloprado/has-changed-path@v1 id: changed-node with: paths: packages/node - - uses: marceloprado/has-changed-path@v1 - id: changed-query - with: - paths: packages/query - - - uses: marceloprado/has-changed-path@v1 - id: changed-utils - with: - paths: packages/utils - - - uses: marceloprado/has-changed-path@v1 - id: changed-validator - with: - paths: packages/validator - - run: yarn - name: build @@ -93,32 +63,18 @@ jobs: package-path: packages/utils npm-token: ${{ secrets.NPM_TOKEN }} - - name: Bump types & deploy - if: steps.changed-types.outputs.changed == 'true' + - name: Bump types ethereum & deploy + if: steps.changed-types-ethereum.outputs.changed == 'true' uses: ./.github/actions/create-prerelease with: package-path: packages/types npm-token: ${{ secrets.NPM_TOKEN }} - - name: Bump common & deploy - if: steps.changed-common.outputs.changed == 'true' - uses: ./.github/actions/create-prerelease - with: - package-path: packages/common - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Bump common substrate & deploy - if: steps.changed-common-substrate.outputs.changed == 'true' - uses: ./.github/actions/create-prerelease - with: - package-path: packages/common-substrate - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Bump node-core & deploy - if: steps.changed-node-core.outputs.changed == 'true' + - name: Bump common ethereum & deploy + if: steps.changed-common-ethereum.outputs.changed == 'true' uses: ./.github/actions/create-prerelease with: - package-path: packages/node-core + package-path: packages/common-ethereum npm-token: ${{ secrets.NPM_TOKEN }} - name: Bump node & deploy @@ -128,27 +84,6 @@ jobs: package-path: packages/node npm-token: ${{ secrets.NPM_TOKEN }} - - name: Bump query & deploy - if: steps.changed-query.outputs.changed == 'true' - uses: ./.github/actions/create-prerelease - with: - package-path: packages/query - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Bump validator & deploy - if: steps.changed-validator.outputs.changed == 'true' - uses: ./.github/actions/create-prerelease - with: - package-path: packages/validator - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Bump cli & deploy - if: steps.changed-cli.outputs.changed == 'true' - uses: ./.github/actions/create-prerelease - with: - package-path: packages/cli - npm-token: ${{ secrets.NPM_TOKEN }} - - name: Commit changes uses: EndBug/add-and-commit@v5 with: diff --git a/.github/workflows/query-docker.yml b/.github/workflows/query-docker.yml deleted file mode 100644 index 57589240..00000000 --- a/.github/workflows/query-docker.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Query-to-docker" -on: - workflow_dispatch: - inputs: - isLatest: - description: 'Add latest tag' - default: 'true' - require: true - -jobs: - query-build-push-docker: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 100 - token: ${{ secrets.REPO_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: onfinality - password: ${{ secrets.DOCKERHUB_TOKEN }} - - ## query - - name: Get updated query version - id: get-query-version - run: | - sh .github/workflows/scripts/queryVersion.sh - - - name: Build and push - if: github.event.inputs.isLatest == 'false' - uses: docker/build-push-action@v2 - with: - push: true - platforms: arm64,amd64 - file: ./packages/query/Dockerfile - tags: onfinality/subql-query:v${{ steps.get-query-version.outputs.QUERY_VERSION }} - build-args: RELEASE_VERSION=${{ steps.get-query-version.outputs.QUERY_VERSION }} - - - name: Build and push - if: github.event.inputs.isLatest == 'true' - uses: docker/build-push-action@v2 - with: - push: true - platforms: arm64,amd64 - file: ./packages/query/Dockerfile - tags: onfinality/subql-query:v${{ steps.get-query-version.outputs.QUERY_VERSION }},onfinality/subql-query:latest - build-args: RELEASE_VERSION=${{ steps.get-query-version.outputs.QUERY_VERSION }} - - - name: Image digest - if: steps.changed-query.outputs.changed == 'true' - run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a39b7e01..6953e984 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: Build-Publish: name: Build-Publish needs: pre-ci - if: "!startsWith(github.event.head_commit.message, '[SKIP CI]') && startsWith(github.event.head_commit.message, '[release]') && github.repository == 'subquery/subql'" + if: "!startsWith(github.event.head_commit.message, '[SKIP CI]') && startsWith(github.event.head_commit.message, '[release]') && github.repository == 'subquery/subql-ethereum'" runs-on: ubuntu-latest steps: #Check out @@ -37,93 +37,39 @@ jobs: #Identify changes - uses: marceloprado/has-changed-path@v1 - id: changed-types + id: changed-types-ethereum with: paths: packages/types - uses: marceloprado/has-changed-path@v1 - id: changed-common + id: changed-common-ethereum with: - paths: packages/common - - - uses: marceloprado/has-changed-path@v1 - id: changed-common-substrate - with: - paths: packages/common-substrate - - - uses: marceloprado/has-changed-path@v1 - id: changed-cli - with: - paths: packages/cli - - - uses: marceloprado/has-changed-path@v1 - id: changed-node-core - with: - paths: packages/node-core + paths: packages/common-ethereum - uses: marceloprado/has-changed-path@v1 id: changed-node with: paths: packages/node - - uses: marceloprado/has-changed-path@v1 - id: changed-query - with: - paths: packages/query - - - uses: marceloprado/has-changed-path@v1 - id: changed-utils - with: - paths: packages/utils - - - uses: marceloprado/has-changed-path@v1 - id: changed-validator - with: - paths: packages/validator - - run: yarn - name: build run: yarn workspaces foreach run build #Publish to npm and github releases - - name: Publish Utils - if: steps.changed-utils.outputs.changed == 'true' - uses: ./.github/actions/create-release - with: - package-path: packages/utils - repo-token: ${{ secrets.REPO_TOKEN }} - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Publish Types - if: steps.changed-types.outputs.changed == 'true' + - name: Publish Types ethereum + if: steps.changed-types-ethereum.outputs.changed == 'true' uses: ./.github/actions/create-release with: package-path: packages/types repo-token: ${{ secrets.REPO_TOKEN }} npm-token: ${{ secrets.NPM_TOKEN }} - - name: Publish Common - if: steps.changed-common.outputs.changed == 'true' - uses: ./.github/actions/create-release - with: - package-path: packages/common - repo-token: ${{ secrets.REPO_TOKEN }} - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Publish Common Substrate - if: steps.changed-common-substrate.outputs.changed == 'true' - uses: ./.github/actions/create-release - with: - package-path: packages/common-substrate - repo-token: ${{ secrets.REPO_TOKEN }} - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Publish Node Core - if: steps.changed-node-core.outputs.changed == 'true' + - name: Publish Common ethereum + if: steps.changed-common-ethereum.outputs.changed == 'true' uses: ./.github/actions/create-release with: - package-path: packages/node-core + package-path: packages/common-ethereum repo-token: ${{ secrets.REPO_TOKEN }} npm-token: ${{ secrets.NPM_TOKEN }} @@ -134,27 +80,3 @@ jobs: package-path: packages/node repo-token: ${{ secrets.REPO_TOKEN }} npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Publish Query - if: steps.changed-query.outputs.changed == 'true' - uses: ./.github/actions/create-release - with: - package-path: packages/query - repo-token: ${{ secrets.REPO_TOKEN }} - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Publish Validator - if: steps.changed-validator.outputs.changed == 'true' - uses: ./.github/actions/create-release - with: - package-path: packages/validator - repo-token: ${{ secrets.REPO_TOKEN }} - npm-token: ${{ secrets.NPM_TOKEN }} - - - name: Publish Cli - if: steps.changed-cli.outputs.changed == 'true' - uses: ./.github/actions/create-release - with: - package-path: packages/cli - repo-token: ${{ secrets.REPO_TOKEN }} - npm-token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/scripts/nodeTerraVersion.sh b/.github/workflows/scripts/nodeTerraVersion.sh deleted file mode 100644 index 08cdb071..00000000 --- a/.github/workflows/scripts/nodeTerraVersion.sh +++ /dev/null @@ -1,9 +0,0 @@ -PACKAGE_VERSION=$(cat ./packages/node-terra/package.json \ - | grep version \ - | head -1 \ - | awk -F: '{ print $2 }' \ - | sed 's/[",]//g' \ - | tr -d '[[:space:]]') - - -echo "::set-output name=NODE_VERSION::$PACKAGE_VERSION" diff --git a/.github/workflows/scripts/queryVersion.sh b/.github/workflows/scripts/queryVersion.sh deleted file mode 100644 index b2655667..00000000 --- a/.github/workflows/scripts/queryVersion.sh +++ /dev/null @@ -1,9 +0,0 @@ -PACKAGE_VERSION=$(cat ./packages/query/package.json \ - | grep version \ - | head -1 \ - | awk -F: '{ print $2 }' \ - | sed 's/[",]//g' \ - | tr -d '[[:space:]]') - - -echo "::set-output name=QUERY_VERSION::$PACKAGE_VERSION" diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile new file mode 100644 index 00000000..88850a10 --- /dev/null +++ b/.gitpod.dockerfile @@ -0,0 +1 @@ +FROM gitpod/workspace-postgresql diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..b672579a --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,9 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) +# and commit this file to your remote git repository to share the goodness with others. +image: gitpod/workspace-postgres:latest + +tasks: + - init: yarn install && yarn run build + + diff --git a/README.md b/README.md index 38cf3cef..b9d3067d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The future is multi-chain - SubQuery is no different. SubQuery is well on our wa - [Polkadot (and all Substrate networks)](https://academy.subquery.network/quickstart/quickstart_chains/polkadot.html) - [Cosmos (and all CosmWasm and Ethermint networks)](https://academy.subquery.network/quickstart/quickstart_chains/cosmos.html) -- [Avalanche (and all Avalanche Subnets)](https://academy.subquery.network/quickstart/quickstart_chains/avalanche.html) +- [ethereum (and all ethereum Subnets)](https://academy.subquery.network/quickstart/quickstart_chains/ethereum.html) - [Algorand](https://academy.subquery.network/quickstart/quickstart_chains/algorand.html) - [Terra](https://academy.subquery.network/quickstart/quickstart_chains/terra.html) diff --git a/jest.config.js b/jest.config.js index 26c527a5..c9c9f543 100644 --- a/jest.config.js +++ b/jest.config.js @@ -21,13 +21,8 @@ module.exports = { // An array of glob patterns indicating a set of files for which coverage information should be collected collectCoverageFrom: [ - 'packages/cli/src/**/*.ts', - 'packages/common/src/**/*.ts', - 'packages/common-substrate/src/**/*.ts', - 'packages/node-core/src/**/*.ts', + 'packages/common-ethereum/src/**/*.ts', 'packages/node/src/**/*.ts', - 'packages/utils/src/**/*.ts', - 'packages/validator/src/**/*.ts', ], // The directory where Jest should output its coverage files @@ -90,10 +85,7 @@ module.exports = { // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module // moduleNameMapper: {}, moduleNameMapper: { - '^@subql/common-substrate/(.*)$': '/packages/common-substrate/src/$1', - '^@subql/common/(.*)$': '/packages/common/src/$1', - '^@subql/node-core/(.*)$': '/packages/node-core/src/$1', - '^@subql/utils/(.*)$': '/packages/utils/src/$1', + '^@subql/common-ethereum/(.*)$': '/packages/common-ethereum/src/$1', }, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader diff --git a/package.json b/package.json index 04b6db6d..9775d7e3 100644 --- a/package.json +++ b/package.json @@ -54,5 +54,13 @@ "prettier --write" ] }, - "packageManager": "yarn@3.1.1" + "packageManager": "yarn@3.1.1", + "dependencies": { + "@subql/node-core": "^0.1.1", + "@subql/utils": "^1.1.0", + "ethers": "^5.7.1", + "sequelize": "6.19.0", + "web3-providers-http": "^1.7.5", + "web3-providers-ws": "^1.7.5" + } } diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md deleted file mode 100644 index a994da72..00000000 --- a/packages/cli/CHANGELOG.md +++ /dev/null @@ -1,291 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -All logs must start with the format: [x.y.z] - yyyy-mm-dd - -## [Unreleased] - -## [1.6.1] - 2022-09-13 -### Fixed -- Fixed `subql-init` for Algorand, Avalanche and Cosmos. - -## [1.6.0] - 2022-08-17 -### Changed -- Support new templates mono-repo structure. (#1236) - -## [1.5.1] - 2022-08-11 -### Fixed -- Bump version for missing update `subql-common` in previous release. - -## [1.5.0] - 2022-08-04 -### Added -- Support for Algorand projects (#1228) - -### Fixed -- Removing `.github` directory from starter templates (#1223) - -## [1.4.0] - 2022-07-27 -### Added -- Added redeploy deployment feature (#1205) -- Rename `--project_name` flag to `--projectName` (#1205) -### Fixed -- Use latest runner validation from common package. (#1195) - -## [1.3.1] - 2022-07-13 -### Fixed -- Added resolution to downgrade `node-fetch` as we have not support ES module (1184) -- Added encodedURI for project deployment key (#1183) - -## [1.3.0] - 2022-07-12 -### Fixed -- CLI deployment when no dictionary or matching endpoint is provided (#1180) -### Added -- Storing ipfs-cid locally (#1169) -- New Flag `-d` added to `deployment:deploy` command allowing runner versions and endpoints to use default values from manifest (#1176) -### Changed -- Rename `deploy` command back to `deployment` (#1176) - -## [1.2.1] - 2022-07-06 -### Added -- Add cosmos family to cli init (#1165) - -## [1.2.0] - 2022-07-05 -### Fixed -- update common-avalanche,fix missing filter, asset and options (#1158) -### Changed -- Rename `deployment` command to `deploy`(#1149) - -## [1.1.1] - 2022-06-29 -### Fixed -- Fixed typo in publish log (#1135) -### Changed -- Update init and publish tests with manifest 1.0.0 (#1114) - -## [1.1.0] - 2022-06-22 -### Changed -- Increase publish project body size up to 50mb (#1100) -- Validate support multi networks, also support validate IPFS deployment. To validate project manifest spec version below 1.0.0, will require to provide `network-family` (#1115) -### Added -- Added avalanche and cosmos to publish (#1105) -- Now cli able to manage deployment on host service, promote, deploy and delete (#1102) - -## [1.0.1] - 2022-05-31 -### Fixed -- Fix cli init duplicate chainId and genesisHash (#1058) - -## [1.0.0] - 2022-05-11 -- Major release -### Fixed -- fix undefined file under chainTypes (#1010) - -## [0.29.0] - 2022-05-11 -### Changed -- remove use manifest in codegen (#1001) - -## [0.28.0] - 2022-05-06 -### Fixed -- Fix migrate missing chain types (#975) -### Changed -- Refactor init command and add network family (#979) - -## [0.27.0] - 2022-05-02 -### Added -- Add utils package (#928) - -## [0.26.1] - 2022-04-27 -### Added -- Support for Terra dynamic datasources (#899) -### Changed -- Output build errors (#901) - -## [0.26.0] - 2022-04-26 -### Added -- Add manifest specVersion 1.0.0 template to `subql init` command (#888) -### Changed -- Drop support for manifest 0.0.1 templates (#900) - -## [0.25.0] - 2022-04-12 -### Changed -- Update @subql/common-terra to allow specifying a mantlemint endpoint (#885) - -## [0.24.0] - 2022-04-06 -### Added -- Add support for manifest 1.0.0, migrate will now upgrade project to 1.0.0 (#845) - -## [0.23.0] - 2022-03-22 -### Added -- Use `TerraProjectManifestVersioned` to support terra contract handling (#848) - -## [0.22.0] - 2022-03-01 -### Added -- Support terra in command line, add terra template (#781) - -## [0.21.0] - 2022-02-24 -### Added -- Support cli publish from a manifest file (#800) - -## [0.20.1] - 2022-02-15 -### Fixed -- Patch release with @subql/validator version bump, in order to fix validation issue. - -## [0.20.0] - 2022-02-09 -### Added -- Add support for dynamic data sources (#773) -- Add authentication for publish command, access token will read from `SUBQL_ACCESS_TOKEN` in environment or under `$HOME/.subql/SUBQL_ACCESS_TOKEN` (#778) -### Fixed -- Fix codegen importing jsonType interface multiple times (#784) -- Fix cli build command issues (#789) - -## [0.19.0] - 2022-01-21 -### Added -- Allow use `subql build` self contained js as instructed by `exports` fields under`package.json` (#753) -### Changed -- Remove .github directory from new projects (#763) - -## [0.18.0] - 2022-01-18 -### Added -- Filter project templates by selected specVersion (#751) - -## [0.17.0] - 2022-01-13 -### Added -- Warning and advice for use manifest specVersion v0.0.1 (#730) -- Message for install git suggestion (#733) -- Allow user to select templates when run `subql init` (#712) - -## [0.16.2] - 2021-12-16 -### Changed -- Update subql/validator dependencies (#720) - -## [0.16.1] - 2021-11-30 -### Fixed -- Remove auto generated enum types and interfaces (#680) - -## [0.16.0] - 2021-11-19 -### Fixed -- Fix migrate datasource entry path (#641) -- Touch up command line description (#628) -### Changed -- Codegen controller using new type mappings (#532) -- Update publish command to handle custom datasource (#641) -- init command now create spec v0.2.0 project by default (#643) -### Added -- Support enums in codegen (#551) - -## [0.15.0] - 2021-11-03 -### Changed -- Improve ts typing for `static create()` function in model.ts template (#573) -- Use jsonrpc client to fetch genesis hash , drop dependencies of polkadot-api (#595) -- Update `subql validate` to validate custom ds (#596) -- Bump dependencies (#584) -### Added -- New command `Subql migrate` allow convert project manifest v0.0.1 to v0.2.0 (#587) - -## [0.14.0] - 2021-10-26 -### Added -- Added publish CLI command which uploads a project to IPFS if it is using project manifest v0.2.0 (#486) -### Changed -- Update Polkadot/api to 6.5.2 (#564) - -## [0.13.0] - 2021-10-12 -### Added -- Cli now support for manifest spec version `0.2.0` (#495) -- Expand on cli `init` capabilities, default to not installing dependencies (#485) - -## [0.12.0] - 2021-09-16 -### Added -- Adds command `subql build` which webpacks the project code into a single file (#475) - -## [0.11.2] - 2021-09-01 -### Fixed -- Fix codegen template for jsonField optional field (#459) - -## [0.11.1] - 2021-08-27 -### Fixed -- Deprecated warnings (#448) - -## [0.11.0] - 2021-08-20 -### Added -- Support Bytea type in Cli (#432) - -## [0.10.0] - 2021-06-25 -### Changed -- Update dependencies (#358) - -## [0.9.3] - 2021-05-04 -### Added -- Codegen will support indexed jsonb fields. No get methods will be created for such fields in the entity class. (#291) - -## [0.9.2] - 2021-04-21 -### Added -- Codegen allow query by foreign key field (#285) - -## [0.9.0] - 2021-04-19 -### Added -- `@index` annotation is now supported in `graphql.schema` (#255): - - Can be added on any field of any entity except primary or foreign keys - - `@subql/node` will recognise it and create table with additional indexes to speed querying - - Allow query by indexed field via `global.store` (#271) -- `@jsonField` annotation is now supported in `graphql.schema` which allows you to store structured data JSON data in a single database field - - We'll automatically generate coresponding JSON interfaces when querying this data (#275) - - Read more about how you can use this in our [updated docs](https://doc.subquery.network/create/graphql.html#json-type) - -## [0.8.0] - 2021-03-11 -### Added -- Update subquery repo path (#196) -- codegen will create foreign key for relations: 1-1, and 1-N  (#212) -- codegen support type Boolean (#216) -- add subcommand validate (#219) - -## [0.7.3] - 2021-02-15 -### Changed -- bump dependencies (#148) - -## [0.7.2] - 2021-02-03 -### Fixed -- fix yaml formatting problem in the starter scaffold generated by subql init (#140) - -## [0.7.1] - 2021-01-27 -### Fixed -- add missing cli-ux dependency (#133) - -## [0.7.0] - 2021-01-27 -### Added -- add user interaction for subql init (#118) - -## [0.6.0] - 2021-01-21 -### Fixed -- read graphql schema from the location defined in project.yml (#105) - -## [0.5.0] - 2021-01-15 -### Changed -- subql init doesn' need --starter by default (#86) -- model template use bigint instead of BigInt (#82) - -## [0.2.0] - 2020-12-22 -### Changed -- support subcommand codegen -- support subcommand init - -[Unreleased]: https://github.com/subquery/subql/compare/cli/0.20.1...HEAD -[0.20.1]: https://github.com/subquery/subql/compare/cli/0.20.0...cli/0.20.1 -[0.20.0]: https://github.com/subquery/subql/compare/cli/0.19.0...cli/0.20.0 -[0.19.0]: https://github.com/subquery/subql/compare/cli/0.18.0...cli/0.19.0 -[0.18.0]: https://github.com/subquery/subql/compare/cli/0.17.0...cli/0.18.0 -[0.17.0]: https://github.com/subquery/subql/compare/cli/0.16.2...cli/0.17.0 -[0.16.2]: https://github.com/subquery/subql/compare/cli/0.16.1...cli/0.16.2 -[0.16.1]: https://github.com/subquery/subql/compare/cli/0.16.0...cli/0.16.1 -[0.16.0]: https://github.com/subquery/subql/compare/cli/0.15.0...cli/0.16.0 -[0.15.0]: https://github.com/subquery/subql/compare/cli/0.14.0...cli/0.15.0 -[0.14.0]: https://github.com/subquery/subql/compare/cli/0.13.0...cli/0.14.0 -[0.9.2]: https://github.com/subquery/subql/compare/v0.9.0...v0.9.2 -[0.9.0]: https://github.com/subquery/subql/compare/v0.8.0...v0.9.0 -[0.8.0]: https://github.com/subquery/subql/compare/v0.7.3...v0.8.0 -[0.7.3]: https://github.com/OnFinality-io/subql/compare/v0.7.2...v0.7.3 -[0.7.2]: https://github.com/OnFinality-io/subql/compare/v0.7.1...v0.7.2 -[0.7.1]: https://github.com/OnFinality-io/subql/compare/v0.7.0...v0.7.1 -[0.7.0]: https://github.com/OnFinality-io/subql/compare/v0.6.0...v0.7.0 -[0.6.0]: https://github.com/OnFinality-io/subql/compare/v0.5.0...v0.6.0 -[0.5.0]: https://github.com/OnFinality-io/subql/compare/v0.2.0...v0.5.0 diff --git a/packages/cli/README.md b/packages/cli/README.md deleted file mode 100644 index e4c91ee9..00000000 --- a/packages/cli/README.md +++ /dev/null @@ -1,313 +0,0 @@ -# @subql/cli - -cli for polkagraph - -[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) -[![Version](https://img.shields.io/npm/v/@subql/cli.svg)](https://npmjs.org/package/@subql/cli) -[![Downloads/week](https://img.shields.io/npm/dw/@subql/cli.svg)](https://npmjs.org/package/@subql/cli) -[![License](https://img.shields.io/npm/l/@subql/cli.svg)](https://github.com/packages/cli/blob/master/package.json) - - - -- [@subql/cli](#subqlcli) -- [Usage](#usage) -- [Commands](#commands) - - -# Usage - - - -```sh-session -$ npm install -g @subql/cli -$ subql COMMAND -running command... -$ subql (-v|--version|version) -@subql/cli/1.6.1-0 linux-x64 node-v16.17.0 -$ subql --help [COMMAND] -USAGE - $ subql COMMAND -... -``` - - - -# Commands - - - -- [`subql build`](#subql-build) -- [`subql codegen`](#subql-codegen) -- [`subql deployment`](#subql-deployment) -- [`subql deployment:delete`](#subql-deploymentdelete) -- [`subql deployment:deploy`](#subql-deploymentdeploy) -- [`subql deployment:promote`](#subql-deploymentpromote) -- [`subql help [COMMAND]`](#subql-help-command) -- [`subql init [PROJECTNAME]`](#subql-init-projectname) -- [`subql migrate`](#subql-migrate) -- [`subql project`](#subql-project) -- [`subql project:create-project`](#subql-projectcreate-project) -- [`subql project:delete-project`](#subql-projectdelete-project) -- [`subql publish`](#subql-publish) -- [`subql validate`](#subql-validate) - -## `subql build` - -Build this SubQuery project code - -``` -USAGE - $ subql build - -OPTIONS - -f, --location=location local folder - -o, --output=output output folder of build e.g. dist - -s, --slient silent mode - --mode=(production|prod|development|dev) [default: production] -``` - -_See code: [lib/commands/build.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/build.js)_ - -## `subql codegen` - -Generate schemas for graph node - -``` -USAGE - $ subql codegen - -OPTIONS - -f, --force - -l, --location=location local folder to run codegen in - --file=file -``` - -_See code: [lib/commands/codegen.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/codegen.js)_ - -## `subql deployment` - -Deploy to hosted service - -``` -USAGE - $ subql deployment - -OPTIONS - -d, --useDefaults Use default values for indexerVersion, queryVersion, dictionary, endpoint - --deploymentID=deploymentID Enter deployment ID - --dict=dict Enter dictionary - --endpoint=endpoint Enter endpoint - --indexerVersion=indexerVersion Enter indexer-version - --ipfsCID=ipfsCID Enter IPFS CID - --options=deploy|promote|delete - --org=org Enter organization name - --projectName=projectName Enter project name - --project_name=project_name Enter project name - --queryVersion=queryVersion Enter query-version - --type=(stage|primary) [default: primary] -``` - -_See code: [lib/commands/deployment/index.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/deployment/index.js)_ - -## `subql deployment:delete` - -Delete Deployment - -``` -USAGE - $ subql deployment:delete - -OPTIONS - --deploymentID=deploymentID Enter deployment ID - --org=org Enter organization name - --project_name=project_name Enter project name -``` - -_See code: [lib/commands/deployment/delete.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/deployment/delete.js)_ - -## `subql deployment:deploy` - -Deployment to hosted service - -``` -USAGE - $ subql deployment:deploy - -OPTIONS - -d, --useDefaults Use default values for indexerVersion, queryVersion, dictionary, endpoint - --dict=dict Enter dictionary - --endpoint=endpoint Enter endpoint - --indexerVersion=indexerVersion Enter indexer-version - --ipfsCID=ipfsCID Enter IPFS CID - --org=org Enter organization name - --projectName=projectName Enter project name - --queryVersion=queryVersion Enter query-version - --type=(stage|primary) [default: primary] -``` - -_See code: [lib/commands/deployment/deploy.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/deployment/deploy.js)_ - -## `subql deployment:promote` - -Promote Deployment - -``` -USAGE - $ subql deployment:promote - -OPTIONS - --deploymentID=deploymentID Enter deployment ID - --org=org Enter organization name - --project_name=project_name Enter project name -``` - -_See code: [lib/commands/deployment/promote.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/deployment/promote.js)_ - -## `subql help [COMMAND]` - -display help for subql - -``` -USAGE - $ subql help [COMMAND] - -ARGUMENTS - COMMAND command to show help for - -OPTIONS - --all see all commands in CLI -``` - -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.3.1/src/commands/help.ts)_ - -## `subql init [PROJECTNAME]` - -Initialize a scaffold subquery project - -``` -USAGE - $ subql init [PROJECTNAME] - -ARGUMENTS - PROJECTNAME Give the starter project name - -OPTIONS - -f, --force - -l, --location=location local folder to create the project in - --install-dependencies Install dependencies as well - --npm Force using NPM instead of yarn, only works with `install-dependencies` flag -``` - -_See code: [lib/commands/init.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/init.js)_ - -## `subql migrate` - -Migrate Subquery project manifest to v1.0.0 - -``` -USAGE - $ subql migrate - -OPTIONS - -f, --force - -l, --location=location local folder to run migrate in - --file=file -``` - -_See code: [lib/commands/migrate.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/migrate.js)_ - -## `subql project` - -Create/Delete project - -``` -USAGE - $ subql project - -OPTIONS - --apiVersion=apiVersion [default: 2] Enter api version - --description=description Enter description - --gitRepo=gitRepo Enter git repository - --logoURL=logoURL Enter logo URL - --options=create|delete - --org=org Enter organization name - --projectName=projectName Enter project name - --subtitle=subtitle Enter subtitle -``` - -_See code: [lib/commands/project/index.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/project/index.js)_ - -## `subql project:create-project` - -Create Project on Hosted Service - -``` -USAGE - $ subql project:create-project - -OPTIONS - --apiVersion=apiVersion [default: 2] Enter api version - --description=description Enter description - --gitRepo=gitRepo Enter git repository - --logoURL=logoURL Enter logo URL - --org=org Enter organization name - --projectName=projectName Enter project name - --subtitle=subtitle Enter subtitle -``` - -_See code: [lib/commands/project/create-project.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/project/create-project.js)_ - -## `subql project:delete-project` - -Delete Project on Hosted Service - -``` -USAGE - $ subql project:delete-project - -OPTIONS - --org=org Enter organization name - --projectName=projectName Enter project name -``` - -_See code: [lib/commands/project/delete-project.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/project/delete-project.js)_ - -## `subql publish` - -Upload this SubQuery project to IPFS - -``` -USAGE - $ subql publish - -OPTIONS - -f, --location=location from project or manifest path - -o, --output Output IPFS CID - --ipfs=ipfs IPFS gateway endpoint -``` - -_See code: [lib/commands/publish.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/publish.js)_ - -## `subql validate` - -Check a folder or github repo is a validate subquery project - -``` -USAGE - $ subql validate - -OPTIONS - -l, --location=location local folder, github repo url or IPFS cid - - --ipfs=ipfs [default: https://ipfs.subquery.network/ipfs/api/v0] - IPFS gateway endpoint, used for validating projects on - IPFS - - --network-family=(Substrate|Avalanche|Terra|Cosmos|Algorand) - - --silent -``` - -_See code: [lib/commands/validate.js](https://github.com/packages/cli/blob/v1.6.1-0/lib/commands/validate.js)_ - - diff --git a/packages/cli/bin/run b/packages/cli/bin/run deleted file mode 100755 index 30b14e17..00000000 --- a/packages/cli/bin/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node - -require('@oclif/command').run() -.then(require('@oclif/command/flush')) -.catch(require('@oclif/errors/handle')) diff --git a/packages/cli/bin/run.cmd b/packages/cli/bin/run.cmd deleted file mode 100644 index 968fc307..00000000 --- a/packages/cli/bin/run.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -node "%~dp0\run" %* diff --git a/packages/cli/package.json b/packages/cli/package.json deleted file mode 100644 index b3267eef..00000000 --- a/packages/cli/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "@subql/cli", - "description": "cli for subquery", - "version": "1.6.1", - "author": "Ian He", - "bin": { - "subql": "./bin/run" - }, - "bugs": "https://github.com/subquery/subql/issues", - "dependencies": { - "@oclif/command": "^1.8.16", - "@oclif/config": "^1.18.3", - "@oclif/core": "^1.3.3", - "@oclif/plugin-help": "^3.2.3", - "@subql/common": "workspace:*", - "@subql/common-algorand": "latest", - "@subql/common-avalanche": "latest", - "@subql/common-cosmos": "latest", - "@subql/common-substrate": "workspace:*", - "@subql/common-terra": "^0.6.0", - "@subql/utils": "workspace:*", - "@subql/validator": "workspace:*", - "@types/ejs": "^3.1.0", - "@types/inquirer": "^8.2.0", - "algosdk": "^1.19.0", - "cli-ux": "^6.0.9", - "ejs": "^3.1.6", - "fuzzy": "^0.1.3", - "inquirer": "^8.2.0", - "inquirer-autocomplete-prompt": "^1.4.0", - "node-fetch": "2.6.7", - "oclif": "^2.4.4", - "rimraf": "^3.0.2", - "simple-git": "^3.12.0", - "ts-loader": "^9.2.6", - "tslib": "^2.3.1", - "webpack": "^5.68.0", - "webpack-merge": "^5.8.0", - "websocket": "^1.0.34", - "yaml-loader": "^0.6.0" - }, - "devDependencies": { - "@oclif/dev-cli": "^1.26.10", - "@types/node": "^14.18.10", - "@types/rimraf": "^3.0.2", - "@types/websocket": "^1", - "eslint": "^8.8.0", - "eslint-config-oclif": "^4.0.0", - "eslint-config-oclif-typescript": "^1.0.2", - "globby": "^11" - }, - "engines": { - "node": ">=8.0.0" - }, - "files": [ - "/bin", - "/lib", - "/npm-shrinkwrap.json", - "/oclif.manifest.json" - ], - "homepage": "https://github.com/subquery/subql", - "repository": "packages/cli", - "keywords": [ - "oclif" - ], - "license": "Apache-2.0", - "main": "lib/index.js", - "oclif": { - "commands": "./lib/commands", - "bin": "subql", - "plugins": [ - "@oclif/plugin-help" - ] - }, - "scripts": { - "build": "rm -rf lib && tsc -b", - "postpack": "rm -f oclif.manifest.json", - "posttest": "eslint . --ext .ts --config .eslintrc", - "prepack": "yarn build && cp -r src/template lib/ && oclif-dev manifest && oclif-dev readme", - "test": "echo NO TESTS", - "version": "oclif-dev readme && git add README.md", - "format": "prettier --write \"src/**/*.ts\"" - }, - "types": "lib/index.d.ts", - "resolutions": { - "node-fetch": "2.6.7" - } -} diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts deleted file mode 100644 index 697d22b8..00000000 --- a/packages/cli/src/commands/build.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {lstatSync, readFileSync} from 'fs'; -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {runWebpack} from '../controller/build-controller'; - -export default class Build extends Command { - static description = 'Build this SubQuery project code'; - - static flags = { - location: Flags.string({char: 'f', description: 'local folder'}), - output: Flags.string({char: 'o', description: 'output folder of build e.g. dist'}), - mode: Flags.enum({options: ['production', 'prod', 'development', 'dev'], default: 'production'}), - slient: Flags.boolean({char: 's', description: 'silent mode'}), - }; - - async run(): Promise { - try { - const {flags} = await this.parse(Build); - - const directory = flags.location ? path.resolve(flags.location) : process.cwd(); - const isDev = flags.mode === 'development' || flags.mode === 'dev'; - - if (!lstatSync(directory).isDirectory()) { - this.error('Argument `location` is not a valid directory'); - } - - // Get the output location from the project package.json main field - const pjson = JSON.parse(readFileSync(path.join(directory, 'package.json')).toString()); - - const defaultEntry = path.join(directory, 'src/index.ts'); - const outputDir = path.resolve(directory, flags.output ?? 'dist'); - - let buildEntries: {[key: string]: string} = {}; - buildEntries.index = defaultEntry; - - if (pjson.exports && typeof pjson.exports !== 'string') { - buildEntries = Object.entries(pjson.exports as Record).reduce( - (acc, [key, value]) => { - acc[key] = path.resolve(directory, value); - return acc; - }, - {...buildEntries} - ); - } - - for (const i in buildEntries) { - if (typeof buildEntries[i] !== 'string') { - this.warn(`Ignoring entry ${i} from build.`); - delete buildEntries[i]; - } - } - await runWebpack(buildEntries, directory, outputDir, isDev, true); - if (!flags.slient) { - this.log('Building and packing code ...'); - this.log('Done!'); - } - } catch (e) { - this.error(e); - } - } -} diff --git a/packages/cli/src/commands/codegen.ts b/packages/cli/src/commands/codegen.ts deleted file mode 100644 index 6f827cd9..00000000 --- a/packages/cli/src/commands/codegen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {codegen} from '../controller/codegen-controller'; - -export default class Codegen extends Command { - static description = 'Generate schemas for graph node'; - - static flags = { - force: Flags.boolean({char: 'f'}), - file: Flags.string(), - location: Flags.string({char: 'l', description: 'local folder to run codegen in'}), - }; - - async run(): Promise { - const {flags} = await this.parse(Codegen); - this.log('==============================='); - this.log('---------Subql Codegen---------'); - this.log('==============================='); - - const location = flags.location ? path.resolve(flags.location) : process.cwd(); - try { - await codegen(location); - } catch (err) { - console.error(err.message); - process.exit(1); - } - } -} diff --git a/packages/cli/src/commands/deployment/delete.ts b/packages/cli/src/commands/deployment/delete.ts deleted file mode 100644 index b4ffe009..00000000 --- a/packages/cli/src/commands/deployment/delete.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {ROOT_API_URL_PROD} from '../../constants'; -import {deleteDeployment} from '../../controller/deploy-controller'; -import {checkToken, valueOrPrompt} from '../../utils'; - -const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); - -export default class Delete extends Command { - static description = 'Delete Deployment'; - - static flags = { - org: Flags.string({description: 'Enter organization name'}), - project_name: Flags.string({description: 'Enter project name'}), - deploymentID: Flags.string({description: 'Enter deployment ID'}), - }; - - async run(): Promise { - const {flags} = await this.parse(Delete); - const authToken = await checkToken(process.env.SUBQL_ACCESS_TOKEN, ACCESS_TOKEN_PATH); - let deploymentID: number = +flags.deploymentID; - let project_name: string = flags.project_name; - let org: string = flags.org; - - org = await valueOrPrompt(org, 'Enter organisation', 'Organisation is required'); - project_name = await valueOrPrompt(project_name, 'Enter project name', 'Project name is required'); - deploymentID = await valueOrPrompt(deploymentID, 'Enter deployment ID', 'Deployment ID is required'); - - this.log(`Removing deployment: ${deploymentID}`); - const delete_output = await deleteDeployment(org, project_name, authToken, +deploymentID, ROOT_API_URL_PROD).catch( - (e) => this.error(e) - ); - this.log(`Removed deployment: ${delete_output}`); - } -} diff --git a/packages/cli/src/commands/deployment/deploy.ts b/packages/cli/src/commands/deployment/deploy.ts deleted file mode 100644 index 60e8dc9e..00000000 --- a/packages/cli/src/commands/deployment/deploy.ts +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import chalk from 'chalk'; -import cli from 'cli-ux'; -import inquirer from 'inquirer'; -import {BASE_PROJECT_URL, DEFAULT_DEPLOYMENT_TYPE, ROOT_API_URL_PROD} from '../../constants'; -import { - deployToHostedService, - ipfsCID_validate, - networkEndpoints, - dictionaryEndpoints, - imageVersions, - processEndpoints, - redeploy, - projectsInfo, -} from '../../controller/deploy-controller'; -import {checkToken, promptWithDefaultValues, valueOrPrompt} from '../../utils'; - -const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); -export default class Deploy extends Command { - static description = 'Deployment to hosted service'; - - static flags = { - org: Flags.string({description: 'Enter organization name'}), - projectName: Flags.string({description: 'Enter project name'}), - ipfsCID: Flags.string({description: 'Enter IPFS CID'}), - - type: Flags.enum({options: ['stage', 'primary'], default: DEFAULT_DEPLOYMENT_TYPE, required: false}), - indexerVersion: Flags.string({description: 'Enter indexer-version', required: false}), - queryVersion: Flags.string({description: 'Enter query-version', required: false}), - dict: Flags.string({description: 'Enter dictionary', required: false}), - endpoint: Flags.string({description: 'Enter endpoint', required: false}), - - useDefaults: Flags.boolean({ - char: 'd', - description: 'Use default values for indexerVersion, queryVersion, dictionary, endpoint', - required: false, - }), - }; - - async run(): Promise { - const {flags} = await this.parse(Deploy); - let {dict, endpoint, indexerVersion, ipfsCID, org, projectName, queryVersion} = flags; - - const authToken = await checkToken(process.env.SUBQL_ACCESS_TOKEN, ACCESS_TOKEN_PATH); - - org = await valueOrPrompt(org, 'Enter organisation', 'Organisation is required'); - projectName = await valueOrPrompt(projectName, 'Enter project name', 'Project name is required'); - ipfsCID = await valueOrPrompt(ipfsCID, 'Enter IPFS CID', 'IPFS CID is required'); - - const validator = await ipfsCID_validate(ipfsCID, authToken, ROOT_API_URL_PROD); - - if (!validator.valid) { - throw new Error(chalk.bgRedBright('Invalid IPFS CID')); - } - - if (!endpoint) { - const validateEndpoint = processEndpoints(await networkEndpoints(ROOT_API_URL_PROD), validator.chainId); - if (!flags.useDefaults) { - endpoint = await promptWithDefaultValues(cli, 'Enter endpoint', validateEndpoint, null, true); - } else if (validateEndpoint) { - endpoint = validateEndpoint; - } else { - throw new Error(chalk.red('Please use --endpoint flag when using a custom Endpoint')); - } - } - - if (!dict) { - const validateDictEndpoint = processEndpoints(await dictionaryEndpoints(ROOT_API_URL_PROD), validator.chainId); - if (!flags.useDefaults && !validateDictEndpoint) { - dict = await promptWithDefaultValues(cli, 'Enter dictionary', validateDictEndpoint, null, false); - } else { - dict = validateDictEndpoint; - } - } - - if (!indexerVersion) { - try { - const indexerVersions = await imageVersions( - validator.manifestRunner.node.name, - validator.manifestRunner.node.version, - authToken, - ROOT_API_URL_PROD - ); - if (!flags.useDefaults) { - const response = await promptWithDefaultValues( - inquirer, - 'Enter indexer version', - null, - indexerVersions, - true - ); - indexerVersion = response; - } else { - indexerVersion = indexerVersions[0]; - } - } catch (e) { - throw new Error(chalk.bgRedBright('Indexer version is required')); - } - } - if (!queryVersion) { - try { - const queryVersions = await imageVersions( - validator.manifestRunner.query.name, - validator.manifestRunner.query.version, - authToken, - ROOT_API_URL_PROD - ); - if (!flags.useDefaults) { - const response = await promptWithDefaultValues(inquirer, 'Enter query version', null, queryVersions, true); - queryVersion = response; - } else { - queryVersion = queryVersions[0]; - } - } catch (e) { - throw new Error(chalk.bgRedBright('Indexer version is required')); - } - } - - const projectInfo = await projectsInfo(authToken, org, projectName, ROOT_API_URL_PROD, flags.type); - - if (projectInfo !== undefined) { - await redeploy( - org, - projectName, - projectInfo.id, - authToken, - ipfsCID, - endpoint, - dict, - indexerVersion, - queryVersion, - ROOT_API_URL_PROD - ); - this.log(`Project: ${projectName} has been re-deployed`); - } else { - this.log('Deploying SubQuery project to Hosted Service'); - const deploymentOutput = await deployToHostedService( - org, - projectName, - authToken, - ipfsCID, - indexerVersion, - queryVersion, - endpoint, - flags.type, - dict, - ROOT_API_URL_PROD - ).catch((e) => this.error(e)); - this.log(`Project: ${deploymentOutput.projectKey} - \nStatus: ${chalk.blue(deploymentOutput.status)} - \nDeploymentID: ${deploymentOutput.id} - \nDeployment Type: ${deploymentOutput.type} - \nIndexer version: ${deploymentOutput.indexerImage} - \nQuery version: ${deploymentOutput.queryImage} - \nEndpoint: ${deploymentOutput.endpoint} - \nDictionary Endpoint: ${deploymentOutput.dictEndpoint} - \nQuery URL: ${deploymentOutput.queryUrl} - \nProject URL: ${BASE_PROJECT_URL}/project/${deploymentOutput.projectKey} - `); - } - } -} diff --git a/packages/cli/src/commands/deployment/index.ts b/packages/cli/src/commands/deployment/index.ts deleted file mode 100644 index f4160849..00000000 --- a/packages/cli/src/commands/deployment/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Command, Flags} from '@oclif/core'; -import * as inquirer from 'inquirer'; -import Delete from './delete'; -import Deploy from './deploy'; -import Promote from './promote'; - -type DeploymentOption = 'promote' | 'delete' | 'deploy'; - -export default class Deployment extends Command { - static description = 'Deploy to hosted service'; - static flags = { - options: Flags.string({ - options: ['deploy', 'promote', 'delete'], - }), - ...Deploy.flags, - ...Promote.flags, - ...Delete.flags, - }; - static optionMapping = { - deploy: Deploy, - promote: Promote, - delete: Delete, - }; - - async run(): Promise { - const {flags} = await this.parse(Deployment); - const option = flags.options; - let userOptions: DeploymentOption; - - if (!option) { - const response = await inquirer.prompt([ - { - name: 'deploymentOptions', - message: 'Select an deployment option', - type: 'list', - choices: [{name: 'deploy'}, {name: 'promote'}, {name: 'delete'}], - }, - ]); - - userOptions = response.deploymentOptions; - } else { - userOptions = option as DeploymentOption; - } - this.log(`Selected deployment option: ${userOptions}`); - try { - const handler = Deployment.optionMapping[userOptions]; - // removes arguments -> deployment and everything before it from the process.argv - const stripped_argv: string[] = process.argv - .filter((v, idx) => idx > process.argv.indexOf('deployment') && !v.includes('--options')) - .reduce((acc, val) => acc.concat(val.split('=')), []); - - await handler.run(stripped_argv); - } catch (e) { - this.log(`Failed to execute command: ${userOptions} error: ${e}`); - } - } -} diff --git a/packages/cli/src/commands/deployment/promote.ts b/packages/cli/src/commands/deployment/promote.ts deleted file mode 100644 index 2a10aae6..00000000 --- a/packages/cli/src/commands/deployment/promote.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {ROOT_API_URL_PROD} from '../../constants'; -import {promoteDeployment} from '../../controller/deploy-controller'; -import {checkToken, valueOrPrompt} from '../../utils'; - -const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); - -export default class Promote extends Command { - static description = 'Promote Deployment'; - - static flags = { - org: Flags.string({description: 'Enter organization name'}), - project_name: Flags.string({description: 'Enter project name'}), - deploymentID: Flags.string({description: 'Enter deployment ID'}), - }; - - async run(): Promise { - const {flags} = await this.parse(Promote); - const authToken = await checkToken(process.env.SUBQL_ACCESS_TOKEN, ACCESS_TOKEN_PATH); - - let deploymentID: number = +flags.deploymentID; - let org: string = flags.org; - let project_name: string = flags.project_name; - - org = await valueOrPrompt(org, 'Enter organisation', 'Organisation is required'); - project_name = await valueOrPrompt(project_name, 'Enter project name', 'Project name is required'); - deploymentID = await valueOrPrompt(deploymentID, 'Enter deployment ID', 'Deployment ID is required'); - - const promote_output = await promoteDeployment( - org, - project_name, - authToken, - +deploymentID, - ROOT_API_URL_PROD - ).catch((e) => this.error(e)); - this.log(`Promote deployment: ${promote_output} from Stage to Production`); - } -} diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts deleted file mode 100644 index 0d19f178..00000000 --- a/packages/cli/src/commands/init.ts +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {URL} from 'url'; -import {Command, Flags} from '@oclif/core'; -import {NETWORK_FAMILY} from '@subql/common'; -import chalk from 'chalk'; -import cli from 'cli-ux'; -import fuzzy from 'fuzzy'; -import * as inquirer from 'inquirer'; -import {uniq} from 'lodash'; -import { - fetchTemplates, - Template, - installDependencies, - cloneProjectTemplate, - cloneProjectGit, - readDefaults, - prepare, -} from '../controller/init-controller'; -import {ProjectSpecBase} from '../types'; -inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt')); - -// Helper function for fuzzy search on prompt input -function filterInput(arr: string[]) { - return (_: any, input: string) => { - input = input || ''; - return new Promise((resolve) => { - resolve( - fuzzy.filter(input, arr).map((el) => { - return el.original; - }) - ); - }); - }; -} - -async function promptValidRemoteAndBranch(): Promise { - let isValid = false; - let remote: string; - while (!isValid) { - try { - remote = await cli.prompt('Custom template git remote', { - required: true, - }); - new URL(remote); - isValid = true; - } catch (e) { - console.log(`Not a valid git remote URL: '${remote}', try again`); - continue; - } - } - const branch = await cli.prompt('Custom template git branch', { - required: true, - }); - return [remote, branch]; -} - -// - -export default class Init extends Command { - static description = 'Initialize a scaffold subquery project'; - - static flags = { - force: Flags.boolean({char: 'f'}), - location: Flags.string({char: 'l', description: 'local folder to create the project in'}), - 'install-dependencies': Flags.boolean({description: 'Install dependencies as well', default: false}), - npm: Flags.boolean({description: 'Force using NPM instead of yarn, only works with `install-dependencies` flag'}), - }; - - static args = [ - { - name: 'projectName', - description: 'Give the starter project name', - }, - ]; - private projectPath: string; //path on GitHub - private project: ProjectSpecBase; - private location: string; - private networkFamily: NETWORK_FAMILY; - private network: string; - - async run(): Promise { - const {args, flags} = await this.parse(Init); - - this.location = flags.location ? path.resolve(flags.location) : process.cwd(); - this.project = {} as ProjectSpecBase; - this.project.name = args.projectName - ? args.projectName - : await cli.prompt('Project name', {default: 'subql-starter', required: true}); - if (fs.existsSync(path.join(this.location, `${this.project.name}`))) { - throw new Error(`Directory ${this.project.name} exists, try another project name`); - } - - let templates: Template[]; - let selectedTemplate: Template; - - templates = await fetchTemplates(); - await this.observeTemplates(templates, flags); - - //Family selection - const families = uniq(templates.map(({family}) => family)).sort(); - await inquirer - .prompt([ - { - name: 'familyResponse', - message: 'Select a network family', - type: 'autocomplete', - searchText: '', - emptyText: 'Network family not found', - pageSize: 20, - source: filterInput(families), - }, - ]) - .then(({familyResponse}) => { - this.networkFamily = familyResponse; - }); - templates = templates.filter(({family}) => family === this.networkFamily); - await this.observeTemplates(templates, flags); - - // Network selection - const networks = uniq(templates.map(({network}) => network)).sort(); - await inquirer - .prompt([ - { - name: 'networkResponse', - message: 'Select a network', - type: 'autocomplete', - searchText: '', - emptyText: 'Network not found', - pageSize: 20, - source: filterInput(networks), - }, - ]) - .then(({networkResponse}) => { - this.network = networkResponse; - }); - const candidateTemplates = templates.filter(({network}) => network === this.network); - await this.observeTemplates(candidateTemplates, flags); - - // Templates selection - const paddingWidth = candidateTemplates.map(({name}) => name.length).reduce((acc, xs) => Math.max(acc, xs)) + 5; - const templateDisplays = candidateTemplates.map( - ({description, name}) => `${name.padEnd(paddingWidth, ' ')}${chalk.gray(description)}` - ); - templateDisplays.push(`${'Other'.padEnd(paddingWidth, ' ')}${chalk.gray('Enter a custom git endpoint')}`); - await inquirer - .prompt([ - { - name: 'templateDisplay', - message: 'Select a template project', - type: 'autocomplete', - searchText: '', - emptyText: 'Template not found', - source: filterInput(templateDisplays), - }, - ]) - .then(async ({templateDisplay}) => { - const templateName = (templateDisplay as string).split(' ')[0]; - if (templateName === 'Other') { - await this.observeTemplates([], flags); - } else { - selectedTemplate = templates.find(({name}) => name === templateName); - await this.observeTemplates([selectedTemplate], flags); - } - }); - this.projectPath = await cloneProjectTemplate(this.location, this.project.name, selectedTemplate); - await this.setupProject(flags); - } - // observe templates, if no option left or manually select use custom templates - async observeTemplates(templates: Template[], flags: any): Promise { - if (templates.length === 0) { - const [gitRemote, gitBranch] = await promptValidRemoteAndBranch(); - this.projectPath = await cloneProjectGit(this.location, this.project.name, gitRemote, gitBranch); - } - } - - async setupProject(flags: any): Promise { - const [ - defaultSpecVersion, - defaultRepository, - defaultEndpoint, - defaultAuthor, - defaultVersion, - defaultDescription, - defaultLicense, - ] = await readDefaults(this.projectPath); - - // Should use template specVersion as default, otherwise use user provided - flags.specVersion = defaultSpecVersion ?? flags.specVersion; - - this.project.endpoint = await cli.prompt('RPC endpoint:', { - default: defaultEndpoint ?? 'wss://polkadot.api.onfinality.io/public-ws', - required: true, - }); - - this.project.repository = await cli.prompt('Git repository', {required: false, default: defaultRepository}); - - const descriptionHint = defaultDescription.substring(0, 40).concat('...'); - this.project.author = await cli.prompt('Author', {required: true, default: defaultAuthor}); - this.project.description = await cli - .prompt('Description', { - required: false, - default: descriptionHint, - }) - .then((description) => { - return description === descriptionHint ? defaultDescription : description; - }); - - this.project.version = await cli.prompt('Version', {required: true, default: defaultVersion}); - this.project.license = await cli.prompt('License', {required: true, default: defaultLicense}); - - cli.action.start('Preparing project'); - await prepare(this.projectPath, this.project); - cli.action.stop(); - if (flags['install-dependencies']) { - cli.action.start('Installing dependencies'); - installDependencies(this.projectPath, flags.npm); - cli.action.stop(); - } - this.log(`${this.project.name} is ready`); - process.exit(0); - } -} diff --git a/packages/cli/src/commands/migrate.ts b/packages/cli/src/commands/migrate.ts deleted file mode 100644 index c2f3cb58..00000000 --- a/packages/cli/src/commands/migrate.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {loadSubstrateProjectManifest, SubstrateProjectManifestVersioned} from '@subql/common-substrate'; -import {loadTerraProjectManifest, TerraProjectManifestVersioned} from '@subql/common-terra'; -import {migrate, prepare} from '../controller/migrate-controller'; - -export default class Migrate extends Command { - static description = 'Migrate Subquery project manifest to v1.0.0'; - - static flags = { - force: Flags.boolean({char: 'f'}), - file: Flags.string(), - location: Flags.string({char: 'l', description: 'local folder to run migrate in'}), - }; - - async run(): Promise { - const {flags} = await this.parse(Migrate); - const location = flags.location ? path.resolve(flags.location) : process.cwd(); - let manifest: SubstrateProjectManifestVersioned | TerraProjectManifestVersioned; - try { - manifest = loadSubstrateProjectManifest(location); - } catch (e) { - try { - manifest = loadTerraProjectManifest(location); - } catch (e) { - this.error(`Please validate project manifest before migrate. \n ${e}`); - } - } - if (manifest.isV1_0_0) { - this.log(`* You are already using manifest spec v1.0.0`); - } else { - console.log(`* Converting manifest to v1.0.0, please provide:`); - const [project, chainTypesRelativePath] = await prepare(location, manifest); - await migrate(location, project, manifest, chainTypesRelativePath); - this.log('* Migration completed'); - process.exit(0); - } - } -} diff --git a/packages/cli/src/commands/project/create-project.ts b/packages/cli/src/commands/project/create-project.ts deleted file mode 100644 index 1b8331f7..00000000 --- a/packages/cli/src/commands/project/create-project.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {BASE_PROJECT_URL, ROOT_API_URL_PROD} from '../../constants'; -import {createProject} from '../../controller/project-controller'; -import {checkToken, valueOrPrompt} from '../../utils'; - -const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); - -export default class Create_project extends Command { - static description = 'Create Project on Hosted Service'; - - static flags = { - org: Flags.string({description: 'Enter organization name'}), - projectName: Flags.string({description: 'Enter project name'}), - gitRepo: Flags.string({description: 'Enter git repository'}), - - logoURL: Flags.string({description: 'Enter logo URL', default: '', required: false}), - subtitle: Flags.string({description: 'Enter subtitle', default: '', required: false}), - description: Flags.string({description: 'Enter description', default: '', required: false}), - apiVersion: Flags.string({description: 'Enter api version', default: '2', required: false}), - }; - - async run(): Promise { - const {flags} = await this.parse(Create_project); - - let {gitRepo, org, projectName} = flags; - const authToken = await checkToken(process.env.SUBQL_ACCESS_TOKEN, ACCESS_TOKEN_PATH); - - org = await valueOrPrompt(org, 'Enter organisation', 'Organisation is required'); - projectName = await valueOrPrompt(projectName, 'Enter project name', 'Project name is required'); - gitRepo = await valueOrPrompt(gitRepo, 'Enter git repository', 'Git repository is required'); - - const result = await createProject( - org, - flags.subtitle, - flags.logoURL, - projectName, - authToken, - gitRepo, - flags.description, - flags.apiVersion, - ROOT_API_URL_PROD - ).catch((e) => this.error(e)); - - this.log(`Successfully created project: ${result.key} - \nProject Url: ${BASE_PROJECT_URL}/project/${result.key}`); - } -} diff --git a/packages/cli/src/commands/project/delete-project.ts b/packages/cli/src/commands/project/delete-project.ts deleted file mode 100644 index 54520f40..00000000 --- a/packages/cli/src/commands/project/delete-project.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {ROOT_API_URL_PROD} from '../../constants'; -import {deleteProject} from '../../controller/project-controller'; -import {checkToken, valueOrPrompt} from '../../utils'; - -const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); - -export default class Delete_project extends Command { - static description = 'Delete Project on Hosted Service'; - - static flags = { - org: Flags.string({description: 'Enter organization name'}), - projectName: Flags.string({description: 'Enter project name'}), - }; - - async run(): Promise { - const {flags} = await this.parse(Delete_project); - const authToken = await checkToken(process.env.SUBQL_ACCESS_TOKEN, ACCESS_TOKEN_PATH); - let {org, projectName} = flags; - - org = await valueOrPrompt(org, 'Enter organisation', 'Organisation is required'); - projectName = await valueOrPrompt(projectName, 'Enter project name', 'Project name is required'); - - const deleteStatus = await deleteProject(authToken, org, projectName, ROOT_API_URL_PROD).catch((e) => - this.error(e) - ); - this.log(`Project: ${deleteStatus} has been deleted`); - } -} diff --git a/packages/cli/src/commands/project/index.ts b/packages/cli/src/commands/project/index.ts deleted file mode 100644 index efc26f35..00000000 --- a/packages/cli/src/commands/project/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Command, Flags} from '@oclif/core'; -import * as inquirer from 'inquirer'; -import Create_project from './create-project'; -import Delete_project from './delete-project'; - -type projectOptions = 'create' | 'delete'; - -export default class Project extends Command { - static description = 'Create/Delete project'; - static flags = { - options: Flags.string({ - options: ['create', 'delete'], - }), - ...Delete_project.flags, - ...Create_project.flags, - }; - static optionMapping = { - create: Create_project, - delete: Delete_project, - }; - async run(): Promise { - const {flags} = await this.parse(Project); - const option = flags.options; - let userOptions: projectOptions; - - if (!option) { - const response = await inquirer.prompt([ - { - name: 'projectOption', - message: 'Select an project option', - type: 'list', - choices: [{name: 'create'}, {name: 'delete'}], - }, - ]); - userOptions = response.projectOption; - } else { - userOptions = option as projectOptions; - } - this.log(`Selected project option: ${userOptions}`); - - try { - const handler = Project.optionMapping[userOptions]; - // removes arguments -> deployment and everything before it from the process.argv - const stripped_argv: string[] = process.argv - .filter((v, idx) => idx > process.argv.indexOf('deployment') && !v.includes('--options')) - .reduce((acc, val) => acc.concat(val.split('=')), []); - - await handler.run(stripped_argv); - } catch (e) { - this.log(`Failed to execute command: ${userOptions} error: ${e}`); - } - } -} diff --git a/packages/cli/src/commands/publish.test.ts b/packages/cli/src/commands/publish.test.ts deleted file mode 100644 index 5fc0ef02..00000000 --- a/packages/cli/src/commands/publish.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {promisify} from 'util'; -import rimraf from 'rimraf'; -import {createTestProject, projectSpecV1_0_0} from '../controller/publish-controller.spec'; -import Publish from './publish'; - -describe('Intergration test - Publish', () => { - let projectDir: string; - afterEach(async () => { - try { - await promisify(rimraf)(projectDir); - } catch (e) { - console.warn('Failed to clean up tmp dir after test'); - } - }); - - it('overwrites any exisiting CID files', async () => { - const initCID = 'QmWLxg7xV7ZWUyc7ZxZ8XuQQ7NmH8WQGXzg7VZ3QQNqF-testing'; - projectDir = await createTestProject(projectSpecV1_0_0); - const cidFilePath = path.resolve(projectDir, '.project-cid'); - await fs.promises.writeFile(cidFilePath, initCID); - await Publish.run(['-f', projectDir, '-o']); - const cidValue = await fs.promises.readFile(cidFilePath, 'utf8'); - expect(initCID).not.toEqual(cidValue); - }); - - it('file name consistent with manfiest file name, if -f is used', async () => { - projectDir = await createTestProject(projectSpecV1_0_0); - const manifestPath = path.resolve(projectDir, 'project.yaml'); - const testManifestPath = path.resolve(projectDir, 'test.yaml'); - fs.renameSync(manifestPath, testManifestPath); - await Publish.run(['-f', testManifestPath]); - - const cidFile = path.resolve(projectDir, '.test-cid'); - const fileExists = await fs.promises.stat(cidFile); - expect(fileExists.isFile()).toBeTruthy(); - }); - - it('create ipfsCID file stored in local with dictiory path', async () => { - projectDir = await createTestProject(projectSpecV1_0_0); - await Publish.run(['-f', projectDir]); - const cidFile = path.resolve(projectDir, '.project-cid'); - const fileExists = fs.existsSync(cidFile); - const IPFScontent = await fs.promises.readFile(cidFile, 'utf8'); - expect(IPFScontent).toBeDefined(); - expect(fileExists).toBeTruthy(); - }); -}); diff --git a/packages/cli/src/commands/publish.ts b/packages/cli/src/commands/publish.ts deleted file mode 100644 index 7cf07413..00000000 --- a/packages/cli/src/commands/publish.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {readFileSync, existsSync} from 'fs'; -import path from 'path'; -import {Command, Flags} from '@oclif/core'; -import {getProjectRootAndManifest} from '@subql/common'; -import {createIPFSFile, uploadToIpfs} from '../controller/publish-controller'; -import Build from './build'; - -const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); - -export default class Publish extends Command { - static description = 'Upload this SubQuery project to IPFS'; - - static flags = { - location: Flags.string({char: 'f', description: 'from project or manifest path'}), - ipfs: Flags.string({description: 'IPFS gateway endpoint', required: false}), - output: Flags.boolean({char: 'o', description: 'Output IPFS CID', required: false}), - }; - - async run(): Promise { - const {flags} = await this.parse(Publish); - const location = flags.location ? path.resolve(flags.location) : process.cwd(); - const project = getProjectRootAndManifest(location); - - // Ensure that the project is built - try { - await Build.run(['--location', project.root, '-s']); - } catch (e) { - this.log(e); - this.error('Failed to build project'); - } - - let authToken: string; - - if (process.env.SUBQL_ACCESS_TOKEN) { - authToken = process.env.SUBQL_ACCESS_TOKEN; - } else if (existsSync(ACCESS_TOKEN_PATH)) { - try { - authToken = process.env.SUBQL_ACCESS_TOKEN ?? readFileSync(ACCESS_TOKEN_PATH, 'utf8'); - } catch (e) { - throw new Error(`Failed to read SUBQL_ACCESS_TOKEN from ${ACCESS_TOKEN_PATH}: ${e}`); - } - } else { - throw new Error('Please provide SUBQL_ACCESS_TOKEN before publish'); - } - const cid = await uploadToIpfs(project.manifest, authToken.trim(), flags.ipfs).catch((e) => this.error(e)); - await createIPFSFile(location, cid); - - if (!flags.output) { - this.log('Uploading SubQuery project to IPFS'); - this.log(`SubQuery Project uploaded to IPFS: ${cid}`); - } else { - this.log(`${cid}`); - } - } -} diff --git a/packages/cli/src/commands/validate.ts b/packages/cli/src/commands/validate.ts deleted file mode 100644 index f54930d8..00000000 --- a/packages/cli/src/commands/validate.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Command, Flags} from '@oclif/core'; -import {IPFS_NODE_ENDPOINT, IPFS_REGEX, NETWORK_FAMILY} from '@subql/common'; -import {commonRules, deploymentRules, Validator} from '@subql/validator'; -import chalk from 'chalk'; - -export default class Validate extends Command { - static description = 'Check a folder or github repo is a validate subquery project'; - - static flags = { - location: Flags.string({char: 'l', description: 'local folder, github repo url or IPFS cid'}), - ipfs: Flags.string({ - description: 'IPFS gateway endpoint, used for validating projects on IPFS', - default: IPFS_NODE_ENDPOINT, - }), - silent: Flags.boolean(), - 'network-family': Flags.enum({options: Object.values(NETWORK_FAMILY)}), - }; - - //TODO, currently validation only work for complete project, ipfs deployment is not supported - async run(): Promise { - const {flags} = await this.parse(Validate); - const location = flags.location ?? process.cwd(); - const v = await Validator.create(location, {ipfs: flags.ipfs}, flags['network-family']); - - const ipfsMatch = location.match(IPFS_REGEX); - if (ipfsMatch) { - v.addRule(...deploymentRules); - } else { - v.addRule(...commonRules); - } - - const reports = await v.getValidateReports(); - const passed = reports.filter((r) => r.valid).length; - const skipped = reports.filter((r) => r.skipped).length; - const failed = reports.length - passed - skipped; - - if (!flags.silent) { - for (const r of reports) { - if (r.valid) { - this.log(`${chalk.bgGreen.bold(' PASS ')} ${r.name}`); - } else if (r.skipped) { - this.log(`${chalk.yellow.bold(' SKIP ')} ${r.name}`); - } else { - this.log(`${chalk.bgRed.bold(' FAIL ')} ${r.name}`); - this.log(` ${chalk.redBright(r.description)}`); - } - } - - this.log(''); - this.log(`Result: ${passed} passed, ${failed} failed, ${skipped} skipped`); - this.log(''); - } - - if (failed > 0) { - this.exit(1); - } - } -} diff --git a/packages/cli/src/constants.ts b/packages/cli/src/constants.ts deleted file mode 100644 index c2d201f7..00000000 --- a/packages/cli/src/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -//DEPLOYMENT -export const DEFAULT_DEPLOYMENT_TYPE = 'primary'; -//PROJECT -export const ROOT_API_URL_DEV = 'https://api.thechaindata.com'; -export const ROOT_API_URL_PROD = 'https://api.subquery.network'; - -export const BASE_PROJECT_URL = 'https://project.subquery.network'; diff --git a/packages/cli/src/controller/build-controller.ts b/packages/cli/src/controller/build-controller.ts deleted file mode 100644 index 0619cc26..00000000 --- a/packages/cli/src/controller/build-controller.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import childProcess from 'child_process'; -import webpack, {Configuration} from 'webpack'; -import {merge} from 'webpack-merge'; - -const getBaseConfig = ( - buildEntries: Configuration['entry'], - projectDir: string, - outputDir: string, - development?: boolean -): webpack.Configuration => ({ - target: 'node', - mode: development ? 'development' : 'production', - context: projectDir, - entry: buildEntries, - devtool: development && 'inline-source-map', - module: { - rules: [ - { - test: /\.tsx?$/, - exclude: /node_modules/, - loader: require.resolve('ts-loader'), - options: { - compilerOptions: { - declaration: false, - }, - }, - }, - { - test: /\.ya?ml$/, - use: 'yaml-loader', - }, - ], - }, - - resolve: { - extensions: ['.tsx', '.ts', '.js', '.json'], - }, - - output: { - path: outputDir, - filename: '[name].js', - libraryTarget: 'commonjs', - }, -}); - -export async function runWebpack( - buildEntries: Configuration['entry'], - projectDir: string, - outputDir: string, - isDev = false, - clean = false -): Promise { - const config = merge( - getBaseConfig(buildEntries, projectDir, outputDir, isDev), - {output: {clean}} - // Can allow projects to override webpack config here - ); - - await new Promise((resolve, reject) => { - webpack(config).run((error, stats) => { - if (error) { - reject(error); - return; - } - - if (stats.hasErrors()) { - const info = stats.toJson(); - - reject(info.errors[0].message); - return; - } - - resolve(true); - }); - }); -} diff --git a/packages/cli/src/controller/codegen-controller.spec.ts b/packages/cli/src/controller/codegen-controller.spec.ts deleted file mode 100644 index 048f615f..00000000 --- a/packages/cli/src/controller/codegen-controller.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import rimraf from 'rimraf'; -import {codegen} from './codegen-controller'; - -jest.mock('fs', () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const fsMock = jest.createMockFromModule('fs') as any; - fsMock.promises = { - mkdir: jest.fn(), - }; - return fsMock; -}); - -jest.mock('rimraf', () => { - return jest.createMockFromModule('rimraf') as unknown; -}); - -jest.setTimeout(30000); - -describe('Codegen can generate schema (mocked)', () => { - const projectPath = path.join(__dirname, '../../test/test1'); - it('throw error when make directory failed at beginning of codegen', async () => { - (rimraf as unknown as jest.Mock).mockImplementation((path, cb) => cb()); - (fs.promises.mkdir as jest.Mock).mockImplementation(async () => Promise.reject(new Error())); - await expect(codegen(projectPath)).rejects.toThrow(/Failed to prepare/); - }); -}); diff --git a/packages/cli/src/controller/codegen-controller.test.ts b/packages/cli/src/controller/codegen-controller.test.ts deleted file mode 100644 index 1e8e65d7..00000000 --- a/packages/cli/src/controller/codegen-controller.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {promisify} from 'util'; - -import rimraf from 'rimraf'; -import {codegen} from './codegen-controller'; - -jest.setTimeout(30000); - -describe('Codegen can generate schema', () => { - afterEach(async () => { - await promisify(rimraf)(path.join(__dirname, '../../test/schemaTest1/src')); - await promisify(rimraf)(path.join(__dirname, '../../test/schemaTest2/src')); - }); - - it('codegen with correct schema should pass', async () => { - const projectPath = path.join(__dirname, '../../test/schemaTest1'); - await codegen(projectPath); - }); - - it('codegen with incorrect schema field should fail', async () => { - const projectPath = path.join(__dirname, '../../test/schemaTest2'); - await expect(codegen(projectPath)).rejects.toThrow(/is not an valid type/); - }); -}); diff --git a/packages/cli/src/controller/codegen-controller.ts b/packages/cli/src/controller/codegen-controller.ts deleted file mode 100644 index b342c3fd..00000000 --- a/packages/cli/src/controller/codegen-controller.ts +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {promisify} from 'util'; -import {getManifestPath, getSchemaPath, loadFromJsonOrYaml} from '@subql/common'; -import { - isCustomDs, - isSubstrateTemplates, - RuntimeDatasourceTemplate as SubstrateDsTemplate, - CustomDatasourceTemplate as SubstrateCustomDsTemplate, -} from '@subql/common-substrate'; -import { - isTerraTemplates, - RuntimeDatasourceTemplate as TerraDsTemplate, - CustomDatasourceTemplate as TerraCustomDsTemplate, -} from '@subql/common-terra'; -import { - getAllEntitiesRelations, - getAllJsonObjects, - setJsonObjectType, - getTypeByScalarName, - GraphQLEntityField, - GraphQLJsonFieldType, - GraphQLEntityIndex, - getAllEnums, -} from '@subql/utils'; -import ejs from 'ejs'; -import {upperFirst, uniq} from 'lodash'; -import rimraf from 'rimraf'; - -type TemplateKind = SubstrateDsTemplate | SubstrateCustomDsTemplate | TerraDsTemplate | TerraCustomDsTemplate; -let MODEL_TEMPLATE_PATH = path.resolve(__dirname, '../template/model.ts.ejs'); -const MODELS_INDEX_TEMPLATE_PATH = path.resolve(__dirname, '../template/models-index.ts.ejs'); -const TYPES_INDEX_TEMPLATE_PATH = path.resolve(__dirname, '../template/types-index.ts.ejs'); -const INTERFACE_TEMPLATE_PATH = path.resolve(__dirname, '../template/interface.ts.ejs'); -const ENUM_TEMPLATE_PATH = path.resolve(__dirname, '../template/enum.ts.ejs'); -const DYNAMIC_DATASOURCE_TEMPLATE_PATH = path.resolve(__dirname, '../template/datasource-templates.ts.ejs'); -const TYPE_ROOT_DIR = 'src/types'; -const MODEL_ROOT_DIR = 'src/types/models'; -const exportTypes = { - models: false, - interfaces: false, - enums: false, - datasources: false, -}; - -// 4. Render entity data in ejs template and write it -export async function renderTemplate(templatePath: string, outputPath: string, templateData: ejs.Data): Promise { - const data = await ejs.renderFile(templatePath, templateData); - await fs.promises.writeFile(outputPath, data); -} - -// 3. Re-format the field of the entity -export interface ProcessedField { - name: string; - type: string; - required: boolean; - isEnum: boolean; - indexed: boolean; - unique?: boolean; - isArray: boolean; - isJsonInterface: boolean; -} - -export async function generateJsonInterfaces(projectPath: string, schema: string): Promise { - const typesDir = path.join(projectPath, TYPE_ROOT_DIR); - const jsonObjects = getAllJsonObjects(schema); - const jsonInterfaces = jsonObjects.map((r) => { - const object = setJsonObjectType(r, jsonObjects); - const fields = processFields('jsonField', object.name, object.fields); - return { - interfaceName: object.name, - fields, - }; - }); - - if (jsonInterfaces.length !== 0) { - const interfaceTemplate = { - props: { - jsonInterfaces, - }, - helper: { - upperFirst, - }, - }; - try { - await renderTemplate(INTERFACE_TEMPLATE_PATH, path.join(typesDir, `interfaces.ts`), interfaceTemplate); - exportTypes.interfaces = true; - } catch (e) { - throw new Error(`When render json interfaces having problems.`); - } - } -} - -export async function generateEnums(projectPath: string, schema: string): Promise { - const typesDir = path.join(projectPath, TYPE_ROOT_DIR); - const jsonObjects = getAllEnums(schema); - const enums = jsonObjects.map((r) => { - return { - name: r.name, - values: r.getValues().map((v) => v.name), - }; - }); - - if (enums.length !== 0) { - const enumsTemplate = { - props: { - enums, - }, - }; - try { - await renderTemplate(ENUM_TEMPLATE_PATH, path.join(typesDir, `enums.ts`), enumsTemplate); - exportTypes.enums = true; - } catch (e) { - throw new Error(`When render enums having problems.`); - } - } -} - -export function processFields( - type: 'entity' | 'jsonField', - className: string, - fields: (GraphQLEntityField | GraphQLJsonFieldType)[], - indexFields: GraphQLEntityIndex[] = [] -): ProcessedField[] { - const fieldList: ProcessedField[] = []; - for (const field of fields) { - const injectField = { - name: field.name, - required: !field.nullable, - isArray: field.isArray, - isEnum: false, - } as ProcessedField; - if (type === 'entity') { - const [indexed, unique] = indexFields.reduce<[boolean, boolean]>( - (acc, indexField) => { - if (indexField.fields.includes(field.name)) { - acc[0] = true; - if (indexField.fields.length === 1 && indexField.unique) { - acc[1] = true; - } else if (indexField.unique === undefined) { - acc[1] = false; - } - } - return acc; - }, - [false, undefined] - ); - injectField.indexed = indexed; - injectField.unique = unique; - } - if ((field as GraphQLEntityField).isEnum) { - injectField.type = field.type; - injectField.isEnum = true; - injectField.isJsonInterface = false; - } else { - switch (field.type) { - default: { - injectField.type = getTypeByScalarName(field.type).tsType; - if (!injectField.type) { - throw new Error( - `Schema: undefined type "${field.type.toString()}" on field "${ - field.name - }" in "type ${className} @${type}"` - ); - } - injectField.isJsonInterface = false; - break; - } - case 'Json': { - if (field.jsonInterface === undefined) { - throw new Error(`On field ${field.name} type is Json but json interface is not defined`); - } - injectField.type = upperFirst(field.jsonInterface.name); - injectField.isJsonInterface = true; - } - } - } - fieldList.push(injectField); - } - return fieldList; -} - -async function prepareDirPath(path: string, recreate: boolean) { - try { - await promisify(rimraf)(path); - if (recreate) { - await fs.promises.mkdir(path, {recursive: true}); - } - } catch (e) { - throw new Error(`Failed to prepare ${path}`); - } -} - -//1. Prepare models directory and load schema -export async function codegen(projectPath: string): Promise { - const modelDir = path.join(projectPath, MODEL_ROOT_DIR); - const interfacesPath = path.join(projectPath, TYPE_ROOT_DIR, `interfaces.ts`); - await prepareDirPath(modelDir, true); - await prepareDirPath(interfacesPath, false); - - const plainManifest = loadFromJsonOrYaml(getManifestPath(projectPath)) as { - specVersion: string; - templates?: TemplateKind[]; - }; - if (plainManifest.templates && plainManifest.templates.length !== 0) { - await generateDatasourceTemplates(projectPath, plainManifest.specVersion, plainManifest.templates); - } - const schemaPath = getSchemaPath(projectPath); - - await generateJsonInterfaces(projectPath, schemaPath); - await generateModels(projectPath, schemaPath); - await generateEnums(projectPath, schemaPath); - - if (exportTypes.interfaces || exportTypes.models || exportTypes.enums || exportTypes.datasources) { - try { - await renderTemplate(TYPES_INDEX_TEMPLATE_PATH, path.join(projectPath, TYPE_ROOT_DIR, `index.ts`), { - props: { - exportTypes, - }, - }); - } catch (e) { - throw new Error(`When render index in types having problems.`); - } - console.log(`* Types index generated !`); - } -} - -// 2. Loop all entities and render it -export async function generateModels(projectPath: string, schema: string): Promise { - const extractEntities = getAllEntitiesRelations(schema); - for (const entity of extractEntities.models) { - const baseFolderPath = '.../../base'; - const className = upperFirst(entity.name); - const entityName = entity.name; - const fields = processFields('entity', className, entity.fields, entity.indexes); - const importJsonInterfaces = uniq(fields.filter((field) => field.isJsonInterface).map((f) => f.type)); - const importEnums = fields.filter((field) => field.isEnum).map((f) => f.type); - const indexedFields = fields.filter((field) => field.indexed && !field.isJsonInterface); - const modelTemplate = { - props: { - baseFolderPath, - className, - entityName, - fields, - importJsonInterfaces, - importEnums, - indexedFields, - }, - helper: { - upperFirst, - }, - }; - try { - await renderTemplate( - MODEL_TEMPLATE_PATH, - path.join(projectPath, MODEL_ROOT_DIR, `${className}.ts`), - modelTemplate - ); - } catch (e) { - console.error(e); - throw new Error(`When render entity ${className} to schema having problems.`); - } - console.log(`* Schema ${className} generated !`); - } - const classNames = extractEntities.models.map((entity) => entity.name); - if (classNames.length !== 0) { - try { - await renderTemplate(MODELS_INDEX_TEMPLATE_PATH, path.join(projectPath, MODEL_ROOT_DIR, `index.ts`), { - props: { - classNames, - }, - helper: { - upperFirst, - }, - }); - exportTypes.models = true; - } catch (e) { - throw new Error(`When render index in models having problems.`); - } - console.log(`* Models index generated !`); - } -} - -export async function generateDatasourceTemplates( - projectPath: string, - specVersion: string, - templates: TemplateKind[] -): Promise { - let props; - if (isSubstrateTemplates(templates, specVersion)) { - props = templates.map((t) => ({ - name: t.name, - args: isCustomDs(t) ? 'Record' : undefined, - })); - } else if (isTerraTemplates(templates, specVersion)) { - props = templates.map((t) => ({ - name: t.name, - args: 'Record', - })); - MODEL_TEMPLATE_PATH = path.resolve(__dirname, '../template/terramodel.ts.ejs'); - } else { - throw new Error(`Generated datasource templates failed: unsupported templates`); - } - try { - await renderTemplate(DYNAMIC_DATASOURCE_TEMPLATE_PATH, path.join(projectPath, TYPE_ROOT_DIR, `datasources.ts`), { - props, - }); - exportTypes.datasources = true; - } catch (e) { - console.error(e); - throw new Error(`Unable to generate datasource template constructors`); - } - console.log(`* Datasource template constructors generated !`); -} diff --git a/packages/cli/src/controller/deploy-controller.spec.ts b/packages/cli/src/controller/deploy-controller.spec.ts deleted file mode 100644 index aa91f0f2..00000000 --- a/packages/cli/src/controller/deploy-controller.spec.ts +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ROOT_API_URL_DEV} from '../constants'; -import {DeploymentDataType, DeploymentSpec, ValidateDataType} from '../types'; -import {delay} from '../utils'; -import { - deployToHostedService, - promoteDeployment, - deleteDeployment, - deploymentStatus, - ipfsCID_validate, - networkEndpoints, - dictionaryEndpoints, - imageVersions, - processEndpoints, - redeploy, - projectsInfo, -} from './deploy-controller'; -import {createProject, deleteProject} from './project-controller'; - -jest.setTimeout(120000); -const projectSpec: DeploymentSpec = { - org: process.env.SUBQL_ORG_TEST, - projectName: 'mockedstarter', - repository: 'https://github.com/bz888/test-deployment-2', - ipfs: 'QmaVh8DGzuRCJZ5zYEDxXQsXYqP9HihjjeuxNNteSDq8xX', - subtitle: '', - description: '', - logoURl: '', - apiVersion: '2', - type: 'stage', -}; - -async function deployTestProject( - validator: ValidateDataType, - ipfs: string, - org: string, - project_name: string, - testAuth: string, - url: string -): Promise { - const indexerV = await imageVersions( - validator.manifestRunner.node.name, - validator.manifestRunner.node.version, - testAuth, - url - ); - const queryV = await imageVersions( - validator.manifestRunner.query.name, - validator.manifestRunner.query.version, - testAuth, - url - ); - const endpoint = await networkEndpoints(url); - const dictEndpoint = await dictionaryEndpoints(url); - return deployToHostedService( - org, - project_name, - testAuth, - ipfs, - indexerV[0], - queryV[0], - processEndpoints(endpoint, validator.chainId), - projectSpec.type, - processEndpoints(dictEndpoint, validator.chainId), - url - ); -} - -const describeIf = (condition: boolean, ...args: Parameters) => - condition ? describe(...args) : describe.skip(...args); - -// Replace/Update your access token when test locally -const testAuth = process.env.SUBQL_ACCESS_TOKEN_TEST; - -describeIf(!!testAuth, 'CLI deploy, delete, promote', () => { - beforeAll(async () => { - const {apiVersion, description, logoURl, org, projectName, repository, subtitle} = projectSpec; - try { - await createProject( - org, - subtitle, - logoURl, - projectName, - testAuth, - repository, - description, - apiVersion, - ROOT_API_URL_DEV - ); - } catch (e) { - console.warn(`Failed at create project ${projectName} ${e}`); - } - }); - - afterAll(async () => { - try { - await deleteProject(testAuth, projectSpec.org, projectSpec.projectName, ROOT_API_URL_DEV); - } catch (e) { - console.warn('Failed to delete project', e); - } - }); - - it('Deploy to Hosted Service and Delete', async () => { - const {ipfs, org, projectName} = projectSpec; - - const validator = await ipfsCID_validate(ipfs, testAuth, ROOT_API_URL_DEV); - const deploy_output = await deployTestProject(validator, ipfs, org, projectName, testAuth, ROOT_API_URL_DEV); - - const del_output = await deleteDeployment(org, projectName, testAuth, deploy_output.id, ROOT_API_URL_DEV); - expect(typeof deploy_output.id).toBe('number'); - expect(+del_output).toBe(deploy_output.id); - }); - - // Only test locally - it.skip('Promote Deployment', async () => { - const {ipfs, org, projectName} = projectSpec; - let status: string; - let attempt = 0; - const validator = await ipfsCID_validate(ipfs, testAuth, ROOT_API_URL_DEV); - const deployOutput = await deployTestProject(validator, ipfs, org, projectName, testAuth, ROOT_API_URL_DEV); - while (status !== 'running') { - if (attempt >= 5) break; - attempt = attempt + 1; - await delay(30); - status = await deploymentStatus(org, projectName, testAuth, deployOutput.id, ROOT_API_URL_DEV); - if (status === 'running') { - const promoteOutput = await promoteDeployment(org, projectName, testAuth, deployOutput.id, ROOT_API_URL_DEV); - expect(+promoteOutput).toBe(deployOutput.id); - } - } - }); - it('should return true for valid ipfsCID', async () => { - const validator = await ipfsCID_validate(projectSpec.ipfs, testAuth, ROOT_API_URL_DEV); - expect(validator.valid).toBe(true); - }); - it('to throw error for invalid ipfsCID', async () => { - try { - await ipfsCID_validate('fake', testAuth, ROOT_API_URL_DEV); - } catch (e) { - expect(e.message).toBe('Failed to validate IPFS CID: fake is not a valid subquery deployment id!'); - } - }); - - it('get Endpoint - polkadot', async () => { - const validator = await ipfsCID_validate(projectSpec.ipfs, testAuth, ROOT_API_URL_DEV); - const endpoints = await networkEndpoints(ROOT_API_URL_DEV); - expect(processEndpoints(endpoints, validator.chainId)).toBe('wss://polkadot.api.onfinality.io/public-ws'); - }); - it('get DictEndpoint - polkadot', async () => { - const validator = await ipfsCID_validate(projectSpec.ipfs, testAuth, ROOT_API_URL_DEV); - const dict = await dictionaryEndpoints(ROOT_API_URL_DEV); - expect(processEndpoints(dict, validator.chainId)).toBe( - 'https://api.subquery.network/sq/subquery/polkadot-dictionary' - ); - }); - it('reDeploy to Hosted Service', async () => { - const {ipfs, org, projectName, type} = projectSpec; - const newIPFS = 'QmbKvrzwSmzTZi5jrhEpa6yDDHQXRURi5S4ztLgJLpBxAi'; - const validator = await ipfsCID_validate(projectSpec.ipfs, testAuth, ROOT_API_URL_DEV); - - const deployOutput = await deployTestProject(validator, ipfs, org, projectName, testAuth, ROOT_API_URL_DEV); - const initProjectInfo = await projectsInfo(testAuth, org, projectName, ROOT_API_URL_DEV, type); - - const endpoints = await networkEndpoints(ROOT_API_URL_DEV); - const dict = await dictionaryEndpoints(ROOT_API_URL_DEV); - const indexerV = await imageVersions( - validator.manifestRunner.node.name, - validator.manifestRunner.node.version, - testAuth, - ROOT_API_URL_DEV - ); - const queryV = await imageVersions( - validator.manifestRunner.query.name, - validator.manifestRunner.query.version, - testAuth, - ROOT_API_URL_DEV - ); - - await redeploy( - org, - projectName, - deployOutput.id, - testAuth, - newIPFS, - processEndpoints(endpoints, validator.chainId), - processEndpoints(dict, validator.chainId), - indexerV[0], - queryV[0], - ROOT_API_URL_DEV - ); - const updatedInfo = await projectsInfo(testAuth, org, projectName, ROOT_API_URL_DEV, type); - - expect(updatedInfo.id).toBe(initProjectInfo.id); - expect(updatedInfo.version).not.toEqual(deployOutput.version); - }); -}); diff --git a/packages/cli/src/controller/deploy-controller.ts b/packages/cli/src/controller/deploy-controller.ts deleted file mode 100644 index 6f47a598..00000000 --- a/packages/cli/src/controller/deploy-controller.ts +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import axios from 'axios'; -import {DeploymentDataType, ProjectDataType, ValidateDataType} from '../types'; -import {buildProjectKey, errorHandle} from '../utils'; - -export async function deployToHostedService( - org: string, - projectName: string, - authToken: string, - ipfsCID: string, - indexerImageVersion: string, - queryImageVersion: string, - endpoint: string, - type: string, - dictEndpoint: string, - url: string -): Promise { - try { - const result = ( - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'post', - url: `v2/subqueries/${buildProjectKey(org, projectName)}/deployments`, - baseURL: url, - data: { - version: ipfsCID, - dictEndpoint: dictEndpoint, - endpoint: endpoint, - advancedSettings: { - '@subql/node': {}, - '@subql/query': {}, - }, - indexerImageVersion: indexerImageVersion, - queryImageVersion: queryImageVersion, - type: type, - }, - }) - ).data; - return result.deployment; - } catch (e) { - errorHandle(e, 'Error deploying to hosted service:'); - } -} - -export async function promoteDeployment( - org: string, - projectName: string, - authToken: string, - deploymentId: number, - url: string -): Promise { - try { - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'post', - url: `subqueries/${buildProjectKey(org, projectName)}/deployments/${deploymentId}/release`, - baseURL: url, - }); - return `${deploymentId}`; - } catch (e) { - errorHandle(e, 'Failed to promote project:'); - } -} - -export async function deleteDeployment( - org: string, - projectName: string, - authToken: string, - deploymentId: number, - url: string -): Promise { - try { - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'delete', - url: `subqueries/${buildProjectKey(org, projectName)}/deployments/${deploymentId}`, - baseURL: url, - }); - return `${deploymentId}`; - } catch (e) { - errorHandle(e, 'Failed to delete deployment:'); - } -} - -export async function deploymentStatus( - org: string, - projectName: string, - authToken: string, - deployID: number, - url: string -): Promise { - try { - const result = ( - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'get', - url: `subqueries/${buildProjectKey(org, projectName)}/deployments/${deployID}/status`, - baseURL: url, - }) - ).data; - return `${result.status}`; - } catch (e) { - errorHandle(e, 'Failed to get deployment status:'); - } -} - -export async function projectsInfo( - authToken: string, - org: string, - projectName: string, - url: string, - type: string -): Promise { - const key = `${org}/${projectName}`; - try { - const result = ( - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'get', - url: `subqueries/${buildProjectKey(org, projectName)}/deployments`, - baseURL: url, - }) - ).data; - return result.find((element: ProjectDataType) => element.projectKey === `${key}` && element.type === type); - } catch (e) { - errorHandle(e, 'Failed to get projects:'); - } -} - -export async function redeploy( - org: string, - projectName: string, - deployID: number, - authToken: string, - ipfsCID: string, - endpoint: string, - dictEndpoint: string, - indexerVersion: string, - queryVersion: string, - url: string -): Promise { - try { - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'put', - url: `v2/subqueries/${buildProjectKey(org, projectName)}/deployments/${deployID}`, - baseURL: url, - data: { - version: ipfsCID, - dictEndpoint: dictEndpoint, - endpoint: endpoint, - indexerImageVersion: indexerVersion, - queryImageVersion: queryVersion, - advancedSettings: { - indexer: {}, - query: {}, - }, - }, - }); - } catch (e) { - errorHandle(e, `Failed to redeploy project: ${e.message}`); - } -} -export async function ipfsCID_validate(cid: string, authToken: string, url: string): Promise { - try { - const result = ( - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'post', - url: `ipfs/deployment-id/${cid}/validate`, - baseURL: url, - }) - ).data; - return result; - } catch (e) { - errorHandle(e, 'Failed to validate IPFS CID:'); - } -} - -export async function dictionaryEndpoints(url: string): Promise { - try { - const result = ( - await axios({ - method: 'get', - url: `subqueries/dictionaries`, - baseURL: url, - }) - ).data; - return result; - } catch (e) { - errorHandle(e, 'Failed to get dictionary endpoint:'); - } -} - -export async function networkEndpoints(url: string): Promise { - try { - const result = ( - await axios({ - method: 'get', - url: `subqueries/network-endpoints`, - baseURL: url, - }) - ).data; - return result; - } catch (e) { - errorHandle(e, 'Failed to get endpoint:'); - } -} - -export function processEndpoints(endpoints: EndpointType[], chainId: string): string | undefined { - return endpoints.find((endpoint: EndpointType) => endpoint.chainId === chainId)?.endpoint; -} - -export async function imageVersions(name: string, version: string, authToken: string, url: string): Promise { - try { - const result = ( - await axios({ - headers: {Authorization: `Bearer ${authToken}`}, - method: 'get', - url: `info/images/${encodeURIComponent(name)}?version=${encodeURIComponent(version)}`, - baseURL: url, - }) - ).data; - return result; - } catch (e) { - errorHandle(e, 'Failed to get image:'); - } -} -interface EndpointType { - network: string; - endpoint: string; - chainId: string; -} diff --git a/packages/cli/src/controller/init-controller.spec.ts b/packages/cli/src/controller/init-controller.spec.ts deleted file mode 100644 index e10e2d29..00000000 --- a/packages/cli/src/controller/init-controller.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as fs from 'fs'; -import os from 'os'; -import path from 'path'; -import {NETWORK_FAMILY} from '@subql/common'; -import git from 'simple-git'; -import {cloneProjectGit} from './init-controller'; - -jest.mock('simple-git', () => { - const mGit = { - clone: jest.fn(), - }; - return jest.fn(() => mGit); -}); - -jest.setTimeout(30000); - -async function makeTempDir() { - const sep = path.sep; - const tmpDir = os.tmpdir(); - const tempPath = await fs.promises.mkdtemp(`${tmpDir}${sep}`); - return tempPath; -} -const projectSpec = { - name: 'mocked_starter', - repository: '', - endpoint: 'wss://rpc.polkadot.io/public-ws', - author: 'jay', - description: 'this is test for init controller', - version: '', - license: '', -}; - -describe('Cli can create project (mocked)', () => { - it('throw error when git clone failed', async () => { - const tempPath = await makeTempDir(); - (git().clone as jest.Mock).mockImplementationOnce((cb) => { - cb(new Error()); - }); - await expect(cloneProjectGit(tempPath, projectSpec.name, 'invalid_url', 'invalid_branch')).rejects.toThrow( - /Failed to clone starter template from git/ - ); - }); -}); diff --git a/packages/cli/src/controller/init-controller.test.ts b/packages/cli/src/controller/init-controller.test.ts deleted file mode 100644 index 54ca80f4..00000000 --- a/packages/cli/src/controller/init-controller.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as fs from 'fs'; -import path from 'path'; -import {makeTempDir} from '@subql/common'; -import { - cloneProjectGit, - cloneProjectTemplate, - fetchTemplates, - prepare, - readDefaults, - Template, -} from './init-controller'; - -// async -const fileExists = async (file: string): Promise => { - return new Promise((resolve, reject) => { - fs.access(file, fs.constants.F_OK, (err) => { - err ? reject(err) : resolve(true); - }); - }); -}; - -jest.setTimeout(30000); - -const projectSpec = { - name: 'mocked_starter', - repository: '', - endpoint: 'wss://rpc.polkadot.io/public-ws', - specVersion: '1.0.0', - author: 'jay', - description: 'this is test for init controller', - version: '', - license: '', -}; - -describe('Cli can create project', () => { - it('should resolve when starter project created via template', async () => { - const tempPath = await makeTempDir(); - const templates = await fetchTemplates(); - const projectPath = await cloneProjectTemplate(tempPath, projectSpec.name, templates[0]); - await prepare(projectPath, projectSpec); - await expect(fileExists(path.join(tempPath, `${projectSpec.name}`))).resolves.toEqual(true); - }); - - it('should resolve when starter project created via git', async () => { - const tempPath = await makeTempDir(); - const projectPath = await cloneProjectGit( - tempPath, - projectSpec.name, - 'https://github.com/subquery/subql-starter', - 'v1.0.0' - ); - await prepare(projectPath, projectSpec); - await expect(fileExists(path.join(tempPath, `${projectSpec.name}`))).resolves.toEqual(true); - }); - - it('throw error if .git exists in starter project', async () => { - const tempPath = await makeTempDir(); - const templates = await fetchTemplates(); - const projectPath = await cloneProjectTemplate(tempPath, projectSpec.name, templates[0]); - await prepare(projectPath, projectSpec); - await expect(fileExists(path.join(tempPath, `${projectSpec.name}/.git`))).rejects.toThrow(); - }); - - it('prepare correctly applies project details', async () => { - const tempPath = await makeTempDir(); - const templates = await fetchTemplates(); - const template = templates.find(({name}) => name === 'polkadot-starter'); - const projectPath = await cloneProjectTemplate(tempPath, projectSpec.name, template); - await prepare(projectPath, projectSpec); - const [specVersion, repository, endpoint, author, version, description, license] = await readDefaults(projectPath); - expect(projectSpec.specVersion).toEqual(specVersion); - expect(projectSpec.repository).toEqual(repository); - expect(projectSpec.endpoint).toEqual(endpoint); - expect(projectSpec.author).toEqual(author); - expect(projectSpec.version).toEqual(version); - expect(projectSpec.description).toEqual(description); - expect(projectSpec.license).toEqual(license); - }); - - it('allow git from sub directory', async () => { - const tempPath = await makeTempDir(); - - const template: Template = { - remote: 'https://github.com/subquery/subql-starter', - family: 'Substrate', - branch: 'multi', - network: 'Polkadot', - name: 'Polkadot-starter', - description: '', - }; - - const projectPath = await cloneProjectTemplate(tempPath, projectSpec.name, template); - await prepare(projectPath, projectSpec); - await expect(fileExists(path.join(tempPath, `${projectSpec.name}`))).resolves.toEqual(true); - }, 5000000); -}); diff --git a/packages/cli/src/controller/init-controller.ts b/packages/cli/src/controller/init-controller.ts deleted file mode 100644 index 5c060ef9..00000000 --- a/packages/cli/src/controller/init-controller.ts +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import childProcess, {execSync} from 'child_process'; -import fs from 'fs'; -import * as path from 'path'; -import {promisify} from 'util'; -import {makeTempDir, ProjectManifestV0_2_0, ProjectManifestV1_0_0} from '@subql/common'; -import {ProjectManifestV0_0_1} from '@subql/common-substrate'; -import axios from 'axios'; -import {copySync} from 'fs-extra'; -import yaml from 'js-yaml'; -import rimraf from 'rimraf'; -import git from 'simple-git'; -import {isProjectSpecV0_2_0, isProjectSpecV1_0_0, ProjectSpecBase} from '../types'; -const TEMPLATES_REMOTE = 'https://raw.githubusercontent.com/subquery/templates/multi/templates.json'; - -export interface Template { - name: string; - description: string; - remote: string; - branch: string; - network: string; - family: string; -} - -export async function fetchTemplates(remote: string = TEMPLATES_REMOTE): Promise { - return axios - .create() - .get(remote) - .then(({data}) => data as Template[]) - .catch((err) => { - throw new Error(`Unable to reach endpoint '${remote}', ${err}`); - }); -} - -export async function cloneProjectGit( - localPath: string, - projectName: string, - projectRemote: string, - branch: string -): Promise { - const projectPath = path.join(localPath, projectName); - try { - await git().clone(projectRemote, projectPath, ['-b', branch, '--single-branch']); - } catch (e) { - let err = 'Failed to clone starter template from git'; - try { - execSync('git --version'); - } catch (_) { - err += ', please install git and ensure that it is available from command line'; - } - throw new Error(err); - } - return projectPath; -} - -export async function cloneProjectTemplate( - localPath: string, - projectName: string, - selectedTemplate: Template -): Promise { - const projectPath = path.join(localPath, projectName); - //make temp directory to store project - const tempPath = await makeTempDir(); - //use sparse-checkout to clone project to temp directory - await git(tempPath).init().addRemote('origin', selectedTemplate.remote); - await git(tempPath).raw('sparse-checkout', 'set', `${selectedTemplate.network}/${selectedTemplate.name}`); - await git(tempPath).raw('pull', 'origin', selectedTemplate.branch); - // Copy content to project path - copySync(path.join(tempPath, `${selectedTemplate.network}/${selectedTemplate.name}`), projectPath); - // Clean temp folder - fs.rmSync(tempPath, {recursive: true, force: true}); - return projectPath; -} - -export async function readDefaults(projectPath: string): Promise { - const packageData = await fs.promises.readFile(`${projectPath}/package.json`); - const currentPackage = JSON.parse(packageData.toString()); - - const yamlPath = path.join(`${projectPath}`, `project.yaml`); - const manifest = await fs.promises.readFile(yamlPath, 'utf8'); - const currentProject = yaml.load(manifest) as ProjectManifestV0_0_1 | ProjectManifestV0_2_0 | ProjectManifestV1_0_0; - return [ - currentProject.specVersion, - currentProject.repository, - currentProject.network.endpoint, - currentPackage.author, - currentPackage.version, - currentPackage.description, - currentPackage.license, - ]; -} - -export async function prepare(projectPath: string, project: ProjectSpecBase): Promise { - try { - await prepareManifest(projectPath, project); - } catch (e) { - throw new Error('Failed to prepare read or write manifest while preparing the project'); - } - try { - await preparePackage(projectPath, project); - } catch (e) { - throw new Error('Failed to prepare read or write package.json while preparing the project'); - } - try { - await promisify(rimraf)(`${projectPath}/.git`); - } catch (e) { - throw new Error('Failed to remove .git from template project'); - } -} - -async function preparePackage(projectPath: string, project: ProjectSpecBase): Promise { - //load and write package.json - const packageData = await fs.promises.readFile(`${projectPath}/package.json`); - const currentPackage = JSON.parse(packageData.toString()); - currentPackage.name = project.name; - currentPackage.version = project.version; - currentPackage.description = project.description ?? currentPackage.description; - currentPackage.author = project.author; - currentPackage.license = project.license; - const newPackage = JSON.stringify(currentPackage, null, 2); - await fs.promises.writeFile(`${projectPath}/package.json`, newPackage, 'utf8'); -} - -async function prepareManifest(projectPath: string, project: ProjectSpecBase): Promise { - //load and write manifest(project.yaml) - const yamlPath = path.join(`${projectPath}`, `project.yaml`); - const manifest = await fs.promises.readFile(yamlPath, 'utf8'); - const data = yaml.load(manifest) as ProjectManifestV0_0_1 | ProjectManifestV0_2_0 | ProjectManifestV1_0_0; - data.description = project.description ?? data.description; - data.repository = project.repository ?? ''; - - data.network.endpoint = project.endpoint; - - if (isProjectSpecV1_0_0(project)) { - (data as ProjectManifestV1_0_0).version = project.version; - (data as ProjectManifestV1_0_0).name = project.name; - (data as ProjectManifestV1_0_0).network.chainId = project.chainId; - } else if (isProjectSpecV0_2_0(project)) { - (data as ProjectManifestV0_2_0).version = project.version; - (data as ProjectManifestV0_2_0).name = project.name; - (data as ProjectManifestV0_2_0).network.genesisHash = project.genesisHash; - } - - const newYaml = yaml.dump(data); - await fs.promises.writeFile(yamlPath, newYaml, 'utf8'); -} - -export function installDependencies(projectPath: string, useNpm?: boolean): void { - let command = 'yarn install'; - - if (useNpm || !checkYarnExists()) { - command = 'npm install'; - } - - childProcess.execSync(command, {cwd: projectPath}); -} - -function checkYarnExists(): boolean { - try { - childProcess.execSync('yarn --version'); - return true; - } catch (e) { - return false; - } -} diff --git a/packages/cli/src/controller/migrate-controller.ts b/packages/cli/src/controller/migrate-controller.ts deleted file mode 100644 index 6951ecef..00000000 --- a/packages/cli/src/controller/migrate-controller.ts +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {ProjectManifestV1_0_0} from '@subql/common'; -import { - SubstrateProjectManifestVersioned, - ProjectNetworkV0_0_1, - ChainTypes, - loadSubstrateProjectManifest, -} from '@subql/common-substrate'; -import {loadTerraProjectManifest, TerraProjectManifestVersioned} from '@subql/common-terra'; -import {classToPlain} from 'class-transformer'; -import {cli} from 'cli-ux'; -import inquirer from 'inquirer'; -import yaml from 'js-yaml'; -import {getGenesisHash} from '../jsonrpc'; -import {ProjectSpecV1_0_0} from '../types'; - -const MANIFEST_PATH = 'project.yaml'; -const MANIFEST_OLD = `project_old.yaml`; -const MANIFEST_V_1_0_0 = `project_1_0_0.yaml`; -const SUBSTRATE_NODE_NAME = '@subql/node'; -const TERRA_NODE_NAME = '@subql/node-terra'; -const DEFAULT_QUERY_NAME = '@subql/query'; - -// eslint-disable-next-line complexity -export async function prepare( - location: string, - manifest: SubstrateProjectManifestVersioned | TerraProjectManifestVersioned -): Promise<[ProjectSpecV1_0_0, string]> { - const packageData = await fs.promises.readFile(`${location}/package.json`, 'utf8'); - const jsonProjectData = JSON.parse(packageData); - let chainTypesRelativePath: string; - const project = {runner: {node: {}, query: {}}} as ProjectSpecV1_0_0; - const projectNetwork = - manifest instanceof SubstrateProjectManifestVersioned && manifest.isV0_0_1 - ? manifest.asV0_0_1.network - : manifest.asV1_0_0.network; - project.name = await cli.prompt('Project name', {default: jsonProjectData.name, required: true}); - project.version = await cli.prompt('Project version', {default: jsonProjectData.version, required: true}); - project.runner.node = await inquirer.prompt([ - { - name: 'name', //equivalent to project.runner.node.name - message: 'select Runner Node spec', - type: 'list', - choices: [{name: SUBSTRATE_NODE_NAME}, {name: TERRA_NODE_NAME}], - }, - ]); - project.runner.node.version = await cli.prompt('Runner node version', {required: true}); - project.runner.query = await inquirer.prompt([ - { - name: 'name', - message: 'select Runner Query spec', - type: 'list', - choices: [{name: DEFAULT_QUERY_NAME}], - }, - ]); - project.runner.query.version = await cli.prompt('Runner query version', {required: true}); - - let genesisHash: string; - if (project.runner.node.name === SUBSTRATE_NODE_NAME) { - cli.action.start('Getting network genesis hash from endpoint for Chain ID'); - try { - genesisHash = await getGenesisHash(projectNetwork.endpoint); - } catch (e) { - genesisHash = null; - } - cli.action.stop(); - } - project.chainId = await cli.prompt('Please provide Chain ID', {default: genesisHash ?? null, required: true}); - - if (manifest instanceof SubstrateProjectManifestVersioned) { - if (manifest.isV0_0_1) { - const projectV1Network = manifest.asV0_0_1.network; - if ( - projectV1Network.types || - projectV1Network.typesAlias || - projectV1Network.typesBundle || - projectV1Network.typesChain || - projectV1Network.typesSpec - ) { - chainTypesRelativePath = await cli.prompt('Please provide network chain types path', { - default: './types.json', - required: true, - }); - const {ext} = path.parse(chainTypesRelativePath); - if (ext !== '.yaml' && ext !== '.yml' && ext !== '.json') { - throw new Error(`Extension ${ext} not supported`); - } - const projectChainTypesPath = path.join(location, chainTypesRelativePath); - //check if the file path is exist, if not create one - if (fs.existsSync(projectChainTypesPath)) { - if (await cli.confirm(`${projectChainTypesPath} already exist, do you want override it [Y/N]`)) { - await createChainTypes(projectV1Network, projectChainTypesPath, ext); - } - } else { - await createChainTypes(projectV1Network, projectChainTypesPath, ext); - } - } - //Patch manifest here - for (const dataSource of manifest.asV1_0_0.dataSources) { - dataSource.mapping.file = await cli.prompt( - `Please provide relative entry path for dataSource ${dataSource.name}'s mapping `, - { - default: jsonProjectData.main.toString().startsWith('./') - ? jsonProjectData.main - : `./${jsonProjectData.main}`, - required: true, - } - ); - delete dataSource.name; - const handlers = dataSource.mapping.handlers; - delete dataSource.mapping.handlers; // adjust position - dataSource.mapping.handlers = handlers; - } - } else { - // handle chainTypes path as v0.2.0 - if (manifest.asV0_2_0.network.chaintypes) { - chainTypesRelativePath = manifest.asV0_2_0.network.chaintypes.file; - } - } - } - return [project, chainTypesRelativePath]; -} - -export async function migrate( - projectPath: string, - project: ProjectSpecV1_0_0, - manifest: SubstrateProjectManifestVersioned | TerraProjectManifestVersioned, - chainTypes?: string -): Promise { - const originManifestPath = path.join(projectPath, MANIFEST_PATH); - const manifestOld = path.join(projectPath, MANIFEST_OLD); - const manifestV1_0_0 = path.join(projectPath, MANIFEST_V_1_0_0); - - try { - const data = {} as ProjectManifestV1_0_0; - data.specVersion = '1.0.0'; - data.name = project.name; - data.version = project.version; - data.runner = project.runner; - data.description = manifest.asV1_0_0.description ?? ''; - data.repository = manifest.asV1_0_0.repository ?? ''; - if (manifest instanceof SubstrateProjectManifestVersioned) { - data.schema = manifest.isV0_0_1 ? {file: manifest.asV0_0_1.schema} : manifest.asV1_0_0.schema; - } else if (manifest instanceof TerraProjectManifestVersioned) { - data.schema = manifest.asV1_0_0.schema; - } - data.network = { - chainId: project.chainId, - endpoint: manifest.asV1_0_0.network.endpoint, - }; - if (manifest.asV1_0_0.network.dictionary) { - data.network.dictionary = manifest.asV1_0_0.network.dictionary; - } - if (chainTypes) { - data.network.chaintypes = {file: chainTypes}; - } - data.dataSources = manifest.asV1_0_0.dataSources as any; //TODO, fix this type as extend BaseDataSource - manifest instanceof SubstrateProjectManifestVersioned && manifest.asV1_0_0.templates - ? (data.templates = manifest.asV1_0_0.templates) - : delete data.templates; - - const newYaml = yaml.dump(classToPlain(data)); - await fs.promises.writeFile(manifestV1_0_0, newYaml, 'utf8'); - } catch (e) { - throw new Error(`Failed to create manifest : ${e}`); - } - //validate before backup and conversion - try { - loadSubstrateProjectManifest(manifestV1_0_0).isV1_0_0; - } catch (e) { - try { - loadTerraProjectManifest(manifestV1_0_0).isV1_0_0; - } catch (e) { - console.error(`${manifestV1_0_0} failed validation for manifest spec 1.0.0, \n ${e}`); - const keep = await cli.confirm(`However, do you want keep ${manifestV1_0_0} for inspection before retry? [Y/N]`); - if (keep) { - process.exit(0); - } else { - await fs.promises.unlink(manifestV1_0_0); - process.exit(0); - } - } - } - //conversion - await conversion(originManifestPath, manifestOld, manifestV1_0_0); -} - -async function conversion(originManifestPath: string, manifestOld: string, manifestV1_0_0: string): Promise { - try { - await fs.promises.rename(originManifestPath, manifestOld); - } catch (e) { - throw new Error(`Failed convert ${originManifestPath} to ${manifestOld},${e}`); - } - try { - await fs.promises.rename(manifestV1_0_0, originManifestPath); - } catch (e) { - throw new Error(`Failed convert ${manifestV1_0_0} to ${originManifestPath},${e}`); - } -} - -export async function createChainTypes( - projectV1Network: ProjectNetworkV0_0_1, - absolutePath: string, - ext: string -): Promise { - const data = {} as ChainTypes; - if (projectV1Network.types) data.types = projectV1Network.types; - if (projectV1Network.typesBundle) data.typesBundle = projectV1Network.typesBundle; - if (projectV1Network.typesAlias) data.typesAlias = projectV1Network.typesAlias; - if (projectV1Network.typesChain) data.typesChain = projectV1Network.typesChain; - if (projectV1Network.typesSpec) data.typesChain = projectV1Network.typesSpec; - - if (ext === '.json') { - await fs.promises.writeFile(absolutePath, JSON.stringify(data, null, 2)); - } else { - await fs.promises.writeFile(absolutePath, yaml.dump(data), 'utf8'); - } - console.log(`* chainTypes is created`); -} diff --git a/packages/cli/src/controller/project-controller.spec.ts b/packages/cli/src/controller/project-controller.spec.ts deleted file mode 100644 index e3f58131..00000000 --- a/packages/cli/src/controller/project-controller.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ROOT_API_URL_DEV} from '../constants'; -import {delay} from '../utils'; -import {createProject, deleteProject} from './project-controller'; - -const projectSpec = { - org: process.env.SUBQL_ORG_TEST, - projectName: 'mocked_project', - repository: 'https://github.com/bz888/test-deployment-2', - ipfs: 'QmaVh8DGzuRCJZ5zYEDxXQsXYqP9HihjjeuxNNteSDq8xX', - subtitle: '', - description: '', - logoURl: '', - apiVersion: '2', -}; - -// Replace/Update your access token when test locally -const testAuth = process.env.SUBQL_ACCESS_TOKEN_TEST; - -const testIf = (condition: boolean, ...args: Parameters) => (condition ? it(...args) : it.skip(...args)); - -jest.setTimeout(120000); -describe('CLI create project and delete project', () => { - testIf(!!testAuth, 'Create project and delete', async () => { - const {apiVersion, description, logoURl, org, projectName, repository, subtitle} = projectSpec; - const create_project = await createProject( - org, - subtitle, - logoURl, - projectName, - testAuth, - repository, - description, - apiVersion, - ROOT_API_URL_DEV - ); - await delay(10); - const delete_project = await deleteProject(testAuth, org, projectName, ROOT_API_URL_DEV); - expect(create_project.key).toMatch(`${process.env.SUBQL_ORG_TEST}/mocked_project`); - expect(delete_project).toMatch(`${process.env.SUBQL_ORG_TEST}/mocked_project`); - }); -}); diff --git a/packages/cli/src/controller/project-controller.ts b/packages/cli/src/controller/project-controller.ts deleted file mode 100644 index 2aa79c28..00000000 --- a/packages/cli/src/controller/project-controller.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import axios from 'axios'; -import {errorHandle} from '../utils'; - -interface createProjectType { - key: string; -} -export async function createProject( - organization: string, - subtitle: string, - logoUrl: string, - project_name: string, - authToken: string, - gitRepository: string, - description: string, - apiVersion: string, - url: string -): Promise { - try { - const result = ( - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'post', - url: 'subqueries', - baseURL: url, - data: { - apiVersion: `v${apiVersion}`, - description: description, - gitRepository: gitRepository, - key: `${organization}/${project_name}`, - logoUrl: logoUrl, - name: project_name, - subtitle: subtitle, - }, - }) - ).data; - return result; - } catch (e) { - errorHandle(e, 'Failed to create project:'); - } -} - -export async function deleteProject( - authToken: string, - organization: string, - project_name: string, - url: string -): Promise { - const key = `${organization}/${project_name}`; - try { - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - }, - method: 'delete', - url: `subqueries/${key}`, - baseURL: url, - }); - return `${key}`; - } catch (e) { - errorHandle(e, 'Failed to delete project:'); - } -} diff --git a/packages/cli/src/controller/publish-controller.spec.ts b/packages/cli/src/controller/publish-controller.spec.ts deleted file mode 100644 index c30239af..00000000 --- a/packages/cli/src/controller/publish-controller.spec.ts +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import childProcess from 'child_process'; -import fs from 'fs'; -import os from 'os'; -import path from 'path'; -import {promisify} from 'util'; -import {NETWORK_FAMILY, ReaderFactory} from '@subql/common'; -import {parseSubstrateProjectManifest, ProjectManifestV1_0_0Impl} from '@subql/common-substrate'; -import {create} from 'ipfs-http-client'; -import rimraf from 'rimraf'; -import Build from '../commands/build'; -import Codegen from '../commands/codegen'; -import Publish from '../commands/publish'; -import { - isProjectSpecV0_0_1, - isProjectSpecV1_0_0, - ProjectSpecBase, - ProjectSpecV0_0_1, - ProjectSpecV0_2_0, - ProjectSpecV1_0_0, -} from '../types'; -import {cloneProjectTemplate, fetchTemplates, prepare} from './init-controller'; -import {uploadFile, uploadToIpfs} from './publish-controller'; - -const projectSpecV0_0_1: ProjectSpecV0_0_1 = { - name: 'mocked_starter', - repository: '', - endpoint: 'wss://rpc.polkadot.io/public-ws', - author: 'jay', - description: 'this is test for init controller', - version: '', - license: '', -}; - -const projectSpecV0_2_0: ProjectSpecV0_2_0 = { - name: 'mocked_starter', - repository: '', - genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', - endpoint: 'wss://rpc.polkadot.io/public-ws', - author: 'jay', - description: 'this is test for init controller', - version: '', - license: '', -}; - -export const projectSpecV1_0_0: ProjectSpecV1_0_0 = { - name: 'mocked_starter', - repository: '', - chainId: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', - endpoint: 'wss://rpc.polkadot.io/public-ws', - author: 'jay', - description: 'this is test for init controller', - version: '', - license: '', - runner: { - node: { - name: '@subql/node', - version: '>=1.0.0', - }, - query: { - name: '@subql/query', - version: '*', - }, - }, -}; - -const ipfsEndpoint = 'http://localhost:5001/api/v0'; -// Replace/Update your access token when test locally -const testAuth = process.env.SUBQL_ACCESS_TOKEN; - -jest.setTimeout(150000); - -export async function createTestProject(projectSpec: ProjectSpecBase): Promise { - const tmpdir = await fs.promises.mkdtemp(`${os.tmpdir()}${path.sep}`); - const projectDir = path.join(tmpdir, projectSpec.name); - const templates = await fetchTemplates(); - const projectPath = await cloneProjectTemplate(tmpdir, projectSpec.name, templates[0]); - await prepare(projectPath, projectSpec); - - // Install dependencies - // node-fetch and subql/types are tempt solutions for resolving dependency issues - // @subql/types can be removed once v1.4.1 is released - childProcess.execSync(`npm i --save-dev @subql/types@1.4.1-1 && npm i`, {cwd: projectDir}); - - await Codegen.run(['-l', projectDir]); - await Build.run(['-f', projectDir]); - - return projectDir; -} - -describe('Cli publish', () => { - let projectDir: string; - - afterEach(async () => { - try { - await promisify(rimraf)(projectDir); - } catch (e) { - console.warn('Failed to clean up tmp dir after test'); - } - }); - - it('should not allow uploading a v0.0.1 spec version project', async () => { - projectDir = await createTestProject(projectSpecV0_0_1); - await expect(uploadToIpfs('', ipfsEndpoint, projectDir)).rejects.toBeDefined(); - }); - - it(`upload file to ipfs`, async () => { - // only enable when test locally - const ipfs = create({url: ipfsEndpoint}); - //test string - const cid = await uploadFile('Test for upload string to ipfs', testAuth); - console.log(`upload file cid: ${cid}`); - // test fs stream (project) - projectDir = await createTestProject(projectSpecV0_2_0); - const fsStream = fs.createReadStream(path.resolve(projectDir, 'project.yaml')); - const cid2 = await uploadFile(fsStream, testAuth); - console.log(`upload file cid: ${cid2}`); - }); - - it('should upload appropriate project to IPFS', async () => { - projectDir = await createTestProject(projectSpecV0_2_0); - const cid = await uploadToIpfs(projectDir, testAuth); - expect(cid).toBeDefined(); - // validation no longer required, as it is deployment object been published - // await expect(Validate.run(['-l', cid, '--ipfs', ipfsEndpoint])).resolves.toBe(undefined); - }); - - it('upload project from a manifest', async () => { - projectDir = await createTestProject(projectSpecV0_2_0); - const manifestPath = path.resolve(projectDir, 'project.yaml'); - const testManifestPath = path.resolve(projectDir, 'test.yaml'); - fs.renameSync(manifestPath, testManifestPath); - await Publish.run(['-f', testManifestPath]); - }); - - it('should not allow uploading a v0.0.1 spec version project', async () => { - projectDir = await createTestProject(projectSpecV0_0_1); - await expect(uploadToIpfs('', ipfsEndpoint, projectDir)).rejects.toBeDefined(); - }); - - it('v1.0.0 should deploy', async () => { - projectDir = await createTestProject(projectSpecV1_0_0); - const reader = await ReaderFactory.create(projectDir); - const manifest = parseSubstrateProjectManifest(await reader.getProjectSchema()).asImpl; - expect((manifest as ProjectManifestV1_0_0Impl).runner).toBeDefined(); - }); - - it('convert to deployment and removed descriptive field', async () => { - projectDir = await createTestProject(projectSpecV1_0_0); - const reader = await ReaderFactory.create(projectDir); - const manifest = parseSubstrateProjectManifest(await reader.getProjectSchema()).asImpl; - const deployment = manifest.toDeployment(); - expect(deployment).not.toContain('author'); - expect(deployment).not.toContain('endpoint'); - expect(deployment).not.toContain('dictionary'); - expect(deployment).not.toContain('description'); - expect(deployment).not.toContain('repository'); - - expect(deployment).toContain('chainId'); - expect(deployment).toContain('specVersion'); - expect(deployment).toContain('dataSources'); - }); -}); diff --git a/packages/cli/src/controller/publish-controller.ts b/packages/cli/src/controller/publish-controller.ts deleted file mode 100644 index 3be5ffb0..00000000 --- a/packages/cli/src/controller/publish-controller.ts +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {ReaderFactory, IPFS_CLUSTER_ENDPOINT, getProjectRootAndManifest} from '@subql/common'; -import {parseAlgorandProjectManifest} from '@subql/common-algorand'; -import {parseSubstrateProjectManifest as parseAvalancheProjectManifest} from '@subql/common-avalanche'; -import {parseCosmosProjectManifest} from '@subql/common-cosmos'; -import {parseSubstrateProjectManifest, manifestIsV0_0_1} from '@subql/common-substrate'; -import {parseTerraProjectManifest} from '@subql/common-terra'; -import {FileReference} from '@subql/types'; -import axios from 'axios'; -import FormData from 'form-data'; -import {IPFSHTTPClient, create} from 'ipfs-http-client'; - -export async function createIPFSFile(projectPath: string, cid: string): Promise { - const filePath = getProjectRootAndManifest(projectPath); - const {name} = path.parse(filePath.manifest); - const MANIFEST_FILE = path.join(filePath.root, `.${name}-cid`); - try { - await fs.promises.writeFile(MANIFEST_FILE, cid, 'utf8'); - } catch (e) { - throw new Error(`Failed to create CID file: ${e}`); - } -} - -export async function uploadToIpfs(projectPath: string, authToken: string, ipfsEndpoint?: string): Promise { - const reader = await ReaderFactory.create(projectPath); - let manifest; - const schema = await reader.getProjectSchema(); - //substrate - try { - manifest = parseSubstrateProjectManifest(schema).asImpl; - if (manifestIsV0_0_1(manifest)) { - throw new Error('Unsupported project manifest spec, only 0.2.0 or greater is supported'); - } - } catch (e) { - //terra - try { - manifest = parseTerraProjectManifest(schema).asImpl; - } catch (e) { - // cosmos - try { - manifest = parseCosmosProjectManifest(schema).asImpl; - } catch (e) { - //avalanche - try { - manifest = parseAvalancheProjectManifest(schema).asImpl; - } catch (e) { - // algorand - try { - manifest = parseAlgorandProjectManifest(schema).asImpl; - } catch (e) { - throw new Error('Unable to pass project manifest'); - } - } - } - } - } - - let ipfs: IPFSHTTPClient; - if (ipfsEndpoint) { - ipfs = create({url: ipfsEndpoint}); - } - const deployment = await replaceFileReferences(reader.root, manifest, authToken, ipfs); - // Upload schema - return uploadFile(deployment.toDeployment(), authToken, ipfs); -} - -/* Recursively finds all FileReferences in an object and replaces the files with IPFS references */ -async function replaceFileReferences( - projectDir: string, - input: T, - authToken: string, - ipfs?: IPFSHTTPClient -): Promise { - if (Array.isArray(input)) { - return (await Promise.all( - input.map((val) => replaceFileReferences(projectDir, val, authToken, ipfs)) - )) as unknown as T; - } else if (typeof input === 'object') { - if (input instanceof Map) { - input = mapToObject(input) as T; - } - if (isFileReference(input)) { - input.file = await uploadFile(fs.createReadStream(path.resolve(projectDir, input.file)), authToken, ipfs).then( - (cid) => `ipfs://${cid}` - ); - } - const keys = Object.keys(input) as unknown as (keyof T)[]; - await Promise.all( - keys.map(async (key) => { - input[key] = await replaceFileReferences(projectDir, input[key], authToken, ipfs); - }) - ); - } - - return input; -} - -export async function uploadFile( - content: string | fs.ReadStream, - authToken: string, - ipfs?: IPFSHTTPClient -): Promise { - let ipfsClientCid: string; - // if user provide ipfs, we will try to upload it to this gateway - if (ipfs) { - try { - ipfsClientCid = (await ipfs.add(content, {pin: true, cidVersion: 0})).cid.toString(); - } catch (e) { - throw new Error(`Publish project to provided IPFS gateway failed, ${e}`); - } - } - let ipfsClusterCid: string; - try { - ipfsClusterCid = await UploadFileByCluster( - determineStringOrFsStream(content) ? await fs.promises.readFile(content.path, 'utf8') : content, - authToken - ); - } catch (e) { - throw new Error(`Publish project to default cluster failed, ${e}`); - } - // Validate IPFS cid - if (ipfsClientCid && ipfsClientCid !== ipfsClusterCid) { - throw new Error(`Published and received IPFS cid not identical \n, - IPFS gateway: ${ipfsClientCid}, IPFS cluster: ${ipfsClusterCid}`); - } - return ipfsClusterCid; -} - -function determineStringOrFsStream(toBeDetermined: unknown): toBeDetermined is fs.ReadStream { - return !!(toBeDetermined as fs.ReadStream).path; -} - -async function UploadFileByCluster(content: string, authToken: string): Promise { - const bodyFormData = new FormData(); - bodyFormData.append('data', content); - const result = ( - await axios({ - headers: { - Authorization: `Bearer ${authToken}`, - 'Content-Type': 'multipart/form-data', - ...bodyFormData.getHeaders(), - }, - method: 'post', - url: IPFS_CLUSTER_ENDPOINT, - data: bodyFormData, - maxBodyLength: 50 * 1024 * 1024, //50 MB - maxContentLength: 50 * 1024 * 1024, - }) - ).data as ClusterResponseData; - return result.cid?.['/']; -} - -function mapToObject(map: Map): Record { - // XXX can use Object.entries with newer versions of node.js - const assetsObj: Record = {}; - for (const key of map.keys()) { - assetsObj[key] = map.get(key); - } - return assetsObj; -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function isFileReference(value: any): value is FileReference { - return value.file && typeof value.file === 'string'; -} - -interface ClusterResponseData { - name: string; - cid: cidSpec; - size: number; -} -// cluster response cid stored as {'/': 'QmVq2bqunmkmEmMCY3x9U9kDcgoRBGRbuBm5j7XKZDvSYt'} -interface cidSpec { - '/': string; -} diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts deleted file mode 100644 index e98a5af6..00000000 --- a/packages/cli/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export {run} from '@oclif/core'; diff --git a/packages/cli/src/jsonrpc/client/http.ts b/packages/cli/src/jsonrpc/client/http.ts deleted file mode 100644 index 8c4271be..00000000 --- a/packages/cli/src/jsonrpc/client/http.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import axios, {AxiosInstance} from 'axios'; -import {Response, ResponseError, ResponseSuccess, ResponseSuccessType} from './types'; - -const TIMEOUT = 5000; - -let id = 0; -export class HttpJsonRpcClient { - protected axios: AxiosInstance; - constructor(url: string) { - this.axios = axios.create({ - baseURL: url, - timeout: TIMEOUT, - }); - } - - async send(method: string, params?: any[]): Promise { - const res = await this.axios.post>('', { - jsonrpc: '2.0', - id: id++, - method, - params, - }); - if ((res.data as ResponseError).error) { - throw (res.data as ResponseError).error; - } - return (res.data as ResponseSuccess).result; - } -} diff --git a/packages/cli/src/jsonrpc/client/index.ts b/packages/cli/src/jsonrpc/client/index.ts deleted file mode 100644 index 6a484e53..00000000 --- a/packages/cli/src/jsonrpc/client/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './http'; -export * from './ws'; diff --git a/packages/cli/src/jsonrpc/client/types.ts b/packages/cli/src/jsonrpc/client/types.ts deleted file mode 100644 index 8cbcdd46..00000000 --- a/packages/cli/src/jsonrpc/client/types.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export interface Message { - jsonrpc: '2.0'; - method: string; - params?: T; -} - -export interface Request extends Message { - id: string | number; -} - -export type Notification = Message; - -export interface ResponseSuccess { - id: string | number | null; - result: T; -} - -export type ResponseSuccessType = string | number | boolean | object | null; - -export interface ResponseError { - id: string | number | null; - error: { - code: number; - message: string; - data?: any; - }; -} - -export type Response = ResponseSuccess | ResponseError; diff --git a/packages/cli/src/jsonrpc/client/ws.ts b/packages/cli/src/jsonrpc/client/ws.ts deleted file mode 100644 index 39d5c2d6..00000000 --- a/packages/cli/src/jsonrpc/client/ws.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ICloseEvent, w3cwebsocket as WebSocket} from 'websocket'; -import {Request, ResponseSuccessType} from './types'; - -let id = 0; -export class WsJsonRpcClient { - static async with(url: string, callback: (client: WsJsonRpcClient) => Promise): Promise { - const client = new WsJsonRpcClient(url); - await client.isReady; - const ret = await callback(client); - client.destroy(); - return ret; - } - - isReady: Promise; - protected _ws: WebSocket; - protected isDestroyed = false; - - protected handlers: {[id: string]: any}; - - constructor(protected address: string) { - this.handlers = {}; - this.connect(); - } - - connect(): void { - try { - this._ws = new WebSocket(this.address); - - this.isReady = new Promise((resolve) => { - this._ws.onopen = () => resolve(this); - }); - - this._ws.onclose = this.onSocketClose; - this._ws.onmessage = this.onSocketMessage; - } catch (error) { - console.error(error); - } - } - - async send(method: string, params?: any[]): Promise { - await this.isReady; - const req: Request = {jsonrpc: '2.0', id: id++, method, params}; - this._ws.send(JSON.stringify(req)); - return new Promise((resolve, reject) => { - this.handlers[req.id] = [resolve, reject]; - }); - } - - destroy(): void { - this.isDestroyed = true; - this._ws.close(); - } - - private onSocketClose = (event: ICloseEvent): void => { - if (this.isDestroyed) return; - - console.error(`disconnected from ${this.address} code: '${event.code}' reason: '${event.reason}'`); - setTimeout((): void => { - this.connect(); - }, 1000); - }; - - private onSocketMessage = ({data: dataStr}: {data: string}) => { - try { - const data = JSON.parse(String(dataStr)); - if (data.id !== undefined && data.id !== null && this.handlers[data.id]) { - const [resolve, reject] = this.handlers[data.id]; - delete this.handlers[data.id]; - if (data.error) { - reject(data.error); - } else { - resolve(data.result); - } - } - } catch (e) { - console.error(e); - } - }; -} diff --git a/packages/cli/src/jsonrpc/index.ts b/packages/cli/src/jsonrpc/index.ts deleted file mode 100644 index 7ee20e34..00000000 --- a/packages/cli/src/jsonrpc/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {HttpJsonRpcClient, WsJsonRpcClient} from './client'; - -export async function getGenesisHash(endpoint: string): Promise { - const client = endpoint.startsWith('ws') ? new WsJsonRpcClient(endpoint) : new HttpJsonRpcClient(endpoint); - const genesisBlock = await client.send('chain_getBlockHash', [0]); - (client as WsJsonRpcClient).destroy?.(); - return genesisBlock; -} diff --git a/packages/cli/src/jsonrpc/jsonrpc.test.ts b/packages/cli/src/jsonrpc/jsonrpc.test.ts deleted file mode 100644 index 54a08178..00000000 --- a/packages/cli/src/jsonrpc/jsonrpc.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {getGenesisHash} from './index'; - -const WS_ENDPOINT = 'wss://polkadot.api.onfinality.io/public-ws'; -const HTTP_ENDPOINT = 'https://polkadot.api.onfinality.io/public'; - -const GENESIS_HASH = '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'; - -describe('test jsonrpc client', () => { - it("Query polkadot's genesisHash via ws endpoint", async () => { - const genesisHash = await getGenesisHash(WS_ENDPOINT); - expect(genesisHash).toEqual(GENESIS_HASH); - }, 10000); - - it("Query polkadot's genesisHash via http endpoint", async () => { - const genesisHash = await getGenesisHash(HTTP_ENDPOINT); - expect(genesisHash).toEqual(GENESIS_HASH); - }); -}); diff --git a/packages/cli/src/template/datasource-templates.ts.ejs b/packages/cli/src/template/datasource-templates.ts.ejs deleted file mode 100644 index 7217b31b..00000000 --- a/packages/cli/src/template/datasource-templates.ts.ejs +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Auto-generated , DO NOT EDIT -<% props.forEach(function(e){ %> -export function create<%= e.name %>Datasource(<% if (e.args) { %>args: <%- e.args %><% } %>): Promise { - return createDynamicDatasource('<%= e.name %>'<% if (e.args) { %>, args<% } %>); -} -<% }); %> diff --git a/packages/cli/src/template/enum.ts.ejs b/packages/cli/src/template/enum.ts.ejs deleted file mode 100644 index e469485e..00000000 --- a/packages/cli/src/template/enum.ts.ejs +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Auto-generated , DO NOT EDIT -<% props.enums.forEach(function(e){ %> -export enum <%= e.name %> { -<% e.values.forEach(function(value){ %> - <%= value %> = "<%= value %>", -<% }); %> -} - -<% }); %> diff --git a/packages/cli/src/template/interface.ts.ejs b/packages/cli/src/template/interface.ts.ejs deleted file mode 100644 index 194b856f..00000000 --- a/packages/cli/src/template/interface.ts.ejs +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Auto-generated , DO NOT EDIT -<% props.jsonInterfaces.forEach(function(interface){ %> -export interface <%= helper.upperFirst(interface.interfaceName) %> { -<% interface.fields.forEach(function(field){ %> - <%= field.name %><%= field.required ? "" : "?" %>: <%= field.type %><%= field.isArray ? "[]" : "" %>; -<% }); %> -} - -<% }); %> diff --git a/packages/cli/src/template/model.ts.ejs b/packages/cli/src/template/model.ts.ejs deleted file mode 100644 index ee6812be..00000000 --- a/packages/cli/src/template/model.ts.ejs +++ /dev/null @@ -1,70 +0,0 @@ -// Auto-generated , DO NOT EDIT -import {Entity, FunctionPropertyNames} from "@subql/types"; -import assert from 'assert'; -<%if (props.importJsonInterfaces.length !== 0) { %> -import {<% props.importJsonInterfaces.forEach(function(interface){ %> - <%= interface %>, -<% }); %>} from '../interfaces' -<% } %> - -<%if (props.importEnums.length !== 0) { %> -import {<% props.importEnums.forEach(function(e){ %> - <%= e %>, -<% }); %>} from '../enums' -<% } %> - -type <%= props.className %>Props = Omit<<%=props.className %>, NonNullable>>>; - -export class <%= props.className %> implements Entity { - - constructor(id: string) { - this.id = id; - } - -<% props.fields.forEach(function(field){ %> - public <%= field.name %><%= field.required ? "" : "?" %>: <%= field.type %><%= field.isArray ? "[]" : "" %>; -<% }); %> - - async save(): Promise{ - let id = this.id; - assert(id !== null, "Cannot save <%=props.className %> entity without an ID"); - await store.set('<%=props.entityName %>', id.toString(), this); - } - static async remove(id:string): Promise{ - assert(id !== null, "Cannot remove <%=props.className %> entity without an ID"); - await store.remove('<%=props.entityName %>', id.toString()); - } - - static async get(id:string): Promise<<%=props.className %> | undefined>{ - assert((id !== null && id !== undefined), "Cannot get <%=props.className %> entity without an ID"); - const record = await store.get('<%=props.entityName %>', id.toString()); - if (record){ - return <%=props.className %>.create(record as <%= props.className %>Props); - }else{ - return; - } - } - -<% props.indexedFields.forEach(function(field){ %> - static async getBy<%=helper.upperFirst(field.name) %>(<%=field.name %>: <%=field.type %>): Promise<<%=props.className %><%=field.unique ? '' : '[]' %> | undefined>{ - <% if (field.unique) {%> - const record = await store.getOneByField('<%=props.entityName %>', '<%=field.name %>', <%=field.name %>); - if (record){ - return <%=props.className %>.create(record as <%= props.className %>Props); - }else{ - return; - } - <% } else { %> - const records = await store.getByField('<%=props.entityName %>', '<%=field.name %>', <%=field.name %>); - return records.map(record => <%=props.className %>.create(record as <%= props.className %>Props)); - <% }%> - } -<% }); %> - - static create(record: <%= props.className %>Props): <%=props.className %> { - assert(typeof record.id === 'string', "id must be provided"); - let entity = new <%=props.className %>(record.id); - Object.assign(entity,record); - return entity; - } -} diff --git a/packages/cli/src/template/models-index.ts.ejs b/packages/cli/src/template/models-index.ts.ejs deleted file mode 100644 index 133f62df..00000000 --- a/packages/cli/src/template/models-index.ts.ejs +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Auto-generated , DO NOT EDIT -<% props.classNames.forEach(function(className){ %> -export {<%= helper.upperFirst(className) %>} from "./<%= className %>" -<% }); %> diff --git a/packages/cli/src/template/terramodel.ts.ejs b/packages/cli/src/template/terramodel.ts.ejs deleted file mode 100644 index f5970411..00000000 --- a/packages/cli/src/template/terramodel.ts.ejs +++ /dev/null @@ -1,70 +0,0 @@ -// Auto-generated , DO NOT EDIT -import {Entity, FunctionPropertyNames} from "@subql/types-terra"; -import assert from 'assert'; -<%if (props.importJsonInterfaces.length !== 0) { %> -import {<% props.importJsonInterfaces.forEach(function(interface){ %> - <%= interface %>, -<% }); %>} from '../interfaces' -<% } %> - -<%if (props.importEnums.length !== 0) { %> -import {<% props.importEnums.forEach(function(e){ %> - <%= e %>, -<% }); %>} from '../enums' -<% } %> - -type <%= props.className %>Props = Omit<<%=props.className %>, NonNullable>>>; - -export class <%= props.className %> implements Entity { - - constructor(id: string) { - this.id = id; - } - -<% props.fields.forEach(function(field){ %> - public <%= field.name %><%= field.required ? "" : "?" %>: <%= field.type %><%= field.isArray ? "[]" : "" %>; -<% }); %> - - async save(): Promise{ - let id = this.id; - assert(id !== null, "Cannot save <%=props.className %> entity without an ID"); - await store.set('<%=props.entityName %>', id.toString(), this); - } - static async remove(id:string): Promise{ - assert(id !== null, "Cannot remove <%=props.className %> entity without an ID"); - await store.remove('<%=props.entityName %>', id.toString()); - } - - static async get(id:string): Promise<<%=props.className %> | undefined>{ - assert((id !== null && id !== undefined), "Cannot get <%=props.className %> entity without an ID"); - const record = await store.get('<%=props.entityName %>', id.toString()); - if (record){ - return <%=props.className %>.create(record as <%= props.className %>Props); - }else{ - return; - } - } - -<% props.indexedFields.forEach(function(field){ %> - static async getBy<%=helper.upperFirst(field.name) %>(<%=field.name %>: <%=field.type %>): Promise<<%=props.className %><%=field.unique ? '' : '[]' %> | undefined>{ - <% if (field.unique) {%> - const record = await store.getOneByField('<%=props.entityName %>', '<%=field.name %>', <%=field.name %>); - if (record){ - return <%=props.className %>.create(record as <%= props.className %>Props); - }else{ - return; - } - <% } else { %> - const records = await store.getByField('<%=props.entityName %>', '<%=field.name %>', <%=field.name %>); - return records.map(record => <%=props.className %>.create(record as <%= props.className %>Props)); - <% }%> - } -<% }); %> - - static create(record: <%= props.className %>Props): <%=props.className %> { - assert(typeof record.id === 'string', "id must be provided"); - let entity = new <%=props.className %>(record.id); - Object.assign(entity,record); - return entity; - } -} diff --git a/packages/cli/src/template/types-index.ts.ejs b/packages/cli/src/template/types-index.ts.ejs deleted file mode 100644 index abec9650..00000000 --- a/packages/cli/src/template/types-index.ts.ejs +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Auto-generated , DO NOT EDIT -<%if (props.exportTypes.models){%>export * from "./models"; <% } %> -<%if (props.exportTypes.interfaces){%>export * from "./interfaces";<% } %> -<%if (props.exportTypes.enums){%>export * from "./enums";<% } %> -<%if (props.exportTypes.datasources){%>export * from "./datasources";<% } %> diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts deleted file mode 100644 index 51f9e820..00000000 --- a/packages/cli/src/types.ts +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {RunnerSpecs} from '@subql/common'; - -export interface ProjectSpecBase { - name: string; - repository?: string; - author: string; - description?: string; - version: string; - license: string; - endpoint: string; -} - -export type ProjectSpecV0_0_1 = ProjectSpecBase; - -export interface ProjectSpecV1_0_0 extends ProjectSpecBase { - chainId: string; - runner: RunnerSpecs; -} - -export interface ProjectSpecV0_2_0 extends ProjectSpecBase { - genesisHash: string; -} - -export interface TerraProjectSpecV0_3_0 extends ProjectSpecBase { - chainId: string; -} - -export function isProjectSpecV0_0_1(projectSpec: ProjectSpecBase): projectSpec is ProjectSpecV0_0_1 { - return !(isProjectSpecV0_2_0(projectSpec) || isTerraProjectSpecV0_3_0(projectSpec)); -} - -export function isProjectSpecV0_2_0(projectSpec: ProjectSpecBase): projectSpec is ProjectSpecV0_2_0 { - return !!(projectSpec as ProjectSpecV0_2_0).genesisHash; -} - -export function isProjectSpecV1_0_0(projectSpec: ProjectSpecBase): projectSpec is ProjectSpecV1_0_0 { - return !!(projectSpec as ProjectSpecV1_0_0).chainId; -} - -export function isTerraProjectSpecV0_3_0(projectSpec: ProjectSpecBase): projectSpec is TerraProjectSpecV0_3_0 { - return !!(projectSpec as TerraProjectSpecV0_3_0).chainId; -} - -export interface ValidateDataType { - valid: boolean; - manifestFile: string | null; - chainId: string | null; - runner?: RunnerSpecs | null; - manifestRunner?: RunnerSpecs | null; - errorMessage?: string; -} - -export interface DeploymentSpec { - org: string; - projectName: string; - repository: string; - ipfs: string; - subtitle: string; - description: string; - logoURl: string; - apiVersion: string; - type: string; -} -export interface DeploymentDataType { - projectKey: string; - version: string; - status: string; - indexerImage: string; - queryImage: string; - endpoint: string; - dictEndpoint: string; - type: string; - createdAt: string; - updatedAt: string; - id: number; - subFolder: string; - queryUrl: string; - configuration: { - config: { - query: Record; - indexer: { - batchSize: number; - }; - role: string; - chainId: string; - }; - }; -} - -export interface ProjectDataType { - createdAt: string; - updatedAt: string; - id: number; - projectKey: string; - version: string; - status: string; - cluster: string; - indexerImage: string; - queryImage: string; - subFolder: string; - endpoint: string; - dictEndpoint: string; - type: string; - queryUrl: string; - configuration: { - config: { - query: {}; - indexer: {}; - }; - }; - role: string; - chainId: string; - apiVersion: string; -} diff --git a/packages/cli/src/utils.ts b/packages/cli/src/utils.ts deleted file mode 100644 index ffe5f5d3..00000000 --- a/packages/cli/src/utils.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {existsSync, readFileSync} from 'fs'; -import axios from 'axios'; -import cli, {ux} from 'cli-ux'; -import inquirer, {Inquirer} from 'inquirer'; - -export async function delay(sec: number): Promise { - return new Promise((resolve) => { - setTimeout(resolve, sec * 1000); - }); -} - -export async function valueOrPrompt(value: T, msg: string, error: string): Promise { - if (value) return value; - try { - return await cli.prompt(msg); - } catch (e) { - throw new Error(error); - } -} - -export async function promptWithDefaultValues( - promptType: Inquirer | typeof ux, - msg: string, - defaultValue?: string, - choices?: string[], - required?: boolean -): Promise { - const promptValue = - promptType === inquirer - ? ( - await promptType.prompt({ - name: 'runnerVersions', - message: msg, - type: 'list', - choices: choices, - }) - ).runnerVersions - : await promptType.prompt(msg, {default: defaultValue, required: required}); - return promptValue; -} - -export async function checkToken(authToken_ENV: string, token_path: string): Promise { - let authToken = authToken_ENV; - if (authToken_ENV) return authToken_ENV; - if (existsSync(token_path)) { - try { - authToken = process.env.SUBQL_ACCESS_TOKEN ?? readFileSync(token_path, 'utf8'); - } catch (e) { - return (authToken = await cli.prompt('Token cannot be found, Enter token')); - } - } else { - authToken = await cli.prompt('Token cannot be found, Enter token'); - return authToken; - } -} - -export function errorHandle(e: any, msg: string): string { - if (axios.isAxiosError(e) as any) { - throw new Error(`${msg} ${e.response.data.message}`); - } else { - throw new Error(`${msg} ${e.message}`); - } -} - -export function buildProjectKey(org: string, projectName: string): string { - return encodeURIComponent(`${org}/${projectName}`); -} diff --git a/packages/cli/test/schemaTest1/project.yaml b/packages/cli/test/schemaTest1/project.yaml deleted file mode 100644 index ac96bb69..00000000 --- a/packages/cli/test/schemaTest1/project.yaml +++ /dev/null @@ -1,22 +0,0 @@ -specVersion: "0.0.1" -description: "" -repository: "https://github.com/subquery/subql-starter" - -schema: "./schema.graphql" - -network: - endpoint: "wss://polkadot.api.onfinality.io/public-ws" - -dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - - - - diff --git a/packages/cli/test/schemaTest1/schema.graphql b/packages/cli/test/schemaTest1/schema.graphql deleted file mode 100644 index 3f509305..00000000 --- a/packages/cli/test/schemaTest1/schema.graphql +++ /dev/null @@ -1,18 +0,0 @@ -enum Test { - FOO - BAR -} -type goodEntity @entity { - id: ID! #id is a required field - field1: Int! - - field2: String #filed2 is an optional field - - field3: BigInt - - field4: Date - - field5: Test - - field6: Float -} diff --git a/packages/cli/test/schemaTest2/badschema.graphql b/packages/cli/test/schemaTest2/badschema.graphql deleted file mode 100644 index fb5ffe26..00000000 --- a/packages/cli/test/schemaTest2/badschema.graphql +++ /dev/null @@ -1,3 +0,0 @@ -type badEntity @entity { - id: BigDecimal -} diff --git a/packages/cli/test/schemaTest2/project.yaml b/packages/cli/test/schemaTest2/project.yaml deleted file mode 100644 index 3d6884fe..00000000 --- a/packages/cli/test/schemaTest2/project.yaml +++ /dev/null @@ -1,21 +0,0 @@ -specVersion: "0.0.1" -description: "" -repository: "https://github.com/subquery/subql-starter" -schema: "./badschema.graphql" - -network: - endpoint: "wss://polkadot.api.onfinality.io/public-ws" - -dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - - - - diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json deleted file mode 100644 index ec4e481f..00000000 --- a/packages/cli/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "esModuleInterop": true, - "importHelpers": true, - "rootDir": "src", - "tsBuildInfoFile": "lib/.tsbuildinfo", - "outDir": "lib", - "noImplicitAny": true - }, - "references": [ - {"path": "../common"}, - {"path": "../common-substrate"}, - {"path": "../utils"}, - {"path": "../validator"} - ], - "include": ["src/**/*"] -} diff --git a/packages/node-core/CHANGELOG.md b/packages/common-ethereum/CHANGELOG.md similarity index 65% rename from packages/node-core/CHANGELOG.md rename to packages/common-ethereum/CHANGELOG.md index 20455f8b..a966de3f 100644 --- a/packages/node-core/CHANGELOG.md +++ b/packages/common-ethereum/CHANGELOG.md @@ -1,5 +1,4 @@ # Changelog - All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), @@ -9,10 +8,3 @@ All logs must start with the format: [x.y.z] - yyyy-mm-dd ## [Unreleased] -## [0.1.1] - 2022-08-26 -### Fixed -- Imports not being relative (#1268) - -## [0.1.0] - 2022-08-26 - -- Move blockchain agnostic code from `node` to `node-core` package. (#1222) diff --git a/packages/cli/LICENSE b/packages/common-ethereum/LICENSE similarity index 100% rename from packages/cli/LICENSE rename to packages/common-ethereum/LICENSE diff --git a/packages/common-substrate/package.json b/packages/common-ethereum/package.json similarity index 59% rename from packages/common-substrate/package.json rename to packages/common-ethereum/package.json index 1c3f2598..edd0f6be 100644 --- a/packages/common-substrate/package.json +++ b/packages/common-ethereum/package.json @@ -1,6 +1,6 @@ { - "name": "@subql/common-substrate", - "version": "1.2.0", + "name": "@subql/common-ethereum", + "version": "0.0.0", "description": "", "scripts": { "build": "rm -rf dist && tsc -b", @@ -13,16 +13,25 @@ "main": "dist/index.js", "license": "Apache-2.0", "dependencies": { - "@subql/common": "workspace:*", - "@subql/types": "workspace:*", + "@polkadot/util": "^8", + "@subql/common": "latest", + "@subql/types-ethereum": "workspace:*", + "bn.js": "4.11.6", "class-transformer": "0.4.0", "class-validator": "^0.13.2", + "flatted": "^3.2.2", + "graphql": "^15.7.2", + "graphql-tag": "^2.12.5", "js-yaml": "^4.1.0", - "reflect-metadata": "^0.1.13" + "pino": "^6.13.3", + "reflect-metadata": "^0.1.13", + "sequelize": "^6.6.2", + "vm2": "^3.9.9" }, "devDependencies": { "@types/bn.js": "4.11.6", "@types/js-yaml": "^4.0.4", "@types/pino": "^6.3.12" - } + }, + "stableVersion": "0.2.0" } diff --git a/packages/common-substrate/src/index.ts b/packages/common-ethereum/src/index.ts similarity index 100% rename from packages/common-substrate/src/index.ts rename to packages/common-ethereum/src/index.ts diff --git a/packages/common-substrate/src/project/index.ts b/packages/common-ethereum/src/project/index.ts similarity index 100% rename from packages/common-substrate/src/project/index.ts rename to packages/common-ethereum/src/project/index.ts diff --git a/packages/common-substrate/src/project/load.spec.ts b/packages/common-ethereum/src/project/load.spec.ts similarity index 99% rename from packages/common-substrate/src/project/load.spec.ts rename to packages/common-ethereum/src/project/load.spec.ts index 36ac4451..e26f5555 100644 --- a/packages/common-substrate/src/project/load.spec.ts +++ b/packages/common-ethereum/src/project/load.spec.ts @@ -1,9 +1,12 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 +import fs from 'fs'; import path from 'path'; import {parseChainTypes} from './load'; +const projectsDir = path.join(__dirname, '../../test'); + const jsChainTypesScript = `(()=>{"use strict";var e={3412:function(e,n){var t=this&&this.__rest||function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o>"}},debug:{traceTransaction:{aliasSection:"debug",description:"Debug trace tx",params:[{name:"transaction_hash",type:"H256"}],type:"Result>"}}};const a={AccountId:"EthereumAccountId",Address:"AccountId",Balance:"u128",RefCount:"u8",LookupSource:"AccountId",Account:{nonce:"U256",balance:"u128"}},{RefCount:o}=a,c=t(a,["RefCount"]),i=Object.assign(Object.assign({},c),{ExtrinsicSignature:"EthereumSignature",RoundIndex:"u32",Candidate:{id:"AccountId",fee:"Perbill",bond:"Balance",nominators:"Vec",total:"Balance",state:"ValidatorStatus"},Nominator:{nominations:"Vec",total:"Balance"},Bond:{owner:"AccountId",amount:"Balance"},ValidatorStatus:{_enum:{Active:"Null",Idle:"Null",Leaving:"RoundIndex"}},TxPoolResultContent:{pending:"HashMap>",queued:"HashMap>"},TxPoolResultInspect:{pending:"HashMap>",queued:"HashMap>"},TxPoolResultStatus:{pending:"U256",queued:"U256"},Summary:"Bytes",PoolTransaction:{hash:"H256",nonce:"U256",blockHash:"Option",blockNumber:"Option",from:"H160",to:"Option",value:"U256",gasPrice:"U256",gas:"U256",input:"Bytes"}}),{ValidatorStatus:s}=i,r=t(i,["ValidatorStatus"]),l=Object.assign(Object.assign({},r),{AccountInfo:"AccountInfoWithTripleRefCount",Candidate:{id:"AccountId",fee:"Perbill",bond:"Balance",nominators:"Vec",total:"Balance",state:"CollatorStatus"},CollatorStatus:{_enum:{Active:"Null",Idle:"Null",Leaving:"RoundIndex"}},Range:"RangeBalance",RangeBalance:{min:"Balance",ideal:"Balance",max:"Balance"},RangePerbill:{min:"Perbill",ideal:"Perbill",max:"Perbill"},InflationInfo:{expect:"RangeBalance",annual:"RangePerbill",round:"RangePerbill"},OrderedSet:"Vec",Collator:{id:"AccountId",bond:"Balance",nominators:"Vec",total:"Balance",state:"CollatorStatus"},CollatorSnapshot:{bond:"Balance",nominators:"Vec",total:"Balance"},SystemInherentData:{validationData:"PersistedValidationData",relayChain_state:"StorageProof",downwardMessages:"Vec",horizontalMessages:"BTreeMap>"},RoundInfo:{current:"RoundIndex",first:"BlockNumber",length:"u32"}}),u=Object.assign(Object.assign({},l),{AuthorId:"AccountId"}),d=Object.assign(Object.assign({},u),{AccountId32:"H256",AuthorId:"AccountId32",ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","CancelProxy","Balances","AuthorMapping"]},RelayChainAccountId:"AccountId32",RewardInfo:{totalReward:"Balance",claimedReward:"Balance"}}),m=Object.assign(Object.assign({},d),{Collator2:{id:"AccountId",bond:"Balance",nominators:"Vec",topNominators:"Vec",bottomNominators:"Vec",totalCounted:"Balance",totalBacking:"Balance",state:"CollatorStatus"},NominatorAdded:{_enum:{AddedToBottom:"Null",AddedToTop:"Balance"}},RegistrationInfo:{account:"AccountId",deposit:"Balance"},ParachainBondConfig:{account:"AccountId",percent:"Percent"}}),p=Object.assign(Object.assign({},m),{EthereumSignature:{r:"H256",s:"H256",v:"U8"},NominatorAdded:{_enum:{AddedToTop:"Balance",AddedToBottom:"Null"}}}),b=Object.assign(Object.assign({},p),{NominatorStatus:{_enum:{Active:"Null",Leaving:"RoundIndex"}},Nominator2:{nominations:"Vec",revocations:"Vec",total:"Balance",scheduledRevocationsCount:"u32",scheduledRevocationsTotal:"Balance",status:"NominatorStatus"},ExitQ:{candidates:"Vec",nominatorsLeaving:"Vec",candidateSchedule:"Vec<(AccountId, RoundIndex)>",nominatorSchedule:"Vec<(AccountId, Option, RoundIndex)>"}}),y=Object.assign(Object.assign({},b),{RewardInfo:{totalReward:"Balance",claimedReward:"Balance",contributedRelayAddresses:"Vec"}}),I=Object.assign(Object.assign({},y),{AssetType:{_enum:{Xcm:"MultiLocation"}},AssetId:"u128",TAssetBalance:"u128",ENUM_AccountId32:{network:"NetworkId",id:"[u8; 32]"},ENUM_AccountKey20:{network:"NetworkId",key:"[u8; 20]"},ENUM_AccountIndex64:{network:"NetworkId",index:"Compact"},ENUM_Plurality:{id:"BodyId",part:"BodyPart"},JunctionV0:{_enum:{Parent:"Null",Parachain:"Compact",AccountId32:"ENUM_AccountId32",AccountIndex64:"ENUM_AccountIndex64",AccountKey20:"ENUM_AccountKey20",PalletInstance:"u8",GeneralIndex:"Compact",GeneralKey:"Vec",OnlyChild:"Null",Plurality:"ENUM_Plurality"}},CurrencyId:{_enum:{SelfReserve:"Null",OtherReserve:"u128"}},AssetRegistrarMetadata:{name:"Vec",symbol:"Vec",decimals:"u8",isFrozen:"bool"},VestingBlockNumber:"u32",MultiLocation:"MultiLocationV0"}),A=Object.assign(Object.assign({},I),{JunctionV1:{_enum:{Parachain:"Compact",AccountId32:"ENUM_AccountId32",AccountIndex64:"ENUM_AccountIndex64",AccountKey20:"ENUM_AccountKey20",PalletInstance:"u8",GeneralIndex:"Compact",GeneralKey:"Vec",OnlyChild:"Null",Plurality:"ENUM_Plurality"}},MultiLocation:"MultiLocationV1"}),g=Object.assign(Object.assign({},A),{MoonbaseRuntimeAssetRegistrarMetadata:{name:"Vec",symbol:"Vec",decimals:"u8",is_frozen:"bool"},PalletCrowdloanRewardsRewardInfo:{total_reward:"Balance",claimed_reward:"Balance",contributed_relay_addresses:"Vec"},ParachainStakingNominator2:{nominations:"Vec",revocations:"Vec",total:"Balance",scheduled_revocations_count:"u32",scheduled_revocations_total:"Balance",status:"NominatorStatus"},ParachainStakingExitQ:{candidates:"Vec",nominators_leaving:"Vec",candidate_schedule:"Vec<(AccountId, RoundIndex)>",nominator_schedule:"Vec<(AccountId, Option, RoundIndex)>"},ParachainStakingCollator2:{id:"AccountId",bond:"Balance",nominators:"Vec",top_nominators:"Vec",bottom_nominators:"Vec",total_counted:"Balance",total_backing:"Balance",state:"CollatorStatus"}});n.moonbeamDefinitions={alias:n.moduleDefinitions,rpc:n.rpcDefinitions,instances:{council:["councilCollective"],technicalCommittee:["techCommitteeCollective"]},types:[{minmax:[0,4],types:a},{minmax:[5,5],types:c},{minmax:[6,19],types:i},{minmax:[19,35],types:l},{minmax:[36,36],types:u},{minmax:[37,42],types:d},{minmax:[43,154],types:m},{minmax:[155,199],types:p},{minmax:[200,399],types:b},{minmax:[400,599],types:y},{minmax:[600,799],types:I},{minmax:[800,899],types:A},{minmax:[900,void 0],types:{ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","CancelProxy","Balances","AuthorMapping"]}}}]},n.moonbeamDefinitionsDeprecated=Object.assign(Object.assign({},n.moonbeamDefinitions),{types:[...n.moonbeamDefinitions.types,{minmax:[900,void 0],types:g}]}),n.typesBundlePre900={spec:{moonbeam:n.moonbeamDefinitions,moonbeamDefinitions:n.moonbeamDefinitions,moonbase:n.moonbeamDefinitions,moonriver:n.moonbeamDefinitions}},n.typesBundleDeprecated={spec:{moonbeam:n.moonbeamDefinitionsDeprecated,moonbeamDefinitions:n.moonbeamDefinitionsDeprecated,moonbase:n.moonbeamDefinitionsDeprecated,moonriver:n.moonbeamDefinitionsDeprecated}}}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var c=n[a]={exports:{}};return e[a].call(c.exports,c,c.exports,t),c.exports}var a={};(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0});const n=t(3412);e.default={typesBundle:n.typesBundleDeprecated}})();var o=exports;for(var c in a)o[c]=a[c];a.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();`; describe('load', () => { diff --git a/packages/common-ethereum/src/project/load.ts b/packages/common-ethereum/src/project/load.ts new file mode 100644 index 00000000..295b029c --- /dev/null +++ b/packages/common-ethereum/src/project/load.ts @@ -0,0 +1,109 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import fs from 'fs'; +import path from 'path'; +import {loadFromJsonOrYaml} from '@subql/common'; +import {plainToClass} from 'class-transformer'; +import {validateSync} from 'class-validator'; +import {NodeVM, VMScript} from 'vm2'; +import {ChainTypes} from './models'; +import {EthereumProjectManifestVersioned, VersionedProjectManifest} from './versioned'; + +export function parseEthereumProjectManifest(raw: unknown): EthereumProjectManifestVersioned { + const projectManifest = new EthereumProjectManifestVersioned(raw as VersionedProjectManifest); + projectManifest.validate(); + return projectManifest; +} + +export function loadChainTypes(file: string, projectRoot: string): unknown { + const {ext} = path.parse(file); + const filePath = path.resolve(projectRoot, file); + if (fs.existsSync(filePath)) { + if (ext === '.js' || ext === '.cjs') { + //load can be self contained js file, or js depend on node_module which will require project root + return loadChainTypesFromJs(filePath, projectRoot); + } else if (ext === '.yaml' || ext === '.yml' || ext === '.json') { + return loadFromJsonOrYaml(filePath); + } else { + throw new Error(`Extension ${ext} not supported`); + } + } else { + throw new Error(`Load from file ${file} not exist`); + } +} + +export function loadEthereumProjectManifest(file: string): EthereumProjectManifestVersioned { + let manifestPath = file; + if (fs.existsSync(file) && fs.lstatSync(file).isDirectory()) { + const yamlFilePath = path.join(file, 'project.yaml'); + const jsonFilePath = path.join(file, 'project.json'); + if (fs.existsSync(yamlFilePath)) { + manifestPath = yamlFilePath; + } else if (fs.existsSync(jsonFilePath)) { + manifestPath = jsonFilePath; + } else { + throw new Error(`Could not find project manifest under dir ${file}`); + } + } + + const doc = loadFromJsonOrYaml(manifestPath); + const projectManifest = new EthereumProjectManifestVersioned(doc as VersionedProjectManifest); + projectManifest.validate(); + return projectManifest; +} +export function parseChainTypes(raw: unknown): ChainTypes { + const chainTypes = plainToClass(ChainTypes, raw); + if ( + !!chainTypes.types || + !!chainTypes.typesChain || + !!chainTypes.typesBundle || + !!chainTypes.typesAlias || + !!chainTypes.typesSpec + ) { + const errors = validateSync(chainTypes, {whitelist: true, forbidNonWhitelisted: true}); + if (errors?.length) { + // TODO: print error details + const errorMsgs = errors.map((e) => e.toString()).join('\n'); + throw new Error(`failed to parse chain types.\n${errorMsgs}`); + } + return chainTypes; + } else { + throw new Error(`chainTypes is not valid`); + } +} + +export function loadChainTypesFromJs(filePath: string, requireRoot?: string): unknown { + const {base, ext} = path.parse(filePath); + const root = requireRoot ?? path.dirname(filePath); + const vm = new NodeVM({ + console: 'redirect', + wasm: false, + sandbox: {}, + require: { + context: 'sandbox', + external: true, + builtin: ['path'], + root: root, + resolve: (moduleName: string) => { + return require.resolve(moduleName, {paths: [root]}); + }, + }, + wrapper: 'commonjs', + sourceExtensions: ['js', 'cjs'], + }); + let rawContent: unknown; + try { + const script = new VMScript( + `module.exports = require('${filePath}').default;`, + path.join(root, 'sandbox') + ).compile(); + rawContent = vm.run(script) as unknown; + } catch (err) { + throw new Error(`\n NodeVM error: ${err}`); + } + if (rawContent === undefined) { + throw new Error(`There was no default export found from required ${base} file`); + } + return rawContent; +} diff --git a/packages/common-ethereum/src/project/models.ts b/packages/common-ethereum/src/project/models.ts new file mode 100644 index 00000000..4e60518b --- /dev/null +++ b/packages/common-ethereum/src/project/models.ts @@ -0,0 +1,196 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types'; + +import {BaseMapping} from '@subql/common'; +import { + EthereumLogFilter, + EthereumHandlerKind, + SubqlCustomHandler, + SubqlMapping, + SubqlHandler, + SubqlRuntimeHandler, + SubqlRuntimeDatasource, + EthereumDatasourceKind, + SubqlCustomDatasource, + FileReference, + CustomDataSourceAsset, + EthereumBlockFilter, + SubqlBlockHandler, + SubqlEventHandler, + SubqlCallHandler, + EthereumTransactionFilter, + SubqlDatasource, +} from '@subql/types-ethereum'; +import {plainToClass, Transform, Type} from 'class-transformer'; +import { + ArrayMaxSize, + IsArray, + IsBoolean, + IsEnum, + IsInt, + IsOptional, + IsString, + IsObject, + ValidateNested, +} from 'class-validator'; + +export class BlockFilter implements EthereumBlockFilter { + @IsOptional() + @IsInt() + modulo?: number; +} + +export class LogFilter implements EthereumLogFilter { + @IsOptional() + @IsArray() + topics?: string[]; + @IsOptional() + @IsString() + address?: string; +} + +export class ChainTypes implements RegisteredTypes { + @IsObject() + @IsOptional() + types?: RegistryTypes; + @IsObject() + @IsOptional() + typesAlias?: Record; + @IsObject() + @IsOptional() + typesBundle?: OverrideBundleType; + @IsObject() + @IsOptional() + typesChain?: Record; + @IsObject() + @IsOptional() + typesSpec?: Record; +} + +export class TransactionFilter implements EthereumTransactionFilter { + @IsOptional() + @IsString() + from?: string; + @IsOptional() + @IsString() + to?: string; + @IsOptional() + @IsString() + function?: string; +} + +export class BlockHandler implements SubqlBlockHandler { + @IsObject() + @IsOptional() + @Type(() => BlockFilter) + filter?: BlockFilter; + @IsEnum(EthereumHandlerKind, {groups: [EthereumHandlerKind.Block]}) + kind: EthereumHandlerKind.Block; + @IsString() + handler: string; +} + +export class CallHandler implements SubqlCallHandler { + @IsObject() + @IsOptional() + @Type(() => TransactionFilter) + filter?: TransactionFilter; + @IsEnum(EthereumHandlerKind, {groups: [EthereumHandlerKind.Call]}) + kind: EthereumHandlerKind.Call; + @IsString() + handler: string; +} + +export class EventHandler implements SubqlEventHandler { + @IsObject() + @IsOptional() + @Type(() => LogFilter) + filter?: LogFilter; + @IsEnum(EthereumHandlerKind, {groups: [EthereumHandlerKind.Event]}) + kind: EthereumHandlerKind.Event; + @IsString() + handler: string; +} + +export class CustomHandler implements SubqlCustomHandler { + @IsString() + kind: string; + @IsString() + handler: string; + @IsObject() + @IsOptional() + filter?: Record; +} + +export class EthereumMapping implements SubqlMapping { + @Transform((params) => { + const handlers: SubqlHandler[] = params.value; + return handlers.map((handler) => { + switch (handler.kind) { + case EthereumHandlerKind.Event: + return plainToClass(EventHandler, handler); + case EthereumHandlerKind.Call: + return plainToClass(CallHandler, handler); + case EthereumHandlerKind.Block: + return plainToClass(BlockHandler, handler); + default: + throw new Error(`handler ${(handler as any).kind} not supported`); + } + }); + }) + @IsArray() + @ValidateNested() + handlers: SubqlHandler[]; + @IsString() + file: string; +} + +export class CustomMapping implements SubqlMapping { + @IsArray() + @Type(() => CustomHandler) + @ValidateNested() + handlers: CustomHandler[]; + @IsString() + file: string; +} + +export class RuntimeDataSourceBase> implements SubqlRuntimeDatasource { + @IsEnum(EthereumDatasourceKind, {groups: [EthereumDatasourceKind.Runtime]}) + kind: EthereumDatasourceKind.Runtime; + @Type(() => EthereumMapping) + @ValidateNested() + mapping: M; + @IsOptional() + @IsInt() + startBlock?: number; + @IsOptional() + assets?: Map; + @IsOptional() + options?: any; +} + +export class FileReferenceImpl implements FileReference { + @IsString() + file: string; +} + +export class CustomDataSourceBase> + implements SubqlCustomDatasource +{ + @IsString() + kind: K; + @Type(() => CustomMapping) + @ValidateNested() + mapping: M; + @IsOptional() + @IsInt() + startBlock?: number; + @Type(() => FileReferenceImpl) + @ValidateNested({each: true}) + assets: Map; + @Type(() => FileReferenceImpl) + @IsObject() + processor: FileReference; +} diff --git a/packages/common-ethereum/src/project/project.spec.ts b/packages/common-ethereum/src/project/project.spec.ts new file mode 100644 index 00000000..0204fb73 --- /dev/null +++ b/packages/common-ethereum/src/project/project.spec.ts @@ -0,0 +1,95 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import path from 'path'; +import {RunnerQueryBaseModel} from '@subql/common'; +import {validateSync} from 'class-validator'; +import {DeploymentV1_0_0, EthereumRunnerNodeImpl, EthereumRunnerSpecsImpl} from '../project/versioned/v1_0_0'; +import {loadEthereumProjectManifest} from './load'; + +const projectsDir = path.join(__dirname, '../../test'); + +describe.skip('project.yaml', () => { + it('can validate project.yaml', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_falsy.yaml'))).toThrow(); + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_falsy_array.yaml'))).toThrow(); + }); + + it('can fail validation if version not supported', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_invalid_version.yaml'))).toThrow(); + }); + + it('can validate a v0.2.0 project.yaml with a custom data source', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_0.2.0_custom_ds.yaml'))).not.toThrow(); + }); + + it('can validate a v0.2.1 project.yaml with templates', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_0.2.1.yaml'))).not.toThrow(); + }); + + it('can validate a v1.0.0 project.yaml with templates', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0.yaml'))).not.toThrow(); + }); + + it('get v1.0.0 deployment mapping filter', () => { + const manifestVersioned = loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0.yaml')); + + const deployment = manifestVersioned.asV1_0_0.deployment; + const filter = deployment.dataSources[0].mapping.handlers[0].filter; + const deploymentString = manifestVersioned.toDeployment(); + expect(filter).not.toBeNull(); + expect(deploymentString).toContain('function: approve(address spender, uint256 rawAmount)'); + }); + + it('can convert genesis hash in v1.0.0 to chainId in deployment', () => { + const deployment = loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0.yaml')).asV1_0_0.deployment; + expect(deployment.network.chainId).not.toBeNull(); + console.log(deployment.network.chainId); + }); + + it.skip('can get chainId for deployment', () => { + const deployment = loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0_chainId.yaml')).asV1_0_0 + .deployment; + expect(deployment.network.chainId).toBe('moonbeamChainId'); + }); + + it('can validate deployment runner versions', () => { + const deployment = new DeploymentV1_0_0(); + const nodeImp = new EthereumRunnerNodeImpl(); + const queryImp = new RunnerQueryBaseModel(); + deployment.specVersion = '1.0.0'; + deployment.runner = new EthereumRunnerSpecsImpl(); + + nodeImp.name = '@subql/node'; + nodeImp.version = '0.29.1'; + deployment.runner.node = nodeImp; + + queryImp.name = '@subql/query'; + queryImp.version = '0.213.1'; + + deployment.runner.query = queryImp; + + validateSync(deployment.runner, {whitelist: true, forbidNonWhitelisted: true}); + }); + + it('can validate a v1.0.0 project.yaml with unsupported runner node', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0_bad_runner.yaml'))).toThrow(); + }); + + //TODO, pre-release should be excluded + it.skip('can throw error with unsupported runner version', () => { + expect(() => + loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0_bad_runner_version.yaml')) + ).toThrow(); + }); + + it('can validate a v1.0.0 project.yaml runner and datasource mismatches', () => { + expect(() => + loadEthereumProjectManifest(path.join(projectsDir, 'project_1.0.0_runner_ds_mismatch.yaml')) + ).toThrow(); + }); + + it('can fail validation if custom ds missing processor', () => { + expect(() => loadEthereumProjectManifest(path.join(projectsDir, 'project_0.2.0_invalid_custom_ds.yaml'))).toThrow(); + }); +}); diff --git a/packages/common-ethereum/src/project/types.ts b/packages/common-ethereum/src/project/types.ts new file mode 100644 index 00000000..38c6a812 --- /dev/null +++ b/packages/common-ethereum/src/project/types.ts @@ -0,0 +1,30 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import {IProjectManifest, ProjectNetworkConfig} from '@subql/common'; +import {SubqlDatasource} from '@subql/types-ethereum'; + +// All of these used to be redefined in this file, re-exporting for simplicity +export { + SubqlRuntimeHandler, + SubqlCustomHandler, + SubqlHandler, + EthereumHandlerKind, + SubqlDatasource as SubqlEthereumDataSource, + SubqlCustomDatasource as SubqlEthereumCustomDataSource, + EthereumBlockFilter, + EthereumTransactionFilter, + EthereumLogFilter, + SubqlDatasourceProcessor, + SubqlHandlerFilter, + EthereumDatasourceKind, + EthereumRuntimeHandlerInputMap as EthereumRuntimeHandlerInputMap, +} from '@subql/types-ethereum'; + +export type IEthereumProjectManifest = IProjectManifest; + +export interface EthereumProjectNetworkConfig extends ProjectNetworkConfig { + genesisHash?: string; + chainId?: string; + subnet?: string; +} diff --git a/packages/common-ethereum/src/project/utils.ts b/packages/common-ethereum/src/project/utils.ts new file mode 100644 index 00000000..4611fc9f --- /dev/null +++ b/packages/common-ethereum/src/project/utils.ts @@ -0,0 +1,37 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { + SecondLayerHandlerProcessor, + SubqlCustomDatasource, + SubqlDatasource, + EthereumDatasourceKind, + EthereumHandlerKind, + SubqlRuntimeDatasource, +} from '@subql/types-ethereum'; + +export function isBlockHandlerProcessor( + hp: SecondLayerHandlerProcessor +): hp is SecondLayerHandlerProcessor { + return hp.baseHandlerKind === EthereumHandlerKind.Block; +} + +export function isEventHandlerProcessor( + hp: SecondLayerHandlerProcessor +): hp is SecondLayerHandlerProcessor { + return hp.baseHandlerKind === EthereumHandlerKind.Event; +} + +export function isCallHandlerProcessor( + hp: SecondLayerHandlerProcessor +): hp is SecondLayerHandlerProcessor { + return hp.baseHandlerKind === EthereumHandlerKind.Call; +} + +export function isCustomDs(ds: SubqlDatasource): ds is SubqlCustomDatasource { + return ds.kind !== EthereumDatasourceKind.Runtime && !!(ds as SubqlCustomDatasource).processor; +} + +export function isRuntimeDs(ds: SubqlDatasource): ds is SubqlRuntimeDatasource { + return ds.kind === EthereumDatasourceKind.Runtime; +} diff --git a/packages/common-ethereum/src/project/versioned/ProjectManifestVersioned.ts b/packages/common-ethereum/src/project/versioned/ProjectManifestVersioned.ts new file mode 100644 index 00000000..0ccfe493 --- /dev/null +++ b/packages/common-ethereum/src/project/versioned/ProjectManifestVersioned.ts @@ -0,0 +1,85 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import {plainToClass} from 'class-transformer'; +import {IEthereumProjectManifest, SubqlEthereumDataSource} from '../types'; +import {ProjectManifestV0_3_0Impl} from './v0_3_0'; +import {ProjectManifestV1_0_0Impl} from './v1_0_0'; +export type VersionedProjectManifest = {specVersion: string}; + +const Ethereum_SUPPORTED_VERSIONS = { + '0.3.0': ProjectManifestV0_3_0Impl, + '1.0.0': ProjectManifestV1_0_0Impl, +}; + +type Versions = keyof typeof Ethereum_SUPPORTED_VERSIONS; + +type ProjectManifestImpls = InstanceType; + +export function manifestIsV0_3_0(manifest: IEthereumProjectManifest): manifest is ProjectManifestV0_3_0Impl { + return manifest.specVersion === '0.3.0'; +} + +export function manifestIsV1_0_0(manifest: IEthereumProjectManifest): manifest is ProjectManifestV1_0_0Impl { + return manifest.specVersion === '1.0.0'; +} + +export class EthereumProjectManifestVersioned implements IEthereumProjectManifest { + private _impl: ProjectManifestImpls; + + constructor(projectManifest: VersionedProjectManifest) { + const klass = Ethereum_SUPPORTED_VERSIONS[projectManifest.specVersion as Versions]; + if (!klass) { + throw new Error('specVersion not supported for project manifest file'); + } + this._impl = plainToClass(klass, projectManifest); + } + + get asImpl(): ProjectManifestImpls { + return this._impl; + } + + get isV0_3_0(): boolean { + return this.specVersion === '0.3.0'; + } + + get asV0_3_0(): ProjectManifestV0_3_0Impl { + return this._impl as ProjectManifestV0_3_0Impl; + } + + get isV1_0_0(): boolean { + return this.specVersion === '1.0.0'; + } + + get asV1_0_0(): ProjectManifestV1_0_0Impl { + return this._impl as ProjectManifestV1_0_0Impl; + } + + toDeployment(): string | undefined { + return this._impl.toDeployment(); + } + + validate(): void { + return this._impl.validate(); + } + + get dataSources(): SubqlEthereumDataSource[] { + return this._impl.dataSources; + } + + get schema(): string { + return this._impl.schema.file; + } + + get specVersion(): string { + return this._impl.specVersion; + } + + get description(): string { + return this._impl.description; + } + + get repository(): string { + return this._impl.repository; + } +} diff --git a/packages/common-substrate/src/project/versioned/index.ts b/packages/common-ethereum/src/project/versioned/index.ts similarity index 90% rename from packages/common-substrate/src/project/versioned/index.ts rename to packages/common-ethereum/src/project/versioned/index.ts index a7bf33f3..09d12bc4 100644 --- a/packages/common-substrate/src/project/versioned/index.ts +++ b/packages/common-ethereum/src/project/versioned/index.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 export * from './ProjectManifestVersioned'; -export * from './v0_0_1'; export * from './v0_2_0'; export * from './v0_2_1'; export * from './v0_3_0'; diff --git a/packages/common/src/project/versioned/v0_2_0/index.ts b/packages/common-ethereum/src/project/versioned/v0_2_0/index.ts similarity index 100% rename from packages/common/src/project/versioned/v0_2_0/index.ts rename to packages/common-ethereum/src/project/versioned/v0_2_0/index.ts diff --git a/packages/common-ethereum/src/project/versioned/v0_2_0/types.ts b/packages/common-ethereum/src/project/versioned/v0_2_0/types.ts new file mode 100644 index 00000000..b72b14dd --- /dev/null +++ b/packages/common-ethereum/src/project/versioned/v0_2_0/types.ts @@ -0,0 +1,29 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import {ProjectManifestV0_2_0} from '@subql/common'; +import { + SubqlDatasource, + SubqlCustomDatasource, + EthereumDatasourceKind, + SubqlRuntimeDatasource, +} from '@subql/types-ethereum'; + +// export interface SubstrateMappingV0_2_0 extends BaseMapping { +// file: string; +// } + +export type RuntimeDataSourceV0_2_0 = SubqlRuntimeDatasource; +export type CustomDatasourceV0_2_0 = SubqlCustomDatasource; + +export type EthereumProjectManifestV0_2_0 = ProjectManifestV0_2_0; + +export function isDatasourceV0_2_0( + dataSource: SubqlDatasource +): dataSource is RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0 { + return !!(dataSource as RuntimeDataSourceV0_2_0).mapping.file; +} + +export function isRuntimeDataSourceV0_2_0(dataSource: SubqlDatasource): dataSource is RuntimeDataSourceV0_2_0 { + return dataSource.kind === EthereumDatasourceKind.Runtime && isDatasourceV0_2_0(dataSource); +} diff --git a/packages/common/src/project/versioned/v0_2_1/index.ts b/packages/common-ethereum/src/project/versioned/v0_2_1/index.ts similarity index 100% rename from packages/common/src/project/versioned/v0_2_1/index.ts rename to packages/common-ethereum/src/project/versioned/v0_2_1/index.ts diff --git a/packages/common-substrate/src/project/versioned/v0_2_1/types.ts b/packages/common-ethereum/src/project/versioned/v0_2_1/types.ts similarity index 90% rename from packages/common-substrate/src/project/versioned/v0_2_1/types.ts rename to packages/common-ethereum/src/project/versioned/v0_2_1/types.ts index 0992d19a..20f787a8 100644 --- a/packages/common-substrate/src/project/versioned/v0_2_1/types.ts +++ b/packages/common-ethereum/src/project/versioned/v0_2_1/types.ts @@ -11,7 +11,7 @@ import {CustomDatasourceV0_2_0, RuntimeDataSourceV0_2_0} from '../v0_2_0'; export interface RuntimeDatasourceTemplate extends Omit, TemplateBase {} export interface CustomDatasourceTemplate extends Omit, TemplateBase {} -export type SubstrateProjectManifestV0_2_1 = ProjectManifestV0_2_1< +export type EthereumProjectManifestV0_2_1 = ProjectManifestV0_2_1< RuntimeDatasourceTemplate | CustomDatasourceTemplate, RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0 >; diff --git a/packages/common-substrate/src/project/versioned/v0_0_1/index.ts b/packages/common-ethereum/src/project/versioned/v0_3_0/index.ts similarity index 100% rename from packages/common-substrate/src/project/versioned/v0_0_1/index.ts rename to packages/common-ethereum/src/project/versioned/v0_3_0/index.ts diff --git a/packages/common-ethereum/src/project/versioned/v0_3_0/model.ts b/packages/common-ethereum/src/project/versioned/v0_3_0/model.ts new file mode 100644 index 00000000..bea1dc42 --- /dev/null +++ b/packages/common-ethereum/src/project/versioned/v0_3_0/model.ts @@ -0,0 +1,133 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import {ProjectManifestBaseImpl} from '@subql/common'; +import {SubqlCustomDatasource, SubqlCustomHandler, SubqlMapping, SubqlRuntimeHandler} from '@subql/types-ethereum'; +import {plainToClass, Transform, TransformFnParams, Type} from 'class-transformer'; +import { + Equals, + IsArray, + IsNotEmpty, + IsObject, + IsOptional, + IsString, + ValidateNested, + validateSync, +} from 'class-validator'; +import {CustomDataSourceBase, RuntimeDataSourceBase, EthereumMapping} from '../../models'; +import { + CustomDatasourceV0_3_0, + EthereumProjectManifestV0_3_0, + RuntimeDataSourceV0_3_0, + SubqlMappingV0_3_0, +} from './types'; + +export class FileType { + @IsString() + file: string; +} + +export class ProjectNetworkDeploymentV0_3_0 { + @IsString() + @IsNotEmpty() + @Transform(({value}: TransformFnParams) => value.trim()) + genesisHash: string; +} + +export class ProjectNetworkV0_3_0 extends ProjectNetworkDeploymentV0_3_0 { + @IsString() + @IsOptional() + endpoint?: string; + @IsString() + @IsOptional() + dictionary?: string; + @IsString() + @IsOptional() + subnet?: string; +} + +export class FileTypeV0_3_0 { + @IsString() + file: string; +} + +export class EthereumProjectMappingV0_3_0 extends EthereumMapping { + @IsString() + file: string; +} + +export class EthereumRuntimeDataSourceV0_3_0Impl + extends RuntimeDataSourceBase> + implements RuntimeDataSourceV0_3_0 +{ + @Type(() => EthereumProjectMappingV0_3_0) + @ValidateNested() + mapping: SubqlMappingV0_3_0; +} + +export class EthereumCustomDataSourceV0_3_0Impl< + K extends string = string, + M extends SubqlMapping = SubqlMapping + > + extends CustomDataSourceBase + implements SubqlCustomDatasource {} + +export class DeploymentV0_3_0 { + @Equals('0.3.0') + @IsString() + specVersion: string; + @ValidateNested() + @Type(() => FileType) + schema: FileType; + @IsArray() + @ValidateNested() + @Type(() => EthereumCustomDataSourceV0_3_0Impl, { + discriminator: { + property: 'kind', + subTypes: [{value: EthereumRuntimeDataSourceV0_3_0Impl, name: 'ethereum/Runtime'}], + }, + keepDiscriminatorProperty: true, + }) + dataSources: (RuntimeDataSourceV0_3_0 | CustomDatasourceV0_3_0)[]; + @ValidateNested() + @Type(() => ProjectNetworkDeploymentV0_3_0) + network: ProjectNetworkDeploymentV0_3_0; +} + +export class ProjectManifestV0_3_0Impl + extends ProjectManifestBaseImpl + implements EthereumProjectManifestV0_3_0 +{ + @Equals('0.3.0') + specVersion: string; + @IsString() + name: string; + @IsString() + version: string; + @IsObject() + @ValidateNested() + @Type(() => ProjectNetworkV0_3_0) + network: ProjectNetworkV0_3_0; + @ValidateNested() + @Type(() => FileType) + schema: FileType; + @IsArray() + @ValidateNested() + @Type(() => EthereumCustomDataSourceV0_3_0Impl, { + discriminator: { + property: 'kind', + subTypes: [{value: EthereumCustomDataSourceV0_3_0Impl, name: 'ethereum/Runtime'}], + }, + keepDiscriminatorProperty: true, + }) + dataSources: (RuntimeDataSourceV0_3_0 | CustomDatasourceV0_3_0)[]; + protected _deployment: DeploymentV0_3_0; + + get deployment(): DeploymentV0_3_0 { + if (!this._deployment) { + this._deployment = plainToClass(DeploymentV0_3_0, this); + validateSync(this._deployment, {whitelist: true}); + } + return this._deployment; + } +} diff --git a/packages/common-ethereum/src/project/versioned/v0_3_0/types.ts b/packages/common-ethereum/src/project/versioned/v0_3_0/types.ts new file mode 100644 index 00000000..318365c5 --- /dev/null +++ b/packages/common-ethereum/src/project/versioned/v0_3_0/types.ts @@ -0,0 +1,45 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { + SubqlCustomDatasource, + SubqlCustomHandler, + SubqlDatasource, + EthereumDatasourceKind, + SubqlHandler, + SubqlMapping, + SubqlRuntimeDatasource, + SubqlRuntimeHandler, +} from '@subql/types-ethereum'; +import {IEthereumProjectManifest} from '../../types'; +import {RuntimeDataSourceV0_2_0, CustomDatasourceV0_2_0} from '../v0_2_0/types'; + +export interface SubqlMappingV0_3_0 extends SubqlMapping { + file: string; +} + +export type RuntimeDataSourceV0_3_0 = SubqlRuntimeDatasource>; +export type CustomDatasourceV0_3_0 = SubqlCustomDatasource>; + +export interface EthereumProjectManifestV0_3_0 extends IEthereumProjectManifest { + name: string; + version: string; + schema: { + file: string; + }; + + network: { + genesisHash: string; + endpoint?: string; + dictionary?: string; + chaintypes?: { + file: string; + }; + }; + + dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; +} + +export function isRuntimeDataSourceV0_3_0(dataSource: SubqlDatasource): dataSource is RuntimeDataSourceV0_2_0 { + return dataSource.kind === EthereumDatasourceKind.Runtime && !!dataSource.mapping.file; +} diff --git a/packages/common-substrate/src/project/versioned/v0_2_0/index.ts b/packages/common-ethereum/src/project/versioned/v1_0_0/index.ts similarity index 100% rename from packages/common-substrate/src/project/versioned/v0_2_0/index.ts rename to packages/common-ethereum/src/project/versioned/v1_0_0/index.ts diff --git a/packages/common-substrate/src/project/versioned/v1_0_0/model.ts b/packages/common-ethereum/src/project/versioned/v1_0_0/model.ts similarity index 65% rename from packages/common-substrate/src/project/versioned/v1_0_0/model.ts rename to packages/common-ethereum/src/project/versioned/v1_0_0/model.ts index 102a1dcf..cbe748b9 100644 --- a/packages/common-substrate/src/project/versioned/v1_0_0/model.ts +++ b/packages/common-ethereum/src/project/versioned/v1_0_0/model.ts @@ -9,7 +9,6 @@ import { RunnerSpecs, SemverVersionValidator, } from '@subql/common'; -import {SubstrateRuntimeDatasource} from '@subql/types'; import {plainToClass, Transform, TransformFnParams, Type} from 'class-transformer'; import { Equals, @@ -22,25 +21,37 @@ import { ValidateNested, validateSync, } from 'class-validator'; +import {SubqlEthereumDataSource} from '../../types'; +import {CustomDatasourceTemplate, RuntimeDatasourceTemplate} from '../v0_2_1'; import { - CustomDatasourceV0_2_0, FileType, - RuntimeDataSourceV0_2_0, - SubstrateCustomDataSourceV0_2_0Impl, - SubstrateRuntimeDataSourceV0_2_0Impl, -} from '../v0_2_0'; -import { - CustomDatasourceTemplate, - CustomDatasourceTemplateImpl, - RuntimeDatasourceTemplate, - RuntimeDatasourceTemplateImpl, -} from '../v0_2_1'; -import {SubstrateProjectManifestV1_0_0} from './types'; + EthereumCustomDataSourceV0_3_0Impl, + EthereumRuntimeDataSourceV0_3_0Impl, + RuntimeDataSourceV0_3_0, + CustomDatasourceV0_3_0, +} from '../v0_3_0'; +import {EthereumProjectManifestV1_0_0} from './types'; -const SUBSTRATE_NODE_NAME = `@subql/node`; +const Ethereum_NODE_NAME = `@subql/node-ethereum`; -export class SubstrateRunnerNodeImpl implements NodeSpec { - @Equals(SUBSTRATE_NODE_NAME, {message: `Runner Substrate node name incorrect, suppose be '${SUBSTRATE_NODE_NAME}'`}) +export class RuntimeDatasourceTemplateImpl + extends EthereumRuntimeDataSourceV0_3_0Impl + implements RuntimeDatasourceTemplate +{ + @IsString() + name: string; +} + +export class CustomDatasourceTemplateImpl + extends EthereumCustomDataSourceV0_3_0Impl + implements CustomDatasourceTemplate +{ + @IsString() + name: string; +} + +export class EthereumRunnerNodeImpl implements NodeSpec { + @Equals(Ethereum_NODE_NAME, {message: `Runner Substrate node name incorrect, suppose be '${Ethereum_NODE_NAME}'`}) name: string; @IsString() @Validate(SemverVersionValidator) @@ -48,10 +59,10 @@ export class SubstrateRunnerNodeImpl implements NodeSpec { version: string; } -export class SubstrateRunnerSpecsImpl implements RunnerSpecs { +export class EthereumRunnerSpecsImpl implements RunnerSpecs { @IsObject() @ValidateNested() - @Type(() => SubstrateRunnerNodeImpl) + @Type(() => EthereumRunnerNodeImpl) node: NodeSpec; @IsObject() @ValidateNested() @@ -68,6 +79,8 @@ export class ProjectNetworkDeploymentV1_0_0 { @Type(() => FileType) @IsOptional() chaintypes?: FileType; + @IsString() + subnet: string; } export class ProjectNetworkV1_0_0 extends ProjectNetworkDeploymentV1_0_0 { @@ -94,28 +107,28 @@ export class DeploymentV1_0_0 { specVersion: string; @IsObject() @ValidateNested() - @Type(() => SubstrateRunnerSpecsImpl) + @Type(() => EthereumRunnerSpecsImpl) runner: RunnerSpecs; @ValidateNested() @Type(() => FileType) schema: FileType; @IsArray() @ValidateNested() - @Type(() => SubstrateCustomDataSourceV0_2_0Impl, { + @Type(() => EthereumCustomDataSourceV0_3_0Impl, { discriminator: { property: 'kind', - subTypes: [{value: SubstrateRuntimeDataSourceV0_2_0Impl, name: 'substrate/Runtime'}], + subTypes: [{value: EthereumRuntimeDataSourceV0_3_0Impl, name: 'ethereum/Runtime'}], }, keepDiscriminatorProperty: true, }) - dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; + dataSources: (RuntimeDataSourceV0_3_0 | CustomDatasourceV0_3_0)[]; @IsOptional() @IsArray() @ValidateNested() @Type(() => CustomDatasourceTemplateImpl, { discriminator: { property: 'kind', - subTypes: [{value: RuntimeDatasourceTemplateImpl, name: 'substrate/Runtime'}], + subTypes: [{value: EthereumRuntimeDataSourceV0_3_0Impl, name: 'ethereum/Runtime'}], }, keepDiscriminatorProperty: true, }) @@ -124,18 +137,18 @@ export class DeploymentV1_0_0 { export class ProjectManifestV1_0_0Impl extends ProjectManifestBaseImpl - implements SubstrateProjectManifestV1_0_0 + implements EthereumProjectManifestV1_0_0 { @Equals('1.0.0') specVersion: string; - @Type(() => SubstrateCustomDataSourceV0_2_0Impl, { + @Type(() => EthereumCustomDataSourceV0_3_0Impl, { discriminator: { property: 'kind', - subTypes: [{value: SubstrateRuntimeDataSourceV0_2_0Impl, name: 'substrate/Runtime'}], + subTypes: [{value: EthereumRuntimeDataSourceV0_3_0Impl, name: 'ethereum/Runtime'}], }, keepDiscriminatorProperty: true, }) - dataSources: (SubstrateRuntimeDatasource | CustomDatasourceV0_2_0)[]; + dataSources: SubqlEthereumDataSource[]; @Type(() => ProjectNetworkV1_0_0) network: ProjectNetworkV1_0_0; @IsString() @@ -151,14 +164,14 @@ export class ProjectManifestV1_0_0Impl @Type(() => CustomDatasourceTemplateImpl, { discriminator: { property: 'kind', - subTypes: [{value: RuntimeDatasourceTemplateImpl, name: 'substrate/Runtime'}], + subTypes: [{value: RuntimeDatasourceTemplateImpl, name: 'ethereum/Runtime'}], }, keepDiscriminatorProperty: true, }) templates?: (RuntimeDatasourceTemplate | CustomDatasourceTemplate)[]; @IsObject() @ValidateNested() - @Type(() => SubstrateRunnerSpecsImpl) + @Type(() => EthereumRunnerSpecsImpl) runner: RunnerSpecs; protected _deployment: D; @@ -167,6 +180,7 @@ export class ProjectManifestV1_0_0Impl this._deployment = plainToClass(DeploymentV1_0_0, this) as unknown as D; validateSync(this._deployment, {whitelist: true}); } + return this._deployment; } } diff --git a/packages/common-substrate/src/project/versioned/v1_0_0/types.ts b/packages/common-ethereum/src/project/versioned/v1_0_0/types.ts similarity index 86% rename from packages/common-substrate/src/project/versioned/v1_0_0/types.ts rename to packages/common-ethereum/src/project/versioned/v1_0_0/types.ts index bd9e3177..9b373a22 100644 --- a/packages/common-substrate/src/project/versioned/v1_0_0/types.ts +++ b/packages/common-ethereum/src/project/versioned/v1_0_0/types.ts @@ -5,7 +5,7 @@ import {ProjectManifestV1_0_0} from '@subql/common'; import {CustomDatasourceV0_2_0, RuntimeDataSourceV0_2_0} from '../v0_2_0'; import {RuntimeDatasourceTemplate, CustomDatasourceTemplate} from '../v0_2_1'; -export type SubstrateProjectManifestV1_0_0 = ProjectManifestV1_0_0< +export type EthereumProjectManifestV1_0_0 = ProjectManifestV1_0_0< RuntimeDatasourceTemplate | CustomDatasourceTemplate, RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0 >; diff --git a/packages/common/tsconfig.json b/packages/common-ethereum/tsconfig.json similarity index 100% rename from packages/common/tsconfig.json rename to packages/common-ethereum/tsconfig.json diff --git a/packages/common-substrate/CHANGELOG.md b/packages/common-substrate/CHANGELOG.md deleted file mode 100644 index efbeb39e..00000000 --- a/packages/common-substrate/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -All logs must start with the format: [x.y.z] - yyyy-mm-dd - -## [Unreleased] - -## [1.2.0] - 2022-07-27 -### Changed -- Apply latest runner version validation rule, now `dev` and `latest` are not supported. - -## [1.1.1] - 2022-07-05 -### Changed -- Bump with `@subql/common` - -## [1.1.0] - 2022-05-31 -### Changed -- Remove `contract-processors` and types improvements (#1012) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.5.0] - 2022-05-11 -### Added -- Add test for project with ds processor assets (#1000) -- Add method to check templates is Substrate ds (#1001) - -## [0.4.0] - 2022-05-02 -### Added -- Add utils package (#928) - -## [0.3.1] - 2022-04-27 -### Changed -- Add missing vm2 dependency (#919) - -## [0.3.0] - 2022-04-06 -### Added -- Add manifest 1.0.0 (#845) -### Fixed -- Fix validation for genesisHash or chainId with empty string (#883) - -## [0.2.0] - 2022-04-04 -### Changed -- Update to use `vm2`(#869) - -## [0.1.0] - 2022-03-01 -### Added -- init commit - -[Unreleased]: https://github.com/subquery/subql/compare/common-substrate/0.1.0...HEAD diff --git a/packages/common-substrate/LICENSE b/packages/common-substrate/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/packages/common-substrate/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/common-substrate/src/project/load.ts b/packages/common-substrate/src/project/load.ts deleted file mode 100644 index 5fc2254b..00000000 --- a/packages/common-substrate/src/project/load.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {getManifestPath, loadFromJsonOrYaml} from '@subql/common'; -import {plainToClass} from 'class-transformer'; -import {validateSync} from 'class-validator'; -// import {NodeVM, VMScript} from 'vm2'; -import {ChainTypes} from './models'; -import {SubstrateProjectManifestVersioned, VersionedProjectManifest} from './versioned'; - -export function parseSubstrateProjectManifest(raw: unknown): SubstrateProjectManifestVersioned { - const projectManifest = new SubstrateProjectManifestVersioned(raw as VersionedProjectManifest); - projectManifest.validate(); - return projectManifest; -} - -export function loadSubstrateProjectManifest(file: string): SubstrateProjectManifestVersioned { - const doc = loadFromJsonOrYaml(getManifestPath(file)); - const projectManifest = new SubstrateProjectManifestVersioned(doc as VersionedProjectManifest); - projectManifest.validate(); - return projectManifest; -} -export function parseChainTypes(raw: unknown): ChainTypes { - const chainTypes = plainToClass(ChainTypes, raw); - if ( - !!chainTypes.types || - !!chainTypes.typesChain || - !!chainTypes.typesBundle || - !!chainTypes.typesAlias || - !!chainTypes.typesSpec - ) { - const errors = validateSync(chainTypes, {whitelist: true, forbidNonWhitelisted: true}); - if (errors?.length) { - // TODO: print error details - const errorMsgs = errors.map((e) => e.toString()).join('\n'); - throw new Error(`failed to parse chain types.\n${errorMsgs}`); - } - return chainTypes; - } else { - throw new Error(`chainTypes is not valid`); - } -} diff --git a/packages/common-substrate/src/project/models.ts b/packages/common-substrate/src/project/models.ts deleted file mode 100644 index 7fddeb3d..00000000 --- a/packages/common-substrate/src/project/models.ts +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types'; - -import {BaseMapping, FileReference} from '@subql/common'; -import { - CustomDataSourceAsset as SubstrateCustomDataSourceAsset, - SubstrateBlockFilter, - SubstrateBlockHandler, - SubstrateCallFilter, - SubstrateCallHandler, - SubstrateCustomHandler, - SubstrateDatasourceKind, - SubstrateEventFilter, - SubstrateEventHandler, - SubstrateHandlerKind, - SubstrateNetworkFilter, - SubstrateRuntimeDatasource, - SubstrateRuntimeHandler, - SubstrateRuntimeHandlerFilter, - SubstrateCustomDatasource, -} from '@subql/types'; -import {plainToClass, Transform, Type} from 'class-transformer'; -import { - ArrayMaxSize, - IsArray, - IsBoolean, - IsEnum, - IsInt, - IsOptional, - IsString, - IsObject, - ValidateNested, -} from 'class-validator'; - -export class BlockFilter implements SubstrateBlockFilter { - @IsOptional() - @IsArray() - @ArrayMaxSize(2) - specVersion?: [number, number]; - @IsOptional() - @IsInt() - modulo?: number; -} - -export class EventFilter extends BlockFilter implements SubstrateEventFilter { - @IsOptional() - @IsString() - module?: string; - @IsOptional() - @IsString() - method?: string; -} - -export class ChainTypes implements RegisteredTypes { - @IsObject() - @IsOptional() - types?: RegistryTypes; - @IsObject() - @IsOptional() - typesAlias?: Record; - @IsObject() - @IsOptional() - typesBundle?: OverrideBundleType; - @IsObject() - @IsOptional() - typesChain?: Record; - @IsObject() - @IsOptional() - typesSpec?: Record; -} - -export class CallFilter extends EventFilter implements SubstrateCallFilter { - @IsOptional() - @IsBoolean() - success?: boolean; -} - -export class BlockHandler implements SubstrateBlockHandler { - @IsOptional() - @ValidateNested() - @Type(() => BlockFilter) - filter?: SubstrateBlockFilter; - @IsEnum(SubstrateHandlerKind, {groups: [SubstrateHandlerKind.Block]}) - kind: SubstrateHandlerKind.Block; - @IsString() - handler: string; -} - -export class CallHandler implements SubstrateCallHandler { - @IsOptional() - @ValidateNested() - @Type(() => CallFilter) - filter?: SubstrateCallFilter; - @IsEnum(SubstrateHandlerKind, {groups: [SubstrateHandlerKind.Call]}) - kind: SubstrateHandlerKind.Call; - @IsString() - handler: string; -} - -export class EventHandler implements SubstrateEventHandler { - @IsOptional() - @ValidateNested() - @Type(() => EventFilter) - filter?: SubstrateEventFilter; - @IsEnum(SubstrateHandlerKind, {groups: [SubstrateHandlerKind.Event]}) - kind: SubstrateHandlerKind.Event; - @IsString() - handler: string; -} - -export class CustomHandler implements SubstrateCustomHandler { - @IsString() - kind: string; - @IsString() - handler: string; - @IsObject() - @IsOptional() - filter?: Record; -} - -export class RuntimeMapping implements BaseMapping { - @Transform((params) => { - const handlers: SubstrateRuntimeHandler[] = params.value; - return handlers.map((handler) => { - switch (handler.kind) { - case SubstrateHandlerKind.Event: - return plainToClass(EventHandler, handler); - case SubstrateHandlerKind.Call: - return plainToClass(CallHandler, handler); - case SubstrateHandlerKind.Block: - return plainToClass(BlockHandler, handler); - default: - throw new Error(`handler ${(handler as any).kind} not supported`); - } - }); - }) - @IsArray() - @ValidateNested() - handlers: SubstrateRuntimeHandler[]; - @IsString() - file: string; -} - -export class CustomMapping implements BaseMapping, SubstrateCustomHandler> { - @IsArray() - @Type(() => CustomHandler) - @ValidateNested() - handlers: CustomHandler[]; - @IsString() - file: string; -} - -export class SubqlNetworkFilterImpl implements SubstrateNetworkFilter { - @IsString() - @IsOptional() - specName?: string; -} - -export class RuntimeDataSourceBase implements SubstrateRuntimeDatasource { - @IsEnum(SubstrateDatasourceKind, {groups: [SubstrateDatasourceKind.Runtime]}) - kind: SubstrateDatasourceKind.Runtime; - @Type(() => RuntimeMapping) - @ValidateNested() - mapping: RuntimeMapping; - @IsOptional() - @IsInt() - startBlock?: number; - @IsOptional() - @ValidateNested() - @Type(() => SubqlNetworkFilterImpl) - filter?: SubstrateNetworkFilter; -} - -export class FileReferenceImpl implements FileReference { - @IsString() - file: string; -} - -export class CustomDataSourceBase - implements SubstrateCustomDatasource -{ - @IsString() - kind: K; - @Type(() => CustomMapping) - @ValidateNested() - mapping: M; - @IsOptional() - @IsInt() - startBlock?: number; - @Type(() => FileReferenceImpl) - @ValidateNested({each: true}) - assets: Map; - @Type(() => FileReferenceImpl) - @IsObject() - processor: FileReference; - @IsOptional() - @IsObject() - filter?: T; -} diff --git a/packages/common-substrate/src/project/project.spec.ts b/packages/common-substrate/src/project/project.spec.ts deleted file mode 100644 index 04e34f08..00000000 --- a/packages/common-substrate/src/project/project.spec.ts +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {RunnerQueryBaseModel, SemverVersionValidator} from '@subql/common'; -import {validateSync} from 'class-validator'; -import {valid, validRange, prerelease, clean, coerce} from 'semver'; -import {DeploymentV1_0_0, SubstrateRunnerNodeImpl, SubstrateRunnerSpecsImpl} from '../project/versioned/v1_0_0'; -import {loadSubstrateProjectManifest} from './load'; - -const projectsDir = path.join(__dirname, '../../test'); - -describe('project.yaml', () => { - it('can parse project.yaml to ProjectManifestImpl', () => { - expect(loadSubstrateProjectManifest(path.join(projectsDir, 'project.yaml'))).toBeTruthy(); - }); - - it('can validate project.yaml', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_falsy.yaml'))).toThrow(); - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_falsy_array.yaml'))).toThrow(); - }); - - it('can validate a v0.2.0 project.yaml', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_0.2.0.yaml'))).not.toThrow(); - }); - - it('can fail validation if version not supported', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_invalid_version.yaml'))).toThrow(); - }); - - it('can validate a v0.2.0 project.yaml with a custom data source', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_0.2.0_custom_ds.yaml'))).not.toThrow(); - }); - - it('can validate a v0.2.1 project.yaml with templates', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_0.2.1.yaml'))).not.toThrow(); - }); - - it('can validate a v1.0.0 project.yaml with templates', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0.yaml'))).not.toThrow(); - }); - - it('can convert genesis hash in v1.0.0 to chainId in deployment', () => { - const deployment = loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0.yaml')).asV1_0_0.deployment; - expect(deployment.network.chainId).not.toBeNull(); - console.log(deployment.network.chainId); - }); - - it('can get chainId for deployment', () => { - const deployment = loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0_chainId.yaml')).asV1_0_0 - .deployment; - expect(deployment.network.chainId).toBe('moonbeamChainId'); - }); - - it('can validate deployment runner versions', () => { - const deployment = new DeploymentV1_0_0(); - const nodeImp = new SubstrateRunnerNodeImpl(); - const queryImp = new RunnerQueryBaseModel(); - deployment.specVersion = '1.0.0'; - deployment.runner = new SubstrateRunnerSpecsImpl(); - - nodeImp.name = '@subql/node'; - nodeImp.version = '0.29.1'; - deployment.runner.node = nodeImp; - - queryImp.name = '@subql/query'; - queryImp.version = '0.213.1'; - - deployment.runner.query = queryImp; - - validateSync(deployment.runner, {whitelist: true, forbidNonWhitelisted: true}); - }); - - it('can validate a v1.0.0 project.yaml with unsupported runner node', () => { - expect(() => loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0_bad_runner.yaml'))).toThrow(); - }); - - it('can throw error with unsupported runner version', () => { - expect(() => - loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0_bad_runner_version.yaml')) - ).toThrow(); - }); - - it('can validate a v1.0.0 project.yaml runner and datasource mismatches', () => { - expect(() => - loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0_runner_ds_mismatch.yaml')) - ).toThrow(); - }); - - it('can fail validation if custom ds missing processor', () => { - expect(() => - loadSubstrateProjectManifest(path.join(projectsDir, 'project_0.2.0_invalid_custom_ds.yaml')) - ).toThrow(); - }); - - it('can convert project with assets to deployment', () => { - const manifest = loadSubstrateProjectManifest(path.join(projectsDir, 'project_1.0.0.yaml')); - expect(manifest.isV1_0_0).toBeTruthy(); - expect(() => manifest.toDeployment()).not.toThrow(); - }); - - it('validate versions', () => { - const checkVersion = new SemverVersionValidator(); - - // Versions - expect(checkVersion.validate('*')).toBeTruthy(); - expect(checkVersion.validate('0.0.0')).toBeTruthy(); - expect(checkVersion.validate('0.1.0')).toBeTruthy(); - expect(checkVersion.validate('1.2.0')).toBeTruthy(); - expect(checkVersion.validate('^0.0.0')).toBeTruthy(); - expect(checkVersion.validate('>=0.1.0')).toBeTruthy(); - expect(checkVersion.validate('<0.1.1-1')).toBeTruthy(); - expect(checkVersion.validate('>=1.2.0')).toBeTruthy(); - expect(checkVersion.validate('~1.2.0-1')).toBeTruthy(); - expect(checkVersion.validate('>=1.2.0-abc')).toBeTruthy(); - - expect(checkVersion.validate('0.1.1-1')).toBeFalsy(); - expect(checkVersion.validate('1.2.0-1')).toBeFalsy(); - expect(checkVersion.validate('1.2.0-abc')).toBeFalsy(); - expect(checkVersion.validate('~')).toBeFalsy(); - expect(checkVersion.validate('latest')).toBeFalsy(); - expect(checkVersion.validate('dev')).toBeFalsy(); - }); -}); diff --git a/packages/common-substrate/src/project/types.ts b/packages/common-substrate/src/project/types.ts deleted file mode 100644 index 42b28af9..00000000 --- a/packages/common-substrate/src/project/types.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {IProjectManifest, ProjectNetworkConfig} from '@subql/common'; -import {SubstrateDatasource} from '@subql/types'; -import {RuntimeDataSourceV0_0_1} from '../project/versioned/v0_0_1'; - -// All of these used to be redefined in this file, re-exporting for simplicity -export { - SubstrateRuntimeHandler, - SubstrateCustomHandler, - SubstrateHandler, - SubstrateHandlerKind, - SubstrateDatasource as SubstrateDataSource, - SubstrateCustomDatasource as SubstrateCustomDataSource, - SubstrateBlockFilter, - SubstrateCallFilter, - SubstrateEventFilter, - SubstrateDatasourceProcessor, - SubstrateNetworkFilter, - SubstrateRuntimeHandlerFilter, - SubstrateDatasourceKind, - RuntimeHandlerInputMap as SubstrateRuntimeHandlerInputMap, -} from '@subql/types'; - -//make exception for runtime datasource 0.0.1 -export type ISubstrateProjectManifest = IProjectManifest; - -export interface SubstrateProjectNetworkConfig extends ProjectNetworkConfig { - genesisHash?: string; - chainId?: string; -} diff --git a/packages/common-substrate/src/project/utils.ts b/packages/common-substrate/src/project/utils.ts deleted file mode 100644 index dfaf35f5..00000000 --- a/packages/common-substrate/src/project/utils.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {CustomDatasourceTemplate, RuntimeDatasourceTemplate} from '@subql/common-substrate/project/versioned'; -import { - SecondLayerHandlerProcessor, - SubstrateCustomDatasource, - SubstrateDatasource, - SubstrateDatasourceKind, - SubstrateHandlerKind, - SubstrateNetworkFilter, - SubstrateRuntimeDatasource, -} from '@subql/types'; -import {gte} from 'semver'; - -export function isBlockHandlerProcessor( - hp: SecondLayerHandlerProcessor -): hp is SecondLayerHandlerProcessor { - return hp.baseHandlerKind === SubstrateHandlerKind.Block; -} - -export function isEventHandlerProcessor( - hp: SecondLayerHandlerProcessor -): hp is SecondLayerHandlerProcessor { - return hp.baseHandlerKind === SubstrateHandlerKind.Event; -} - -export function isCallHandlerProcessor( - hp: SecondLayerHandlerProcessor -): hp is SecondLayerHandlerProcessor { - return hp.baseHandlerKind === SubstrateHandlerKind.Call; -} - -export function isCustomDs( - ds: SubstrateDatasource -): ds is SubstrateCustomDatasource { - return ds.kind !== SubstrateDatasourceKind.Runtime && !!(ds as SubstrateCustomDatasource).processor; -} - -export function isRuntimeDs(ds: SubstrateDatasource): ds is SubstrateRuntimeDatasource { - return ds.kind === SubstrateDatasourceKind.Runtime; -} - -export function isSubstrateTemplates( - templatesData: any, - specVersion: string -): templatesData is (RuntimeDatasourceTemplate | CustomDatasourceTemplate)[] { - return (isRuntimeDs(templatesData[0]) || isCustomDs(templatesData[0])) && gte(specVersion, '0.2.1'); -} diff --git a/packages/common-substrate/src/project/versioned/ProjectManifestVersioned.ts b/packages/common-substrate/src/project/versioned/ProjectManifestVersioned.ts deleted file mode 100644 index f8422ee7..00000000 --- a/packages/common-substrate/src/project/versioned/ProjectManifestVersioned.ts +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {SubstrateDatasource} from '@subql/types'; -import {plainToClass} from 'class-transformer'; -import {ISubstrateProjectManifest} from '../types'; -import {ProjectManifestV0_0_1Impl, RuntimeDataSourceV0_0_1} from './v0_0_1'; -import {ProjectManifestV0_2_0Impl} from './v0_2_0'; -import {ProjectManifestV0_2_1Impl} from './v0_2_1'; -import {ProjectManifestV0_3_0Impl} from './v0_3_0'; -import {ProjectManifestV1_0_0Impl} from './v1_0_0'; -export type VersionedProjectManifest = {specVersion: string}; - -const SUBSTRATE_SUPPORTED_VERSIONS = { - '0.0.1': ProjectManifestV0_0_1Impl, - '0.2.0': ProjectManifestV0_2_0Impl, - '0.2.1': ProjectManifestV0_2_1Impl, - '0.3.0': ProjectManifestV0_3_0Impl, - '1.0.0': ProjectManifestV1_0_0Impl, -}; - -type Versions = keyof typeof SUBSTRATE_SUPPORTED_VERSIONS; - -type ProjectManifestImpls = InstanceType; - -export function manifestIsV0_0_1(manifest: ISubstrateProjectManifest): manifest is ProjectManifestV0_0_1Impl { - return manifest.specVersion === '0.0.1'; -} - -export function manifestIsV0_2_0(manifest: ISubstrateProjectManifest): manifest is ProjectManifestV0_2_0Impl { - return manifest.specVersion === '0.2.0'; -} - -export function manifestIsV0_2_1(manifest: ISubstrateProjectManifest): manifest is ProjectManifestV0_2_1Impl { - return manifest.specVersion === '0.2.1'; -} - -export function manifestIsV0_3_0(manifest: ISubstrateProjectManifest): manifest is ProjectManifestV0_3_0Impl { - return manifest.specVersion === '0.3.0'; -} - -export function manifestIsV1_0_0(manifest: ISubstrateProjectManifest): manifest is ProjectManifestV1_0_0Impl { - return manifest.specVersion === '1.0.0'; -} - -export class SubstrateProjectManifestVersioned implements ISubstrateProjectManifest { - private _impl: ProjectManifestImpls; - - constructor(projectManifest: VersionedProjectManifest) { - const klass = SUBSTRATE_SUPPORTED_VERSIONS[projectManifest.specVersion as Versions]; - if (!klass) { - throw new Error('specVersion not supported for project manifest file'); - } - this._impl = plainToClass(klass, projectManifest); - } - - get asImpl(): ProjectManifestImpls { - return this._impl; - } - - get isV0_0_1(): boolean { - return this.specVersion === '0.0.1'; - } - - get asV0_0_1(): ProjectManifestV0_0_1Impl { - return this._impl as ProjectManifestV0_0_1Impl; - } - - get isV0_2_0(): boolean { - return this.specVersion === '0.2.0'; - } - - get asV0_2_0(): ProjectManifestV0_2_0Impl { - return this._impl as ProjectManifestV0_2_0Impl; - } - - get isV0_2_1(): boolean { - return this.specVersion === '0.2.1'; - } - - get asV0_2_1(): ProjectManifestV0_2_1Impl { - return this._impl as ProjectManifestV0_2_1Impl; - } - - get isV0_3_0(): boolean { - return this.specVersion === '0.3.0'; - } - - get asV0_3_0(): ProjectManifestV0_3_0Impl { - return this._impl as ProjectManifestV0_3_0Impl; - } - - get isV1_0_0(): boolean { - return this.specVersion === '1.0.0'; - } - - get asV1_0_0(): ProjectManifestV1_0_0Impl { - return this._impl as ProjectManifestV1_0_0Impl; - } - - toDeployment(): string | undefined { - return this._impl.toDeployment(); - } - - validate(): void { - return this._impl.validate(); - } - - get dataSources(): (SubstrateDatasource | RuntimeDataSourceV0_0_1)[] { - return this._impl.dataSources; - } - - get schema(): string { - if (manifestIsV0_0_1(this._impl)) { - return this._impl.schema; - } - - return this._impl.schema.file; - } - - get specVersion(): string { - return this._impl.specVersion; - } - - get description(): string { - return this._impl.description; - } - - get repository(): string { - return this._impl.repository; - } -} diff --git a/packages/common-substrate/src/project/versioned/v0_0_1/model.ts b/packages/common-substrate/src/project/versioned/v0_0_1/model.ts deleted file mode 100644 index d89ba49a..00000000 --- a/packages/common-substrate/src/project/versioned/v0_0_1/model.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ProjectManifestBaseImpl} from '@subql/common'; -import { - SubstrateDatasourceKind, - SubstrateHandlerKind, - SubstrateNetworkFilter, - SubstrateRuntimeHandler, -} from '@subql/types'; -import {plainToClass, Transform, Type} from 'class-transformer'; -import { - Equals, - IsArray, - IsEnum, - IsInt, - IsObject, - IsOptional, - IsString, - ValidateNested, - validateSync, -} from 'class-validator'; -import {ChainTypes, SubqlNetworkFilterImpl, EventHandler, CallHandler, BlockHandler} from '../../models'; -import {SubstrateProjectNetworkConfig} from '../../types'; -import {ManifestV0_0_1Mapping, ProjectManifestV0_0_1, RuntimeDataSourceV0_0_1} from './types'; - -export class ProjectNetworkV0_0_1 extends ChainTypes implements SubstrateProjectNetworkConfig { - @IsString() - endpoint: string; - @IsString() - @IsOptional() - dictionary?: string; -} - -export class RuntimeMappingV0_0_1 implements ManifestV0_0_1Mapping { - @Transform((params) => { - const handlers: SubstrateRuntimeHandler[] = params.value; - return handlers.map((handler) => { - switch (handler.kind) { - case SubstrateHandlerKind.Event: - return plainToClass(EventHandler, handler); - case SubstrateHandlerKind.Call: - return plainToClass(CallHandler, handler); - case SubstrateHandlerKind.Block: - return plainToClass(BlockHandler, handler); - default: - throw new Error(`handler ${(handler as any).kind} not supported`); - } - }); - }) - @IsArray() - @ValidateNested() - handlers: SubstrateRuntimeHandler[]; -} - -export class RuntimeDataSourceV0_0_1Impl implements RuntimeDataSourceV0_0_1 { - @IsString() - name: string; - @IsEnum(SubstrateDatasourceKind, {groups: [SubstrateDatasourceKind.Runtime]}) - kind: SubstrateDatasourceKind.Runtime; - @Type(() => RuntimeMappingV0_0_1) - @ValidateNested() - mapping: RuntimeMappingV0_0_1; - @IsOptional() - @IsInt() - startBlock?: number; - @IsOptional() - @ValidateNested() - @Type(() => SubqlNetworkFilterImpl) - filter?: SubstrateNetworkFilter; -} - -export class ProjectManifestV0_0_1Impl extends ProjectManifestBaseImpl implements ProjectManifestV0_0_1 { - @Equals('0.0.1') - specVersion: string; - @ValidateNested() - @Type(() => ProjectNetworkV0_0_1) - @IsObject() - network: ProjectNetworkV0_0_1; - @IsString() - schema: string; - @IsArray() - @ValidateNested() - @Type(() => RuntimeDataSourceV0_0_1Impl) - dataSources: RuntimeDataSourceV0_0_1[]; - - get deployment(): null { - throw new Error('Manifest spec 0.0.1 is not support for deployment, please migrate to 0.2.0 or above'); - } - - validate(): void { - const errors = validateSync(this, {whitelist: true, forbidNonWhitelisted: true}); - if (errors?.length) { - // TODO: print error details - const errorMsgs = errors.map((e) => e.toString()).join('\n'); - throw new Error(`failed to parse project.yaml.\n${errorMsgs}`); - } - } -} diff --git a/packages/common-substrate/src/project/versioned/v0_0_1/types.ts b/packages/common-substrate/src/project/versioned/v0_0_1/types.ts deleted file mode 100644 index 01c50782..00000000 --- a/packages/common-substrate/src/project/versioned/v0_0_1/types.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {RegisteredTypes} from '@polkadot/types/types'; -import {BaseMapping, IProjectManifest} from '@subql/common'; -import { - SubstrateRuntimeDatasource, - SubstrateNetworkFilter, - SubstrateRuntimeHandlerFilter, - SubstrateRuntimeHandler, - SubstrateDatasourceKind, -} from '@subql/types'; -import {SubstrateProjectNetworkConfig} from '../../types'; - -export type ProjectNetworkConfigV0_0_1 = SubstrateProjectNetworkConfig & RegisteredTypes; - -// export interface RuntimeDataSourceV0_0_1 extends SubstrateRuntimeDataSource { -// name: string; -// filter?: SubstrateNetworkFilter; -// } - -export type ManifestV0_0_1Mapping = Omit, 'file'>; - -export interface RuntimeDataSourceV0_0_1 extends Omit { - name: string; - filter?: SubstrateNetworkFilter; - kind: SubstrateDatasourceKind.Runtime; - mapping: ManifestV0_0_1Mapping; -} - -export interface ProjectManifestV0_0_1 extends IProjectManifest { - schema: string; - network: ProjectNetworkConfigV0_0_1; -} diff --git a/packages/common-substrate/src/project/versioned/v0_2_0/model.ts b/packages/common-substrate/src/project/versioned/v0_2_0/model.ts deleted file mode 100644 index 73e987a9..00000000 --- a/packages/common-substrate/src/project/versioned/v0_2_0/model.ts +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BaseMapping, ProjectManifestBaseImpl} from '@subql/common'; -import {SubstrateCustomDatasource, SubstrateNetworkFilter} from '@subql/types'; -import {plainToClass, Transform, TransformFnParams, Type} from 'class-transformer'; -import { - Equals, - IsArray, - IsNotEmpty, - IsObject, - IsOptional, - IsString, - ValidateNested, - validateSync, -} from 'class-validator'; -import {CustomDataSourceBase, RuntimeDataSourceBase} from '../../models'; -import {CustomDatasourceV0_2_0, SubstrateProjectManifestV0_2_0, RuntimeDataSourceV0_2_0} from './types'; - -export class FileType { - @IsString() - file: string; -} - -export class ProjectNetworkDeploymentV0_2_0 { - @IsString() - @IsNotEmpty() - @Transform(({value}: TransformFnParams) => value.trim()) - genesisHash: string; - @ValidateNested() - @Type(() => FileType) - @IsOptional() - chaintypes?: FileType; -} - -export class ProjectNetworkV0_2_0 extends ProjectNetworkDeploymentV0_2_0 { - @IsString() - @IsOptional() - endpoint?: string; - @IsString() - @IsOptional() - dictionary?: string; -} - -function validateObject(object: any, errorMessage = 'failed to validate object.'): void { - const errors = validateSync(object, {whitelist: true, forbidNonWhitelisted: true}); - if (errors?.length) { - // TODO: print error details - const errorMsgs = errors.map((e) => e.toString()).join('\n'); - throw new Error(`${errorMessage}\n${errorMsgs}`); - } -} - -export class SubstrateRuntimeDataSourceV0_2_0Impl extends RuntimeDataSourceBase implements RuntimeDataSourceV0_2_0 { - validate(): void { - return validateObject(this, 'failed to validate runtime datasource.'); - } -} - -export class SubstrateCustomDataSourceV0_2_0Impl< - K extends string = string, - T extends SubstrateNetworkFilter = SubstrateNetworkFilter, - M extends BaseMapping = BaseMapping, any> - > - extends CustomDataSourceBase - implements SubstrateCustomDatasource -{ - validate(): void { - return validateObject(this, 'failed to validate custom datasource.'); - } -} - -export class DeploymentV0_2_0 { - @Equals('0.2.0') - @IsString() - specVersion: string; - @ValidateNested() - @Type(() => FileType) - schema: FileType; - @IsArray() - @ValidateNested() - @Type(() => SubstrateCustomDataSourceV0_2_0Impl, { - discriminator: { - property: 'kind', - subTypes: [{value: SubstrateRuntimeDataSourceV0_2_0Impl, name: 'substrate/Runtime'}], - }, - keepDiscriminatorProperty: true, - }) - dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; - @ValidateNested() - @Type(() => ProjectNetworkDeploymentV0_2_0) - network: ProjectNetworkDeploymentV0_2_0; -} - -export class ProjectManifestV0_2_0Impl - extends ProjectManifestBaseImpl - implements SubstrateProjectManifestV0_2_0 -{ - @Equals('0.2.0') - specVersion: string; - @IsString() - name: string; - @IsString() - version: string; - @IsObject() - @ValidateNested() - @Type(() => ProjectNetworkV0_2_0) - network: ProjectNetworkV0_2_0; - @ValidateNested() - @Type(() => FileType) - schema: FileType; - @IsArray() - @ValidateNested() - @Type(() => SubstrateCustomDataSourceV0_2_0Impl, { - discriminator: { - property: 'kind', - subTypes: [{value: SubstrateRuntimeDataSourceV0_2_0Impl, name: 'substrate/Runtime'}], - }, - keepDiscriminatorProperty: true, - }) - dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; - protected _deployment: D; - - get deployment(): D { - if (!this._deployment) { - this._deployment = plainToClass(DeploymentV0_2_0, this) as unknown as D; - validateSync(this._deployment, {whitelist: true}); - } - return this._deployment; - } -} diff --git a/packages/common-substrate/src/project/versioned/v0_2_0/types.ts b/packages/common-substrate/src/project/versioned/v0_2_0/types.ts deleted file mode 100644 index 5ec0d6a4..00000000 --- a/packages/common-substrate/src/project/versioned/v0_2_0/types.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ProjectManifestV0_2_0} from '@subql/common'; -import { - SubstrateCustomDatasource, - SubstrateDatasource, - SubstrateDatasourceKind, - SubstrateRuntimeDatasource, -} from '@subql/types'; - -// export interface SubstrateMappingV0_2_0 extends BaseMapping { -// file: string; -// } - -export type RuntimeDataSourceV0_2_0 = SubstrateRuntimeDatasource; -export type CustomDatasourceV0_2_0 = SubstrateCustomDatasource; - -export type SubstrateProjectManifestV0_2_0 = ProjectManifestV0_2_0; - -export function isDatasourceV0_2_0( - dataSource: SubstrateDatasource -): dataSource is RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0 { - return !!(dataSource as RuntimeDataSourceV0_2_0).mapping.file; -} - -export function isRuntimeDataSourceV0_2_0(dataSource: SubstrateDatasource): dataSource is RuntimeDataSourceV0_2_0 { - return dataSource.kind === SubstrateDatasourceKind.Runtime && isDatasourceV0_2_0(dataSource); -} diff --git a/packages/common-substrate/src/project/versioned/v0_2_1/index.ts b/packages/common-substrate/src/project/versioned/v0_2_1/index.ts deleted file mode 100644 index a193755c..00000000 --- a/packages/common-substrate/src/project/versioned/v0_2_1/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './model'; -export * from './types'; diff --git a/packages/common-substrate/src/project/versioned/v0_2_1/model.ts b/packages/common-substrate/src/project/versioned/v0_2_1/model.ts deleted file mode 100644 index aedbbc2d..00000000 --- a/packages/common-substrate/src/project/versioned/v0_2_1/model.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {plainToClass, Type} from 'class-transformer'; -import {Equals, IsArray, IsOptional, IsString, ValidateNested, validateSync} from 'class-validator'; -import { - SubstrateCustomDataSourceV0_2_0Impl, - DeploymentV0_2_0, - ProjectManifestV0_2_0Impl, - SubstrateRuntimeDataSourceV0_2_0Impl, -} from '../v0_2_0'; -import {CustomDatasourceTemplate, SubstrateProjectManifestV0_2_1, RuntimeDatasourceTemplate} from './types'; - -export class RuntimeDatasourceTemplateImpl - extends SubstrateRuntimeDataSourceV0_2_0Impl - implements RuntimeDatasourceTemplate -{ - @IsString() - name: string; -} - -export class CustomDatasourceTemplateImpl - extends SubstrateCustomDataSourceV0_2_0Impl - implements CustomDatasourceTemplate -{ - @IsString() - name: string; -} - -export class DeploymentV0_2_1 extends DeploymentV0_2_0 { - @Equals('0.2.1') - @IsString() - specVersion: string; - - @IsOptional() - @IsArray() - @ValidateNested() - @Type(() => CustomDatasourceTemplateImpl, { - discriminator: { - property: 'kind', - subTypes: [{value: RuntimeDatasourceTemplateImpl, name: 'substrate/Runtime'}], - }, - keepDiscriminatorProperty: true, - }) - templates?: (RuntimeDatasourceTemplate | CustomDatasourceTemplate)[]; -} - -export class ProjectManifestV0_2_1Impl - extends ProjectManifestV0_2_0Impl - implements SubstrateProjectManifestV0_2_1 -{ - @IsOptional() - @IsArray() - @ValidateNested() - @Type(() => CustomDatasourceTemplateImpl, { - discriminator: { - property: 'kind', - subTypes: [{value: RuntimeDatasourceTemplateImpl, name: 'substrate/Runtime'}], - }, - keepDiscriminatorProperty: true, - }) - templates?: (RuntimeDatasourceTemplate | CustomDatasourceTemplate)[]; - protected _deployment: DeploymentV0_2_1; - - get deployment(): DeploymentV0_2_1 { - if (!this._deployment) { - this._deployment = plainToClass(DeploymentV0_2_1, this); - validateSync(this._deployment, {whitelist: true}); - } - return this._deployment; - } -} diff --git a/packages/common-substrate/src/project/versioned/v0_3_0/model.ts b/packages/common-substrate/src/project/versioned/v0_3_0/model.ts deleted file mode 100644 index a2ec5087..00000000 --- a/packages/common-substrate/src/project/versioned/v0_3_0/model.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {plainToClass, Type} from 'class-transformer'; -import {Equals, IsArray, IsObject, IsString, ValidateNested, validateSync} from 'class-validator'; -import { - FileType, - ProjectNetworkV0_2_0, - ProjectNetworkDeploymentV0_2_0, - CustomDatasourceV0_2_0, - RuntimeDataSourceV0_2_0, - ProjectManifestV0_2_0Impl, - SubstrateCustomDataSourceV0_2_0Impl, - SubstrateRuntimeDataSourceV0_2_0Impl, -} from '../v0_2_0'; -import {SubstrateProjectManifestV0_3_0} from './types'; - -export class DeploymentV0_3_0 { - @Equals('0.3.0') - @IsString() - specVersion: string; - @ValidateNested() - @Type(() => FileType) - schema: FileType; - @IsArray() - @ValidateNested() - @Type(() => SubstrateCustomDataSourceV0_2_0Impl, { - discriminator: { - property: 'kind', - subTypes: [{value: SubstrateRuntimeDataSourceV0_2_0Impl, name: 'substrate/Runtime'}], - }, - keepDiscriminatorProperty: true, - }) - dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; - @ValidateNested() - @Type(() => ProjectNetworkDeploymentV0_2_0) - network: ProjectNetworkDeploymentV0_2_0; -} - -export class ProjectManifestV0_3_0Impl - extends ProjectManifestV0_2_0Impl - implements SubstrateProjectManifestV0_3_0 -{ - @Equals('0.3.0') - specVersion: string; - @IsString() - name: string; - @IsString() - version: string; - @IsObject() - @ValidateNested() - @Type(() => ProjectNetworkV0_2_0) - network: ProjectNetworkV0_2_0; - @ValidateNested() - @Type(() => FileType) - schema: FileType; - @IsArray() - @ValidateNested() - @Type(() => SubstrateCustomDataSourceV0_2_0Impl, { - discriminator: { - property: 'kind', - subTypes: [{value: SubstrateRuntimeDataSourceV0_2_0Impl, name: 'substrate/Runtime'}], - }, - keepDiscriminatorProperty: true, - }) - dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; - protected _deployment: DeploymentV0_3_0; - - get deployment(): DeploymentV0_3_0 { - if (!this._deployment) { - this._deployment = plainToClass(DeploymentV0_3_0, this); - validateSync(this._deployment, {whitelist: true}); - } - return this._deployment; - } -} diff --git a/packages/common-substrate/src/project/versioned/v0_3_0/types.ts b/packages/common-substrate/src/project/versioned/v0_3_0/types.ts deleted file mode 100644 index 77a1ca40..00000000 --- a/packages/common-substrate/src/project/versioned/v0_3_0/types.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { - // ISubqlProjectManifest as ISubstrateProjectManifest, - SubstrateDatasource, - SubstrateDatasourceKind, -} from '@subql/types'; -import {ISubstrateProjectManifest} from '../../types'; -import {RuntimeDataSourceV0_2_0, CustomDatasourceV0_2_0} from '../v0_2_0/types'; - -export interface SubstrateProjectManifestV0_3_0 extends ISubstrateProjectManifest { - name: string; - version: string; - schema: { - file: string; - }; - - network: { - genesisHash: string; - endpoint?: string; - dictionary?: string; - chaintypes?: { - file: string; - }; - }; - - dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[]; -} - -export function isRuntimeDataSourceV0_3_0(dataSource: SubstrateDatasource): dataSource is RuntimeDataSourceV0_2_0 { - return dataSource.kind === SubstrateDatasourceKind.Runtime && !!dataSource.mapping.file; -} diff --git a/packages/common-substrate/src/project/versioned/v1_0_0/index.ts b/packages/common-substrate/src/project/versioned/v1_0_0/index.ts deleted file mode 100644 index a193755c..00000000 --- a/packages/common-substrate/src/project/versioned/v1_0_0/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './model'; -export * from './types'; diff --git a/packages/common-substrate/test/project.yaml b/packages/common-substrate/test/project.yaml deleted file mode 100644 index b59427a2..00000000 --- a/packages/common-substrate/test/project.yaml +++ /dev/null @@ -1,48 +0,0 @@ -specVersion: '0.0.1' -description: '' -repository: 'https://github.com/OnFinality-io/subql-examples' - -schema: './schema.graphql' - -network: - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - types: {'TestType': 'u32'} - typesAlias: {Alias: {TestType2: 'test'}} - typesBundle: - { - spec: {'2312': {types: [{minmax: [232, 122], types: {TestType3: 'test3'}}]}}, - chain: {mockchain: {types: [{minmax: [232, 122], types: {TestType4: 'test4'}}]}}, - } - typesChain: {chain2: {TestType5: 'test'}} - typesSpec: {spec3: {TestType6: 'test'}} - -dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - filter: - specVersion: [23, 24] - - handler: handleBlock - kind: substrate/BlockHandler - filter: - specVersion: [100] - - handler: handleEvent - kind: substrate/CallHandler - filter: - module: balance - method: xxx - success: true - specVersion: [null, 23] - - handler: handleEvent - kind: substrate/EventHandler - filter: - module: balance - method: xxx -# - name: contract -# kind: substrate/Ink! -# - name: contract2 -# kind: substrate/EVM diff --git a/packages/common-substrate/test/project_0.2.0.yaml b/packages/common-substrate/test/project_0.2.0.yaml deleted file mode 100644 index 21825825..00000000 --- a/packages/common-substrate/test/project_0.2.0.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# project.yaml -specVersion: '0.2.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' -name: Test -version: '0.0.0' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - dictionary: 'https://api.subquery.network/sq/subquery/dictionary-polkadot' - chaintypes: - file: ./types.json - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/common-substrate/test/project_0.2.0_custom_ds.yaml b/packages/common-substrate/test/project_0.2.0_custom_ds.yaml deleted file mode 100644 index 26ef3a95..00000000 --- a/packages/common-substrate/test/project_0.2.0_custom_ds.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# project.yaml -specVersion: '0.2.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' -name: Test -version: '0.0.0' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - chaintypes: - file: ./types.json - -dataSources: - - kind: substrate/Jsonfy - startBlock: 1 - processor: - file: '@subql/contract-processors/jsonfy.js' - assets: - test: - file: './abi.json' - mapping: - file: dist/index.js - handlers: - - handler: handleEvent - kind: substrate/JsonfyEvent diff --git a/packages/common-substrate/test/project_0.2.0_invalid_custom_ds.yaml b/packages/common-substrate/test/project_0.2.0_invalid_custom_ds.yaml deleted file mode 100644 index 77b5ef70..00000000 --- a/packages/common-substrate/test/project_0.2.0_invalid_custom_ds.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# project.yaml -specVersion: '0.2.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' -name: Test -version: '0.0.0' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - chaintypes: - file: ./types.json - -dataSources: - - kind: substrate/Jsonfy - startBlock: 1 - # processor: - # file: '@subql/contract-processors/jsonfy.js' - mapping: - file: dist/index.js - handlers: - - handler: handleEvent - kind: substrate/JsonfyEvent diff --git a/packages/common-substrate/test/project_0.2.1.yaml b/packages/common-substrate/test/project_0.2.1.yaml deleted file mode 100644 index 1118bd39..00000000 --- a/packages/common-substrate/test/project_0.2.1.yaml +++ /dev/null @@ -1,84 +0,0 @@ -specVersion: 0.2.1 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -schema: - file: ./schema.graphql -network: - # genesisHash: '0x956876d5b80e47e523a6629b3c3ac3e42f2850ad12e236d87a0aaac87c9f6bc9' # Moonriver - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: substrate/Moonbeam - startBlock: 1358833 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: settings - address: '0xde030fC2b42AE2438B32506ECf63B2f3c1665579' - assets: - settings: - file: ./src/settings.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleUpdateSettings - kind: substrate/MoonbeamCall - filter: - function: setAllAddresses(address _sqToken,address _staking,address _indexerRegistry,address _queryRegistry) # add ",address _serviceAgreementRegistry" in later versions - -templates: - - name: QueryRegistry - kind: substrate/Moonbeam - startBlock: 1358829 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: queryRegistry - # address: '0xB0b3f6bc7a8E0bCb2aa1Cd2Ae2dE56fbdA3c0651' - assets: - queryRegistry: - file: ./src/queryRegistry.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleNewQuery - kind: substrate/MoonbeamEvent - filter: - topics: - - CreateQuery(uint256 queryId, address creator, bytes32 metadata, bytes32 deploymentId, bytes32 version) - - handler: handleUpdateQueryMetadata - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryMetadata(address owner, uint256 queryId, bytes32 metadata) - - handler: handleUpdateQueryDeployment - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryDeployment(address owner, uint256 queryId, bytes32 deploymentId, bytes32 version) - - handler: handleStartIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StartIndexing(address indexer, bytes32 deploymentId) - - handler: handleIndexingUpdate - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateDeploymentStatus(address indexer, bytes32 deploymentId, uint256 blockheight, bytes32 mmrRoot, uint256 timestamp) - - handler: handleIndexingReady - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateIndexingStatusToReady(address indexer, bytes32 deploymentId, uint256 _timestamp) - - handler: handleStopIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StopIndexing(address indexer, bytes32 deploymentId) diff --git a/packages/common-substrate/test/project_1.0.0.yaml b/packages/common-substrate/test/project_1.0.0.yaml deleted file mode 100644 index de38ae4b..00000000 --- a/packages/common-substrate/test/project_1.0.0.yaml +++ /dev/null @@ -1,91 +0,0 @@ -specVersion: 1.0.0 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/node' - version: '0.28.0' - query: - name: '@subql/query' - version: '^0.12.0' -schema: - file: ./schema.graphql -network: - # genesisHash: '0x956876d5b80e47e523a6629b3c3ac3e42f2850ad12e236d87a0aaac87c9f6bc9' # Moonriver - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: substrate/Moonbeam - startBlock: 1358833 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: settings - address: '0xde030fC2b42AE2438B32506ECf63B2f3c1665579' - assets: - settings: - file: ./src/settings.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleUpdateSettings - kind: substrate/MoonbeamCall - filter: - function: setAllAddresses(address _sqToken,address _staking,address _indexerRegistry,address _queryRegistry) # add ",address _serviceAgreementRegistry" in later versions - -templates: - - name: QueryRegistry - kind: substrate/Moonbeam - startBlock: 1358829 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: queryRegistry - # address: '0xB0b3f6bc7a8E0bCb2aa1Cd2Ae2dE56fbdA3c0651' - assets: - queryRegistry: - file: ./src/queryRegistry.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleNewQuery - kind: substrate/MoonbeamEvent - filter: - topics: - - CreateQuery(uint256 queryId, address creator, bytes32 metadata, bytes32 deploymentId, bytes32 version) - - handler: handleUpdateQueryMetadata - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryMetadata(address owner, uint256 queryId, bytes32 metadata) - - handler: handleUpdateQueryDeployment - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryDeployment(address owner, uint256 queryId, bytes32 deploymentId, bytes32 version) - - handler: handleStartIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StartIndexing(address indexer, bytes32 deploymentId) - - handler: handleIndexingUpdate - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateDeploymentStatus(address indexer, bytes32 deploymentId, uint256 blockheight, bytes32 mmrRoot, uint256 timestamp) - - handler: handleIndexingReady - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateIndexingStatusToReady(address indexer, bytes32 deploymentId, uint256 _timestamp) - - handler: handleStopIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StopIndexing(address indexer, bytes32 deploymentId) diff --git a/packages/common-substrate/test/project_1.0.0_bad_runner.yaml b/packages/common-substrate/test/project_1.0.0_bad_runner.yaml deleted file mode 100644 index 60419b77..00000000 --- a/packages/common-substrate/test/project_1.0.0_bad_runner.yaml +++ /dev/null @@ -1,91 +0,0 @@ -specVersion: 1.0.0 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/terra-node' - version: ^0.30.0 - query: - name: '@subql/query' - version: ^0.12.0 -schema: - file: ./schema.graphql -network: - # genesisHash: '0x956876d5b80e47e523a6629b3c3ac3e42f2850ad12e236d87a0aaac87c9f6bc9' # Moonriver - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: substrate/Moonbeam - startBlock: 1358833 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: settings - address: '0xde030fC2b42AE2438B32506ECf63B2f3c1665579' - assets: - settings: - file: ./src/settings.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleUpdateSettings - kind: substrate/MoonbeamCall - filter: - function: setAllAddresses(address _sqToken,address _staking,address _indexerRegistry,address _queryRegistry) # add ",address _serviceAgreementRegistry" in later versions - -templates: - - name: QueryRegistry - kind: substrate/Moonbeam - startBlock: 1358829 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: queryRegistry - # address: '0xB0b3f6bc7a8E0bCb2aa1Cd2Ae2dE56fbdA3c0651' - assets: - queryRegistry: - file: ./src/queryRegistry.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleNewQuery - kind: substrate/MoonbeamEvent - filter: - topics: - - CreateQuery(uint256 queryId, address creator, bytes32 metadata, bytes32 deploymentId, bytes32 version) - - handler: handleUpdateQueryMetadata - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryMetadata(address owner, uint256 queryId, bytes32 metadata) - - handler: handleUpdateQueryDeployment - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryDeployment(address owner, uint256 queryId, bytes32 deploymentId, bytes32 version) - - handler: handleStartIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StartIndexing(address indexer, bytes32 deploymentId) - - handler: handleIndexingUpdate - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateDeploymentStatus(address indexer, bytes32 deploymentId, uint256 blockheight, bytes32 mmrRoot, uint256 timestamp) - - handler: handleIndexingReady - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateIndexingStatusToReady(address indexer, bytes32 deploymentId, uint256 _timestamp) - - handler: handleStopIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StopIndexing(address indexer, bytes32 deploymentId) diff --git a/packages/common-substrate/test/project_1.0.0_bad_runner_version.yaml b/packages/common-substrate/test/project_1.0.0_bad_runner_version.yaml deleted file mode 100644 index c30a062f..00000000 --- a/packages/common-substrate/test/project_1.0.0_bad_runner_version.yaml +++ /dev/null @@ -1,91 +0,0 @@ -specVersion: 1.0.0 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/node' - version: 'dev' #should not support - query: - name: '@subql/query' - version: 'latest' #should not support -schema: - file: ./schema.graphql -network: - # genesisHash: '0x956876d5b80e47e523a6629b3c3ac3e42f2850ad12e236d87a0aaac87c9f6bc9' # Moonriver - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: substrate/Moonbeam - startBlock: 1358833 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: settings - address: '0xde030fC2b42AE2438B32506ECf63B2f3c1665579' - assets: - settings: - file: ./src/settings.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleUpdateSettings - kind: substrate/MoonbeamCall - filter: - function: setAllAddresses(address _sqToken,address _staking,address _indexerRegistry,address _queryRegistry) # add ",address _serviceAgreementRegistry" in later versions - -templates: - - name: QueryRegistry - kind: substrate/Moonbeam - startBlock: 1358829 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: queryRegistry - # address: '0xB0b3f6bc7a8E0bCb2aa1Cd2Ae2dE56fbdA3c0651' - assets: - queryRegistry: - file: ./src/queryRegistry.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleNewQuery - kind: substrate/MoonbeamEvent - filter: - topics: - - CreateQuery(uint256 queryId, address creator, bytes32 metadata, bytes32 deploymentId, bytes32 version) - - handler: handleUpdateQueryMetadata - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryMetadata(address owner, uint256 queryId, bytes32 metadata) - - handler: handleUpdateQueryDeployment - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryDeployment(address owner, uint256 queryId, bytes32 deploymentId, bytes32 version) - - handler: handleStartIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StartIndexing(address indexer, bytes32 deploymentId) - - handler: handleIndexingUpdate - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateDeploymentStatus(address indexer, bytes32 deploymentId, uint256 blockheight, bytes32 mmrRoot, uint256 timestamp) - - handler: handleIndexingReady - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateIndexingStatusToReady(address indexer, bytes32 deploymentId, uint256 _timestamp) - - handler: handleStopIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StopIndexing(address indexer, bytes32 deploymentId) diff --git a/packages/common-substrate/test/project_1.0.0_chainId.yaml b/packages/common-substrate/test/project_1.0.0_chainId.yaml deleted file mode 100644 index 51a18061..00000000 --- a/packages/common-substrate/test/project_1.0.0_chainId.yaml +++ /dev/null @@ -1,91 +0,0 @@ -specVersion: 1.0.0 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/node' - version: 0.28.0 - query: - name: '@subql/query' - version: ^0.12.0 -schema: - file: ./schema.graphql -network: - chainId: 'moonbeamChainId' - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: substrate/Moonbeam - startBlock: 1358833 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: settings - address: '0xde030fC2b42AE2438B32506ECf63B2f3c1665579' - assets: - settings: - file: ./src/settings.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleUpdateSettings - kind: substrate/MoonbeamCall - filter: - function: setAllAddresses(address _sqToken,address _staking,address _indexerRegistry,address _queryRegistry) # add ",address _serviceAgreementRegistry" in later versions - -templates: - - name: QueryRegistry - kind: substrate/Moonbeam - startBlock: 1358829 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: queryRegistry - # address: '0xB0b3f6bc7a8E0bCb2aa1Cd2Ae2dE56fbdA3c0651' - assets: - queryRegistry: - file: ./src/queryRegistry.abi.json - mapping: - file: ./dist/index.js - handlers: - - handler: handleNewQuery - kind: substrate/MoonbeamEvent - filter: - topics: - - CreateQuery(uint256 queryId, address creator, bytes32 metadata, bytes32 deploymentId, bytes32 version) - - handler: handleUpdateQueryMetadata - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryMetadata(address owner, uint256 queryId, bytes32 metadata) - - handler: handleUpdateQueryDeployment - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryDeployment(address owner, uint256 queryId, bytes32 deploymentId, bytes32 version) - - handler: handleStartIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StartIndexing(address indexer, bytes32 deploymentId) - - handler: handleIndexingUpdate - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateDeploymentStatus(address indexer, bytes32 deploymentId, uint256 blockheight, bytes32 mmrRoot, uint256 timestamp) - - handler: handleIndexingReady - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateIndexingStatusToReady(address indexer, bytes32 deploymentId, uint256 _timestamp) - - handler: handleStopIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StopIndexing(address indexer, bytes32 deploymentId) diff --git a/packages/common-substrate/test/project_1.0.0_runner_ds_mismatch.yaml b/packages/common-substrate/test/project_1.0.0_runner_ds_mismatch.yaml deleted file mode 100644 index 51a1b5ff..00000000 --- a/packages/common-substrate/test/project_1.0.0_runner_ds_mismatch.yaml +++ /dev/null @@ -1,34 +0,0 @@ -specVersion: 1.0.0 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/node' - version: ^0.30.0 - query: - name: '@subql/query' - version: ^0.12.0 -schema: - file: ./schema.graphql -network: - # genesisHash: '0x956876d5b80e47e523a6629b3c3ac3e42f2850ad12e236d87a0aaac87c9f6bc9' # Moonriver - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: terra/Runtime - startBlock: 6694554 - mapping: - file: './dist/index.js' - handlers: - - handler: handleBlock - kind: terra/BlockHandler - - handler: handleEvent - kind: terra/EventHandler - filter: - type: transfer diff --git a/packages/common-substrate/test/project_falsy.yaml b/packages/common-substrate/test/project_falsy.yaml deleted file mode 100644 index 53bb18e7..00000000 --- a/packages/common-substrate/test/project_falsy.yaml +++ /dev/null @@ -1,20 +0,0 @@ -specVersion: '0.0.1' -description: '' -repository: 'https://github.com/OnFinality-io/subql-examples' - -schema: './schema.graphql' - -#network: -# endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - -dataSources: - - name: main - kind: substrate/SmartContract - mapping: - handlers: - - handler: handleBlock - kind: substrate/XXXHandler - filter: - module: xxx - - name: handleEvent - kind: substrate/CallHandler diff --git a/packages/common-substrate/test/project_falsy_array.yaml b/packages/common-substrate/test/project_falsy_array.yaml deleted file mode 100644 index 282019df..00000000 --- a/packages/common-substrate/test/project_falsy_array.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- specVersion: '0.0.1' - description: '' - repository: 'https://github.com/OnFinality-io/subql-examples' - - schema: './schema.graphql' - - #network: - # endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - filter: - specVersion: [23, 24] - -- specVersion: '0.0.2' - description: '' - repository: 'https://github.com/OnFinality-io/subql-examples' - - schema: './schema.graphql' - - #network: - # endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - filter: - specVersion: [23, 24] diff --git a/packages/common-substrate/test/project_invalid_version.yaml b/packages/common-substrate/test/project_invalid_version.yaml deleted file mode 100644 index 26d43402..00000000 --- a/packages/common-substrate/test/project_invalid_version.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# project.yaml -specVersion: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - chaintypes: - file: ./types.json - -dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/common-substrate/tsconfig.json b/packages/common-substrate/tsconfig.json deleted file mode 100644 index fede5593..00000000 --- a/packages/common-substrate/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "tsBuildInfoFile": "dist/.tsbuildinfo", - "outDir": "dist", - "noImplicitAny": true - }, - "references": [{"path": "../types"}, {"path": "../common"}], - "include": ["src/**/*"] -} diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md deleted file mode 100644 index f7f9d80c..00000000 --- a/packages/common/CHANGELOG.md +++ /dev/null @@ -1,212 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -All logs must start with the format: [x.y.z] - yyyy-mm-dd - -## [Unreleased] - -## [1.4.0] - 2022-08-17 -### Changed -- Support new templates mono-repo structure. (#1236) - -## [1.3.0] - 2022-08-11 -### Added -- Add Algorand to constants (#1228) - -## [1.2.2] - 2022-07-27 -### Fixed -- `latest`, `dev` and `~` are no longer supported runner versions. - -## [1.2.1] - 2022-07-05 -### Fixed -- Tidy up dependency, move `ipfs-http-client` to common packages (#1160) - -## [1.2.0] - 2022-06-22 -### Added -- Add method to distinguish network family from project with spec above 1.0.0 (#1115) - -## [1.1.0] - 2022-05-31 -### Fixed -- Fix runner error check with pre-release (#1027) -### Added -- Add constants for Mmr query api (#968) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.23.0] - 2022-05-11 -### Fixed -- Fix toDeployment with ds processor assets (#1000) -### Added -- Add method to get path for manifest and schema, in order improve cli codegen (#1001) - -## [0.22.0] - 2022-05-02 -### Added -- Add utils package (#928) - -## [0.21.2] - 2021-04-27 -### Fixed -- Fix deps (#919) - -## [0.21.1] - 2021-04-26 -### Fixed -- Fix Terra dictionary queries type (#893) - -## [0.21.0] - 2021-04-06 -### Add -- Add types for manifest 1.0.0 (#845) - -## [0.20.0] - 2021-04-04 -### Changed -- Update to use `vm2` v3.9.9 (#870) - -## [0.19.0] - 2021-03-01 -### Changed -- Moved substrate components to `@subql/common-substrate` - -## [0.18.0] - 2021-02-24 -### Fixed -- Fix function call from calling itself (#808) -### Changed -- Update readers to support reader project from its manifest file (#800) - -## [0.17.0] - 2021-02-09 -### Added -- Add manifest v0.2.1 to support dynamic data source -### Changed -- Move readers from validator to common and use them for loading projects in the node (#511) -### Fixed -- Add missing interfaces to common classes (#782) - -## [0.16.0] - 2021-01-13 -### Added -- Add rowCountEstimate to Metadata (#736) -- Add method `findAvailablePort` (#739) - -## [0.15.0] - 2021-12-16 -### Added -- Support provide `filePath` and `rotate` option with logger. (#667) -- Add support for loading chaintypes from js (#698) -### Fixed -- Fixed load js file in sandbox (#717) - -## [0.14.1] - 2021-11-30 -### Fixed -- Remove auto generated enum types for codegen (#680) -- Remove auto generated enum types in entities and relations (#682) - -## [0.14.0] - 2021-11-19 -### Added -- Add TypeClass, supported types mapping , support float type(#532) -- Refactor dictionary gql queries (#613) -- Process enum in entities (#551) -### Changed -- Moved isCustomDs and isRuntimeDs to here (#610) -- Remove descriptive field in deployment (#637) - -## [0.13.0] - 2021-11-03 -### Added -- Add `abi` to to project CustomDataSourceBase (#547) -- Add `address` and rule to project CustomDataSourceBase, improve Moonbeam EVM (#593); -- Move `abi` and `address` under `processor.options` (#598) -### Changed -- Bump dependencies (#584) -### Fixed -- Allow dictionary in ProjectManifest v0.2.0 (#578) - -## [0.12.0] - 2021-10-26 -### Changed -- Move project manifest types to @subql/types because it is now also required by subquery project. (#512) - -## [0.11.0] - 2021-10-12 -### Added -- Support for new project manifest spec v0.2.0. Which has many improvements including, no longer requiring the package.json file, multiple code entry points, referencing files via other protocols such as IPFS (#495) - -## [0.10.1] - 2021-08-27 -### Fixed -- Deprecated warnings and remove unused dependency (#448) - -## [0.10.0] - 2021-08-20 -### Added -- Add Bytes type (#432) - -## [0.9.2] - 2021-07-29 -### Fixed -- Fix types in entities, also add validation for schema input types. (#406) - -## [0.9.1] - 2021-07-26 -### Fixed -- Fixed bug that prevented indexes from being added automatically on foreign keys (#371) - -## [0.9.0] - 2021-06-25 -### Added -- Add metadata type for query and additional rule of dictionary for project validation(#342) -### Changed -- Update dependencies (#358) - -## [0.8.3] - 2021-05-04 -### Added -- Indexing is automatically added into JSON field types in database to speed up query performance. Users should not add the `@index` annotation to any `@jsonField` as it will be automatically managed during the codegen process. We implement GIN indexes for JSON fields in our database (#291) - -## [0.8.2] - 2021-04-21 -### Added -- Enforce index on foreign key field (#285) - -## [0.8.0] - 2021-04-20 -### Fixed -- We now support injecting a custom logger into your project that can accept different logging levels (#248) - - Read more about it in our [updated documentation](https://doc.subquery.network/create/introduction.html#logging) - -### Added -- Support network filter for dataSources (#247) -- Support @index in schema.graphql (#271) -- Support json type in schema.graphql (#275) - -## [0.7.0] - 2021-03-11 -### Added -- support type Boolean in graphql schema (#216) -- refactor to build relationship of entities from grahql schema (#212) -- refactor logger to @subql/common (#220) - -## [0.6.1] - 2021-02-15 -### Changed -- bump dependencies (#148) - -## [0.6.0] - 2021-01-27 -### Fixed -- pin class-transfermer to 0.3.1 (#116) - -## [0.5.0] - 2021-01-25 -### Added -- support specVersion filter and success filter (#106) -- support other custom types option that @polkadot/api has (#107) - -## [0.4.0] - 2021-01-12 -### Changed -- [BREAKING] project manifest spec updated to support custom types (#65) - -## [0.3.0] - 2021-01-06 -### Added -- support callHandler and eventHandler (#47) - -## [0.2.0] - 2020-12-22 -### Added -- init commit - -[Unreleased]: https://github.com/subquery/subql/compare/common/0.17.0...HEAD -[0.17.0]: https://github.com/subquery/subql/compare/common/0.16.0...common/0.17.0 -[0.16.0]: https://github.com/subquery/subql/compare/common/0.15.0...common/0.16.0 -[0.15.0]: https://github.com/subquery/subql/compare/common/0.14.1...common/0.15.0 -[0.14.1]: https://github.com/subquery/subql/compare/common/0.14.0...common/0.14.1 -[0.14.0]: https://github.com/subquery/subql/compare/common/0.13.0...common/0.14.0 -[0.13.0]: https://github.com/subquery/subql/compare/common/0.12.0...common/0.13.0 -[0.8.2]: https://github.com/subquery/subql/compare/v0.8.0...v0.8.2 -[0.8.0]: https://github.com/subquery/subql/compare/v0.7.0...v0.8.0 -[0.7.0]: https://github.com/subquery/subql/compare/v0.6.1...v0.7.0 -[0.6.1]: https://github.com/OnFinality-io/subql/compare/v0.6.0...v0.6.1 -[0.5.0]: https://github.com/OnFinality-io/subql/compare/v0.4.0...v0.5.0 -[0.4.0]: https://github.com/OnFinality-io/subql/compare/v0.3.0...v0.4.0 -[0.3.0]: https://github.com/OnFinality-io/subql/compare/v0.2.0...v0.3.0 diff --git a/packages/common/LICENSE b/packages/common/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/packages/common/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/common/fixtures/package.json b/packages/common/fixtures/package.json deleted file mode 100644 index 60b16ae1..00000000 --- a/packages/common/fixtures/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "subquery-starter", - "version": "0.0.3", - "description": "This project can be use as a starting point for developing your SubQuery project", - "main": "dist/index.js", - "scripts": { - "build": "tsc -b", - "prepack": "rm -rf dist && npm build", - "test": "jest", - "codegen": "./node_modules/.bin/subql codegen" - }, - - "homepage": "https://github.com/subquery/subql-starter", - "repository": "github:subquery/subql-starter", - "files": [ - "dist", - "schema.graphql", - "project.yaml" - ], - "author": "Ian He & Jay Ji", - "license": "Apache-2.0", - "devDependencies": { - "@polkadot/api": "^3", - "@subql/types": "^0.6.0", - "typescript": "^4.1.3", - "@subql/cli": "^0.7.3" - } -} diff --git a/packages/common/fixtures/project.yaml b/packages/common/fixtures/project.yaml deleted file mode 100644 index 23332df7..00000000 --- a/packages/common/fixtures/project.yaml +++ /dev/null @@ -1,24 +0,0 @@ -specVersion: "0.0.1" -description: "" -repository: "https://github.com/subquery/subql-starter" - -schema: "./schema.graphql" - -network: - endpoint: "wss://polkadot.api.onfinality.io/public-ws" - -dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/common/package.json b/packages/common/package.json deleted file mode 100644 index a412c171..00000000 --- a/packages/common/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@subql/common", - "version": "1.4.0", - "description": "", - "scripts": { - "build": "rm -rf dist && tsc -b", - "test": "echo \"Error: no test specified\" && exit 1", - "format": "prettier --write \"src/**/*.ts\"" - }, - "homepage": "https://github.com/subquery/subql", - "repository": "github:subquery/subql", - "author": "Ian He", - "main": "dist/index.js", - "license": "Apache-2.0", - "dependencies": { - "axios": "^0.27.2", - "class-transformer": "0.5.1", - "class-validator": "^0.13.2", - "fs-extra": "^10.1.0", - "ipfs-http-client": "^52.0.3", - "js-yaml": "^4.1.0", - "reflect-metadata": "^0.1.13", - "semver": "^7.3.5" - }, - "devDependencies": { - "@types/bn.js": "4.11.6", - "@types/detect-port": "^1", - "@types/fs-extra": "^9.0.13", - "@types/js-yaml": "^4.0.5", - "@types/pino": "^6.3.12", - "@types/semver": "^7.3.9", - "@types/tar": "^6.1.1" - } -} diff --git a/packages/common/src/constants.ts b/packages/common/src/constants.ts deleted file mode 100644 index 205491e1..00000000 --- a/packages/common/src/constants.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -//IPFS -export const IPFS_DEV = 'https://interipfs.thechaindata.com'; -export const IPFS_PROD = 'https://ipfs.subquery.network'; -export const IPFS_NODE_ENDPOINT = `${IPFS_PROD}/ipfs/api/v0`; -export const IPFS_CLUSTER_ENDPOINT = `${IPFS_PROD}/cluster/add`; -export const IPFS_REGEX = /^ipfs:\/\//i; - -// MANIFEST -export const RUNNER_REGEX = /(\^?)(\d|x|\*)+\.(\d|x|\*)+\.(\d|x|\*)+/; - -//MMR -export const DEFAULT_WORD_SIZE = 32; -export const DEFAULT_LEAF = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex'); -export const MMR_AWAIT_TIME = 2; - -// NETWORK -export enum NETWORK_FAMILY { - substrate = 'Substrate', - avalanche = 'Avalanche', - terra = 'Terra', - cosmos = 'Cosmos', - algorand = 'Algorand', -} - -export const runnerMapping = { - '@subql/node': NETWORK_FAMILY.substrate, - '@subql/node-substrate': NETWORK_FAMILY.substrate, - '@subql/node-avalanche': NETWORK_FAMILY.avalanche, - '@subql/node-terra': NETWORK_FAMILY.terra, - '@subql/node-cosmos': NETWORK_FAMILY.cosmos, - '@subql/node-algorand': NETWORK_FAMILY.algorand, -}; diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts deleted file mode 100644 index b1b554d4..00000000 --- a/packages/common/src/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import 'reflect-metadata'; - -export * from './project'; -export * from './constants'; diff --git a/packages/common/src/project/index.ts b/packages/common/src/project/index.ts deleted file mode 100644 index 233af7f6..00000000 --- a/packages/common/src/project/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './load'; -export * from './types'; -export * from './versioned'; -export * from './readers'; -export * from './utils'; diff --git a/packages/common/src/project/load.ts b/packages/common/src/project/load.ts deleted file mode 100644 index a58d857c..00000000 --- a/packages/common/src/project/load.ts +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import yaml from 'js-yaml'; -import {gte} from 'semver'; -import {NETWORK_FAMILY, runnerMapping} from '../constants'; -import {ProjectManifestV0_2_0} from '../project/versioned'; -export function loadFromJsonOrYaml(file: string): unknown { - const {ext} = path.parse(file); - if (ext !== '.yaml' && ext !== '.yml' && ext !== '.json') { - throw new Error(`Extension ${ext} not supported`); - } - const rawContent = fs.readFileSync(file, 'utf-8'); - return yaml.load(rawContent); -} - -export function getManifestPath(file: string): string { - let manifestPath = file; - if (fs.existsSync(file) && fs.lstatSync(file).isDirectory()) { - const yamlFilePath = path.join(file, 'project.yaml'); - const jsonFilePath = path.join(file, 'project.json'); - if (fs.existsSync(yamlFilePath)) { - manifestPath = yamlFilePath; - } else if (fs.existsSync(jsonFilePath)) { - manifestPath = jsonFilePath; - } else { - throw new Error(`Could not find project manifest under dir ${file}`); - } - } - return manifestPath; -} - -export function getSchemaPath(file: string) { - const yamlFile = loadFromJsonOrYaml(getManifestPath(file)); - if ((yamlFile as any).specVersion === '0.0.1') { - return path.join(file, (yamlFile as any).schema); - } - return path.join(file, (yamlFile as ProjectManifestV0_2_0).schema.file); -} - -// Only work for manifest specVersion >= 1.0.0 -export function getProjectNetwork(rawManifest: unknown): NETWORK_FAMILY { - if (gte((rawManifest as any).specVersion, '1.0.0')) { - const network = runnerMapping[(rawManifest as any).runner.node.name as keyof typeof runnerMapping]; - if (network === undefined) { - throw new Error(`Can not identify project network with runner node ${(rawManifest as any).runner.node.name}`); - } - return network; - } else { - throw new Error('Can not identify project network under spec version 1.0.0'); - } -} diff --git a/packages/common/src/project/readers/github-reader.spec.ts b/packages/common/src/project/readers/github-reader.spec.ts deleted file mode 100644 index fffa0579..00000000 --- a/packages/common/src/project/readers/github-reader.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {GithubReader} from './github-reader'; -import {Reader} from './reader'; - -describe('GithubReader', () => { - let reader: Reader; - - beforeAll(() => { - const key = 'subquery/tutorials-block-timestamp'; - reader = new GithubReader(key); - }); - - it('should return the package json object', async () => { - const data = await reader.getPkg(); - expect(data.name).toBe('block-timestamp'); - }); - - it('should return the project schema object', async () => { - const data: any = await reader.getProjectSchema(); - expect(data.repository).toBe('https://github.com/subquery/subql-examples'); - }); -}); diff --git a/packages/common/src/project/readers/github-reader.ts b/packages/common/src/project/readers/github-reader.ts deleted file mode 100644 index b401033b..00000000 --- a/packages/common/src/project/readers/github-reader.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import axios, {AxiosInstance} from 'axios'; -import yaml from 'js-yaml'; -import {IPackageJson} from 'package-json-type'; -import {Reader} from './reader'; - -export class GithubReader implements Reader { - private readonly api: AxiosInstance; - private defaultBranch: string; - - constructor(private readonly key: string) { - this.api = axios.create({ - baseURL: `https://raw.githubusercontent.com/${key}`, - }); - } - - get root(): undefined { - return undefined; - } - - async getPkg(): Promise { - return this.getFile('package.json') as Promise as Promise; - } - - async getProjectSchema(): Promise { - const projectYaml = await this.getFile('project.yaml'); - if (projectYaml === undefined) { - throw new Error('Fetch project from github got undefined'); - } - return yaml.load(projectYaml); - } - - async getFile(fileName: string): Promise { - try { - const branch = await this.getDefaultBranch(); - const {data} = await this.api.get(path.join(branch, fileName)); - - return data; - } catch (err) { - return undefined; - } - } - - private async getDefaultBranch(): Promise { - if (this.defaultBranch) { - return this.defaultBranch; - } - const {data} = await axios.get(`https://api.github.com/repos/${this.key}`); - this.defaultBranch = data.default_branch; - return this.defaultBranch; - } -} diff --git a/packages/common/src/project/readers/index.ts b/packages/common/src/project/readers/index.ts deleted file mode 100644 index b428a75e..00000000 --- a/packages/common/src/project/readers/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './reader'; -export * from './github-reader'; -export * from './ipfs-reader'; -export * from './local-reader'; diff --git a/packages/common/src/project/readers/ipfs-reader.spec.ts b/packages/common/src/project/readers/ipfs-reader.spec.ts deleted file mode 100644 index c058c15c..00000000 --- a/packages/common/src/project/readers/ipfs-reader.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {IPFSReader} from './ipfs-reader'; -import {Reader} from './reader'; - -const IPFSGateway = 'https://interipfs.thechaindata.com/ipfs/api/v0'; - -describe('IPFSReader', () => { - let reader: Reader; - - it('should return a project deployment', async () => { - reader = new IPFSReader('Qmdwxos2aDv8KebrLcs2Y9uANJ5SFawagDwKgiogRrrUjM', IPFSGateway); - - const data: any = await reader.getProjectSchema(); - - expect(data.network.genesisHash).toBe('0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'); - }); -}); diff --git a/packages/common/src/project/readers/ipfs-reader.ts b/packages/common/src/project/readers/ipfs-reader.ts deleted file mode 100644 index 9cadc8a2..00000000 --- a/packages/common/src/project/readers/ipfs-reader.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {u8aConcat} from '@polkadot/util'; -import IPFS from 'ipfs-http-client'; -import yaml from 'js-yaml'; -import {IPackageJson} from 'package-json-type'; -import {IPFS_NODE_ENDPOINT} from '../../constants'; -import {Reader} from './reader'; - -const CIDv0 = new RegExp(/Qm[1-9A-Za-z]{44}[^OIl]/i); -const CIDv1 = new RegExp( - /Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,}/i -); - -export class IPFSReader implements Reader { - private ipfs: IPFS.IPFSHTTPClient; - - constructor(private readonly cid: string, gateway?: string) { - if (!CIDv0.test(cid) && !CIDv1.test(cid)) { - throw new Error('IPFS project path CID is not valid'); - } - this.ipfs = IPFS.create({url: gateway ?? IPFS_NODE_ENDPOINT}); - } - - get root(): undefined { - return undefined; - } - - async getPkg(): Promise { - return Promise.resolve(undefined); - } - - async getProjectSchema(): Promise { - const projectYaml = await this.getFile(this.cid); - if (projectYaml === undefined) { - throw new Error(`Fetch project from ipfs ${this.cid} got undefined`); - } - return yaml.load(projectYaml); - } - - async getFile(fileName: string): Promise { - try { - const resolvedFileName = fileName.replace('ipfs://', ''); - const req = this.ipfs.cat(resolvedFileName); - const scriptBufferArray: Uint8Array[] = []; - for await (const res of req) { - scriptBufferArray.push(res); - } - return Buffer.from(u8aConcat(...scriptBufferArray)).toString('utf8'); - } catch (e) { - console.error(`Reader get file failed`, e); - return undefined; - } - } -} diff --git a/packages/common/src/project/readers/local-reader.spec.ts b/packages/common/src/project/readers/local-reader.spec.ts deleted file mode 100644 index 453f7a99..00000000 --- a/packages/common/src/project/readers/local-reader.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as path from 'path'; -import {LocalReader} from './local-reader'; -import {Reader} from './reader'; - -describe('LocalReader', () => { - let reader: Reader; - - beforeAll(() => { - const loc = path.join(__dirname, '../../../fixtures'); - reader = new LocalReader(loc, path.resolve(loc, './project.yaml')); - }); - - it('should return the package json object', async () => { - const data = await reader.getPkg(); - expect(data.name).toBe('subquery-starter'); - }); - - it('should return the project schema object', async () => { - const data: any = await reader.getProjectSchema(); - expect(data.repository).toBe('https://github.com/subquery/subql-starter'); - }); -}); diff --git a/packages/common/src/project/readers/local-reader.ts b/packages/common/src/project/readers/local-reader.ts deleted file mode 100644 index 95a66959..00000000 --- a/packages/common/src/project/readers/local-reader.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as fs from 'fs'; -import * as path from 'path'; -import yaml from 'js-yaml'; -import {IPackageJson} from 'package-json-type'; -import {Reader} from './reader'; - -export class LocalReader implements Reader { - constructor(private readonly projectPath: string, private readonly manifestPath: string) {} - - get root(): string { - return path.resolve(this.projectPath); - } - - async getPkg(): Promise { - return yaml.load(await this.getFile('package.json')) as IPackageJson; - } - - async getProjectSchema(): Promise { - if (!fs.existsSync(this.manifestPath)) { - return Promise.resolve(undefined); - } - return yaml.load(fs.readFileSync(this.manifestPath, 'utf-8')); - } - - async getFile(fileName: string): Promise { - const file = path.resolve(this.projectPath, fileName); - if (!fs.existsSync(file)) { - return Promise.resolve(undefined); - } - try { - return fs.readFileSync(file, 'utf-8'); - } catch (e) { - return undefined; - } - } -} diff --git a/packages/common/src/project/readers/reader.spec.ts b/packages/common/src/project/readers/reader.spec.ts deleted file mode 100644 index f7035f63..00000000 --- a/packages/common/src/project/readers/reader.spec.ts +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {GithubReader} from './github-reader'; -import {IPFSReader} from './ipfs-reader'; -import {LocalReader} from './local-reader'; -import {ReaderFactory} from './reader'; - -const tarPath = path.join(__dirname, '/../../../test/mockedSubqueryProject.tgz'); - -describe('ReaderFactory', () => { - it('should return the Github Reader', async () => { - const url = 'https://github.com/subquery/subql-starter'; - const reader = await ReaderFactory.create(url); - expect(reader instanceof GithubReader).toBeTruthy(); - }); - - it('should return the Local Reader', async () => { - const loc = path.join(__dirname, '../../../fixtures'); - const reader = await ReaderFactory.create(loc); - expect(reader instanceof LocalReader).toBeTruthy(); - }); - - it('should return the IPFS Reader for a CID v0', async () => { - const loc = 'ipfs://QmYyCCSaHLpPvZmex5ExHGdW7mavKYeiixVEyvNGwD1LLw'; - const reader = await ReaderFactory.create(loc, {}); - - expect(reader instanceof IPFSReader).toBeTruthy(); - }); - - it('should return the IPFS Reader for a CID v1', async () => { - const loc = 'ipfs://bafybeie56fq7db5adfyt3afqwhje6pq2m77gn5ik6pg75bioger6kzjn6a'; - const reader = await ReaderFactory.create(loc, {}); - expect(reader instanceof IPFSReader).toBeTruthy(); - }); - - it.skip('should support archive files', async () => { - const reader = await ReaderFactory.create(tarPath); - const finalPath = reader.root; - expect(fs.existsSync(finalPath)).toBeTruthy(); - }); - - it('throw error if getProjectRootAndManifest path not exist', async () => { - await expect(() => ReaderFactory.create('path/not/exist')).rejects.toThrow(/unknown location/); - }); - - it('throw error if ipfs path is not valid', async () => { - await expect(() => ReaderFactory.create('ipfs://notValid', {})).rejects.toThrow( - /IPFS project path CID is not valid/ - ); - }); -}); diff --git a/packages/common/src/project/readers/reader.ts b/packages/common/src/project/readers/reader.ts deleted file mode 100644 index fa7bb206..00000000 --- a/packages/common/src/project/readers/reader.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import {IPackageJson} from 'package-json-type'; -import {IPFS_REGEX} from '../../constants'; -import {getProjectRootAndManifest} from '../../project'; -import {GithubReader} from './github-reader'; -import {IPFSReader} from './ipfs-reader'; -import {LocalReader} from './local-reader'; - -export type ReaderOptions = { - ipfs?: string; -}; - -export interface Reader { - getProjectSchema(): Promise; - getPkg(): Promise; - getFile(file: string): Promise; - root: string | undefined; -} - -export class ReaderFactory { - // eslint-disable-next-line @typescript-eslint/require-await - static async create(location: string, options?: ReaderOptions): Promise { - // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec - const githubMatch = location.match(/https:\/\/github.com\/([\w-_]+\/[\w-_]+)/i); - if (githubMatch) { - return new GithubReader(githubMatch[1]); - } - - const ipfsMatch = location.match(IPFS_REGEX); - if (ipfsMatch) { - return new IPFSReader(location.replace('ipfs://', ''), options.ipfs); - } - - //local mode - if (fs.existsSync(location)) { - const project = getProjectRootAndManifest(location); - return new LocalReader(project.root, project.manifest); - } - - throw new Error(`unknown location: ${location}`); - } -} diff --git a/packages/common/src/project/types.ts b/packages/common/src/project/types.ts deleted file mode 100644 index 5dd38c03..00000000 --- a/packages/common/src/project/types.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export interface IProjectManifest { - specVersion: string; - description: string; - repository: string; - dataSources: D[]; - toDeployment(): string; - validate(): void; -} - -export interface ProjectNetworkConfig { - endpoint: string; - dictionary?: string; - //genesisHash?: string; -} - -export interface FileReference { - file: string; -} diff --git a/packages/common/src/project/utils.ts b/packages/common/src/project/utils.ts deleted file mode 100644 index 5111d2e1..00000000 --- a/packages/common/src/project/utils.ts +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import os from 'os'; -import path from 'path'; -import {ValidationArguments, ValidatorConstraint, ValidatorConstraintInterface} from 'class-validator'; -import detectPort from 'detect-port'; -import {prerelease, satisfies, valid, validRange} from 'semver'; - -export async function makeTempDir(): Promise { - const sep = path.sep; - const tmpDir = os.tmpdir(); - const tempPath = await fs.promises.mkdtemp(`${tmpDir}${sep}`); - return tempPath; -} - -export async function findAvailablePort(startPort: number, range = 10): Promise { - for (let port = startPort; port <= startPort + range; port++) { - try { - const _port = await detectPort(port); - if (_port === port) { - return port; - } - } catch (e) { - return null; - } - } - - return null; -} - -export interface ProjectRootAndManifest { - root: string; - manifest: string; -} - -// --subquery -f pass in can be project.yaml or project.path, -// use this to determine its project root and manifest -export function getProjectRootAndManifest(subquery: string): ProjectRootAndManifest { - const project = {} as ProjectRootAndManifest; - const stats = fs.statSync(subquery); - if (stats.isDirectory()) { - project.root = subquery; - project.manifest = path.resolve(subquery, 'project.yaml'); - } else if (stats.isFile()) { - const {dir} = path.parse(subquery); - project.root = dir; - project.manifest = subquery; - } - project.root = path.resolve(project.root); - return project; -} - -export function validateSemver(current: string, required: string): boolean { - return satisfies(current, required, {includePrerelease: true}); -} - -@ValidatorConstraint({name: 'semver', async: false}) -export class SemverVersionValidator implements ValidatorConstraintInterface { - validate(value: string | null | undefined): boolean { - if (valid(value, {includePrerelease: false}) === null) { - return validRange(value, {includePrerelease: false}) !== null; - } else { - return prerelease(value) === null; - } - } - defaultMessage(args: ValidationArguments): string { - return `'${args.value}' is not a valid version. Please provide a valid semver`; - } -} - -export async function delay(sec: number): Promise { - return new Promise((resolve) => { - setTimeout(resolve, sec * 1000); - }); -} diff --git a/packages/common/src/project/versioned/base.ts b/packages/common/src/project/versioned/base.ts deleted file mode 100644 index 1b209b38..00000000 --- a/packages/common/src/project/versioned/base.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {classToPlain} from 'class-transformer'; -import {Allow, IsString, validateSync} from 'class-validator'; -import yaml from 'js-yaml'; - -export abstract class ProjectManifestBaseImpl { - @Allow() - definitions: object; - @IsString() - description: string; - @IsString() - repository: string; - @IsString() - specVersion: string; - - abstract readonly deployment: D; - - toDeployment(): string { - // classToPlain fixes Map type with assets fields - return yaml.dump(classToPlain(this.deployment), { - sortKeys: true, - condenseFlow: true, - }); - } - - validate(): void { - const errors = validateSync(this.deployment, {whitelist: true, forbidNonWhitelisted: true}); - if (errors?.length) { - // TODO: print error details - const errorMsgs = errors.map((e) => e.toString()).join('\n'); - throw new Error(`failed to parse project.yaml.\n${errorMsgs}`); - } - } -} - -export interface BaseDataSource< - F = Record, - H extends BaseHandler = BaseHandler, - T extends BaseMapping = BaseMapping -> { - name?: string; - kind: string; - startBlock?: number; - mapping: T; -} - -export interface BaseMapping> { - file: string; - handlers: T[]; -} - -export interface BaseHandler { - handler: string; - kind: string; - filter?: T; -} diff --git a/packages/common/src/project/versioned/index.ts b/packages/common/src/project/versioned/index.ts deleted file mode 100644 index 3b5342d0..00000000 --- a/packages/common/src/project/versioned/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './base'; -export * from './v0_2_0'; -export * from './v0_2_1'; -export * from './v1_0_0'; diff --git a/packages/common/src/project/versioned/v0_2_0/types.ts b/packages/common/src/project/versioned/v0_2_0/types.ts deleted file mode 100644 index e84b134d..00000000 --- a/packages/common/src/project/versioned/v0_2_0/types.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BaseDataSource} from '../base'; - -export interface ProjectManifestV0_2_0 { - name: string; - version: string; - schema: { - file: string; - }; - network: { - genesisHash: string; - endpoint?: string; - dictionary?: string; - chaintypes?: { - file: string; - }; - }; - dataSources: D[]; - specVersion?: string; - repository?: string; - description?: string; -} diff --git a/packages/common/src/project/versioned/v0_2_1/types.ts b/packages/common/src/project/versioned/v0_2_1/types.ts deleted file mode 100644 index 55a23564..00000000 --- a/packages/common/src/project/versioned/v0_2_1/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BaseDataSource} from '../base'; -import {ProjectManifestV0_2_0} from '../v0_2_0'; - -export interface TemplateBase { - name: string; -} - -export interface ProjectManifestV0_2_1> - extends ProjectManifestV0_2_0 { - dataSources: D[]; - templates?: T[]; -} diff --git a/packages/common/src/project/versioned/v1_0_0/index.ts b/packages/common/src/project/versioned/v1_0_0/index.ts deleted file mode 100644 index 64e307e0..00000000 --- a/packages/common/src/project/versioned/v1_0_0/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './types'; -export * from './models'; diff --git a/packages/common/src/project/versioned/v1_0_0/models.ts b/packages/common/src/project/versioned/v1_0_0/models.ts deleted file mode 100644 index 8a9937e5..00000000 --- a/packages/common/src/project/versioned/v1_0_0/models.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Equals, IsString, Validate} from 'class-validator'; -import {SemverVersionValidator} from '../../utils'; -import {QuerySpec} from './types'; - -export class RunnerQueryBaseModel implements QuerySpec { - @Equals('@subql/query') - name: string; - @IsString() - @Validate(SemverVersionValidator) - // @Matches(RUNNER_REGEX) - version: string; -} diff --git a/packages/common/src/project/versioned/v1_0_0/types.ts b/packages/common/src/project/versioned/v1_0_0/types.ts deleted file mode 100644 index 1ba3957e..00000000 --- a/packages/common/src/project/versioned/v1_0_0/types.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BaseDataSource} from '../base'; -import {ProjectManifestV0_2_1, TemplateBase} from '../v0_2_1'; - -export interface RunnerSpecs { - node: NodeSpec; - query: QuerySpec; -} - -export interface NodeSpec { - name: string; - version: string; -} - -export interface QuerySpec { - name: string; - version: string; -} - -export interface ProjectManifestV1_0_0 - extends Omit, 'network'> { - dataSources: D[]; - runner: RunnerSpecs; - templates?: T[]; - network: { - chainId: string; - endpoint?: string; - dictionary?: string; - chaintypes?: { - file: string; - }; - }; -} diff --git a/packages/common/test/mockedSubqueryProject.tgz b/packages/common/test/mockedSubqueryProject.tgz deleted file mode 100644 index 529b925cf929ac3af457d2450caf43242fc33ebe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2041 zcmV&Ss~lQ|z10j%V`wZpC=}Xq{ILMERq9 zf-2Pi{-2D*?`us@zW0r(oXP2PU3ug8^kb3`nPN^)AAiVyK5MuACQMcyv&m1%UoHOq z_=BU4`5%9?SI$=N`i$Ss|Jm`$^ltvoP9EOp|9crfBDW7Jwbci6I?!E)r@3t_e{jT$ zH@b1gR=hsTrr9*i7TV>FseN4W8{^2e%h#=L_Ovr)Nv10F_oS+Vgc^v{?~T(Z?T? zcR8g?A;Uheo##!j_!m<@3A>dkH8cArY+}-mU|biw*}Ac>bndgg+Lp}bJ7J?*zp)Lo z4^oyU*Oe2?KD~O>+3n`Bt~Io&a-#TbG)E>&nyK zwv=PGb()l8KxZOTt*N#K;J>mB0s3@lYo5gR=JwzYO_TH65)$JQL@QHiN4t&5H&iIE zNMw3TsaZ94D^&(eoNtszz0rPWo9iPfLmRsz;{%2Bz*&4{lq83T&$)Vl0L6?y4-e7c zLILda;jAF%ql>3W(yjCoV3q=smV2^Q&<*z5no5aS~AVipR)BuOdWUkkUC65DReA(8;qzFco}t z%GqI#k0|X9evhi9G!hU+?Sh6acbFJ-6*AF-vV4tO5t%}BW2==}-|}!xE_L)GBt_<3 z{M@1}L!R)-6a96L_ppo?%E3Qv#eQW4Vbh^Wdt)Do|AK~{2ifgiD0g{NbbZb~dn4XM z&>`yRktonMdSvDpkeuq5sxm7y1qqBe2*AbAT8pC|D8>MA+hz*)J{-k3+8xE{1u|9M z(YFYPvP2woP~wIhpkl4|q`YTGBh$UT1r{vA!hunMDa^=S+K5oVNETpY9YH_HG9F0 z;&-2HyszDSGKptrwpmX~4Wx^&Pm@FLDAVqUPqS!%%MiM>YO6e8G@GOgXo9CJhXQjK z{KX66_I|5Em^sYk%nsQ-a8a-x14Rs#V5jczK+AT4_bCaN796DoAy~mHX|^STz~|aqjuu=W$g7t2MrTQklSiCYYhCHCl!qK) zw92ux=5i3>Drh!D9BQofw;-2|N>U_`Q2v5zg|rc!A)vr+RE?mc+>REV=WXS2opl0^ zQAB+kd{AW^Fd2^dVzg~fd8wR}PDPGig!S(OP*w&T%5E0{a&lpXBYQhWT zU27nT=hRA55>G3wD&TdPPpd+*IDmr6bM0J@ZhHWTE(<5QO1RpVb{|q>RQIEYxP=Uj zNzMGZqd-q2p~3hi#ABfDyo2=temdRU;BtM${TzJ3E>&WA!DyTzO!8P-BpQ%-EAIKi z$(eLevK1l05((sUg_1wU!Em<;2+qfKAEZ+9VeHAztLhYdU{uy5Q=5#R4rrGQu89eUsV^)Iek#&YM0iS&pH-6JDGo;Ui^9+|Aph0Tv zWYp;%BuRiEP-b`j%Y-$w4$@|0b?2CCQ|DRt_>>uoEnLR0xMpiNNAsFWRhbjN4oWY3 zjbbvtE&CHBwl`ZXYa+zo_(^e2Gnt9SY#!U-uCR39%s; - - abstract get api(): any; /*ApiWrapper*/ -} diff --git a/packages/node-core/src/configure/NodeConfig.spec.ts b/packages/node-core/src/configure/NodeConfig.spec.ts deleted file mode 100644 index 28afbfba..00000000 --- a/packages/node-core/src/configure/NodeConfig.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as path from 'path'; -import {NodeConfig} from './NodeConfig'; - -describe('NodeConfig', () => { - it('supports read from yaml', () => { - const config = NodeConfig.fromFile(path.join(__dirname, '../../test/config.yml')); - expect(config).toBeInstanceOf(NodeConfig); - expect(config).toMatchObject({ - subquery: '../../../../subql-example/extrinsics', - subqueryName: 'extrinsics', - }); - }); - - it('support read from json', () => { - const config = NodeConfig.fromFile(path.join(__dirname, '../../test/config.json')); - expect(config).toBeInstanceOf(NodeConfig); - expect(config).toMatchObject({ - subquery: '../../../../subql-example/extrinsics', - subqueryName: 'extrinsics', - }); - }); - - it('throw error for unknown configs', () => { - expect(() => NodeConfig.fromFile(path.join(__dirname, '../../test/config.toml'))).toThrow(); - expect(() => NodeConfig.fromFile(path.join(__dirname, '../../test/con.toml'))).toThrow(/Load config from file/); - }); -}); diff --git a/packages/node-core/src/configure/NodeConfig.ts b/packages/node-core/src/configure/NodeConfig.ts deleted file mode 100644 index b5545886..00000000 --- a/packages/node-core/src/configure/NodeConfig.ts +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import assert from 'assert'; -import fs from 'fs'; -import path from 'path'; -import {loadFromJsonOrYaml} from '@subql/common'; -import {last} from 'lodash'; -import {LevelWithSilent} from 'pino'; -import {getLogger} from '../logger'; -import {assign} from '../utils/object'; - -const logger = getLogger('configure'); - -export interface IConfig { - readonly subquery: string; - readonly subqueryName?: string; - readonly dbSchema?: string; - readonly localMode: boolean; - readonly batchSize: number; - readonly timeout: number; - readonly debug: boolean; - readonly preferRange: boolean; - readonly networkEndpoint?: string; - readonly networkDictionary?: string; - readonly outputFmt?: 'json'; - readonly logLevel?: LevelWithSilent; - readonly queryLimit: number; - readonly indexCountLimit: number; - readonly timestampField: boolean; - readonly proofOfIndex: boolean; - readonly mmrPath?: string; - readonly ipfs?: string; - readonly dictionaryTimeout: number; - readonly workers?: number; -} - -export type MinConfig = Partial> & Pick; - -const DEFAULT_CONFIG = { - localMode: false, - batchSize: 100, - timeout: 900, - preferRange: false, - debug: false, - queryLimit: 100, - indexCountLimit: 10, - timestampField: true, - proofOfIndex: false, - dictionaryTimeout: 30, -}; - -export class NodeConfig implements IConfig { - private readonly _config: IConfig; - - static fromFile(filePath: string, configFromArgs?: Partial): NodeConfig { - if (!fs.existsSync(filePath)) { - throw new Error(`Load config from file ${filePath} is not exist`); - } - let configFromFile: unknown; - try { - configFromFile = loadFromJsonOrYaml(filePath); - } catch (e) { - logger.error(`failed to load config file, ${e}`); - throw e; - } - - const config = assign(configFromFile, configFromArgs) as IConfig; - return new NodeConfig(config); - } - - constructor(config: MinConfig) { - this._config = assign({}, DEFAULT_CONFIG, config); - } - - get subquery(): string { - assert(this._config.subquery); - return this._config.subquery; - } - - get subqueryName(): string { - assert(this._config.subquery); - return this._config.subqueryName ?? last(this.subquery.split(path.sep)); - } - - get localMode(): boolean { - return this._config.localMode; - } - - get batchSize(): number { - return this._config.batchSize; - } - - get networkEndpoint(): string | undefined { - return this._config.networkEndpoint; - } - - get networkDictionary(): string | undefined { - return this._config.networkDictionary; - } - - get timeout(): number { - return this._config.timeout; - } - - get debug(): boolean { - return this._config.debug; - } - - get preferRange(): boolean { - return this._config.preferRange; - } - - get outputFmt(): 'json' | undefined { - return this._config.outputFmt; - } - - get logLevel(): LevelWithSilent { - return this.debug ? 'debug' : this._config.logLevel; - } - - get queryLimit(): number { - return this._config.queryLimit; - } - - get indexCountLimit(): number { - return this._config.indexCountLimit; - } - - get timestampField(): boolean { - return this._config.timestampField; - } - - get proofOfIndex(): boolean { - return this._config.proofOfIndex; - } - - get dictionaryTimeout(): number { - return this._config.dictionaryTimeout; - } - - get mmrPath(): string { - return this._config.mmrPath ?? `.mmr/${this.subqueryName}.mmr`; - } - get ipfs(): string { - return this._config.ipfs; - } - - get dbSchema(): string { - return this._config.dbSchema ?? this.subqueryName; - } - - get workers(): number { - return this._config.workers; - } - - merge(config: Partial): this { - assign(this._config, config); - return this; - } -} diff --git a/packages/node-core/src/db/db.module.test.ts b/packages/node-core/src/db/db.module.test.ts deleted file mode 100644 index b1553694..00000000 --- a/packages/node-core/src/db/db.module.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {INestApplication} from '@nestjs/common'; -import {Test} from '@nestjs/testing'; -import {Sequelize} from 'sequelize'; -import {SubqueryRepo} from '../entities'; -import {DbModule} from './db.module'; - -describe('DbModule', () => { - let app: INestApplication; - - afterEach(async () => { - return app?.close(); - }); - - it('can connect to database', async () => { - const module = await Test.createTestingModule({ - imports: [ - DbModule.forRoot({ - host: process.env.DB_HOST ?? '127.0.0.1', - port: process.env.DB_PORT ? Number(process.env.DB_PORT) : 5432, - username: process.env.DB_USER ?? 'postgres', - password: process.env.DB_PASS ?? 'postgres', - database: process.env.DB_DATABASE ?? 'postgres', - }), - ], - }).compile(); - - app = module.createNestApplication(); - await app.init(); - const sequelize = app.get(Sequelize); - await expect(sequelize.authenticate()).resolves.not.toThrow(); - }, 30000); - - it('can load subquery model', async () => { - const module = await Test.createTestingModule({ - imports: [ - DbModule.forRoot({ - host: process.env.DB_HOST ?? '127.0.0.1', - port: process.env.DB_PORT ? Number(process.env.DB_PORT) : 5432, - username: process.env.DB_USER ?? 'postgres', - password: process.env.DB_PASS ?? 'postgres', - database: process.env.DB_DATABASE ?? 'postgres', - }), - DbModule.forFeature(['Subquery']), - ], - }).compile(); - - app = module.createNestApplication(); - await app.init(); - const subqueryRepo: SubqueryRepo = app.get('Subquery'); - await expect(subqueryRepo.describe()).resolves.toBeTruthy(); - }, 30000); -}); diff --git a/packages/node-core/src/db/db.module.ts b/packages/node-core/src/db/db.module.ts deleted file mode 100644 index 015fcda3..00000000 --- a/packages/node-core/src/db/db.module.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {DynamicModule, Global} from '@nestjs/common'; -import {Sequelize, Options as SequelizeOption} from 'sequelize'; -import * as entities from '../entities'; -import {getLogger} from '../logger'; -import {delay} from '../utils/promise'; -import {getYargsOption} from '../yargs'; - -export interface DbOption { - host: string; - port: number; - username: string; - password: string; - database: string; -} - -const logger = getLogger('db'); - -async function establishConnection(sequelize: Sequelize, numRetries: number): Promise { - try { - await sequelize.authenticate(); - } catch (error) { - logger.error(error, 'Unable to connect to the database'); - if (numRetries > 0) { - await delay(3); - void (await establishConnection(sequelize, numRetries - 1)); - } else { - process.exit(1); - } - } -} - -const sequelizeFactory = (option: SequelizeOption) => async () => { - const sequelize = new Sequelize(option); - const numRetries = 5; - await establishConnection(sequelize, numRetries); - for (const factoryFn of Object.keys(entities).filter((k) => /Factory$/.exec(k))) { - entities[factoryFn as keyof typeof entities](sequelize); - } - const {migrate} = getYargsOption().argv; - await sequelize.sync({alter: migrate}); - return sequelize; -}; - -@Global() -export class DbModule { - static forRoot(option: DbOption): DynamicModule { - const {argv} = getYargsOption(); - const logger = getLogger('db'); - return { - module: DbModule, - providers: [ - { - provide: Sequelize, - useFactory: sequelizeFactory({ - ...option, - dialect: 'postgres', - logging: argv.debug - ? (sql: string, timing?: number) => { - logger.debug(sql); - } - : false, - }), - }, - ], - exports: [Sequelize], - }; - } - - static forFeature(models: string[]): DynamicModule { - return { - module: DbModule, - providers: models.map((model) => ({ - provide: model, - inject: [Sequelize], - useFactory: (sequelize: Sequelize) => sequelize.model(model), - })), - exports: models, - }; - } -} diff --git a/packages/node-core/src/db/index.ts b/packages/node-core/src/db/index.ts deleted file mode 100644 index 943f9dc8..00000000 --- a/packages/node-core/src/db/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './db.module'; diff --git a/packages/node-core/src/entities/Subquery.entity.ts b/packages/node-core/src/entities/Subquery.entity.ts deleted file mode 100644 index 8c31d332..00000000 --- a/packages/node-core/src/entities/Subquery.entity.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BuildOptions, DataTypes, Model, Sequelize} from 'sequelize'; - -interface SubqueryModelAttributes extends SubqueryCreationAttributes { - id: string; - createdAt?: Date; - updatedAt?: Date; -} - -interface SubqueryCreationAttributes { - name: string; - dbSchema: string; - version?: string; - hash: string; - nextBlockHeight?: number; - network: string; - networkGenesis: string; -} - -export interface SubqueryModel - extends Model, - SubqueryModelAttributes {} - -export type SubqueryRepo = typeof Model & { - new (values?: unknown, options?: BuildOptions): SubqueryModel; -}; - -export function SubqueryFactory(sequelize: Sequelize): SubqueryRepo { - return sequelize.define( - 'Subquery', - { - id: { - type: DataTypes.INTEGER, - autoIncrement: true, - primaryKey: true, - }, - name: { - type: DataTypes.STRING, - allowNull: false, - unique: true, - }, - dbSchema: { - type: DataTypes.STRING, - allowNull: false, - }, - version: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: 0, - }, - hash: { - type: DataTypes.STRING, - allowNull: false, - }, - nextBlockHeight: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: 1, - }, - network: { - type: DataTypes.STRING, - allowNull: true, - }, - networkGenesis: { - type: DataTypes.STRING, - allowNull: true, - }, - }, - {underscored: true} - ); -} diff --git a/packages/node-core/src/entities/index.ts b/packages/node-core/src/entities/index.ts deleted file mode 100644 index 9a2a95fa..00000000 --- a/packages/node-core/src/entities/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './Subquery.entity'; diff --git a/packages/node-core/src/events.ts b/packages/node-core/src/events.ts deleted file mode 100644 index 8f3e6c72..00000000 --- a/packages/node-core/src/events.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export enum IndexerEvent { - ApiConnected = 'api_connected', - BlockTarget = 'block_target_height', - BlockBest = 'block_best_height', - BlockProcessing = 'block_processing_height', - BlockProcessedCount = 'block_processed_count', - BlockQueueSize = 'block_queue_size', - BlocknumberQueueSize = 'blocknumber_queue_size', - NetworkMetadata = 'network_metadata', - UsingDictionary = 'using_dictionary', - SkipDictionary = 'skip_dictionary', - Ready = 'ready', -} - -export interface ProcessBlockPayload { - height: number; - timestamp: number; -} - -export interface ProcessedBlockCountPayload { - processedBlockCount: number; - timestamp: number; -} - -export interface TargetBlockPayload { - height: number; -} - -export interface BestBlockPayload { - height: number; -} -export interface EventPayload { - value: T; -} - -export interface NetworkMetadataPayload { - chain: string; - specName: string; - genesisHash: string; -} - -export interface MmrPayload { - offset: number; - height: number; - hash: string; //the node hash - mmrRoot: string; -} - -export interface MmrProof { - digest: string; - leafLength: number; - nodes: MmrNode[]; -} - -export interface MmrNode { - node: string; - hash: string; -} diff --git a/packages/node-core/src/index.ts b/packages/node-core/src/index.ts deleted file mode 100644 index dd14fd09..00000000 --- a/packages/node-core/src/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './api.service'; -export * from './logger'; -export * from './yargs'; -export * from './profiler'; -export * from './events'; -export * from './configure'; -export * from './entities'; -export * from './db'; -export * from './meta'; -export * from './utils'; -export * from './indexer'; diff --git a/packages/node-core/src/indexer/PoiBlock.ts b/packages/node-core/src/indexer/PoiBlock.ts deleted file mode 100644 index 9fe1684a..00000000 --- a/packages/node-core/src/indexer/PoiBlock.ts +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { u8aConcat, numberToU8a, hexToU8a, isHex, isU8a } from '@polkadot/util'; -import { blake2AsU8a } from '@polkadot/util-crypto'; -import { ProofOfIndex } from './entities/Poi.entity'; - -const poiBlockHash = ( - id: number, - chainBlockHash: string | Uint8Array, - operationHashRoot: Uint8Array, - parentHash: Uint8Array, - projectId: string, -): Uint8Array => { - if (!id || !chainBlockHash || !operationHashRoot || !projectId) { - throw new Error('Poof of index: can not generate block hash'); - } - return blake2AsU8a( - u8aConcat( - numberToU8a(id), - chainBlockHash, - operationHashRoot, - Buffer.from(projectId), - parentHash, - ), - ); -}; - -export class PoiBlock implements ProofOfIndex { - readonly id: number; - readonly chainBlockHash: Uint8Array; - readonly hash: Uint8Array; - readonly parentHash: Uint8Array; - readonly operationHashRoot: Uint8Array; - mmrRoot: Uint8Array; - readonly projectId: string; - - constructor( - id: number, - chainBlockHash: Uint8Array, - hash: Uint8Array, - parentHash: Uint8Array, - operationHashRoot: Uint8Array, - projectId: string, - ) { - this.id = id; - this.chainBlockHash = chainBlockHash; - this.hash = hash; - this.parentHash = parentHash; - this.operationHashRoot = operationHashRoot; - this.projectId = projectId; - } - - static create( - id: number, - chainBlockHash: string | Uint8Array, - operationHashRoot: Uint8Array, - parentHash: Uint8Array, - projectId: string, - ): PoiBlock { - const _poiBlockHash = poiBlockHash( - id, - chainBlockHash, - operationHashRoot, - parentHash, - projectId, - ); - let _chainBlockHash: Uint8Array; - if (isHex(chainBlockHash)) { - _chainBlockHash = hexToU8a(chainBlockHash); - } else if (isU8a(chainBlockHash)) { - _chainBlockHash = chainBlockHash; - } - const poiBlock = new PoiBlock( - id, - _chainBlockHash, - _poiBlockHash, - parentHash, - operationHashRoot, - projectId, - ); - return poiBlock; - } -} diff --git a/packages/node-core/src/indexer/StoreOperations.spec.ts b/packages/node-core/src/indexer/StoreOperations.spec.ts deleted file mode 100644 index 98da5913..00000000 --- a/packages/node-core/src/indexer/StoreOperations.spec.ts +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {u8aToHex} from '@polkadot/util'; -import {GraphQLJsonFieldType} from '@subql/utils'; -import {StoreOperations} from './StoreOperations'; -import {OperationType} from './types'; - -type StarterEntity = { - id: string; - field1: number; - field2?: string; - field3?: BigInt; - field4?: Date; - field5?: boolean; - field6?: any; - field7?: number; - createdAt: Date; - updatedAt: Date; -}; - -const testOperations = [ - { - operation: OperationType.Set, - entityType: 'StarterEntity', - data: { - id: '0x2494bd5d089cf370c366351e851755ee42e8477df1c17ea1d9c2ae94e4f77ea8', - field1: 41914, - }, - }, - { - operation: OperationType.Set, - entityType: 'StarterEntity', - data: { - id: '0x2494bd5d089cf370c366351e851755ee42e8477df1c17ea1d9c2ae94e4f77ea8', - field3: null, - field1: 41914, - field2: null, - field4: new Date('2020-05-29T13:28:36.000Z'), - field5: true, - createdAt: new Date('2021-08-18T02:36:06.549Z'), - updatedAt: new Date('2021-08-18T02:36:06.549Z'), - }, - }, - { - operation: OperationType.Set, - entityType: 'StarterEntity', - data: { - id: '0x2494bd5d089cf370c366351e851755ee42e8477df1c17ea1d9c2ae94e4f77ea8', - field3: null, - field1: 41914, - field2: null, - field4: new Date('2020-05-29T13:28:36.000Z'), - field5: true, - createdAt: new Date('2021-08-18T02:36:06.549Z'), - updatedAt: new Date('2021-08-18T02:36:06.549Z'), - }, - }, - { - operation: OperationType.Set, - entityType: 'StarterEntity', - data: { - id: '0x2494bd5d089cf370c366351e851755ee42e8477df1c17ea1d9c2ae94e4f77ea8', - field3: null, - field1: 41914, - field2: null, - field4: new Date('2020-05-29T13:28:36.000Z'), - field5: true, - field6: {meat: 0, fruit: {apple: 'Apple'}}, - createdAt: new Date('2021-08-18T02:36:06.549Z'), - updatedAt: new Date('2021-08-18T02:36:06.549Z'), - field7: parseFloat('3.14'), - field8: 'Foo', - }, - }, - { - operation: OperationType.Remove, - entityType: 'StarterEntity', - data: '0x2494bd5d089cf370c366351e851755ee42e8477df1c17ea1d9c2ae94e4f77ea8', - }, -]; - -const falseOperation = { - operation: OperationType.Remove, - entityType: 'StarterEntity', - data: { - id: '0x2494bd5d089cf370c366351e851755ee42e8477df1c17ea1d9c2ae94e4f77ea8', - field3: null, - field1: 41914, - field2: null, - field4: new Date('2020-05-29T13:28:36.000Z'), - field5: true, - field6: {meat: 0, fruit: {apple: 'Apple'}}, - createdAt: new Date('2021-08-18T02:36:06.549Z'), - updatedAt: new Date('2021-08-18T02:36:06.549Z'), - field7: parseFloat('3.14'), - }, -}; -const apple: GraphQLJsonFieldType = { - name: 'apple', - type: 'String', - nullable: true, - isArray: false, -}; -const fruitJson: GraphQLJsonFieldType = { - name: 'fruit', - type: 'Json', - jsonInterface: {name: 'Fruit', fields: [apple]}, - isArray: false, - nullable: true, -}; -const meatJson: GraphQLJsonFieldType = { - name: 'meat', - type: 'Int', - nullable: true, - isArray: false, -}; -const models = [ - { - name: 'StarterEntity', - fields: [ - { - name: 'id', - type: 'ID', - isArray: false, - nullable: false, - isEnum: false, - }, - { - name: 'field1', - type: 'Int', - isArray: false, - nullable: false, - isEnum: false, - }, - { - name: 'field2', - type: 'String', - isArray: false, - nullable: true, - isEnum: false, - }, - { - name: 'field3', - type: 'BigInt', - isArray: false, - nullable: true, - isEnum: false, - }, - { - name: 'field4', - type: 'Date', - isArray: false, - nullable: true, - isEnum: false, - }, - { - name: 'field5', - type: 'Boolean', - isArray: false, - nullable: true, - isEnum: false, - }, - { - name: 'field6', - type: 'Json', - jsonInterface: {name: 'Food', fields: [meatJson, fruitJson]}, - isArray: false, - nullable: true, - isEnum: false, - }, - { - name: 'field7', - type: 'Float', - isArray: false, - nullable: true, - isEnum: false, - }, - { - type: 'TestEnum', - description: 'Field description', - isEnum: true, - isArray: false, - nullable: false, - name: 'field8', - }, - ], - indexes: [], - }, -]; - -describe('StoreOperations', () => { - it('put operation into the merkel leaf, and generate Merkle Root, also able to reset', () => { - const operationStack = new StoreOperations(models); - for (const o of testOperations) { - operationStack.put(o.operation, o.entityType, o.data); - } - - operationStack.makeOperationMerkleTree(); - expect(operationStack.getOperationLeafCount()).toBe(5); - console.log(`Root in hex: ${u8aToHex(operationStack.getOperationMerkleRoot())}`); - operationStack.reset(); - expect(operationStack.getOperationLeafCount()).toBe(0); - }); - - it('throw error when remove data is not string type', () => { - const operationStack = new StoreOperations(models); - - expect(() => operationStack.put(falseOperation.operation, falseOperation.entityType, falseOperation.data)).toThrow( - `Remove operation only accept data in string type` - ); - }); -}); diff --git a/packages/node-core/src/indexer/StoreOperations.ts b/packages/node-core/src/indexer/StoreOperations.ts deleted file mode 100644 index 40745533..00000000 --- a/packages/node-core/src/indexer/StoreOperations.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {u8aConcat, u8aToBuffer, isString} from '@polkadot/util'; -import {Entity} from '@subql/types'; -import {getTypeByScalarName, GraphQLModelsType} from '@subql/utils'; -import MerkleTools from 'merkle-tools'; -import {OperationEntity, OperationType} from './types'; - -export class StoreOperations { - private merkleTools: MerkleTools; - - constructor(private models: GraphQLModelsType[]) { - this.merkleTools = new MerkleTools({ - hashType: 'sha256', - }); - } - - private operationEntityToUint8Array(operation: OperationEntity): Uint8Array { - const dataBufferArray: Uint8Array[] = []; - if (operation.operation === OperationType.Remove) { - //remove case - if (isString(operation.data)) { - dataBufferArray.push(Buffer.from(operation.data)); - } else { - throw new Error(`Remove operation only accept data in string type`); - } - } else { - const operationModel = this.models.find(({name}) => name === operation.entityType); - for (const field of operationModel.fields) { - const fieldValue = (operation.data as Entity & Record)[field.name]; - dataBufferArray.push(Buffer.from(field.name)); - - if (fieldValue !== undefined && fieldValue !== null) { - if (field.isEnum) { - //if it is a enum, process it as string - getTypeByScalarName('String').hashCode(fieldValue); - } else { - dataBufferArray.push(getTypeByScalarName(field.type).hashCode(fieldValue)); - } - } - } - } - return u8aConcat(Buffer.from(operation.operation), Buffer.from(operation.entityType), ...dataBufferArray); - } - - put(operation: OperationType, entity: string, data: Entity | string): void { - const operationEntity: OperationEntity = { - operation: operation, - entityType: entity, - data: data, - }; - this.merkleTools.addLeaf(u8aToBuffer(this.operationEntityToUint8Array(operationEntity))); - } - - reset(): void { - // Bad types - (this.merkleTools as any).resetTree(); - } - - makeOperationMerkleTree(): void { - this.merkleTools.makeTree(); - } - - getOperationMerkleRoot(): Uint8Array { - if (this.merkleTools.getTreeReadyState()) { - return this.merkleTools.getMerkleRoot(); - } else { - throw new Error(`Failed to get Merkle root from operations, tree is not built yet`); - } - } - - getOperationLeafCount(): any { - return this.merkleTools.getLeafCount(); - } -} diff --git a/packages/node-core/src/indexer/benchmark.service.ts b/packages/node-core/src/indexer/benchmark.service.ts deleted file mode 100644 index 7e963795..00000000 --- a/packages/node-core/src/indexer/benchmark.service.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {OnEvent} from '@nestjs/event-emitter'; -import {Interval} from '@nestjs/schedule'; -import dayjs from 'dayjs'; -import duration from 'dayjs/plugin/duration'; -import {IndexerEvent, ProcessBlockPayload, ProcessedBlockCountPayload, TargetBlockPayload} from '../events'; -import {getLogger} from '../logger'; -import {delay} from '../utils/promise'; -import {getYargsOption} from '../yargs'; - -const SAMPLING_TIME_VARIANCE = 15; -const logger = getLogger('benchmark'); -const {argv} = getYargsOption(); -dayjs.extend(duration); - -export class BenchmarkService { - private currentProcessingHeight: number; - private currentProcessingTimestamp: number; - private targetHeight: number; - private lastRegisteredHeight: number; - private lastRegisteredTimestamp: number; - private blockPerSecond: number; - - private currentProcessedBlockAmount: number; - private lastProcessedBlockAmount: number; - - @Interval(SAMPLING_TIME_VARIANCE * 1000) - async benchmark(): Promise { - if (!this.currentProcessingHeight || !this.currentProcessingTimestamp || !this.currentProcessedBlockAmount) { - await delay(10); - } else { - if (this.lastRegisteredHeight && this.lastRegisteredTimestamp) { - const heightDiff = this.currentProcessingHeight - this.lastRegisteredHeight; - const timeDiff = this.currentProcessingTimestamp - this.lastRegisteredTimestamp; - this.blockPerSecond = heightDiff === 0 || timeDiff === 0 ? 0 : heightDiff / (timeDiff / 1000); - - const blockDuration = dayjs.duration( - (this.targetHeight - this.currentProcessingHeight) / this.blockPerSecond, - 'seconds' - ); - const hoursMinsStr = blockDuration.format('HH [hours] mm [mins]'); - const days = Math.floor(blockDuration.asDays()); - const durationStr = `${days} days ${hoursMinsStr}`; - - if (argv.profiler) { - logger.info( - `Processed ${ - this.currentProcessedBlockAmount - this.lastProcessedBlockAmount - } blocks in the last ${SAMPLING_TIME_VARIANCE}secs ` - ); - } - - logger.info( - this.targetHeight === this.lastRegisteredHeight && this.blockPerSecond === 0 - ? 'Fully synced, waiting for new blocks' - : `${this.blockPerSecond.toFixed(2)} bps, target: #${this.targetHeight}, current: #${ - this.currentProcessingHeight - }, estimate time: ${this.blockPerSecond === 0 ? 'unknown' : durationStr}` - ); - } - this.lastRegisteredHeight = this.currentProcessingHeight; - this.lastRegisteredTimestamp = this.currentProcessingTimestamp; - this.lastProcessedBlockAmount = this.currentProcessedBlockAmount; - } - } - - @OnEvent(IndexerEvent.BlockProcessing) - handleProcessingBlock(blockPayload: ProcessBlockPayload): void { - this.currentProcessingHeight = blockPayload.height; - this.currentProcessingTimestamp = blockPayload.timestamp; - } - - @OnEvent(IndexerEvent.BlockProcessedCount) - handleProcessedBlock(blockPayload: ProcessedBlockCountPayload): void { - this.currentProcessedBlockAmount = blockPayload.processedBlockCount; - this.currentProcessingTimestamp = blockPayload.timestamp; - } - - @OnEvent(IndexerEvent.BlockTarget) - handleTargetBlock(blockPayload: TargetBlockPayload): void { - this.targetHeight = blockPayload.height; - } -} diff --git a/packages/node-core/src/indexer/entities/Metadata.entity.ts b/packages/node-core/src/indexer/entities/Metadata.entity.ts deleted file mode 100644 index 92682888..00000000 --- a/packages/node-core/src/indexer/entities/Metadata.entity.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BuildOptions, DataTypes, Model, Sequelize} from 'sequelize'; - -export interface Metadata { - key: string; - value: number | string | boolean; -} - -export interface MetadataModel extends Model, Metadata {} - -export type MetadataRepo = typeof Model & { - new (values?: unknown, options?: BuildOptions): MetadataModel; -}; - -export function MetadataFactory(sequelize: Sequelize, schema: string): MetadataRepo { - return sequelize.define( - `_metadata`, - { - key: { - type: DataTypes.STRING, - primaryKey: true, - }, - value: { - type: DataTypes.JSONB, - }, - }, - {freezeTableName: true, schema: schema} - ); -} diff --git a/packages/node-core/src/indexer/entities/Poi.entity.ts b/packages/node-core/src/indexer/entities/Poi.entity.ts deleted file mode 100644 index 7793448b..00000000 --- a/packages/node-core/src/indexer/entities/Poi.entity.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {BuildOptions, DataTypes, Model, Sequelize} from 'sequelize'; - -export interface ProofOfIndex { - id: number; //blockHeight - chainBlockHash: Uint8Array; - hash: Uint8Array; - parentHash?: Uint8Array; - operationHashRoot: Uint8Array; - mmrRoot?: Uint8Array; - projectId: string; -} - -export interface PoiModel extends Model, ProofOfIndex {} - -export type PoiRepo = typeof Model & { - new (values?: unknown, options?: BuildOptions): PoiModel; -}; - -export function PoiFactory(sequelize: Sequelize, schema: string): PoiRepo { - return sequelize.define( - `_poi`, - { - id: { - type: DataTypes.INTEGER, - primaryKey: true, - }, - chainBlockHash: { - type: DataTypes.BLOB, - allowNull: false, - unique: true, - }, - hash: { - type: DataTypes.BLOB, - allowNull: false, - unique: true, - }, - parentHash: { - type: DataTypes.BLOB, - allowNull: false, - unique: true, - }, - operationHashRoot: { - type: DataTypes.BLOB, - allowNull: false, - }, - mmrRoot: { - type: DataTypes.BLOB, - allowNull: true, - unique: true, - }, - projectId: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: '0', - }, - }, - { - freezeTableName: true, - schema: schema, - indexes: [{fields: ['hash']}], - } - ); -} diff --git a/packages/node-core/src/indexer/entities/index.ts b/packages/node-core/src/indexer/entities/index.ts deleted file mode 100644 index 7a2d78d4..00000000 --- a/packages/node-core/src/indexer/entities/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './Poi.entity'; -export * from './Metadata.entity'; diff --git a/packages/node-core/src/indexer/index.ts b/packages/node-core/src/indexer/index.ts deleted file mode 100644 index a5bb0028..00000000 --- a/packages/node-core/src/indexer/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './benchmark.service'; -export * from './entities'; -export * from './PoiBlock'; -export * from './types'; -export * from './StoreOperations'; -export * from './store.service'; -export * from './poi.service'; -export * from './mmr.service'; -export * from './worker'; diff --git a/packages/node-core/src/indexer/mmr.service.ts b/packages/node-core/src/indexer/mmr.service.ts deleted file mode 100644 index 15552a74..00000000 --- a/packages/node-core/src/indexer/mmr.service.ts +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import {Injectable, OnApplicationShutdown} from '@nestjs/common'; -import {u8aToHex, u8aEq} from '@polkadot/util'; -import {DEFAULT_WORD_SIZE, DEFAULT_LEAF, MMR_AWAIT_TIME} from '@subql/common'; -import {MMR, FileBasedDb} from '@subql/x-merkle-mountain-range'; -import {keccak256} from 'js-sha3'; -import {Sequelize, Op} from 'sequelize'; -import {NodeConfig} from '../configure'; -import {MmrPayload, MmrProof} from '../events'; -import {getLogger} from '../logger'; -import {delay} from '../utils'; -import {MetadataFactory, MetadataRepo, PoiFactory, PoiRepo, ProofOfIndex} from './entities'; - -const logger = getLogger('mmr'); - -const DEFAULT_FETCH_RANGE = 100; - -const keccak256Hash = (...nodeValues: Uint8Array[]) => - Buffer.from(keccak256(Buffer.concat(nodeValues)), 'hex'); - -@Injectable() -export class MmrService implements OnApplicationShutdown { - private isShutdown = false; - private isSyncing = false; - private metadataRepo: MetadataRepo; - private fileBasedMmr: MMR; - private poiRepo: PoiRepo; - // This is the next block height that suppose to calculate its mmr value - private nextMmrBlockHeight: number; - private blockOffset: number; - - constructor(protected nodeConfig: NodeConfig, protected sequelize: Sequelize) {} - - onApplicationShutdown(): void { - this.isShutdown = true; - } - - async syncFileBaseFromPoi( - schema: string, - blockOffset: number, - ): Promise { - if (this.isSyncing) return; - this.isSyncing = true; - this.metadataRepo = MetadataFactory(this.sequelize, schema); - this.poiRepo = PoiFactory(this.sequelize, schema); - this.fileBasedMmr = await this.ensureFileBasedMmr(this.nodeConfig.mmrPath); - this.blockOffset = blockOffset; - - // The file based database current leaf length - const fileBasedMmrLeafLength = await this.fileBasedMmr.getLeafLength(); - // However, when initialization we pick the previous block for file db and poi mmr validation - // if mmr leaf length 0 ensure the next block height to be processed min is 1. - this.nextMmrBlockHeight = fileBasedMmrLeafLength + blockOffset + 1; - // The latest poi record in database with mmr value - const latestPoiWithMmr = await this.getLatestPoiWithMmr(); - if (latestPoiWithMmr) { - // The latestPoiWithMmr its mmr value in filebase db - const latestPoiFilebaseMmrValue = await this.fileBasedMmr.getRoot(latestPoiWithMmr.id - blockOffset - 1); - this.validatePoiMmr(latestPoiWithMmr, latestPoiFilebaseMmrValue); - } - logger.info(`file based database MMR start with next block height at ${this.nextMmrBlockHeight}`); - while (!this.isShutdown) { - const poiBlocks = await this.getPoiBlocksByRange(this.nextMmrBlockHeight); - if (poiBlocks.length !== 0) { - for (const block of poiBlocks) { - if (this.nextMmrBlockHeight < block.id) { - for (let i = this.nextMmrBlockHeight; i < block.id; i++) { - await this.fileBasedMmr.append(DEFAULT_LEAF); - this.nextMmrBlockHeight = i + 1; - } - } - await this.appendMmrNode(block); - } - } else { - const keys = ['lastProcessedHeight', 'lastPoiHeight'] as const; - const entries = await this.metadataRepo.findAll({ - where: { - key: keys, - }, - }); - const keyValue = entries.reduce((arr, curr) => { - arr[curr.key as typeof keys[number]] = curr.value as string | boolean | number; - return arr; - }, {} as {[key in typeof keys[number]]: string | boolean | number}); - // this.nextMmrBlockHeight means block before nextMmrBlockHeight-1 already exist in filebase mmr - if ( - this.nextMmrBlockHeight > Number(keyValue.lastPoiHeight) && - this.nextMmrBlockHeight <= Number(keyValue.lastProcessedHeight) - ) { - for (let i = this.nextMmrBlockHeight; i <= Number(keyValue.lastProcessedHeight); i++) { - await this.fileBasedMmr.append(DEFAULT_LEAF); - this.nextMmrBlockHeight = i + 1; - } - } - await delay(MMR_AWAIT_TIME); - } - } - this.isSyncing = false; - } - - private async appendMmrNode(poiBlock: ProofOfIndex): Promise { - const newLeaf = poiBlock.hash; - if (newLeaf.length !== DEFAULT_WORD_SIZE) { - throw new Error(`Append Mmr failed, input data length should be ${DEFAULT_WORD_SIZE}`); - } - const estLeafIndexByBlockHeight = poiBlock.id - this.blockOffset - 1; - // The next leaf index in mmr, current latest leaf index always .getLeafLength -1. - await this.fileBasedMmr.append(newLeaf, estLeafIndexByBlockHeight); - const mmrRoot = await this.fileBasedMmr.getRoot(estLeafIndexByBlockHeight); - await this.updatePoiMmrRoot(poiBlock.id, mmrRoot); - this.nextMmrBlockHeight = poiBlock.id + 1; - } - - private validatePoiMmr(poiWithMmr: ProofOfIndex, mmrValue: Uint8Array): void { - if (!u8aEq(poiWithMmr.mmrRoot, mmrValue)) { - throw new Error( - `Poi block height ${poiWithMmr.id}, Poi mmr ${u8aToHex( - poiWithMmr.mmrRoot, - )} not the same as filebased mmr: ${u8aToHex(mmrValue)}`, - ); - } else { - logger.info( - `CHECKING : Poi block height ${poiWithMmr.id}, Poi mmr is same as file based mmr` //remove for debug - ); - } - } - - private async updatePoiMmrRoot( - id: number, - mmrValue: Uint8Array, - ): Promise { - const poiBlock = await this.poiRepo.findByPk(id); - if (poiBlock.mmrRoot === null) { - poiBlock.mmrRoot = mmrValue; - await poiBlock.save(); - } else { - this.validatePoiMmr(poiBlock, mmrValue); - } - } - - private async getPoiBlocksByRange( - startHeight: number, - ): Promise { - const poiBlocks = await this.poiRepo.findAll({ - limit: DEFAULT_FETCH_RANGE, - where: {id: {[Op.gte]: startHeight}}, - order: [['id', 'ASC']], - }); - if (poiBlocks.length !== 0) { - return poiBlocks; - } else { - return []; - } - } - - private async getLatestPoiWithMmr(): Promise { - const poiBlock = await this.poiRepo.findOne({ - order: [['id', 'DESC']], - where: {mmrRoot: {[Op.ne]: null}}, - }); - return poiBlock; - } - - // async getFirstPoiWithoutMmr(): Promise { - // const poiBlock = await this.poiRepo.findOne({ - // order: [['id', 'ASC']], - // where: { mmrRoot: { [Op.eq]: null } }, - // }); - // return poiBlock; - // } - - private async ensureFileBasedMmr(projectMmrPath: string): Promise { - let fileBasedDb: FileBasedDb; - if (fs.existsSync(projectMmrPath)) { - fileBasedDb = await FileBasedDb.open(projectMmrPath); - } else { - fileBasedDb = await FileBasedDb.create(projectMmrPath, DEFAULT_WORD_SIZE); - } - return new MMR(keccak256Hash, fileBasedDb); - } - - async getMmr(blockHeight: number): Promise { - const leafIndex = blockHeight - this.blockOffset - 1; - if (leafIndex < 0) { - throw new Error(`Parameter blockHeight must greater equal to ${this.blockOffset + 1} `); - } - const [mmrResponse, node] = await Promise.all([ - this.fileBasedMmr.getRoot(leafIndex), - this.fileBasedMmr.get(leafIndex), - ]); - return { - offset: this.blockOffset, - height: blockHeight, - mmrRoot: u8aToHex(mmrResponse), - hash: u8aToHex(node), - }; - } - - async getLatestMmr(): Promise { - // latest leaf index need fetch from .db, as original method will use cache - const blockHeight = (await this.fileBasedMmr.db.getLeafLength()) + this.blockOffset; - return this.getMmr(blockHeight); - } - - async getLatestMmrProof(): Promise { - // latest leaf index need fetch from .db, as original method will use cache - const blockHeight = (await this.fileBasedMmr.db.getLeafLength()) + this.blockOffset; - return this.getMmrProof(blockHeight); - } - - async getMmrProof(blockHeight: number): Promise { - const leafIndex = blockHeight - this.blockOffset - 1; - if (leafIndex < 0) { - throw new Error(`Parameter blockHeight must greater equal to ${this.blockOffset + 1} `); - } - const mmrProof = await this.fileBasedMmr.getProof([leafIndex]); - const nodes = Object.entries(mmrProof.db.nodes).map(([key, data]) => { - return { - node: key, - hash: u8aToHex(data as Uint8Array), - }; - }); - return { - digest: mmrProof.digest.name, - leafLength: mmrProof.db.leafLength, - nodes, - }; - } - - async deleteMmrNode(blockHeight: number, blockOffset: number): Promise { - this.fileBasedMmr = await this.ensureFileBasedMmr(this.nodeConfig.mmrPath); - const leafIndex = blockHeight - blockOffset - 1; - if (leafIndex < 0) { - throw new Error( - `Target block height must greater equal to ${blockOffset + 1} `, - ); - } - await this.fileBasedMmr.delete(leafIndex); - } -} diff --git a/packages/node-core/src/indexer/poi.service.ts b/packages/node-core/src/indexer/poi.service.ts deleted file mode 100644 index f2af01ad..00000000 --- a/packages/node-core/src/indexer/poi.service.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {isMainThread} from 'node:worker_threads'; -import {Injectable, OnApplicationShutdown} from '@nestjs/common'; -import {hexToU8a} from '@polkadot/util'; -import {Sequelize} from 'sequelize'; -import {NodeConfig} from '../configure'; -import {PoiFactory, PoiRepo} from './entities'; - -const DEFAULT_PARENT_HASH = hexToU8a('0x00'); - -@Injectable() -export class PoiService implements OnApplicationShutdown { - private isShutdown = false; - private latestPoiBlockHash: Uint8Array; - private poiRepo: PoiRepo; - private schema: string; - - constructor(protected nodeConfig: NodeConfig, protected sequelize: Sequelize) {} - - onApplicationShutdown(): void { - this.isShutdown = true; - } - - async init(schema: string): Promise { - this.schema = schema; - this.poiRepo = PoiFactory(this.sequelize, this.schema); - this.latestPoiBlockHash = await this.getLatestPoiBlockHash(); - } - - async fetchPoiBlockHashFromDb(): Promise { - const lastPoi = await this.poiRepo.findOne({ - order: [['id', 'DESC']], - }); - if (lastPoi === null || lastPoi === undefined) { - return null; - } else if (lastPoi !== null && lastPoi.hash) { - return lastPoi.hash; - } else { - throw new Error(`Poi found but can not get latest hash`); - } - } - - async getLatestPoiBlockHash(): Promise { - if (!this.latestPoiBlockHash || !isMainThread) { - const poiBlockHash = await this.fetchPoiBlockHashFromDb(); - if (poiBlockHash === null || poiBlockHash === undefined) { - this.latestPoiBlockHash = DEFAULT_PARENT_HASH; - } else { - this.latestPoiBlockHash = poiBlockHash; - } - } - return this.latestPoiBlockHash; - } - - setLatestPoiBlockHash(hash: Uint8Array): void { - this.latestPoiBlockHash = hash; - } -} diff --git a/packages/node-core/src/indexer/store.service.spec.ts b/packages/node-core/src/indexer/store.service.spec.ts deleted file mode 100644 index a9c278cb..00000000 --- a/packages/node-core/src/indexer/store.service.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {DataTypes, Model, ModelAttributes} from 'sequelize'; -import {StoreService} from './store.service'; - -describe('Store Service', () => { - let storeService: StoreService; - - it('addIdAndBlockRangeAttributes', () => { - storeService = new StoreService(null, null); - const attributes = { - id: { - type: DataTypes.STRING, - primaryKey: true, - }, - } as ModelAttributes, any>; - storeService.addIdAndBlockRangeAttributes(attributes); - expect(Object.keys(attributes).length).toEqual(3); - expect((attributes.id as any).primaryKey).toEqual(false); - expect(attributes.__id).toEqual({ - type: DataTypes.UUID, - defaultValue: DataTypes.UUIDV4, - allowNull: false, - primaryKey: true, - }); - expect(attributes.__block_range).toEqual({ - type: DataTypes.RANGE(DataTypes.BIGINT), - allowNull: false, - }); - }); -}); diff --git a/packages/node-core/src/indexer/store.service.ts b/packages/node-core/src/indexer/store.service.ts deleted file mode 100644 index 7b46c563..00000000 --- a/packages/node-core/src/indexer/store.service.ts +++ /dev/null @@ -1,730 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import assert from 'assert'; -import {isMainThread} from 'worker_threads'; -import {Injectable} from '@nestjs/common'; -import {hexToU8a, u8aToBuffer} from '@polkadot/util'; -import {blake2AsHex} from '@polkadot/util-crypto'; -import {Entity, Store} from '@subql/types'; -import {GraphQLModelsRelationsEnums, GraphQLRelationsType, IndexType} from '@subql/utils'; -import {camelCase, flatten, isEqual, upperFirst} from 'lodash'; -import { - CreationAttributes, - DataTypes, - IndexesOptions, - Model, - ModelAttributeColumnOptions, - ModelAttributes, - ModelStatic, - Op, - QueryTypes, - Sequelize, - Transaction, - UpsertOptions, - Utils, -} from 'sequelize'; -import {NodeConfig} from '../configure'; -import {getLogger} from '../logger'; -import { - commentTableQuery, - commentConstraintQuery, - createNotifyTrigger, - createSendNotificationTriggerFunction, - createUniqueIndexQuery, - dropNotifyTrigger, - getFkConstraint, - getNotifyTriggers, - SmartTags, - smartTags, - getVirtualFkTag, - addTagsToForeignKeyMap, - createExcludeConstraintQuery, - BTREE_GIST_EXTENSION_EXIST_QUERY, - modelsTypeToModelAttributes, - camelCaseObjectKey, - makeTriggerName, -} from '../utils'; -import {getYargsOption} from '../yargs'; -import {Metadata, MetadataFactory, MetadataRepo, PoiFactory, PoiRepo, ProofOfIndex} from './entities'; -import {StoreOperations} from './StoreOperations'; -import {OperationType} from './types'; - -const logger = getLogger('store'); -const NULL_MERKEL_ROOT = hexToU8a('0x00'); -const {argv} = getYargsOption(); -const NotifyTriggerManipulationType = [`INSERT`, `DELETE`, `UPDATE`]; -const KEY_FIELDS = ['id', '__id', '__block_range']; - -interface IndexField { - entityName: string; - fieldName: string; - isUnique: boolean; - type: string; -} - -interface NotifyTriggerPayload { - triggerName: string; - eventManipulation: string; -} -@Injectable() -export class StoreService { - private tx?: Transaction; - private modelIndexedFields: IndexField[]; - private schema: string; - private modelsRelations: GraphQLModelsRelationsEnums; - private poiRepo: PoiRepo; - private metaDataRepo: MetadataRepo; - private operationStack: StoreOperations; - private blockHeight: number; - historical: boolean; - - constructor(private sequelize: Sequelize, private config: NodeConfig) {} - - async init(modelsRelations: GraphQLModelsRelationsEnums, schema: string): Promise { - this.schema = schema; - this.modelsRelations = modelsRelations; - this.historical = await this.getHistoricalStateEnabled(); - - try { - await this.syncSchema(this.schema); - } catch (e) { - logger.error(e, `Having a problem when syncing schema`); - process.exit(1); - } - try { - this.modelIndexedFields = await this.getAllIndexFields(this.schema); - } catch (e) { - logger.error(e, `Having a problem when get indexed fields`); - process.exit(1); - } - } - - async incrementBlockCount(tx: Transaction): Promise { - await this.sequelize.query( - `UPDATE "${this.schema}"._metadata SET value = (COALESCE(value->0):: int + 1)::text::jsonb WHERE key ='processedBlockCount'`, - {transaction: tx} - ); - } - - // eslint-disable-next-line complexity - async syncSchema(schema: string): Promise { - const enumTypeMap = new Map(); - if (this.historical) { - const [results] = await this.sequelize.query(BTREE_GIST_EXTENSION_EXIST_QUERY); - if (results.length === 0) { - throw new Error('Btree_gist extension is required to enable historical data, contact DB admin for support'); - } - } - - for (const e of this.modelsRelations.enums) { - // We shouldn't set the typename to e.name because it could potentially create SQL injection, - // using a replacement at the type name location doesn't work. - const enumTypeName = `${schema}_enum_${this.enumNameToHash(e.name)}`; - - const [results] = await this.sequelize.query( - `select e.enumlabel as enum_value - from pg_type t - join pg_enum e on t.oid = e.enumtypid - where t.typname = ? - order by enumsortorder;`, - {replacements: [enumTypeName]} - ); - - if (results.length === 0) { - await this.sequelize.query(`CREATE TYPE "${enumTypeName}" as ENUM (${e.values.map(() => '?').join(',')});`, { - replacements: e.values, - }); - } else { - const currentValues = results.map((v: any) => v.enum_value); - // Assert the existing enum is same - - // Make it a function to not execute potentially big joins unless needed - if (!isEqual(e.values, currentValues)) { - throw new Error( - `\n * Can't modify enum "${e.name}" between runs: \n * Before: [${currentValues.join( - `,` - )}] \n * After : [${e.values.join(',')}] \n * You must rerun the project to do such a change` - ); - } - } - - const comment = `@enum\\n@enumName ${e.name}${e.description ? `\\n ${e.description}` : ''}`; - - await this.sequelize.query(`COMMENT ON TYPE "${enumTypeName}" IS E?`, { - replacements: [comment], - }); - enumTypeMap.set(e.name, `"${enumTypeName}"`); - } - const extraQueries = []; - if (argv.subscription) { - extraQueries.push(createSendNotificationTriggerFunction); - } - for (const model of this.modelsRelations.models) { - const attributes = modelsTypeToModelAttributes(model, enumTypeMap); - const indexes = model.indexes.map(({fields, unique, using}) => ({ - fields: fields.map((field) => Utils.underscoredIf(field, true)), - unique, - using, - })); - if (indexes.length > this.config.indexCountLimit) { - throw new Error(`too many indexes on entity ${model.name}`); - } - if (this.historical) { - this.addIdAndBlockRangeAttributes(attributes); - this.addBlockRangeColumnToIndexes(indexes); - } - const sequelizeModel = this.sequelize.define(model.name, attributes, { - underscored: true, - comment: model.description, - freezeTableName: false, - createdAt: this.config.timestampField, - updatedAt: this.config.timestampField, - schema, - indexes, - }); - if (this.historical) { - this.addScopeAndBlockHeightHooks(sequelizeModel); - extraQueries.push(createExcludeConstraintQuery(schema, sequelizeModel.tableName)); - } - if (argv.subscription) { - const triggerName = makeTriggerName(schema, sequelizeModel.tableName); - const triggers = await this.sequelize.query(getNotifyTriggers(), { - replacements: {triggerName}, - type: QueryTypes.SELECT, - }); - // Triggers not been found - if (triggers.length === 0) { - extraQueries.push(createNotifyTrigger(schema, sequelizeModel.tableName)); - } else { - this.validateNotifyTriggers(triggerName, triggers as NotifyTriggerPayload[]); - } - } else { - extraQueries.push(dropNotifyTrigger(schema, sequelizeModel.tableName)); - } - } - const foreignKeyMap = new Map>(); - for (const relation of this.modelsRelations.relations) { - const model = this.sequelize.model(relation.from); - const relatedModel = this.sequelize.model(relation.to); - if (this.historical) { - this.addRelationToMap(relation, foreignKeyMap, model, relatedModel); - continue; - } - switch (relation.type) { - case 'belongsTo': { - model.belongsTo(relatedModel, {foreignKey: relation.foreignKey}); - break; - } - case 'hasOne': { - const rel = model.hasOne(relatedModel, { - foreignKey: relation.foreignKey, - }); - const fkConstraint = getFkConstraint(rel.target.tableName, rel.foreignKey); - const tags = smartTags({ - singleForeignFieldName: relation.fieldName, - }); - extraQueries.push( - commentConstraintQuery(`"${schema}"."${rel.target.tableName}"`, fkConstraint, tags), - createUniqueIndexQuery(schema, relatedModel.tableName, relation.foreignKey) - ); - break; - } - case 'hasMany': { - const rel = model.hasMany(relatedModel, { - foreignKey: relation.foreignKey, - }); - const fkConstraint = getFkConstraint(rel.target.tableName, rel.foreignKey); - const tags = smartTags({ - foreignFieldName: relation.fieldName, - }); - extraQueries.push(commentConstraintQuery(`"${schema}"."${rel.target.tableName}"`, fkConstraint, tags)); - - break; - } - default: - throw new Error('Relation type is not supported'); - } - } - foreignKeyMap.forEach((keys, tableName) => { - const comment = Array.from(keys.values()) - .map((tags) => smartTags(tags, '|')) - .join('\n'); - const query = commentTableQuery(`"${schema}"."${tableName}"`, comment); - extraQueries.push(query); - }); - if (this.config.proofOfIndex) { - this.poiRepo = PoiFactory(this.sequelize, schema); - } - this.metaDataRepo = MetadataFactory(this.sequelize, schema); - - // this will allow alter current entity, including fields - // TODO, add rules for changes, eg only allow add nullable field - // Only allow altering the tables on the main thread - await this.sequelize.sync({alter: {drop: isMainThread}}); - await this.setMetadata('historicalStateEnabled', this.historical); - for (const query of extraQueries) { - await this.sequelize.query(query); - } - } - - async getHistoricalStateEnabled(): Promise { - let enabled = true; - try { - // Throws if _metadata doesn't exist (first startup) - const result = await this.sequelize.query<{value: boolean}>( - `SELECT value FROM "${this.schema}"."_metadata" WHERE key = 'historicalStateEnabled'`, - {type: QueryTypes.SELECT} - ); - if (result.length > 0) { - enabled = result[0].value; - } else { - enabled = false; - } - } catch (e) { - enabled = !argv['disable-historical']; - } - logger.info(`Historical state is ${enabled ? 'enabled' : 'disabled'}`); - return enabled; - } - - addBlockRangeColumnToIndexes(indexes: IndexesOptions[]): void { - indexes.forEach((index) => { - if (index.using === IndexType.GIN) { - return; - } - index.fields.push('_block_range'); - index.using = IndexType.GIST; - // GIST does not support unique indexes - index.unique = false; - }); - } - - private addRelationToMap( - relation: GraphQLRelationsType, - foreignKeys: Map>, - model: ModelStatic, - relatedModel: ModelStatic - ) { - switch (relation.type) { - case 'belongsTo': { - addTagsToForeignKeyMap(foreignKeys, model.tableName, relation.foreignKey, { - foreignKey: getVirtualFkTag(relation.foreignKey, relatedModel.tableName), - }); - break; - } - case 'hasOne': { - addTagsToForeignKeyMap(foreignKeys, relatedModel.tableName, relation.foreignKey, { - singleForeignFieldName: relation.fieldName, - }); - break; - } - case 'hasMany': { - addTagsToForeignKeyMap(foreignKeys, relatedModel.tableName, relation.foreignKey, { - foreignFieldName: relation.fieldName, - }); - break; - } - default: - throw new Error('Relation type is not supported'); - } - } - - addIdAndBlockRangeAttributes(attributes: ModelAttributes, any>): void { - (attributes.id as ModelAttributeColumnOptions).primaryKey = false; - attributes.__id = { - type: DataTypes.UUID, - defaultValue: DataTypes.UUIDV4, - allowNull: false, - primaryKey: true, - } as ModelAttributeColumnOptions; - attributes.__block_range = { - type: DataTypes.RANGE(DataTypes.BIGINT), - allowNull: false, - } as ModelAttributeColumnOptions; - } - - private addScopeAndBlockHeightHooks(sequelizeModel: ModelStatic): void { - sequelizeModel.addScope('defaultScope', { - attributes: { - exclude: ['__id', '__block_range'], - }, - }); - sequelizeModel.addHook('beforeFind', (options) => { - (options.where as any).__block_range = { - [Op.contains]: this.blockHeight as any, - }; - }); - sequelizeModel.addHook('beforeValidate', (attributes, options) => { - attributes.__block_range = [this.blockHeight, null]; - }); - sequelizeModel.addHook('beforeBulkCreate', (instances, options) => { - instances.forEach((item) => { - item.__block_range = [this.blockHeight, null]; - }); - }); - } - - validateNotifyTriggers(triggerName: string, triggers: NotifyTriggerPayload[]): void { - if (triggers.length !== NotifyTriggerManipulationType.length) { - throw new Error( - `Found ${triggers.length} ${triggerName} triggers, expected ${NotifyTriggerManipulationType.length} triggers ` - ); - } - triggers.map((t) => { - if (!NotifyTriggerManipulationType.includes(t.eventManipulation)) { - throw new Error(`Found unexpected trigger ${t.triggerName} with manipulation ${t.eventManipulation}`); - } - }); - } - - enumNameToHash(enumName: string): string { - return blake2AsHex(enumName).substr(2, 10); - } - - setTransaction(tx: Transaction): void { - this.tx = tx; - tx.afterCommit(() => (this.tx = undefined)); - if (this.config.proofOfIndex) { - this.operationStack = new StoreOperations(this.modelsRelations.models); - } - } - - setBlockHeight(blockHeight: number): void { - this.blockHeight = blockHeight; - } - - async setMetadataBatch(metadata: Metadata[], options?: UpsertOptions): Promise { - await Promise.all(metadata.map(({key, value}) => this.setMetadata(key, value, options))); - } - - async setMetadata(key: string, value: string | number | boolean, options?: UpsertOptions): Promise { - assert(this.metaDataRepo, `Model _metadata does not exist`); - await this.metaDataRepo.upsert({key, value}, options); - } - - async setPoi(blockPoi: ProofOfIndex, options?: UpsertOptions): Promise { - assert(this.poiRepo, `Model _poi does not exist`); - blockPoi.chainBlockHash = u8aToBuffer(blockPoi.chainBlockHash); - blockPoi.hash = u8aToBuffer(blockPoi.hash); - blockPoi.parentHash = u8aToBuffer(blockPoi.parentHash); - await this.poiRepo.upsert(blockPoi, options); - } - - getOperationMerkleRoot(): Uint8Array { - if (this.config.proofOfIndex) { - this.operationStack.makeOperationMerkleTree(); - const merkelRoot = this.operationStack.getOperationMerkleRoot(); - if (merkelRoot === null) { - return NULL_MERKEL_ROOT; - } - return merkelRoot; - } - return NULL_MERKEL_ROOT; - } - - private async getAllIndexFields(schema: string) { - const fields: IndexField[][] = []; - for (const entity of this.modelsRelations.models) { - const model = this.sequelize.model(entity.name); - const tableFields = await this.packEntityFields(schema, entity.name, model.tableName); - fields.push(tableFields); - } - return flatten(fields); - } - - private async packEntityFields(schema: string, entity: string, table: string): Promise { - const rows = await this.sequelize.query( - `select - '${entity}' as entity_name, - a.attname as field_name, - idx.indisunique as is_unique, - am.amname as type -from - pg_index idx - JOIN pg_class cls ON cls.oid=idx.indexrelid - JOIN pg_class tab ON tab.oid=idx.indrelid - JOIN pg_am am ON am.oid=cls.relam, - pg_namespace n, - pg_attribute a -where - n.nspname = '${schema}' - and tab.relname = '${table}' - and a.attrelid = tab.oid - and a.attnum = ANY(idx.indkey) - and not idx.indisprimary -group by - n.nspname, - a.attname, - tab.relname, - idx.indisunique, - am.amname`, - { - type: QueryTypes.SELECT, - } - ); - return rows.map((result) => camelCaseObjectKey(result)) as IndexField[]; - } - - private async markAsDeleted(model: ModelStatic, id: string) { - return model.update( - { - __block_range: this.sequelize.fn( - 'int8range', - this.sequelize.fn('lower', this.sequelize.col('_block_range')), - this.blockHeight - ), - }, - { - hooks: false, - transaction: this.tx, - where: { - id: id, - __block_range: { - [Op.contains]: this.blockHeight as any, - }, - }, - } - ); - } - - async rewind(targetBlockHeight: number, transaction: Transaction): Promise { - for (const model of Object.values(this.sequelize.models)) { - if ('__block_range' in model.getAttributes()) { - await model.destroy({ - transaction, - hooks: false, - where: this.sequelize.where( - this.sequelize.fn('lower', this.sequelize.col('_block_range')), - Op.gt, - targetBlockHeight - ), - }); - await model.update( - { - __block_range: this.sequelize.fn( - 'int8range', - this.sequelize.fn('lower', this.sequelize.col('_block_range')), - null - ), - }, - { - transaction, - hooks: false, - where: { - __block_range: { - [Op.contains]: targetBlockHeight, - }, - }, - } - ); - } - } - - await this.setMetadata('lastProcessedHeight', targetBlockHeight, { - transaction, - }); - if (this.config.proofOfIndex) { - await this.poiRepo.destroy({ - transaction, - where: { - id: { - [Op.gt]: targetBlockHeight, - }, - }, - }); - await this.setMetadata('lastPoiHeight', targetBlockHeight, { - transaction, - }); - } - } - - getStore(): Store { - return { - get: async (entity: string, id: string): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - const record = await model.findOne({ - where: {id}, - transaction: this.tx, - }); - return record?.toJSON() as T; - } catch (e) { - throw new Error(`Failed to get Entity ${entity} with id ${id}: ${e}`); - } - }, - getByField: async ( - entity: string, - field: keyof T, - value: T[keyof T] | T[keyof T][], - options?: { - offset?: number; - limit?: number; - } - ): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - const indexed = - this.modelIndexedFields.findIndex( - (indexField) => - upperFirst(camelCase(indexField.entityName)) === entity && camelCase(indexField.fieldName) === field - ) > -1; - assert(indexed, `to query by field ${String(field)}, an index must be created on model ${entity}`); - const records = await model.findAll({ - where: {[field]: value}, - transaction: this.tx, - limit: options?.limit ?? this.config.queryLimit, - offset: options?.offset, - }); - return records.map((record) => record.toJSON() as T); - } catch (e) { - throw new Error(`Failed to getByField Entity ${entity} with field ${String(field)}: ${e}`); - } - }, - getOneByField: async ( - entity: string, - field: keyof T, - value: T[keyof T] - ): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - const indexed = - this.modelIndexedFields.findIndex( - (indexField) => - upperFirst(camelCase(indexField.entityName)) === entity && - camelCase(indexField.fieldName) === field && - indexField.isUnique - ) > -1; - assert(indexed, `to query by field ${String(field)}, an unique index must be created on model ${entity}`); - const record = await model.findOne({ - where: {[field]: value}, - transaction: this.tx, - }); - return record?.toJSON() as T; - } catch (e) { - throw new Error(`Failed to getOneByField Entity ${entity} with field ${String(field)}: ${e}`); - } - }, - set: async (entity: string, _id: string, data: Entity): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - const attributes = data as unknown as CreationAttributes; - if (this.historical) { - const [updatedRows] = await model.update(attributes, { - hooks: false, - transaction: this.tx, - where: this.sequelize.and( - {id: data.id}, - this.sequelize.where(this.sequelize.fn('lower', this.sequelize.col('_block_range')), this.blockHeight) - ), - }); - if (updatedRows < 1) { - await this.markAsDeleted(model, data.id); - await model.create(attributes, { - transaction: this.tx, - }); - } - } else { - await model.upsert(attributes, { - transaction: this.tx, - }); - } - if (this.config.proofOfIndex) { - this.operationStack.put(OperationType.Set, entity, data); - } - } catch (e) { - throw new Error(`Failed to set Entity ${entity} with _id ${_id}: ${e}`); - } - }, - bulkCreate: async (entity: string, data: Entity[]): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - await model.bulkCreate(data as unknown as CreationAttributes[], { - transaction: this.tx, - }); - if (this.config.proofOfIndex) { - for (const item of data) { - this.operationStack.put(OperationType.Set, entity, item); - } - } - } catch (e) { - throw new Error(`Failed to bulkCreate Entity ${entity}: ${e}`); - } - }, - - bulkUpdate: async (entity: string, data: Entity[], fields?: string[]): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - if (this.historical) { - if (fields.length !== 0) { - logger.warn(`Update specified fields with historical feature is not supported`); - } - const newRecordAttributes: CreationAttributes[] = []; - await Promise.all( - data.map(async (record) => { - const attributes = record as unknown as CreationAttributes; - const [updatedRows] = await model.update(attributes, { - hooks: false, - transaction: this.tx, - where: this.sequelize.and( - {id: record.id}, - this.sequelize.where( - this.sequelize.fn('lower', this.sequelize.col('_block_range')), - this.blockHeight - ) - ), - }); - if (updatedRows < 1) { - await this.markAsDeleted(model, record.id); - newRecordAttributes.push(attributes); - } - }) - ); - if (newRecordAttributes.length !== 0) { - await model.bulkCreate(newRecordAttributes, { - transaction: this.tx, - }); - } - } else { - const modelFields = - fields ?? Object.keys(model.getAttributes()).filter((item) => !KEY_FIELDS.includes(item)); - await model.bulkCreate(data as unknown as CreationAttributes[], { - transaction: this.tx, - updateOnDuplicate: modelFields, - }); - } - if (this.config.proofOfIndex) { - for (const item of data) { - this.operationStack.put(OperationType.Set, entity, item); - } - } - } catch (e) { - throw new Error(`Failed to bulkCreate Entity ${entity}: ${e}`); - } - }, - - remove: async (entity: string, id: string): Promise => { - try { - const model = this.sequelize.model(entity); - assert(model, `model ${entity} not exists`); - if (this.historical) { - await this.markAsDeleted(model, id); - } else { - await model.destroy({where: {id}, transaction: this.tx}); - } - if (this.config.proofOfIndex) { - this.operationStack.put(OperationType.Remove, entity, id); - } - } catch (e) { - throw new Error(`Failed to remove Entity ${entity} with id ${id}: ${e}`); - } - }, - }; - } -} diff --git a/packages/node-core/src/indexer/types.ts b/packages/node-core/src/indexer/types.ts deleted file mode 100644 index 205716bc..00000000 --- a/packages/node-core/src/indexer/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Entity} from '@subql/types'; - -export enum OperationType { - Set = 'Set', - Remove = 'Remove', -} - -export type OperationEntity = { - operation: OperationType; - entityType: string; - data: Entity | string; -}; diff --git a/packages/node-core/src/indexer/worker/index.ts b/packages/node-core/src/indexer/worker/index.ts deleted file mode 100644 index 7e28826f..00000000 --- a/packages/node-core/src/indexer/worker/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './worker.builder'; diff --git a/packages/node-core/src/indexer/worker/worker.builder.ts b/packages/node-core/src/indexer/worker/worker.builder.ts deleted file mode 100644 index 9771856b..00000000 --- a/packages/node-core/src/indexer/worker/worker.builder.ts +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2020-2021 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as workers from 'worker_threads'; -import {Logger} from 'pino'; -import {getLogger} from '../../logger'; - -export type SerializableError = { - message: string; - stack?: string; -}; - -export type Request = { - id: number | string; - name: string; - args: any[]; -}; - -export type Response = { - id: number | string; - error?: SerializableError; - result?: T; -}; - -export type AsyncFunc = (...args: any[]) => T | Promise | void; -type AsyncMethods = Record; - -// TODO can we pass an event emitter rather than use parent port -// This would make it agnostic to child process - -/* Builds an interface on the worker side to interact with main process */ -export function registerWorker(fns: AsyncMethods): void { - let functions: AsyncMethods; - - function register(fns: typeof functions) { - functions = fns; - } - - async function handleRequest(req: Request): Promise { - const fn = functions[req.name]; - - if (!fn) { - workers.parentPort.postMessage({ - id: req.id, - error: { - message: `handleRequest: Function "${req.name}" not found`, - }, - }); - return; - } - - try { - const res = await fn(...req.args); - - workers.parentPort.postMessage({ - id: req.id, - result: res, - }); - } catch (e) { - workers.parentPort.postMessage({ - id: req.id, - error: e, - }); - } - } - - workers.parentPort.on('message', (req: Request) => { - void handleRequest(req); - }); - - register(fns); -} - -/* Host side, used to initialise and interact with worker */ -export class Worker { - private worker: workers.Worker; - private logger: Logger; - - private responseListeners: Record void> = {}; - - private _reqCounter = 0; - - private constructor(path: string, fns: (keyof T)[]) { - this.worker = new workers.Worker(path, { - argv: process.argv, - }); - - this.logger = getLogger(`worker: ${this.worker.threadId}`); - - this.worker.on('message', (res: Response) => { - if (this.responseListeners[res.id]) { - this.responseListeners[res.id](res.result, res.error); - - delete this.responseListeners[res.id]; - } else { - this.logger.warn(`No handler found for request: "${res.id}"`); - } - }); - - this.worker.on('error', (error) => { - this.logger.error(error, 'Worker error'); - }); - - this.worker.on('messageerror', (error) => { - this.logger.error(error, 'Worker message error'); - }); - - this.worker.on('exit', (code) => { - this.logger.error(`Worker exited with code ${code}`); - process.exit(code); - }); - - // Add expected methods to class - fns.map((fn) => { - if ((this as any)[fn]) { - throw new Error(`Method ${String(fn)} is already defined`); - } - Object.assign(this, {[fn]: (...args: any[]) => this.execute(fn, args)}); - }); - } - - static create(path: string, fns: (keyof T)[]): Worker & T { - const worker = new Worker(path, fns); - - return worker as Worker & T; - } - - private getReqId(): number { - return this._reqCounter++; - } - - async terminate(): Promise { - return this.worker.terminate(); - } - - private async execute(fnName: keyof T, ...args: any[]): Promise { - const id = this.getReqId(); - - return new Promise((resolve, reject) => { - this.responseListeners[id] = (data, error) => { - if (error) { - const e = new Error(error.message); - e.stack = error.stack ?? e.stack; - reject(e); - } else { - resolve(data); - } - }; - - this.worker.postMessage({ - id, - name: fnName, - args, - }); - }); - } -} diff --git a/packages/node-core/src/logger.ts b/packages/node-core/src/logger.ts deleted file mode 100644 index efa9d824..00000000 --- a/packages/node-core/src/logger.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { isMainThread, threadId } from 'node:worker_threads'; -import { LoggerService } from '@nestjs/common'; -import { Logger } from '@subql/utils'; -import Pino from 'pino'; -import { argv } from './yargs'; - -const outputFmt = argv('output-fmt') as 'json' | 'colored'; -const debug = argv('debug'); -const logLevel = argv('log-level') as string | undefined; - -const logger = new Logger({ - level: debug ? 'debug' : logLevel, - outputFormat: outputFmt, - nestedKey: 'payload', -}); - -export function getLogger(category: string): Pino.Logger { - return logger.getLogger(category); -} - -export function setLevel(level: Pino.LevelWithSilent): void { - logger.setLevel(level); -} - -export class NestLogger implements LoggerService { - private logger = logger.getLogger( - `nestjs${isMainThread ? '-0' : `-#${threadId}`}`, - ); - - error(message: any, trace?: string): void { - if (trace) { - this.logger.error({ trace }, message); - } else { - this.logger.error(message); - } - } - - log(message: any): void { - this.logger.info(message); - } - - warn(message: any): void { - this.logger.warn(message); - } -} diff --git a/packages/node-core/src/merkle-mountain-range.d.ts b/packages/node-core/src/merkle-mountain-range.d.ts deleted file mode 100644 index 4bfe9b31..00000000 --- a/packages/node-core/src/merkle-mountain-range.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -declare module '@subql/x-merkle-mountain-range' { - class MMR { - - constructor(public digest: Digest, public db: D) - getLeafLength(): Promise; - get(leafIndex: number): Promise; - getRoot(leafIndex: number): Promise; - append(value: Uint8Array, leafIndex?: number): Promise; - getProof(leafIndexes: number[], referenceTreeLength?: any): Promise>; - delete(leafIndex: number): Promise; - } - - type Digest = (...nodeValues: Uint8Array[]) => Uint8Array; - - interface Db { - getLeafLength(): Promise; - setLeafLength(length: number): Promise; - getNodes(): Promise>; - } - - class FileBasedDb implements Db { - static open(path: string): Promise; - static create(path: string, wordSize: number): Promise; - - getLeafLength(): Promise; - setLeafLength(length: number): Promise; - getNodes(): Promise>; - } - - class MemoryBasedDb implements Db { - getLeafLength(): Promise; - setLeafLength(length: number): Promise; - getNodes(): Promise>; - - leafLength: number; - nodes: Record; - } -} diff --git a/packages/node-core/src/meta/event.listener.ts b/packages/node-core/src/meta/event.listener.ts deleted file mode 100644 index 87861450..00000000 --- a/packages/node-core/src/meta/event.listener.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {OnEvent} from '@nestjs/event-emitter'; -import {InjectMetric} from '@willsoto/nestjs-prometheus'; -import {Gauge} from 'prom-client'; -import { - BestBlockPayload, - EventPayload, - IndexerEvent, - ProcessBlockPayload, - ProcessedBlockCountPayload, - TargetBlockPayload, -} from '../events'; - -export class MetricEventListener { - private skipDictionaryCount = 0; - - constructor( - @InjectMetric('subql_indexer_api_connected') - private apiConnectedMetric: Gauge, - @InjectMetric('subql_indexer_block_queue_size') - private blockQueueSizeMetric: Gauge, - @InjectMetric('subql_indexer_blocknumber_queue_size') - private blocknumberQueueSizeMetric: Gauge, - @InjectMetric('subql_indexer_processing_block_height') - private processingBlockHeight: Gauge, - @InjectMetric('subql_indexer_target_block_height') - private targetHeightMetric: Gauge, - @InjectMetric('subql_indexer_best_block_height') - private bestHeightMetric: Gauge, - @InjectMetric('subql_indexer_using_dictionary') - private usingDictionaryMetric: Gauge, - @InjectMetric('subql_indexer_skip_dictionary_count') - private skipDictionaryCountMetric: Gauge, - @InjectMetric('subql_indexer_processed_block_count') - private processedBlockCountMetric: Gauge - ) {} - - @OnEvent(IndexerEvent.ApiConnected) - handleApiConnected({value}: EventPayload): void { - this.apiConnectedMetric.set(value); - } - - @OnEvent(IndexerEvent.BlockQueueSize) - handleBlockQueueSizeMetric({value}: EventPayload): void { - this.blockQueueSizeMetric.set(value); - } - - @OnEvent(IndexerEvent.BlocknumberQueueSize) - handleBlocknumberQueueSizeMetric({value}: EventPayload): void { - this.blocknumberQueueSizeMetric.set(value); - } - - @OnEvent(IndexerEvent.BlockProcessing) - handleProcessingBlock(blockPayload: ProcessBlockPayload): void { - this.processingBlockHeight.set(blockPayload.height); - } - - @OnEvent(IndexerEvent.BlockProcessedCount) - handleProcessedBlockCount(blockPayload: ProcessedBlockCountPayload): void { - this.processedBlockCountMetric.set(blockPayload.processedBlockCount); - } - - @OnEvent(IndexerEvent.BlockTarget) - handleTargetBlock(blockPayload: TargetBlockPayload): void { - this.targetHeightMetric.set(blockPayload.height); - } - - @OnEvent(IndexerEvent.BlockBest) - handleBestBlock(blockPayload: BestBlockPayload): void { - this.bestHeightMetric.set(blockPayload.height); - } - - @OnEvent(IndexerEvent.UsingDictionary) - handleUsingDictionary({value}: EventPayload): void { - this.usingDictionaryMetric.set(value); - } - - @OnEvent(IndexerEvent.SkipDictionary) - handleSkipDictionary(): void { - this.skipDictionaryCount += 1; - this.skipDictionaryCountMetric.set(this.skipDictionaryCount); - } -} diff --git a/packages/node-core/src/meta/health.controller.ts b/packages/node-core/src/meta/health.controller.ts deleted file mode 100644 index 8f1edf21..00000000 --- a/packages/node-core/src/meta/health.controller.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Controller, Get, HttpException, HttpStatus} from '@nestjs/common'; -import {getLogger} from '../logger'; -import {HealthService} from './health.service'; - -const logger = getLogger('health'); - -@Controller('health') -export class HealthController { - constructor(private healthService: HealthService) {} - - @Get() - getHealth(): void { - try { - this.healthService.getHealth(); - } catch (e) { - logger.error(e.message); - throw new HttpException( - { - status: HttpStatus.INTERNAL_SERVER_ERROR, - error: e.message, - }, - HttpStatus.INTERNAL_SERVER_ERROR - ); - } - } -} diff --git a/packages/node-core/src/meta/health.service.ts b/packages/node-core/src/meta/health.service.ts deleted file mode 100644 index 4df05a81..00000000 --- a/packages/node-core/src/meta/health.service.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Injectable} from '@nestjs/common'; -import {OnEvent} from '@nestjs/event-emitter'; -import {Interval} from '@nestjs/schedule'; -import {NodeConfig} from '../configure'; -import {IndexerEvent, ProcessBlockPayload, TargetBlockPayload} from '../events'; -import {StoreService} from '../indexer'; - -const DEFAULT_TIMEOUT = 900000; -const CHECK_HEALTH_INTERVAL = 60000; - -@Injectable() -export class HealthService { - private recordBlockHeight?: number; - private recordBlockTimestamp?: number; - private currentProcessingHeight?: number; - private currentProcessingTimestamp?: number; - private blockTime = 6000; - private healthTimeout: number; - private indexerHealthy: boolean; - - constructor(protected nodeConfig: NodeConfig, private storeService: StoreService) { - this.healthTimeout = Math.max(DEFAULT_TIMEOUT, this.nodeConfig.timeout * 1000); - } - - @Interval(CHECK_HEALTH_INTERVAL) - async checkHealthStatus(): Promise { - let healthy: boolean; - - try { - this.getHealth(); - healthy = true; - } catch (e) { - healthy = false; - } - - if (healthy !== this.indexerHealthy) { - await this.storeService.setMetadata('indexerHealthy', healthy); - this.indexerHealthy = healthy; - } - } - - @OnEvent(IndexerEvent.BlockTarget) - handleTargetBlock(blockPayload: TargetBlockPayload): void { - if (this.recordBlockHeight !== blockPayload.height) { - this.recordBlockHeight = blockPayload.height; - this.recordBlockTimestamp = Date.now(); - } - } - - @OnEvent(IndexerEvent.BlockProcessing) - handleProcessingBlock(blockPayload: ProcessBlockPayload): void { - if (this.currentProcessingHeight !== blockPayload.height) { - this.currentProcessingHeight = blockPayload.height; - this.currentProcessingTimestamp = blockPayload.timestamp; - } - } - - getHealth(): void { - if (this.recordBlockTimestamp && Date.now() - this.recordBlockTimestamp > this.blockTime * 10) { - throw new Error('Endpoint is not healthy'); - } - if (this.currentProcessingTimestamp && Date.now() - this.currentProcessingTimestamp > this.healthTimeout) { - throw new Error('Indexer is not healthy'); - } - } -} diff --git a/packages/node-core/src/meta/index.ts b/packages/node-core/src/meta/index.ts deleted file mode 100644 index c326f6e6..00000000 --- a/packages/node-core/src/meta/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './event.listener'; -export * from './mmrQuery.controller'; -export * from './health.controller'; -export * from './health.service'; -export * from './ready.controller'; -export * from './ready.service'; diff --git a/packages/node-core/src/meta/mmrQuery.controller.ts b/packages/node-core/src/meta/mmrQuery.controller.ts deleted file mode 100644 index e7be07d3..00000000 --- a/packages/node-core/src/meta/mmrQuery.controller.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Controller, Get, Param, UseFilters} from '@nestjs/common'; -import {MmrService} from '../indexer'; -import {MmrExceptionsFilter} from '../utils/mmr-exception.filter'; - -const mmrExceptionsFilter = new MmrExceptionsFilter(); - -@Controller('mmrs') -export class MmrQueryController { - constructor(private mmrService: MmrService) {} - - @Get('latest') - @UseFilters(mmrExceptionsFilter) - async getLatestMmr(@Param() params: any) { - // eslint-disable-next-line no-return-await - return this.mmrService.getLatestMmr(); - } - - @Get('latest/proof') - @UseFilters(mmrExceptionsFilter) - async getLatestMmrProof(@Param() params: any) { - return this.mmrService.getLatestMmrProof(); - } - - @Get(':blockHeight') - @UseFilters(mmrExceptionsFilter) - async getMmr(@Param() params: {blockHeight: number}) { - // eslint-disable-next-line no-return-await - return this.mmrService.getMmr(params.blockHeight); - } - - @Get(':blockHeight/proof') - @UseFilters(mmrExceptionsFilter) - async getMmrProof(@Param() params: {blockHeight: number}) { - return this.mmrService.getMmrProof(params.blockHeight); - } -} diff --git a/packages/node-core/src/meta/ready.controller.ts b/packages/node-core/src/meta/ready.controller.ts deleted file mode 100644 index 38818396..00000000 --- a/packages/node-core/src/meta/ready.controller.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Controller, Get, HttpException, HttpStatus} from '@nestjs/common'; -import {ReadyService} from './ready.service'; - -@Controller('ready') -export class ReadyController { - constructor(private readyService: ReadyService) {} - - @Get() - getReady() { - if (!this.readyService.ready) { - throw new HttpException( - { - status: HttpStatus.SERVICE_UNAVAILABLE, - error: 'Database schema is not created or ready', - }, - HttpStatus.SERVICE_UNAVAILABLE - ); - } - } -} diff --git a/packages/node-core/src/meta/ready.service.ts b/packages/node-core/src/meta/ready.service.ts deleted file mode 100644 index ac7ed5b8..00000000 --- a/packages/node-core/src/meta/ready.service.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { Injectable } from '@nestjs/common'; -import { OnEvent } from '@nestjs/event-emitter'; -import { EventPayload, IndexerEvent } from '../events'; - -@Injectable() -export class ReadyService { - private _ready: boolean; - - constructor() { - this._ready = false; - } - - @OnEvent(IndexerEvent.Ready) - handleReady({ value }: EventPayload): void { - this._ready = value; - } - - get ready(): boolean { - return this._ready; - } -} diff --git a/packages/node-core/src/profiler.ts b/packages/node-core/src/profiler.ts deleted file mode 100644 index 7decba92..00000000 --- a/packages/node-core/src/profiler.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -/* class decorator */ - -import { getLogger } from './logger'; - -function isPromise(e: any): boolean { - return !!e && typeof e.then === 'function'; -} -const logger = getLogger('profiler'); - -function printCost( - start: Date, - end: Date, - target: string, - method: string, -): void { - logger.info(`${target}, ${method}, ${end.getTime() - start.getTime()} ms`); -} -export function profiler(enabled = true): any { - return (target: any, name: string, descriptor: PropertyDescriptor): void => { - if (enabled && !!descriptor && typeof descriptor.value === 'function') { - const orig = descriptor.value; - // tslint:disable no-function-expression no-invalid-this - descriptor.value = function (...args: any[]): any { - const start = new Date(); - const res = orig.bind(this)(...args); - if (isPromise(res)) { - res.then( - (_: any) => { - printCost(start, new Date(), target.constructor.name, name); - return _; - }, - (err: any) => { - printCost(start, new Date(), target.constructor.name, name); - throw err; - }, - ); - } else { - printCost(start, new Date(), target.constructor.name, name); - } - return res; - }; - } - }; -} - -type AnyFn = (...args: any[]) => any; - -export const profilerWrap = - (method: T, target: any, name: string) => - (...args: Parameters): ReturnType => { - const start = new Date(); - const res = method(...args); - if (isPromise(res)) { - res.then( - (_: any) => { - printCost(start, new Date(), target, name); - return _; - }, - (err: any) => { - printCost(start, new Date(), target, name); - throw err; - }, - ); - } else { - printCost(start, new Date(), target, name); - } - return res; - }; diff --git a/packages/node-core/src/utils/batch-size.ts b/packages/node-core/src/utils/batch-size.ts deleted file mode 100644 index 01fb2600..00000000 --- a/packages/node-core/src/utils/batch-size.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {getHeapStatistics} from 'v8'; -import {getLogger} from '../logger'; -import {getYargsOption} from '../yargs'; - -const HIGH_THRESHOLD = 0.85; -const LOW_THRESHOLD = 0.6; - -const {argv} = getYargsOption(); -const logger = getLogger('memory'); - -export function checkMemoryUsage(batchSizeScale: number): number { - const memoryData = getHeapStatistics(); - const ratio = memoryData.used_heap_size / memoryData.heap_size_limit; - if (argv.profiler) { - logger.info(`Heap Statistics: ${JSON.stringify(memoryData)}`); - logger.info(`Heap Usage: ${ratio}`); - } - let scale = batchSizeScale; - - if (ratio > HIGH_THRESHOLD) { - if (scale > 0) { - scale = Math.max(scale - 0.1, 0); - logger.debug(`Heap usage: ${ratio}, decreasing batch size by 10%`); - } - } - - if (ratio < LOW_THRESHOLD) { - if (scale < 1) { - scale = Math.min(scale + 0.1, 1); - logger.debug(`Heap usage: ${ratio} increasing batch size by 10%`); - } - } - return scale; -} diff --git a/packages/node-core/src/utils/graphql.ts b/packages/node-core/src/utils/graphql.ts deleted file mode 100644 index 8a4fad9e..00000000 --- a/packages/node-core/src/utils/graphql.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {isHex, hexToU8a, u8aToBuffer, u8aToHex, bufferToU8a, isBuffer, isNull} from '@polkadot/util'; -import {getTypeByScalarName, GraphQLModelsType} from '@subql/utils'; -import {ModelAttributes, ModelAttributeColumnOptions} from 'sequelize'; - -export function modelsTypeToModelAttributes(modelType: GraphQLModelsType, enums: Map): ModelAttributes { - const fields = modelType.fields; - return Object.values(fields).reduce((acc, field) => { - const allowNull = field.nullable; - const columnOption: ModelAttributeColumnOptions = { - type: field.isEnum - ? `${enums.get(field.type)}${field.isArray ? '[]' : ''}` - : field.isArray - ? getTypeByScalarName('Json').sequelizeType - : getTypeByScalarName(field.type).sequelizeType, - comment: field.description, - allowNull, - primaryKey: field.type === 'ID', - }; - if (field.type === 'BigInt') { - columnOption.get = function () { - const dataValue = this.getDataValue(field.name); - if (field.isArray) { - return dataValue ? dataValue.map((v: any) => BigInt(v)) : null; - } - return dataValue ? BigInt(dataValue) : null; - }; - columnOption.set = function (val: unknown) { - if (field.isArray) { - this.setDataValue( - field.name, - (val as unknown[])?.map((v) => v.toString()) - ); - } else { - this.setDataValue(field.name, val?.toString()); - } - }; - } - if (field.type === 'Bytes') { - columnOption.get = function () { - const dataValue = this.getDataValue(field.name); - if (!dataValue) { - return null; - } - if (!isBuffer(dataValue)) { - throw new Error(`Bytes: store.get() returned type is not buffer type`); - } - return u8aToHex(bufferToU8a(dataValue)); - }; - columnOption.set = function (val: unknown) { - if (val === undefined || isNull(val)) { - this.setDataValue(field.name, null); - } else if (isHex(val)) { - const setValue = u8aToBuffer(hexToU8a(val)); - this.setDataValue(field.name, setValue); - } else { - throw new Error(`input for Bytes type is only support unprefixed hex`); - } - }; - } - acc[field.name] = columnOption; - return acc; - }, {} as ModelAttributes); -} diff --git a/packages/node-core/src/utils/index.ts b/packages/node-core/src/utils/index.ts deleted file mode 100644 index fb16c4f0..00000000 --- a/packages/node-core/src/utils/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './object'; -export * from './promise'; -export * from './graphql'; -export * from './sync-helper'; -export * from './batch-size'; -export * from './autoQueue'; diff --git a/packages/node-core/src/utils/mmr-exception.filter.ts b/packages/node-core/src/utils/mmr-exception.filter.ts deleted file mode 100644 index 636c5d85..00000000 --- a/packages/node-core/src/utils/mmr-exception.filter.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpStatus} from '@nestjs/common'; - -@Catch() -export class MmrExceptionsFilter implements ExceptionFilter { - catch(exception: unknown, host: ArgumentsHost): void { - const ctx = host.switchToHttp(); - const response = ctx.getResponse(); - - let status: number; - let errorMessage: string; - - if (exception instanceof HttpException) { - status = exception.getStatus(); - errorMessage = exception.message; - } else { - status = HttpStatus.INTERNAL_SERVER_ERROR; - errorMessage = (exception as Error).message; - } - - response.status(status).json({ - statusCode: status, - error: errorMessage, - }); - } -} diff --git a/packages/node-core/src/utils/object.spec.ts b/packages/node-core/src/utils/object.spec.ts deleted file mode 100644 index 845a1892..00000000 --- a/packages/node-core/src/utils/object.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {camelCaseObjectKey} from './object'; - -it('Convert objects key to camelCase', () => { - const object = { - entity: 'someEntity', - active_for_auction: 'someAuction', - }; - - const result = camelCaseObjectKey(object); - - expect(result).toEqual({ - entity: 'someEntity', - activeForAuction: 'someAuction', - }); -}); diff --git a/packages/node-core/src/utils/object.ts b/packages/node-core/src/utils/object.ts deleted file mode 100644 index 579e39de..00000000 --- a/packages/node-core/src/utils/object.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {assignWith, camelCase, isUndefined} from 'lodash'; - -export function assign( - target: TObject, - src: TSource1, - src2?: TSource2 -): TObject & TSource1 & TSource2 { - return assignWith(target, src, src2, (objValue, srcValue) => (isUndefined(srcValue) ? objValue : srcValue)); -} - -export function camelCaseObjectKey(object: Record): object { - return Object.keys(object).reduce( - (result, key) => ({ - ...result, - [camelCase(key)]: object[key], - }), - {} - ); -} diff --git a/packages/node-core/src/utils/promise.spec.ts b/packages/node-core/src/utils/promise.spec.ts deleted file mode 100644 index 1813f81b..00000000 --- a/packages/node-core/src/utils/promise.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {delay, timeout} from './promise'; - -it('utils.promise delay()', async () => { - const start = new Date(); - await delay(1); - const millsecDiff = new Date().getTime() - start.getTime(); - expect(millsecDiff).toBeGreaterThanOrEqual(1000); - expect(millsecDiff).toBeLessThan(1050); -}); - -it('utils.promise timeout()', async () => { - const firstPromise = (async () => { - await delay(1); - return true; - })(); - await expect(timeout(firstPromise, 2)).resolves.toEqual(true); - const secondPromise = delay(3); - await expect(timeout(secondPromise, 2)).rejects.toThrow(/timeout/); -}); diff --git a/packages/node-core/src/utils/promise.ts b/packages/node-core/src/utils/promise.ts deleted file mode 100644 index bb83ca9f..00000000 --- a/packages/node-core/src/utils/promise.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -//deprecate method, use delay from @subql/common -export async function delay(sec: number): Promise { - return new Promise((resolve) => { - setTimeout(resolve, sec * 1000); - }); -} - -export async function timeout(promise: Promise, sec: number): Promise { - // so we can have a more comprehensive error stack - const err = new Error('timeout'); - return Promise.race([ - promise, - new Promise((resolve, reject) => { - setTimeout(() => reject(err), sec * 1000); - }), - ]); -} diff --git a/packages/node-core/src/utils/sync-helper.ts b/packages/node-core/src/utils/sync-helper.ts deleted file mode 100644 index bcde1b26..00000000 --- a/packages/node-core/src/utils/sync-helper.ts +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { blake2AsHex } from '@polkadot/util-crypto'; -import {Utils} from 'sequelize'; - -export interface SmartTags { - foreignKey?: string; - foreignFieldName?: string; - singleForeignFieldName?: string; -} - -const tagOrder = { - foreignKey: 0, - foreignFieldName: 1, - singleForeignFieldName: 2, -}; - -const byTagOrder = (a: [keyof SmartTags, any], b: [keyof SmartTags, any]) => { - return tagOrder[a[0]] - tagOrder[b[0]]; -}; - -export function smartTags(tags: SmartTags, separator = '\n'): string { - return Object.entries(tags) - .sort(byTagOrder) - .map(([k, v]) => `@${k} ${v}`) - .join(separator); -} - -export function getVirtualFkTag(field: string, to: string): string { - return `(${underscored(field)}) REFERENCES ${to} (id)`; -} - -const underscored = (input: string) => Utils.underscoredIf(input, true); - -export function getFkConstraint(tableName: string, foreignKey: string): string { - return [tableName, foreignKey, 'fkey'].map(underscored).join('_'); -} - -export function getUniqConstraint(tableName: string, field: string): string { - return [tableName, field, 'uindex'].map(underscored).join('_'); -} - -function getExcludeConstraint(tableName: string): string { - return [tableName, '_id', '_block_range', 'exclude'].map(underscored).join('_'); -} - -export function commentConstraintQuery(table: string, constraint: string, comment: string): string { - return `COMMENT ON CONSTRAINT ${constraint} ON ${table} IS E'${comment}'`; -} - -export function commentTableQuery(column: string, comment: string): string { - return `COMMENT ON TABLE ${column} IS E'${comment}'`; -} - -export function addTagsToForeignKeyMap( - map: Map>, - tableName: string, - foreignKey: string, - newTags: SmartTags -): void { - if (!map.has(tableName)) { - map.set(tableName, new Map()); - } - const tableKeys = map.get(tableName); - let foreignKeyTags = tableKeys.get(foreignKey) || ({} as SmartTags); - foreignKeyTags = Object.assign(foreignKeyTags, newTags); - tableKeys.set(foreignKey, foreignKeyTags); -} - -export const BTREE_GIST_EXTENSION_EXIST_QUERY = `SELECT * FROM pg_extension where extname = 'btree_gist'`; - -export function createExcludeConstraintQuery(schema: string, table: string): string { - const constraint = getExcludeConstraint(table); - return `DO $$ - BEGIN - IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = '${constraint}') THEN - ALTER TABLE "${schema}"."${table}" ADD CONSTRAINT ${constraint} EXCLUDE USING gist (id WITH =, _block_range WITH &&); - END IF; - END; - $$`; -} - -export function createUniqueIndexQuery(schema: string, table: string, field: string): string { - return `create unique index if not exists '${getUniqConstraint(table, field)}' on '${schema}.${table}' (${underscored( - field - )})`; -} - -export const createSendNotificationTriggerFunction = ` -CREATE OR REPLACE FUNCTION send_notification() - RETURNS trigger AS $$ -DECLARE - row RECORD; - payload JSONB; -BEGIN - IF (TG_OP = 'DELETE') THEN - row = OLD; - ELSE - row = NEW; - END IF; - payload = jsonb_build_object( - 'id', row.id, - 'mutation_type', TG_OP, - '_entity', row); - IF payload -> '_entity' ? '_block_range' THEN - IF NOT upper_inf(row._block_range) THEN - RETURN NULL; - END IF; - payload = payload || '{"mutation_type": "UPDATE"}'; - payload = payload #- '{"_entity","_id"}'; - payload = payload #- '{"_entity","_block_range"}'; - END IF; - IF (octet_length(payload::text) >= 8000) THEN - payload = payload || '{"_entity": null}'; - END IF; - PERFORM pg_notify( - CONCAT(TG_TABLE_SCHEMA, '.', TG_TABLE_NAME), - payload::text); - RETURN NULL; -END; -$$ LANGUAGE plpgsql;`; - -export function dropNotifyTrigger(schema: string, table: string): string { - const triggerName = makeTriggerName(schema, table); - return `DROP TRIGGER IF EXISTS "${triggerName}" - ON "${schema}"."${table}";`; -} - -export function getNotifyTriggers(): string { - return `select trigger_name as "triggerName", event_manipulation as "eventManipulation" from information_schema.triggers - WHERE trigger_name = :triggerName`; -} -export function createNotifyTrigger(schema: string, table: string): string { - const triggerName = makeTriggerName(schema, table); - return ` -CREATE TRIGGER "${triggerName}" - AFTER INSERT OR UPDATE OR DELETE - ON "${schema}"."${table}" - FOR EACH ROW EXECUTE FUNCTION send_notification();`; -} - -export function makeTriggerName(schema: string, tableName: string): string { - // max name length is 63 bytes in Postgres - return blake2AsHex(`${schema}_${tableName}_notify_trigger`).substr(2, 10); -} diff --git a/packages/node-core/src/yargs.ts b/packages/node-core/src/yargs.ts deleted file mode 100644 index b5ef4139..00000000 --- a/packages/node-core/src/yargs.ts +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {hideBin} from 'yargs/helpers'; -import yargs from 'yargs/yargs'; - -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export function getYargsOption() { - return yargs(hideBin(process.argv)).options({ - subquery: { - alias: 'f', - demandOption: true, - default: process.cwd(), - describe: 'Local path or IPFS cid of the subquery project', - type: 'string', - }, - 'subquery-name': { - deprecated: true, - demandOption: false, - describe: 'Name of the subquery project', - type: 'string', - }, - config: { - alias: 'c', - demandOption: false, - describe: 'Specify configuration file', - type: 'string', - }, - local: { - deprecated: true, - type: 'boolean', - demandOption: false, - describe: 'Use local mode', - }, - 'force-clean': { - type: 'boolean', - demandOption: false, - describe: 'Force clean the database, dropping project schemas and tables', - }, - 'db-schema': { - demandOption: false, - describe: 'Db schema name of the project', - type: 'string', - }, - unsafe: { - type: 'boolean', - demandOption: false, - describe: 'Allows usage of any built-in module within the sandbox', - }, - subscription: { - demandOption: false, - describe: 'Enable subscription by create notification triggers', - type: 'boolean', - default: false, - }, - 'batch-size': { - demandOption: false, - describe: 'Batch size of blocks to fetch in one round', - type: 'number', - }, - 'scale-batch-size': { - type: 'boolean', - demandOption: false, - describe: 'scale batch size based on memory usage', - default: false, - }, - timeout: { - demandOption: false, - describe: 'Timeout for indexer sandbox to execute the mapping functions', - type: 'number', - }, - debug: { - demandOption: false, - describe: 'Show debug information to console output. will forcefully set log level to debug', - type: 'boolean', - default: false, - }, - profiler: { - demandOption: false, - describe: 'Show profiler information to console output', - type: 'boolean', - default: false, - }, - 'network-endpoint': { - demandOption: false, - type: 'string', - describe: 'Blockchain network endpoint to connect', - }, - 'output-fmt': { - demandOption: false, - describe: 'Print log as json or plain text', - type: 'string', - choices: ['json', 'colored'], - }, - 'log-level': { - demandOption: false, - describe: 'Specify log level to print. Ignored when --debug is used', - type: 'string', - choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'], - }, - migrate: { - demandOption: false, - describe: 'Migrate db schema (for management tables only)', - type: 'boolean', - default: false, - }, - 'timestamp-field': { - demandOption: false, - describe: 'Enable/disable created_at and updated_at in schema', - type: 'boolean', - default: false, - }, - 'network-dictionary': { - alias: 'd', - demandOption: false, - describe: 'Specify the dictionary api for this network', - type: 'string', - }, - 'dictionary-timeout': { - demandOption: false, - describe: 'Max timeout for dictionary query', - type: 'number', - }, - 'mmr-path': { - alias: 'm', - demandOption: false, - describe: 'Local path of the merkle mountain range (.mmr) file', - type: 'string', - }, - 'proof-of-index': { - demandOption: false, - describe: 'Enable/disable proof of index', - type: 'boolean', - default: false, - }, - ipfs: { - demandOption: false, - describe: 'IPFS gateway endpoint', - type: 'string', - }, - port: { - alias: 'p', - demandOption: false, - describe: 'The port the service will bind to', - type: 'number', - }, - 'disable-historical': { - demandOption: false, - default: true, - describe: 'Disable storing historical state entities', - type: 'boolean', - }, - reindex: { - demandOption: false, - describe: 'Reindex to specified block height', - type: 'number', - }, - workers: { - alias: 'w', - demandOption: false, - describe: 'Number of worker threads to use for fetching and processing blocks. Disabled by default.', - type: 'number', - }, - 'query-limit': { - demandOption: false, - describe: 'The limit of items a project can query with store.getByField at once', - type: 'number', - default: 100, - }, - }); -} - -export function argv(arg: string): unknown { - return getYargsOption().argv[arg]; -} diff --git a/packages/node-core/test/config.json b/packages/node-core/test/config.json deleted file mode 100644 index 42dbcab8..00000000 --- a/packages/node-core/test/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "subquery": "../../../../subql-example/extrinsics", - "subqueryName": "extrinsics" -} diff --git a/packages/node-core/test/config.toml b/packages/node-core/test/config.toml deleted file mode 100644 index 42dbcab8..00000000 --- a/packages/node-core/test/config.toml +++ /dev/null @@ -1,4 +0,0 @@ -{ - "subquery": "../../../../subql-example/extrinsics", - "subqueryName": "extrinsics" -} diff --git a/packages/node-core/test/config.yml b/packages/node-core/test/config.yml deleted file mode 100644 index ac4e93e4..00000000 --- a/packages/node-core/test/config.yml +++ /dev/null @@ -1,2 +0,0 @@ -subquery: ../../../../subql-example/extrinsics -subqueryName: extrinsics diff --git a/packages/node-core/tsconfig.json b/packages/node-core/tsconfig.json deleted file mode 100644 index 0680df46..00000000 --- a/packages/node-core/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "tsBuildInfoFile": "dist/.tsbuildinfo", - "rootDir": "src", - "outDir": "dist", - "noImplicitAny": true - }, - "references": [{"path": "../common"}, {"path": "../utils"}], - "include": ["src/**/*"] -} diff --git a/packages/node/.gitignore b/packages/node/.gitignore deleted file mode 100644 index c16ef026..00000000 --- a/packages/node/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# compiled output -/dist -/node_modules - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# OS -.DS_Store - -# Tests -/coverage -/.nyc_output - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json \ No newline at end of file diff --git a/packages/node/.trigger b/packages/node/.trigger deleted file mode 100644 index 6f4eebdf..00000000 --- a/packages/node/.trigger +++ /dev/null @@ -1 +0,0 @@ -0.8.1 diff --git a/packages/node/CHANGELOG.md b/packages/node/CHANGELOG.md index 53ab65b6..d94e3d6c 100644 --- a/packages/node/CHANGELOG.md +++ b/packages/node/CHANGELOG.md @@ -5,659 +5,3 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - -## [1.9.2] - 2022-09-19 -### Changed -- In order to fix go-dictionary integration we changed dictionary query to use case-insensitive search for events/extrinsics name. (#1301) - - -## [1.9.1] - 2022-08-29 -### Fixed -- Fixed `@subql/node-core` import path issues (#1272) - -## [1.9.0] - 2022-08-26 -### Changed -- Use `@subql/node-core` package. (#1222) -- Updated store.getByField to have limit and offset options. `getByField(entity: string, field: string, value: any, options?: {offset?: number; limit?: number}): Promise;`. (#1259) -### Fixed -- Indexing stop processing blocks. (#1261) - -## [1.8.0] - 2022-08-17 -### Fixed -- Not parsing BigInt array entity fields correctly. (#1252) -- Cache lookup error with worker threads due to schema migration changes. (#1250) -### Added -- Improved performance logging. (#1244) -- `bulkUpdate` and `bulkGet` to the injected store. This can be used to optimise handlers and speed up indexing. (#1246) - - -## [1.7.0] - 2022-08-11 -### Changed -- Update Polkadot/api to v9 (#1234) -- schema migration, allow user add/remove entity field after indexing started (#1226) -### Fixed -- Utilise dictionary if all block filters have `modulo` set (#1232) -- Bring back profiling fetchBlocksBatches, remove unnecessary await (#1235) -- Fix running custom ds processors in parallel on different data (#1243) - -## [1.6.1] - 2022-08-02 -Priority: High. Fixes 1.6.0 failed to start issue. -### Fixed -- Fix one off events being missed on startup (#1224) - -## [1.6.0] - 2022-07-27 -### Changed -- Make handler data types generic (#1194) -### Added -- [Experimental Feature] Support for worker threads. This will move block fetching and processing into a worker. It can increase performance by up to 4 times. By default, this feature is disabled. You can enable it with the `--workers=` flag. The number of workers will be capped to the number of CPU cores. (#1103) -- [Experimental Feature] Add reindexing feature. You can use `--reindex=` to remove indexed data and reindex from specified block height. Please note that the way of using this feature will be updated soon. (#1208) -- Add block modulo filter on substrate blockHandler, E.g. if modulo: 50, the block handler will run on every 50 blocks. (#1196) - -## [1.5.1] - 2022-07-15 -### Fixed -- Unable to create ds processor from template when project hosted on IPFS (#1190) - -## [1.5.0] - 2022-07-12 -### Added -- add option `dictionary-timeout`, allow indexer decide timeout for query dictionary result (#1177) -### Changed -- Improve error log (#1174) -- Update Polkadot to 8.12.2 (#1179) - -- Use `node-core` package - -## [1.4.1] - 2022-07-07 -### Fixed -- Fix oversize subscription notification trigger name (#1171) - -## [1.4.0] - 2022-07-05 -### Fixed -- Fix DI issue with EventEmitter not being resolved (#1154) -- Validate dictionary before use its specVersion (#1152) -### Changed -- use Http keepAlive and maxSockets, use http2 (#1150) - -## [1.3.0] - 2022-06-29 -### Changed -- Update tests with Manifest v1.0.0 (#1114) -- Update redecorate api, allow apiAt object to query data earlier than current indexing block (#1111) -- Using chain block time as interval to fetch latest finalized and best block height (#1134) -### Fixed -- Fix set block offset twice issue (#1133) -- Fix warning for fetch specVersion when dictionary undefined, and tidy up logs (#1127) -- Fix pending data being used when it should be reset with new DS (#1140) - -## [1.2.1] - 2022-06-22 -### Fixed -- Handle when templates are undefined - -## [1.2.0] - 2022-06-22 -### Added -- Use dictionary SpecVersion map (#1046) -- Support dictionary for dynamic ds (#1110) -### Changed -- Split setup code from indexer manager to another service (#1092) -### Fixed -- Handle when specVersion query response is undefined (#1097) -- Fix templates not being processed for manifest v1.0.0 (#1116) - -## [1.1.2] - 2022-06-02 -### Fixed -- Fixed btree_gist extension, also provide docker postgres with extension (#1090) -- Fixed handle multi datasources with different start block height (#1091) - -## [1.1.1] - 2022-06-01 -### Fixed -- Fix disabling historical (#1085) -- Fix benchmark logging (#1083) - -## [1.1.0] - 2022-05-31 -### Fixed -- Move POI logic under option check (#1064) -### Added -- Add api to query file based mmr (#968) -- Experimental feature: Support query by block number (#992) -### Changed -Remove `contract-processors` to [subquery/datasource-processors](https://github.com/subquery/datasource-processors), types improvements and support for datasource processors v1.0.0 (#1012) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.35.2] - 2022-05-10 -Priority: High. Fixes events being handled multiple times, issue was introduced in 0.34.0 - -### Fixed -- Events being handled multiple times (#994) - -## [0.35.1] - 2022-05-06 -### Changed -- Bump with `@subql/utils` - -## [0.35.0] - 2022-05-02 -### Added -- Add utils package (#928) -### Fixed -- Handle undefined filters (#929) -### Changed -- Update polkadot 8.2.1 (#910) - -## [0.34.0] - 2022-04-26 -### Changed -- Remove notify trigger if subscription disabled (#882) -- Drop support for manifest v0.0.1 (#900) -- Process block content in time secquence rather than ds/handler order (#853) -### Fixed -- Fixed the mmr inconsistent value issue, remove redundant code, and set `blockOffset` value to the first store operation blockHeight -1 (#894) - -## [0.33.0] - 2022-04-06 -### Added -- Add support for handle manifest 1.0.0 (#845) - -## [0.32.0] - 2022-04-04 -### Changed -- Update to use `vm2`(#869) -- Update Polkadot/api to 7.14.3 (#866) -- move subscription to dedicate flag (#867) - -## [0.31.1] - 2022-03-23 -### Fixed -- Fix subscription notification trigger name invalid issue(#862) - -## [0.31.0] - 2022-03-22 -### Changed -- Update Polkadot/api to 7.12.1 (#849) -### Added -- Add Notification Trigger in order to support GraphQL subscription (#846) - -## [0.30.2] - 2022-03-15 -### Fixed -- Fix unable able fetch with small batch size issue (#847) - -## [0.30.1] - 2022-03-10 -### Fixed -- Fix enum sort order (#844) - -## [0.30.0] - 2022-03-01 -### Changed -- Update imports, as substrate related components now will be imported from `subql/common-substrate`. (#781) - -## [0.29.1] - 2022-02-23 -### Fixed -- Fix get default subquery name (#820) - -## [0.29.0] - 2022-02-23 -### Changed -- Update Polkadot/api to 7.9.1 (#815) -- Support node indexing from a manifest file (#800) - -## [0.28.2] - 2022-02-16 -### Changed -- Update Polkadot/api to 7.8.1 ,in order to resolve previous release issue (#806) - -## [0.28.1] - 2022-02-15 -### Fixed -- Fixed issue that node stop fetch block when set batch size to 1. (#802) - -## [0.28.0] - 2022-02-09 -### Added -- Support running the indexer from locations other than the filesystem, and refactor `SubqueryProject` class (#511) -- Add support for index dynamic datasources (#773) -- Add support for historical RPC methods that use BlockNumber (#788) -### Changed -- Update Polkadot/api to 7.7.1 (#787) -### Fixed -- Fixed mmr initialization start height issue (#600) - - -## [0.27.2] - 2022-01-23 -### Changed -- Update Polkadot/api to 7.4.1 (#757) -### Fixed -- Fix genesis hash validation for manifest v0.0.1 (#762) - -## [0.27.1] - 2022-01-18 -### Changed -- Ready endpoint return code (#750) - -## [0.27.0] - 2022-01-13 -### Changed -- Deprecate local mode (#725) -- Update Polkadot/api to 7.3.1 (#745) -### Added -- Add ready status of indexer to endpoint (#728) -- Add `--port` option, auto find available port when the default one is occupied. (#739)ss -### Fixed -- Fix handle chainTypes error (#732) -- Try catch on init api with chainTypes (#738) -- Verify project store genesis hash with network genesis hash, instead of check specName only (#735) -- Remove update metadata last processed block by interval (#740) -- Use Promise.all for set metadata (#743) - - -## [0.26.0] - 2021-12-16 -### Added -- Support dictionary for custom datasource (#686) -- Automatic adjust fetched block batch size based on memory usage, enable by passing `--scale-batch-size` (#668) -- Depreciate subqueries table (#683) -- Add `bulkCreate()` to `store` (#699) -- Add support for loading chaintypes from js (#698) -### Fixed -- Fix name escaping with db queries (#702) -- Fix `lastProcessedHeight` value representation (#711) - -## [0.25.3] - 2021-12-02 -Priority: High. Any project use enum should re-index with latest node ASAP. -### Fixed: -- Skip insert poi when db transaction is null (#687) -- Replace enum index with unique hash value, in order resolve schema type name conflict issue.(#688) - - -## [0.25.2] - 2021-11-30 -Priority: high for projects indexed with 0.25.x or above -### Fixed: -- Upgrade dependency common, in order to remove auto generated enum types from entities relations (#682) - -## [0.25.1] - 2021-11-27 -Priority: high for projects use dictionary -### Fixed: -- Fix variable replacement in dictionary's gql, remove the quote wrapping (#673) -### Changed: -- set default false for `--timestamp-field` (#661) - -## [0.25.0] - 2021-11-19 -### Fixed: -- Fix publish failing with custom ds and assets (#610) -- Support for enum, add into store and store operations (#551) -### Added: -- Allow running node from a different port through flag `—port`(#618) -- Add flag `force-clean`, force clean the database, dropping project schemas and tables (#619) -- Add `unsafe` flag for subql/node (#629) -### Changed: -- Merge metadata from query and node (#555) -- Refactor dictionary gql queries (#613) -- Use types mapping in storeOperation (#532) -- Replace patch api with `api.at()` (#638) -- Update polkadot api to 6.9.2 (#648) - -## [0.24.0] - 2021-11-03 -### Added -- [custom ds] Read and feed assets to custom ds's `validate()` (#547) -- Improve error msg when fetch block fails (#602) -### Changed -- Bump dependencies (#584) -- Moonbeam EVM, filter before transforming with custom datasource (#593) -- Update Polkadot/api to 6.6.1 (#599) -### Fixed -- Moonbeam networks shows negative bps and fail Healthy checks (#589) - -## [0.23.1] - 2021-10-27 -### Fixed -- Disable the profiler on health check and remove logs (#569) - -## [0.23.0] - 2021-10-26 -### Added -- Add MMR service allow to acquire Proof of index information and generate Merkle mountain range root, create and store root value in a file-based database, simultaneously it updates in the corresponding MMR value in the `_poi` table. - This feature will be running along with the Proof of index service, also allow the user to specify a local path for .mmr by using flag `--mmr-path`. (#488) -- Introduce custom datasource (beta), enable subql to support a vary kind of smart contract solutions that embedded in parachains (#512) - -### Changed -- Update Polkadot/api to 6.5.2 (#564) - -### Fixed -- Performance improvement (#565) - -## [0.22.0] - 2021-10-12 -### Changed -- Update Polkadot/api to 6.3.1 to support metadata v14 (#505) -- Fetch service improve logs to include block height,it threw error at the time (#492) - -### Fixed -- Throw errors when connection dropped by http, and exit (#519) -- Addition fix for Poi service with if condition (#508) - -### Added -- Support project manifest 0.2.0 (#495) - -## [0.21.1] - 2021-09-18 -### Fixed -- Fixed apollo/client dependency issue (#482) - -## [0.21.0] - 2021-09-16 -### Changed -- Update Polkadot/api to 5.9.1 (#476) - -### Added -- Api service support http(s) endpoint (#474) -- Add Proof-of-index service allow generate and record the hash of indexed work. User can enable this feature through the `--proof-of-work` command. Please note that this feature is currently in an experimental stage. (#443) - -## [0.20.3] - 2021-09-01 -### Changed -- Update Polkadot/api to 5.7.1 (#460) - -## [0.20.2] - 2021-08-28 -### Fixed -- Solve the missing block height of the event/extrinsic in the batch returned by the dictionary service (#452) - -## [0.20.1] - 2021-08-27 -### Fixed -- Deprecated warnings (#448) - -## [0.20.0] - 2021-08-20 -### Changed -- Update Polkadot/api to 5.5.2 (#439) - -### Added -- support interpret Bytea type (#432) - -## [0.19.2] - 2021-08-16 -### Fixed -- Improve data sources filtering handling and error messages (#417) - -### Changed -- Adjust health check time to be the same as indexer timeout, or a minimum of 900 seconds. Also, log error when it is not healthy (#420) -- Update Polkadot/api to 5.5.1 (#433) - -## [0.19.1] - 2021-07-29 -### Fixed -- When the schema object type is an array convert to Jsonb type (#406) - -## [0.19.0] - 2021-07-27 -### Changed -- Bump `polkadot/api` to 5.2.1 (#402) - -### Fixed -- Disable `api.at()` in patched API (#402) -- Fix to improve snake case handling for foreign keys and unique index constraint (#382) -- Fix `subql-node --help` so that it displays full options (#396) - -### Added -- Expose best block height in meta (#392) - -## [0.18.0] - 2021-07-06 -### Fixed -- Fix metric listener handle skip dictionary (#380) - -## [0.17.4] - 2021-07-06 -### Fixed -- Fix problem when filling the block number buffer missing the last number which has caused some block records are missing. (#378) - -## [0.17.3] - 2021-07-06 -### Fixed -- Fixed bug that prevented indexes from being added automatically on foreign keys (#371) - -### Added -- add profiler to monitoring indexer performance (#369) -- add metrics to listen status of using dictionary and number of times it been skipped. (#369) - -## [0.17.2] - 2021-07-01 -### Fixed -- fix get runtimeVersion failed when fetch service initialization (#367) -- set useDictionary to false when one of the event/extrinsic filters are not provided (#367) - -## [0.17.1] - 2021-06-29 -### Fixed -- Fix an edge case for dictionary query, add blocknumber max range to speed up dictionary (#365) - -## [0.17.0] - 2021-06-25 -### Added -- Add an external dictionary feature to massively improve indexing speed. - - Enable by `--network-dictionary=` or in `project.yaml` - [read more](https://doc.subquery.network/run/run.html#using-a-dictionary) (#342) - - Add dictionary service to fetch dictionary from external GraphQL API (#342) - - Add additional block number buffer in fetch service to handle incoming dictionary data (#342) - -### Changed -- replace vm2 with @subql/x-vm2 (#358) -- Update other dependencies (#358) - -## [0.16.2] - 2021-06-28 -### Changed -- Bump polkadot/api to 4.16.2 (#363) - -## [0.16.1] - 2021-06-22 -### Added -- Add arg for enable/disable timestamp created_at and updated_at though `--timestamp-field` (#352) - -## [0.16.0] - 2021-06-22 -### Changed -- metadata expose last processed block (#327) -- Remove created_at and updated_at from table (#343) -- Bump polkadot/api to 4.15.1 (#350) - -## [0.15.1] - 2021-05-27 -### Changed -- Bump polkadot/api to 4.11.2 - -## [0.15.0] - 2021-05-24 -### Changed -- Bump polkadot/api to 4.11.1 - -### Fixed -- Skip fetch finalized block until API is ready. -- Fix indexes detection - -## [0.14.0] - 2021-05-19 -### Fixed -- Use pull instead of subscribe to get new block height. This solves issues where the subscription stalls and SubQuery reports an incorrect block height. - -### Changed -- Not all `api.rpc` are banned now, historical RPC methods can be called. See the docs [link](https://doc.subquery.network/create/mapping.html#rpc-calls) (#304) -- Bump polkadot/api dependency (#310) -- Replace vm2 with fork to support lib like `@polkadot/*` that uses esm as default (#311) - -## [0.13.0] - 2021-05-06 -### Added -- Bump release version due to recent major updates, also need publish new release to npm. - -## [0.12.3] - 2021-05-04 -### Added -- Automatically verifies that a model's indexed fields are supported by extracting indexed fields from the database (#289) -- [Experimental Feature] We're removed the restrictions on using third party CommonJS libraries in your SubQuery project sandbox - please read more about this in our [updated documentation](https://doc.subquery.network/create/mapping.html##modules-and-libraries) (#292) -- Support for more NodeJS modules (`buffer`, `crypto`, `util`, `events`, and `path`) (#294) - -## [0.12.2] - 2021-04-21 -### Added -- Enforce index on foreign key field (#285) - -### Fixed -- Improve logs for db sync, catch error and exit (#283) - -## [0.12.0] - 2021-04-20 -### Fixed -- Bump dependencies for logger -- Fix query for double map storage (#269) - -### Added -- Support network filter for dataSources (#247) -- Expose events in SubstrateBlock (#256) -- api.findCall and api.findError will use current block's metadata (#251) -- Inject global variable logger in sandbox and depricated console.log in subquery project, use logger instead. (#259) -- Create indexes on the fields with @index and allow querying by indexed field (#271) -- Create jsonb column for fields marked as jsonField in schema.graphql (#275) -- Bump @polkadot/api version to v4.6.2 - -## [0.11.0] - 2021-03-25 -### Fixed -- Fix benchmark output format issues (#235) -- Only warning when user set start block to number smaller than 1. (#239) - -### Added -- Support entity relations (#132) -- Refactor api.query...multi(),  api.queryMulti() to use rpc.queryStorageAt() (#244) - -## [0.10.2] - 2021-03-11 -### Added -- refactor logger to @subql/common (#220) -- Bump polkadot/js version to v4.0.3 which shall fix a chain data decoding issue (#222) - -## [0.10.1] - 2021-03-03 -### Fixed -- use parent's specVersion to decide if metadata need to be injected (#211) - -## [0.10.0] - 2021-03-03 -### Added -- performance improvement: reduce injectMetadata call (#206) -- performance improvement: reduce specVersion query for each batch (#207) - -## [0.9.2] - 2021-03-03 -### Added -- more comprehensive timeout error stack (#198) -- use logger.info() instead of log() for sandbox logging (#197) -- estimate time remaining consider block increases (#199) -- add configurable timeout (#202) -- bump @polkadot/api to 3.11.1 (#203) - -## [0.9.1] - 2021-03-03 -### Fixed -- revert metrics name changes (#193) - -### Added -- Update subquery starter repo path to new organization (#196) - -## [0.9.0] - 2021-02-23 -### Added -- Ian improve error logging (#181): support --log-level flag, error stack will be correctly organized -- Add benchmark outputs (#183): will print benchmark stats every 15s -- add meta api and store network info in subqueries table (#191) - -### Fixed -- fix memory overflow and timeouts while indexing a large number of events - -## [0.8.3] - 2021-02-17 -### Fixed -- keep retrying failed block not skipping it (#175) - -## [0.8.2] - 2021-02-16 -### Fixed -- fix query.system.lastRuntimeUpgrade return null before the first runtime upgrade, use rpc.state.getRuntimeVersion instead (#169) -- after connection reconnected, indexing will now resume (#168) - -## [0.8.1] - 2021-02-15 -### Fixed -- fix dependencies (#164) - -## [0.8.0] - 2021-02-15 -### Changed -- bump dependencies -- don't freeze table name (#161) - -### Added -- cache metadata if specVersion bumped (#156) -- improve logging, support --output-fmt=json (#158) -- support override network endpoint from --network-endpoint flag (#157) -- add prometheus metrics (#159) - -## [0.7.0] - 2021-01-27 -### Fixed -- fix crash for events not own by extrinsic (#120) - -### Added -- batch fetch blocks (#124) -- wrap all handler executions of same block in a db transaction (#125) -- node add startscript (#128) - -## [0.6.0] - 2021-01-25 -### Changed -- bump @polkadot/api (#90) -- clean up console output unless start with --debug (#95) -- bump @polkadot/api to v3.6.3 (#109) - -### Added -- patch and inject api in sandbox context (#103) -- support specVersion filter and success filter (#106) -- support other custom types option that @polkadot/api has (#107) - -## [0.5.0] - 2021-01-15 -### Fixed -- Fix BigInt transformation (#79) - -### Changed -- escalate sandbox out of IndexerManager (#83) - -## [0.4.0] - 2021-01-12 -### Added -- allow user to define start block in project (#54) -- add local flag to support create all tables in the default db schema (#59) -- retry when can not establish connection with postgres (#61) -- add priority to find subquery project entry point from package json file (#60) -- support load project from tarball file (#55) - -### Fixed -- read db connection strings from env (#63) - -### Changed -- [BREAKING] project manifest spec updated to support custom types (#65) - -## [0.3.0] - 2021-01-06 -### Added -- support callHandler and eventHandler (#47) - -## [0.2.0] - 2020-12-22 -### Added -- support block handler -- put subquery tables in their own db schema -- use BigInt instead of BN (#27) - -### Changed -- bump @polkadot/api to 3.1.1 - -[Unreleased]: https://github.com/subquery/subql/compare/node/0.30.1...HEAD -[0.30.1]: https://github.com/subquery/subql/compare/node/0.30.0...node/0.30.1 -[0.30.0]: https://github.com/subquery/subql/compare/node/0.29.1...node/0.30.0 -[0.29.1]: https://github.com/subquery/subql/compare/node/0.29.0...node/0.29.1 -[0.29.0]: https://github.com/subquery/subql/compare/node/0.28.2...node/0.29.1 -[0.28.2]: https://github.com/subquery/subql/compare/node/0.28.1...node/0.28.2 -[0.28.1]: https://github.com/subquery/subql/compare/node/0.28.0...node/0.28.1 -[0.28.0]: https://github.com/subquery/subql/compare/node/0.27.2...node/0.28.0 -[0.27.2]: https://github.com/subquery/subql/compare/node/0.27.1...node/0.27.2 -[0.27.1]: https://github.com/subquery/subql/compare/node/0.27.0...node/0.27.1 -[0.27.0]: https://github.com/subquery/subql/compare/node/0.26.0...node/0.27.0 -[0.26.0]: https://github.com/subquery/subql/compare/node/0.25.3...node/0.26.0 -[0.25.3]: https://github.com/subquery/subql/compare/node/0.25.2...node/0.25.3 -[0.25.2]: https://github.com/subquery/subql/compare/node/0.25.1...node/0.25.2 -[0.25.1]: https://github.com/subquery/subql/compare/node/0.25.0...node/0.25.1 -[0.25.0]: https://github.com/subquery/subql/compare/node/0.24.0...node/0.25.0 -[0.24.0]: https://github.com/subquery/subql/compare/node/0.23.1...node/0.24.0 -[0.23.1]: https://github.com/subquery/subql/compare/node/0.23.0...node/0.23.1 -[0.23.0]: https://github.com/subquery/subql/compare/v0.16.0...v0.16.1 -[0.22.0]: https://github.com/subquery/subql/compare/v0.16.0...v0.16.1 -[0.21.1]: https://github.com/subquery/subql/compare/v0.16.0...v0.16.1 -[0.21.0]: https://github.com/subquery/subql/compare/v0.16.0...v0.16.1 -[0.20.3]: https://github.com/subquery/subql/compare/v0.16.0...v0.16.1 -[0.20.2]: https://github.com/subquery/subql/compare/v0.20.1...v0.20.2 -[0.20.1]: https://github.com/subquery/subql/compare/v0.20.0...v0.20.1 -[0.20.0]: https://github.com/subquery/subql/compare/v0.19.2...v0.20.0 -[0.19.2]: https://github.com/subquery/subql/compare/v0.19.1...v0.19.2 -[0.19.1]: https://github.com/subquery/subql/compare/v0.19.0...v0.19.1 -[0.19.0]: https://github.com/subquery/subql/compare/v0.18.0...v0.19.0 -[0.18.0]: https://github.com/subquery/subql/compare/v0.17.4...v0.18.0 -[0.17.4]: https://github.com/subquery/subql/compare/v0.17.3...v0.17.4 -[0.17.3]: https://github.com/subquery/subql/compare/v0.17.2...v0.17.3 -[0.17.2]: https://github.com/subquery/subql/compare/v0.17.1...v0.17.2 -[0.17.1]: https://github.com/subquery/subql/compare/v0.17.0...v0.17.1 -[0.17.0]: https://github.com/subquery/subql/compare/v0.17.0...v0.17.0 -[0.16.2]: https://github.com/subquery/subql/compare/v0.16.1...v0.16.2 -[0.16.1]: https://github.com/subquery/subql/compare/v0.16.0...v0.16.1 -[0.16.0]: https://github.com/subquery/subql/compare/v0.15.1...v0.16.0 -[0.15.1]: https://github.com/subquery/subql/compare/v0.15.0...v0.15.1 -[0.15.0]: https://github.com/subquery/subql/compare/v0.14.0...v0.15.0 -[0.14.0]: https://github.com/subquery/subql/compare/v0.13.0...v0.14.0 -[0.13.0]: https://github.com/subquery/subql/compare/v0.12.3...v0.13.0 -[0.12.3]: https://github.com/subquery/subql/compare/v0.12.2...v0.12.3 -[0.12.2]: https://github.com/subquery/subql/compare/v0.12.0...v0.12.2 -[0.12.0]: https://github.com/subquery/subql/compare/v0.11.0...v0.12.0 -[0.11.0]: https://github.com/subquery/subql/compare/v0.10.2...v0.11.0 -[0.10.2]: https://github.com/subquery/subql/compare/v0.10.1...v0.10.2 -[0.10.1]: https://github.com/subquery/subql/compare/v0.10.0...v0.10.1 -[0.10.0]: https://github.com/subquery/subql/compare/v0.9.2...v0.10.0 -[0.9.2]: https://github.com/subquery/subql/compare/v0.9.1...v0.9.2 -[0.9.1]: https://github.com/subquery/subql/compare/v0.9.0...v0.9.1 -[0.9.0]: https://github.com/OnFinality-io/subql/compare/v0.8.3...v0.9.0 -[0.8.3]: https://github.com/OnFinality-io/subql/compare/v0.8.2...v0.8.3 -[0.8.2]: https://github.com/OnFinality-io/subql/compare/v0.8.1...v0.8.2 -[0.8.1]: https://github.com/OnFinality-io/subql/compare/v0.8.0...v0.8.1 -[0.8.0]: https://github.com/OnFinality-io/subql/compare/v0.7.0...v0.8.0 -[0.7.0]: https://github.com/OnFinality-io/subql/compare/v0.6.0...v0.7.0 -[0.6.0]: https://github.com/OnFinality-io/subql/compare/v0.5.0...v0.6.0 -[0.5.0]: https://github.com/OnFinality-io/subql/compare/v0.4.0...v0.5.0 -[0.4.0]: https://github.com/OnFinality-io/subql/compare/v0.3.0...v0.4.0 -[0.3.0]: https://github.com/OnFinality-io/subql/compare/v0.2.0...v0.3.0 diff --git a/packages/node/Dockerfile b/packages/node/Dockerfile index 9548515f..fcaa75f6 100644 --- a/packages/node/Dockerfile +++ b/packages/node/Dockerfile @@ -1,8 +1,8 @@ # production images FROM node:16 as builder ARG RELEASE_VERSION -ENTRYPOINT ["subql-node"] -RUN npm i -g --unsafe-perm @subql/node@${RELEASE_VERSION} +ENTRYPOINT ["subql-node-ethereum"] +RUN npm i -g --unsafe-perm @subql/node-ethereum@${RELEASE_VERSION} FROM node:16-alpine ENV TZ utc @@ -10,5 +10,5 @@ ENV TZ utc RUN apk add --no-cache tini git curl COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/lib/node_modules/@subql/node/bin/run"] +ENTRYPOINT ["/sbin/tini", "--", "/usr/local/lib/node_modules/@subql/node-ethereum/bin/run"] CMD ["-f","/app"] diff --git a/packages/node/docker/docker-compose.yml b/packages/node/docker-compose.yml similarity index 74% rename from packages/node/docker/docker-compose.yml rename to packages/node/docker-compose.yml index 0378c573..ea72a023 100644 --- a/packages/node/docker/docker-compose.yml +++ b/packages/node/docker-compose.yml @@ -2,9 +2,7 @@ version: '3' services: postgres: - build: - context: . - dockerfile: pg-Dockerfile + image: postgres:12-alpine ports: - 5432:5432 volumes: diff --git a/packages/node/docker/load-extensions.sh b/packages/node/docker/load-extensions.sh deleted file mode 100644 index 317b663d..00000000 --- a/packages/node/docker/load-extensions.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" < { - describe('convert manifest to project object', () => { - let projectDirV0_2_0: string; - let projectDirV0_3_0: string; - let projectDirV1_0_0: string; - let templateProject: string; - - beforeEach(() => { - projectDirV0_2_0 = path.resolve( - __dirname, - '../../test/projectFixture/v0.2.0', - ); - - projectDirV0_3_0 = path.resolve( - __dirname, - '../../test/projectFixture/v0.3.0', - ); - - projectDirV1_0_0 = path.resolve( - __dirname, - '../../test/projectFixture/v1.0.0', - ); - templateProject = path.resolve( - __dirname, - '../../test/projectFixture/template-v1.0.0', - ); - }); - - it('convert local 0.2.0 manifest to project object', async () => { - //manually pass the endpoint - const project = await SubqueryProject.create(projectDirV0_2_0, { - endpoint: 'wss://rpc.polkadot.io/public-ws', - }); - - expect((project.dataSources[1] as any).processor.file).toMatch( - /moonbeam.js/, - ); - }, 5000000); - - it('convert local 0.3.0 manifest to project object', async () => { - //manually pass the endpoint - const project = await SubqueryProject.create(projectDirV0_3_0, { - endpoint: 'wss://rpc.polkadot.io/public-ws', - }); - - expect((project.dataSources[1] as any).processor.file).toMatch( - /moonbeam.js/, - ); - }, 5000000); - - it.skip('convert 0.2.0 ipfs deployment to project object', async () => { - const deployment = `ipfs://QmUdQKsfHox5qcEYKCVZQwWtye8bdGQM2vCZrw6o4NBKwm`; - //manually pass the endpoint - const project = await SubqueryProject.create( - deployment, - { endpoint: 'wss://rpc.polkadot.io/public-ws' }, - { ipfs: 'http://127.0.0.1:8080' }, - ); - }, 5000000); - - it('convert 1.0.0 ipfs deployment to project object', async () => { - const expectedRunner = { - node: { - name: '@subql/node', - version: '>=1.0.0', - }, - query: { - name: '@subql/query', - version: '*', - }, - }; - const project = await SubqueryProject.create(projectDirV1_0_0, { - endpoint: 'wss://rpc.polkadot.io/public-ws', - }); - - expect(project.runner).toMatchObject(expectedRunner); - }, 500000); - - it('check processChainId', async () => { - const project = await SubqueryProject.create(projectDirV1_0_0, { - endpoint: 'wss://rpc.polkadot.io/public-ws', - }); - expect(project.network.chainId).toMatch( - '0x401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b', - ); - }, 5000000); - - it('check loadProjectTemplates', async () => { - const project = await SubqueryProject.create(templateProject, { - endpoint: 'wss://moonbeam-alpha.api.onfinality.io/public-ws', - }); - const project_v1 = await SubqueryProject.create(projectDirV1_0_0, { - endpoint: 'wss://rpc.polkadot.io/public-ws', - }); - expect(project_v1).not.toContain('template'); - expect(project.templates.length).toBe(1); - }); - }); -}); diff --git a/packages/node/src/configure/SubqueryProject.ts b/packages/node/src/configure/SubqueryProject.ts index c94e277a..ae3bd536 100644 --- a/packages/node/src/configure/SubqueryProject.ts +++ b/packages/node/src/configure/SubqueryProject.ts @@ -10,15 +10,12 @@ import { validateSemver, } from '@subql/common'; import { - SubstrateProjectNetworkConfig, - parseSubstrateProjectManifest, - ProjectManifestV0_2_0Impl, - ProjectManifestV0_2_1Impl, - ProjectManifestV0_3_0Impl, - SubstrateDataSource, + EthereumProjectNetworkConfig, + parseEthereumProjectManifest, + SubqlEthereumDataSource, FileType, ProjectManifestV1_0_0Impl, -} from '@subql/common-substrate'; +} from '@subql/common-ethereum'; import { buildSchemaFromString } from '@subql/utils'; import { GraphQLSchema } from 'graphql'; import { @@ -27,8 +24,8 @@ import { updateDataSourcesV0_2_0, } from '../utils/project'; -export type SubqlProjectDs = SubstrateDataSource & { - mapping: SubstrateDataSource['mapping'] & { entryScript: string }; +export type SubqlProjectDs = SubqlEthereumDataSource & { + mapping: SubqlEthereumDataSource['mapping'] & { entryScript: string }; }; export type SubqlProjectDsTemplate = Omit & { @@ -42,7 +39,7 @@ const NOT_SUPPORT = (name: string) => () => { export class SubqueryProject { id: string; root: string; - network: Partial; + network: Partial; dataSources: SubqlProjectDs[]; schema: GraphQLSchema; templates: SubqlProjectDsTemplate[]; @@ -51,7 +48,7 @@ export class SubqueryProject { static async create( path: string, - networkOverrides?: Partial, + networkOverrides?: Partial, readerOptions?: ReaderOptions, ): Promise { // We have to use reader here, because path can be remote or local @@ -61,32 +58,17 @@ export class SubqueryProject { if (projectSchema === undefined) { throw new Error(`Get manifest from project path ${path} failed`); } + const manifest = parseEthereumProjectManifest(projectSchema); - const manifest = parseSubstrateProjectManifest(projectSchema); - - if (manifest.isV0_0_1) { - NOT_SUPPORT('0.0.1'); - } else if (manifest.isV0_2_0 || manifest.isV0_3_0) { - return loadProjectFromManifestBase( - manifest.asV0_2_0, - reader, - path, - networkOverrides, - ); - } else if (manifest.isV0_2_1) { - return loadProjectFromManifest0_2_1( - manifest.asV0_2_1, - reader, - path, - networkOverrides, - ); - } else if (manifest.isV1_0_0) { + if (manifest.isV1_0_0) { return loadProjectFromManifest1_0_0( manifest.asV1_0_0, reader, path, networkOverrides, ); + } else { + NOT_SUPPORT(manifest.specVersion); } } } @@ -108,17 +90,13 @@ function processChainId(network: any): SubqueryProjectNetwork { return network; } -type SUPPORT_MANIFEST = - | ProjectManifestV0_2_0Impl - | ProjectManifestV0_2_1Impl - | ProjectManifestV0_3_0Impl - | ProjectManifestV1_0_0Impl; +type SUPPORT_MANIFEST = ProjectManifestV1_0_0Impl; async function loadProjectFromManifestBase( projectManifest: SUPPORT_MANIFEST, reader: Reader, path: string, - networkOverrides?: Partial, + networkOverrides?: Partial, ): Promise { const root = await getProjectRoot(reader); @@ -163,33 +141,16 @@ async function loadProjectFromManifestBase( }; } -async function loadProjectFromManifest0_2_1( - projectManifest: ProjectManifestV0_2_1Impl, - reader: Reader, - path: string, - networkOverrides?: Partial, -): Promise { - const project = await loadProjectFromManifestBase( - projectManifest, - reader, - path, - networkOverrides, - ); - project.templates = await loadProjectTemplates( - projectManifest, - project.root, - reader, - ); - return project; -} - -const { version: packageVersion } = require('../../package.json'); +const { + name: packageName, + version: packageVersion, +} = require('../../package.json'); async function loadProjectFromManifest1_0_0( projectManifest: ProjectManifestV1_0_0Impl, reader: Reader, path: string, - networkOverrides?: Partial, + networkOverrides?: Partial, ): Promise { const project = await loadProjectFromManifestBase( projectManifest, @@ -197,12 +158,12 @@ async function loadProjectFromManifest1_0_0( path, networkOverrides, ); - project.templates = await loadProjectTemplates( - projectManifest, - project.root, - reader, - ); project.runner = projectManifest.runner; + if (packageName !== project.runner.node.name) { + throw new Error( + `Runner requires ${project.runner.node.name}, current node ${packageName}`, + ); + } if (!validateSemver(packageVersion, project.runner.node.version)) { throw new Error( `Runner require node version ${project.runner.node.version}, current node ${packageVersion}`, @@ -210,21 +171,3 @@ async function loadProjectFromManifest1_0_0( } return project; } - -async function loadProjectTemplates( - projectManifest: ProjectManifestV0_2_1Impl | ProjectManifestV1_0_0Impl, - root: string, - reader: Reader, -): Promise { - if (projectManifest.templates && projectManifest.templates.length !== 0) { - const dsTemplates = await updateDataSourcesV0_2_0( - projectManifest.templates, - reader, - root, - ); - return dsTemplates.map((ds, index) => ({ - ...ds, - name: projectManifest.templates[index].name, - })); - } -} diff --git a/packages/node/src/configure/configure.module.ts b/packages/node/src/configure/configure.module.ts index 551803c2..c42aca52 100644 --- a/packages/node/src/configure/configure.module.ts +++ b/packages/node/src/configure/configure.module.ts @@ -5,7 +5,7 @@ import assert from 'assert'; import path from 'path'; import { DynamicModule, Global, Module } from '@nestjs/common'; import { getProjectRootAndManifest, IPFS_REGEX } from '@subql/common'; -import { SubstrateProjectNetworkConfig } from '@subql/common-substrate'; +import { EthereumProjectNetworkConfig } from '@subql/common-ethereum'; import { IConfig, MinConfig, @@ -125,7 +125,7 @@ export class ConfigureModule { const project = async () => { const p = await SubqueryProject.create( argv.subquery, - omitBy( + omitBy>( { endpoint: config.networkEndpoint, dictionary: config.networkDictionary, diff --git a/packages/node/src/ethereum/api.ethereum.ts b/packages/node/src/ethereum/api.ethereum.ts new file mode 100644 index 00000000..55f70c90 --- /dev/null +++ b/packages/node/src/ethereum/api.ethereum.ts @@ -0,0 +1,241 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import assert from 'assert'; +import fs from 'fs'; +import http from 'http'; +import https from 'https'; +import url from 'url'; +import { Interface } from '@ethersproject/abi'; +import { hexDataSlice } from '@ethersproject/bytes'; +import { parse as parseTx } from '@ethersproject/transactions'; +import { RuntimeDataSourceV0_2_0 } from '@subql/common-ethereum'; +import { getLogger } from '@subql/node-core'; +import { + ApiWrapper, + BlockWrapper, + EthereumBlockWrapper, + EthereumTransaction, + EthereumResult, + EthereumLog, +} from '@subql/types-ethereum'; +import { ethers } from 'ethers'; +import { EthereumBlockWrapped } from './block.ethereum'; +import { + formatBlock, + formatReceipt, + formatTransaction, +} from './utils.ethereum'; +const Web3HttpProvider = require('web3-providers-http'); +const Web3WsProvider = require('web3-providers-ws'); + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { version: packageVersion } = require('../../package.json'); + +const logger = getLogger('api.ethereum'); + +async function loadAssets( + ds: RuntimeDataSourceV0_2_0, +): Promise> { + if (!ds.assets) { + return {}; + } + const res: Record = {}; + + for (const [name, { file }] of Object.entries(ds.assets)) { + try { + res[name] = await fs.promises.readFile(file, { encoding: 'utf8' }); + } catch (e) { + throw new Error(`Failed to load datasource asset ${file}`); + } + } + + return res; +} + +export class EthereumApi implements ApiWrapper { + private client: ethers.providers.Web3Provider; + private genesisBlock: Record; + private contractInterfaces: Record = {}; + private chainId: number; + + constructor(private endpoint: string) { + const { hostname, pathname, port, protocol, searchParams } = new URL( + endpoint, + ); + const httpAgent = new http.Agent({ keepAlive: true, maxSockets: 10 }); + const httpsAgent = new https.Agent({ keepAlive: true, maxSockets: 10 }); + + const protocolStr = protocol.replace(':', ''); + const portNum = port + ? parseInt(port, 10) + : protocolStr === 'https' + ? undefined + : 80; + + let provider; + if (protocolStr === 'https' || protocolStr === 'http') { + const options = { + keepAlive: true, + headers: { + name: 'User-Agent', + value: `Subquery-Node ${packageVersion}`, + }, + agent: { + http: httpAgent, + https: httpsAgent, + }, + }; + if ((searchParams as any).apiKey) { + (options.headers as any).apiKey = searchParams.get('apiKey'); + } + provider = new Web3HttpProvider(this.endpoint, options); + } else if (protocolStr === 'ws' || protocolStr === 'wss') { + const options = { + headers: { + 'User-Agent': `Subquery-Node ${packageVersion}`, + }, + clientConfig: { + keepAlive: true, + }, + }; + if ((searchParams as any).apiKey) { + (options.headers as any).apiKey = searchParams.get('apiKey'); + } + + provider = new Web3WsProvider(endpoint, options); + } else { + throw new Error(`Unsupported protocol: ${protocol}`); + } + + this.client = new ethers.providers.Web3Provider(provider); + } + + async init(): Promise { + this.genesisBlock = await this.client.send('eth_getBlockByNumber', [ + ethers.utils.hexValue(0), + true, + ]); + logger.info(this.endpoint); + + this.chainId = await this.client.send('net_version', []); + } + + async getLastHeight(): Promise { + return this.client.getBlockNumber(); + } + + getRuntimeChain(): string { + return 'ethereum'; + } + + getChainId(): number { + return this.chainId; + } + + getGenesisHash(): string { + return this.genesisBlock.hash; + } + + getSpecName(): string { + return 'ethereum'; + } + + async getFinalizedBlockHeight(): Promise { + // Doesn't seem to be a difference between finalized and latest + return this.client.getBlockNumber(); + } + + async fetchBlocks(bufferBlocks: number[]): Promise { + return Promise.all( + bufferBlocks.map(async (num) => { + try { + // Fetch Block + const block_promise = await this.client.send('eth_getBlockByNumber', [ + ethers.utils.hexValue(num), + true, + ]); + + const block = formatBlock(block_promise); + //const block = this.client.formatter.blockWithTransactions(rawBlock); + block.stateRoot = this.client.formatter.hash(block.stateRoot); + // Get transaction receipts + const transactions = await Promise.all( + block.transactions.map(async (tx) => { + //logger.info(JSON.stringify(tx)) + const transaction = formatTransaction(tx); + const receipt = await this.client.send( + 'eth_getTransactionReceipt', + [tx.hash], + ); + + transaction.receipt = formatReceipt(receipt, block); + return transaction; + }), + ); + return new EthereumBlockWrapped(block, transactions); + } catch (e) { + // Wrap error from an axios error to fix issue with error being undefined + const error = new Error(e.message); + logger.error(error, `Failed to fetch block at height ${num}`); + throw error; + } + }), + ); + } + + freezeApi(processor: any, blockContent: BlockWrapper): void { + processor.freeze(this.client, 'api'); + } + + private buildInterface( + abiName: string, + assets: Record, + ): Interface | undefined { + if (!assets[abiName]) { + throw new Error(`ABI named "${abiName}" not referenced in assets`); + } + + // This assumes that all datasources have a different abi name or they are the same abi + if (!this.contractInterfaces[abiName]) { + // Constructing the interface validates the ABI + try { + let abiObj = JSON.parse(assets[abiName]); + + /* + * Allows parsing JSON artifacts as well as ABIs + * https://trufflesuite.github.io/artifact-updates/background.html#what-are-artifacts + */ + if (!Array.isArray(abiObj) && abiObj.abi) { + abiObj = abiObj.abi; + } + + this.contractInterfaces[abiName] = new Interface(abiObj); + } catch (e) { + logger.error(`Unable to parse ABI: ${e.message}`); + throw new Error('ABI is invalid'); + } + } + + return this.contractInterfaces[abiName]; + } + + async parseLog( + log: EthereumLog, + ds: RuntimeDataSourceV0_2_0, + ): Promise | EthereumLog> { + try { + if (!ds?.options?.abi) { + return log; + } + const iface = this.buildInterface(ds.options.abi, await loadAssets(ds)); + return { + ...log, + args: iface?.parseLog(log).args as T, + }; + } catch (e) { + logger.warn(`Failed to parse log data: ${e.message}`); + return log; + } + } +} diff --git a/packages/node/src/ethereum/api.service.ethereum.ts b/packages/node/src/ethereum/api.service.ethereum.ts new file mode 100644 index 00000000..6abb136d --- /dev/null +++ b/packages/node/src/ethereum/api.service.ethereum.ts @@ -0,0 +1,58 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { Injectable } from '@nestjs/common'; +import { ProjectNetworkV1_0_0 } from '@subql/common-ethereum'; +import { ApiService, getLogger } from '@subql/node-core'; +import { EthereumApi } from './api.ethereum'; + +const logger = getLogger('api'); + +@Injectable() +export class EthereumApiService extends ApiService { + private _api: EthereumApi; + + async init(): Promise { + try { + let network: ProjectNetworkV1_0_0; + try { + network = this.project.network; + } catch (e) { + logger.error(Object.keys(e)); + process.exit(1); + } + + this.api = new EthereumApi(network.endpoint); + + await this.api.init(); + this.networkMeta = { + chain: this.api.getRuntimeChain(), + specName: this.api.getSpecName(), + genesisHash: this.api.getGenesisHash(), + }; + + if (network.chainId !== this.api.getChainId().toString()) { + const err = new Error( + `Network chainId doesn't match expected chainId. expected="${ + network.chainId + }" actual="${this.api.getChainId()}`, + ); + logger.error(err, err.message); + throw err; + } + + return this; + } catch (e) { + logger.error(e, 'Failed to init api service'); + process.exit(1); + } + } + + get api(): EthereumApi { + return this._api; + } + + private set api(value: EthereumApi) { + this._api = value; + } +} diff --git a/packages/node/src/ethereum/block.ethereum.ts b/packages/node/src/ethereum/block.ethereum.ts new file mode 100644 index 00000000..c487e132 --- /dev/null +++ b/packages/node/src/ethereum/block.ethereum.ts @@ -0,0 +1,126 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { + EthereumBlock, + EthereumTransactionFilter, + EthereumLog, + EthereumLogFilter, + EthereumResult, + EthereumBlockFilter, + EthereumBlockWrapper, + EthereumTransaction, +} from '@subql/types-ethereum'; +import { ethers } from 'ethers'; +import { flatten } from 'lodash'; +import { + eventToTopic, + functionToSighash, + hexStringEq, + stringNormalizedEq, +} from '../utils/string'; +import { formatLog } from './utils.ethereum'; + +export class EthereumBlockWrapped implements EthereumBlockWrapper { + private _logs: EthereumLog[]; + constructor( + private _block: EthereumBlock, + private _txs: EthereumTransaction[], + ) { + this._logs = flatten(_txs.map((tx) => tx.receipt.logs)).map((log) => + formatLog(log, _block), + ) as EthereumLog[]; + this._logs.map((log) => { + log.block = this.block; + return log; + }); + this.block.logs = this._logs.map((log) => { + const logCopy = { ...log }; + logCopy.block = undefined; + return logCopy; + }); + } + + get block(): EthereumBlock { + return this._block; + } + + get blockHeight(): number { + return this.block.number; + } + + get hash(): string { + return this.block.hash; + } + + get transactions(): EthereumTransaction[] { + return this._txs; + } + + get logs(): EthereumLog[] { + return this._logs; + } + + static filterBlocksProcessor( + block: EthereumBlock, + filter: EthereumBlockFilter, + ): boolean { + if (filter?.modulo && block.number % filter.modulo !== 0) { + return false; + } + return true; + } + + static filterTransactionsProcessor( + transaction: EthereumTransaction, + filter: EthereumTransactionFilter, + address?: string, + ): boolean { + if (!filter) return true; + if (filter.to && !stringNormalizedEq(filter.to, transaction.to)) { + return false; + } + if (filter.from && !stringNormalizedEq(filter.from, transaction.from)) { + return false; + } + if (address && !filter.to && !stringNormalizedEq(address, transaction.to)) { + return false; + } + if ( + filter.function && + transaction.input.indexOf(functionToSighash(filter.function)) !== 0 + ) { + return false; + } + return true; + } + + static filterLogsProcessor( + log: EthereumLog, + filter: EthereumLogFilter, + address?: string, + ): boolean { + if (address && !stringNormalizedEq(address, log.address)) { + return false; + } + + if (!filter) return true; + + if (filter.topics) { + for (let i = 0; i < Math.min(filter.topics.length, 4); i++) { + const topic = filter.topics[i]; + if (!topic) { + continue; + } + + if (!log.topics[i]) { + return false; + } + if (!hexStringEq(eventToTopic(topic), log.topics[i])) { + return false; + } + } + } + return true; + } +} diff --git a/packages/common-substrate/src/project/versioned/v0_3_0/index.ts b/packages/node/src/ethereum/index.ts similarity index 59% rename from packages/common-substrate/src/project/versioned/v0_3_0/index.ts rename to packages/node/src/ethereum/index.ts index a193755c..a7b88434 100644 --- a/packages/common-substrate/src/project/versioned/v0_3_0/index.ts +++ b/packages/node/src/ethereum/index.ts @@ -1,5 +1,5 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './model'; -export * from './types'; +export * from './api.ethereum'; +export * from './api.service.ethereum'; diff --git a/packages/node/src/ethereum/utils.ethereum.ts b/packages/node/src/ethereum/utils.ethereum.ts new file mode 100644 index 00000000..62332f06 --- /dev/null +++ b/packages/node/src/ethereum/utils.ethereum.ts @@ -0,0 +1,147 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { getAddress } from '@ethersproject/address'; +import { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import { Zero } from '@ethersproject/constants'; +import { + ApiWrapper, + EthereumBlock, + EthereumLog, + EthereumReceipt, + EthereumResult, + EthereumTransaction, +} from '@subql/types-ethereum'; +import { ethers } from 'ethers'; + +export function calcInterval(api: ApiWrapper): number { + // TODO find a way to get this from the blockchain + return 6000; +} + +function handleAddress(value: string): string { + if (value === '0x') { + return null; + } + return getAddress(value); +} + +function handleNumber(value: string | number): BigNumber { + if (value === undefined) { + return Zero; + } + if (value === '0x') { + return Zero; + } + return BigNumber.from(value); +} + +export function formatBlock(block: Record): EthereumBlock { + const newBlock: EthereumBlock = { + difficulty: handleNumber(block.difficulty).toBigInt(), + extDataGasUsed: block.extDataGasUsed, + extDataHash: block.extDataHash, + gasLimit: handleNumber(block.gasLimit).toBigInt(), + gasUsed: handleNumber(block.gasUsed).toBigInt(), + hash: block.hash, + logsBloom: block.logsBloom, + miner: block.miner, + mixHash: block.mixHash, + nonce: block.nonce, + number: handleNumber(block.number).toNumber(), + parentHash: block.parentHash, + receiptsRoot: block.receiptsRoot, + sha3Uncles: block.sha3Uncles, + size: handleNumber(block.size).toBigInt(), + stateRoot: block.stateRoot, + timestamp: handleNumber(block.timestamp).toBigInt(), + totalDifficulty: handleNumber(block.totalDifficulty).toBigInt(), + transactions: block.transactions, + transactionsRoot: block.transactionsRoot, + uncles: block.uncles, + baseFeePerGas: block.baseFeePerGas + ? handleNumber(block.baseFeePerGas).toBigInt() + : undefined, + blockGasCost: block.blockGasCost + ? handleNumber(block.blockGasCost).toBigInt() + : undefined, + blockExtraData: block.blockExtraData, + logs: [], // Filled in at AvalancheBlockWrapped constructor + }; + + return newBlock; +} +export function formatLog( + log: EthereumLog | EthereumLog, + block: EthereumBlock, +): EthereumLog | EthereumLog { + const newLog: EthereumLog = { + address: log.address, + topics: log.topics, + data: log.data, + blockNumber: handleNumber(log.blockNumber).toNumber(), + transactionHash: log.transactionHash, + transactionIndex: handleNumber(log.transactionIndex).toNumber(), + blockHash: log.blockHash, + logIndex: handleNumber(log.logIndex).toNumber(), + removed: log.removed, + args: log.args, + block, + }; + return newLog; +} + +export function formatTransaction( + tx: Record, +): EthereumTransaction { + const transaction: EthereumTransaction = { + blockHash: tx.blockHash, + blockNumber: handleNumber(tx.blockNumber).toNumber(), + from: tx.from, + gas: handleNumber(tx.gas).toBigInt(), + gasPrice: handleNumber(tx.gasPrice).toBigInt(), + hash: tx.hash, + input: tx.input, + nonce: handleNumber(tx.nonce).toBigInt(), + to: tx.to, + transactionIndex: handleNumber(tx.transactionIndex).toBigInt(), + value: handleNumber(tx.value).toBigInt(), + type: tx.type, + v: handleNumber(tx.v).toBigInt(), + r: tx.r, + s: tx.s, + accessList: tx.accessList, + chainId: tx.chainId, + maxFeePerGas: tx.maxFeePerGas + ? handleNumber(tx.maxFeePerGas).toBigInt() + : undefined, + maxPriorityFeePerGas: tx.maxPriorityFeePerGas + ? handleNumber(tx.maxPriorityFeePerGas).toBigInt() + : undefined, + receipt: undefined, // Filled in at AvalancheApi.fetchBlocks + }; + return transaction; +} + +export function formatReceipt( + receipt: Record, + block: EthereumBlock, +): EthereumReceipt { + const newReceipt: EthereumReceipt = { + blockHash: receipt.blockHash, + blockNumber: handleNumber(receipt.blockNumber).toNumber(), + contractAddress: receipt.contractAddress, + cumulativeGasUsed: handleNumber(receipt.cumulativeGasUsed).toBigInt(), + effectiveGasPrice: handleNumber(receipt.effectiveGasPrice).toBigInt(), + from: receipt.from, + gasUsed: handleNumber(receipt.gasUsed).toBigInt(), + logs: receipt.logs.map((log) => formatLog(log, block)), + logsBloom: receipt.logsBloom, + status: Boolean(handleNumber(receipt.status).toNumber()), + to: receipt.to, + transactionHash: receipt.transactionHash, + transactionIndex: handleNumber(receipt.transactionIndex).toNumber(), + type: receipt.type, + }; + return newReceipt; +} diff --git a/packages/node/src/indexer/api.service.spec.ts b/packages/node/src/indexer/api.service.spec.ts deleted file mode 100644 index 49579a65..00000000 --- a/packages/node/src/indexer/api.service.spec.ts +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { EventEmitter2 } from '@nestjs/event-emitter'; -import { ApiPromise, WsProvider } from '@polkadot/api'; -import { ProjectNetworkV0_0_1 } from '@subql/common-substrate'; -import { GraphQLSchema } from 'graphql'; -import { omit } from 'lodash'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { ApiService } from './api.service'; - -jest.mock('@polkadot/api', () => { - const ApiPromise = jest.fn(); - (ApiPromise as any).create = jest.fn(() => ({ - on: jest.fn(), - runtimeChain: jest.fn(), - runtimeVersion: { specName: jest.fn() }, - genesisHash: - '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe', - consts: jest.fn(), - })); - return { ApiPromise, WsProvider: jest.fn() }; -}); - -const testNetwork: ProjectNetworkV0_0_1 = { - endpoint: 'wss://kusama.api.onfinality.io/public-ws', - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { TestType2: 'test' }, - }, - typesBundle: { - spec: { - '2312': { - types: [{ minmax: [232, 122], types: { TestType3: 'test3' } }], - }, - }, - chain: { - mockchain: { - types: [{ minmax: [232, 122], types: { TestType4: 'test4' } }], - }, - }, - }, - typesChain: { chain2: { TestType5: 'test' } }, - typesSpec: { spec3: { TestType6: 'test' } }, -}; - -function testSubqueryProject(): SubqueryProject { - return { - network: { - endpoint: testNetwork.endpoint, - genesisHash: - '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe', - }, - chainTypes: { - types: testNetwork.types, - typesAlias: testNetwork.typesAlias, - typesBundle: testNetwork.typesBundle, - typesChain: testNetwork.typesChain, - typesSpec: testNetwork.typesSpec, - }, - dataSources: [], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -describe('ApiService', () => { - it('read custom types from project manifest', async () => { - const project = testSubqueryProject(); - const apiService = new ApiService(project, new EventEmitter2()); - await apiService.init(); - expect(WsProvider).toHaveBeenCalledWith(testNetwork.endpoint); - expect(ApiPromise.create).toHaveBeenCalledWith({ - provider: expect.anything(), - throwOnConnect: expect.anything(), - noInitWarn: true, - ...omit(testNetwork, ['endpoint']), - }); - }); - - it('throws if expected genesis hash doesnt match', async () => { - const project = testSubqueryProject(); - - // Now after manifest 1.0.0, will use chainId instead of genesisHash - (project.network as any).chainId = '0x'; - - const apiService = new ApiService(project, new EventEmitter2()); - - await expect(apiService.init()).rejects.toThrow(); - }); -}); diff --git a/packages/node/src/indexer/api.service.test.ts b/packages/node/src/indexer/api.service.test.ts deleted file mode 100644 index aa658275..00000000 --- a/packages/node/src/indexer/api.service.test.ts +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { INestApplication } from '@nestjs/common'; -import { EventEmitterModule } from '@nestjs/event-emitter'; -import { Test } from '@nestjs/testing'; -import { BlockHash, RuntimeVersion } from '@polkadot/types/interfaces'; -import { delay } from '@subql/node-core'; -import { SubstrateBlock } from '@subql/types'; -import { GraphQLSchema } from 'graphql'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { wrapBlock } from '../utils/substrate'; -import { ApiService } from './api.service'; - -const WS_ENDPOINT = 'wss://kusama.api.onfinality.io/public-ws'; -const HTTP_ENDPOINT = 'https://kusama.api.onfinality.io/public'; - -const TEST_BLOCKHASH = - '0x70070f6c1ad5b9ce3d0a09e94086e22b8d4f08a18491183de96614706bf59600'; // kusama #6721189 - -const TEST_BLOCKNUMBER = 6721189; // kusama - -function testSubqueryProject(endpoint: string): SubqueryProject { - return { - network: { - endpoint, - dictionary: `https://api.subquery.network/sq/subquery/dictionary-polkadot`, - }, - dataSources: [], - id: 'test', - root: './', - chainTypes: { - types: { - TestType: 'u32', - }, - }, - schema: new GraphQLSchema({}), - templates: [], - }; -} - -jest.setTimeout(90000); -describe('ApiService', () => { - let app: INestApplication; - - afterEach(async () => { - return app?.close(); - }); - - const prepareApiService = async ( - endpoint: string = WS_ENDPOINT, - ): Promise => { - const module = await Test.createTestingModule({ - providers: [ - { - provide: SubqueryProject, - useFactory: () => testSubqueryProject(endpoint), - }, - ApiService, - ], - imports: [EventEmitterModule.forRoot()], - }).compile(); - - app = module.createNestApplication(); - await app.init(); - const apiService = app.get(ApiService); - await apiService.init(); - return apiService; - }; - - it('can instantiate api', async () => { - const apiService = await prepareApiService(); - const api = apiService.getApi(); - - const apiAt = await api.at(TEST_BLOCKHASH); - apiAt.registry; - expect(api.registry.getDefinition('TestType')).toEqual('u32'); - // workaround for ending the test immediately (before return of subscribeRuntimeVersion) - // will cause an unhandled promise rejection and affect the result of next test. - await delay(0.5); - }); - - it('api query is locked at specified block', async () => { - const apiService = await prepareApiService(); - const api = apiService.getApi(); - const blockhash = await api.rpc.chain.getBlockHash(2); - const validators = await api.query.session.validators.at(blockhash); - const block = await api.rpc.chain.getBlock(blockhash); - const mockBlock = wrapBlock(block, []) as unknown as SubstrateBlock; - const runtimeVersion = { specVersion: 1 } as unknown as RuntimeVersion; - const patchedApi = await apiService.getPatchedApi( - mockBlock, - runtimeVersion, - ); - const [patchedValidators, currentValidators] = await Promise.all([ - patchedApi.query.session.validators(), - api.query.session.validators(), - ]); - expect(validators).toMatchObject(patchedValidators); - expect(patchedValidators).not.toMatchObject(currentValidators); - }); - - it('api query input is double map', async () => { - const apiService = await prepareApiService(); - const api = apiService.getApi(); - const blockhash = await api.rpc.chain.getBlockHash(6721189); - const block = await api.rpc.chain.getBlock(blockhash); - const mockBlock = wrapBlock(block, []) as unknown as SubstrateBlock; - const runtimeVersion = { specVersion: 13 } as unknown as RuntimeVersion; - const patchedApi = await apiService.getPatchedApi( - mockBlock, - runtimeVersion, - ); - const apiResults = await api.query.staking.erasStakers.at( - blockhash, - 2038, - `DMkKL7AZw9TkNw2NaBdocmFRGUG8r8T4kdGGcB13fv2LARy`, - ); - const patchedResult = await patchedApi.query.staking.erasStakers( - 2038, - `DMkKL7AZw9TkNw2NaBdocmFRGUG8r8T4kdGGcB13fv2LARy`, - ); - expect(apiResults).toEqual(patchedResult); - await delay(0.5); - }); - - it('apiAt could fetch previous block info', async () => { - const apiService = await prepareApiService( - 'wss://polkadot.api.onfinality.io/public-ws', - ); - const api = apiService.getApi(); - const blockhash = await api.rpc.chain.getBlockHash(6721195); - const block = await api.rpc.chain.getBlock(blockhash); - const mockBlock = wrapBlock(block, []) as unknown as SubstrateBlock; - const runtimeVersion = { specVersion: 9090 } as unknown as RuntimeVersion; - // step 1, get early block, original polkadot api query result - const earlyBlockhash = await api.rpc.chain.getBlockHash(5661443); - const apiResults = await api.rpc.state.getRuntimeVersion(earlyBlockhash); - // step 2, api get patched result with block height - const patchedApi = await apiService.getPatchedApi( - mockBlock, - runtimeVersion, - ); - const patchedResult = await patchedApi.rpc.state.getRuntimeVersion( - earlyBlockhash, - ); - expect(apiResults).toEqual(patchedResult); - // patchedApi without input blockHash, will return runtimeVersion at 6721195 - const patchedResult2 = await patchedApi.rpc.state.getRuntimeVersion(); - expect(apiResults).not.toEqual(patchedResult2); - // To be same as runtimeVersion at 6721195 - expect(patchedResult2.specVersion.toNumber()).toEqual(9090); - await delay(0.5); - }); - - it('apiAt will throw when fetch future block info', async () => { - const apiService = await prepareApiService( - 'wss://polkadot.api.onfinality.io/public-ws', - ); - const api = apiService.getApi(); - const blockhash = await api.rpc.chain.getBlockHash(5661443); - const block = await api.rpc.chain.getBlock(blockhash); - const mockBlock = wrapBlock(block, []) as unknown as SubstrateBlock; - const runtimeVersion = { specVersion: 9050 } as unknown as RuntimeVersion; - // step 1, get future block, original polkadot api query result - const futureBlockhash = await api.rpc.chain.getBlockHash(6721195); - // step 2, api get patched result with block height - const patchedApi = await apiService.getPatchedApi( - mockBlock, - runtimeVersion, - ); - await expect( - patchedApi.rpc.state.getRuntimeVersion(futureBlockhash), - ).rejects.toThrow( - 'input block hash 0x509f1b7627970a326a840e3c32be75bb568cf64b92b007611b4216069fe0d9a7 ahead of current block 5661443 is not supported', - ); - }); - - it.skip('api consts is swapped to the specified block', async () => { - const apiService = await prepareApiService(); - const api = apiService.getApi(); - // upgrade at 4401242 that maxNominatorRewardedPerValidator changed from 256 to 128 - let blockhash: BlockHash; - const currentMaxNRPV = - api.consts.staking.maxNominatorRewardedPerValidator.toNumber(); - if (currentMaxNRPV === 128) { - blockhash = await api.rpc.chain.getBlockHash(4401242); - } else { - blockhash = await api.rpc.chain.getBlockHash(4401243); - } - - const block = await api.rpc.chain.getBlock(blockhash); - const mockBlock = wrapBlock(block, []) as unknown as SubstrateBlock; - const runtimeVersion = { specVersion: 28 } as unknown as RuntimeVersion; - const patchedApi = await apiService.getPatchedApi( - mockBlock, - runtimeVersion, - ); - expect( - patchedApi.consts.staking.maxNominatorRewardedPerValidator.toNumber(), - ).not.toEqual(currentMaxNRPV); - }); - - // it('.tx.*.*, .derive.*.* are removed', async () => { - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // const multiResults = await Promise.all([ - // await api.query.system.account.at(TEST_BLOCKHASH, account1), - // await api.query.system.account.at(TEST_BLOCKHASH, account2), - // ]); - // const patchedApi = await apiService.getPatchedApi( - // TEST_BLOCKHASH, - // TEST_BLOCKNUMBER, - // ); - // // eslint-disable-next-line @typescript-eslint/promise-function-async - // const [patchedMultiResults, currentMulti] = await Promise.all([ - // patchedApi.query.system.account.multi([account1, account2]), - // api.query.system.account.multi([account1, account2]), - // ]); - // expect(patchedMultiResults.map((r) => r.toJSON())).toEqual( - // multiResults.map((r) => r.toJSON()), - // ); - // expect(patchedMultiResults.map((r) => r.toJSON())).not.toEqual( - // currentMulti.map((r) => r.toJSON()), - // ); - // }); - // - // it.skip('xxx.xxx.multi with input parameter is a double map', async () => { - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // const patchedApi = await apiService.getPatchedApi( - // TEST_BLOCKHASH, - // TEST_BLOCKNUMBER, - // ); - // const multiResults = await Promise.all([ - // await api.query.staking.erasStakers.at( - // TEST_BLOCKHASH, - // 2038, - // `DMkKL7AZw9TkNw2NaBdocmFRGUG8r8T4kdGGcB13fv2LARy`, - // ), - // await api.query.staking.erasStakers.at( - // TEST_BLOCKHASH, - // 2038, - // `HAGcVQikZmEEgBBaChwjTVdwdA53Qopg2AYUtqw738C5kUq`, - // ), - // ]); - // const patchedResult = await patchedApi.query.staking.erasStakers.multi([ - // [2038, `DMkKL7AZw9TkNw2NaBdocmFRGUG8r8T4kdGGcB13fv2LARy`], - // [2038, `HAGcVQikZmEEgBBaChwjTVdwdA53Qopg2AYUtqw738C5kUq`], - // ]); - // expect(multiResults).toEqual(patchedResult); - // }); - // - // it('api.queryMulti', async () => { - // const account = 'E7ncQKp4xayUoUdpraxBjT7NzLoayLJA4TuPcKKboBkJ5GH'; - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // const patchedApi = await apiService.getPatchedApi( - // TEST_BLOCKHASH, - // TEST_BLOCKNUMBER, - // ); - // - // const multiResults = await Promise.all([ - // api.query.timestamp.now.at(TEST_BLOCKHASH), - // await api.query.session.validators.at(TEST_BLOCKHASH), - // await api.query.system.account.at(TEST_BLOCKHASH, account), - // await api.query.staking.erasStakers.at( - // TEST_BLOCKHASH, - // 2038, - // `HAGcVQikZmEEgBBaChwjTVdwdA53Qopg2AYUtqw738C5kUq`, - // ), - // ]); - // - // const patchedApiResults = await patchedApi.queryMulti([ - // patchedApi.query.timestamp.now, // not in array - // [patchedApi.query.session.validators], // zero arg - // [patchedApi.query.system.account, account], //one arg - // [ - // patchedApi.query.staking.erasStakers, - // [2038, `HAGcVQikZmEEgBBaChwjTVdwdA53Qopg2AYUtqw738C5kUq`], - // ], // arg in array - // ]); - // - // expect(multiResults.map((r) => r.toJSON())).toEqual( - // patchedApiResults.map((r) => r.toJSON()), - // ); - // }); - // - // it.skip('api.rx.queryMulti is not supported', async () => { - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // const patchedApi = await apiService.getPatchedApi( - // TEST_BLOCKHASH, - // TEST_BLOCKNUMBER, - // ); - // expect(() => - // (patchedApi.rx as any).queryMulti( - // [api.query.timestamp.now], - // [api.query.session.validators], - // ), - // ).toThrow(/is not supported/); - // }); - // - // it('support .entries', async () => { - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // const patchedApi = await apiService.getPatchedApi( - // TEST_BLOCKHASH, - // TEST_BLOCKNUMBER, - // ); - // const patchedResult = await patchedApi.query.staking.erasStakers.entries( - // 2038, - // ); - // const apiAt = await api.at(TEST_BLOCKHASH); - // const result = await apiAt.query.staking.erasStakers.entries(2038); - // expect(patchedResult).toEqual(result); - // }); - // - // it('support historic api rpc', async () => { - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // - // const blockhash = await api.rpc.chain.getBlockHash(4401242); - // const patchedApi = await apiService.getPatchedApi(blockhash, 4401242); - // - // const b1 = await patchedApi.rpc.chain.getBlock(); - // const apiBlock = await api.rpc.chain.getBlock(blockhash); - // const b2 = await patchedApi.rpc.chain.getBlock('0x12312314'); - // - // expect(b1.block.hash.toString()).toEqual(blockhash.toString()); - // expect(apiBlock.block.hash.toString()).toEqual(blockhash.toString()); - // expect(b2.block.hash.toString()).toEqual(blockhash.toString()); - // expect(() => patchedApi.rpc.author.rotateKeys()).toThrow( - // /is not supported/, - // ); - // }); - // - // it('successful set block hash when continuous call api.xxx.xxx.at ', async () => { - // const apiService = await prepareApiService(); - // const api = apiService.getApi(); - // - // const blockhash1 = await api.rpc.chain.getBlockHash(1378036); - // let patchedApi = await apiService.getPatchedApi(blockhash1, 1378036); - // const validators1 = await patchedApi.query.session.validators(); - // - // const blockhash2 = await api.rpc.chain.getBlockHash(1385137); - // patchedApi = await apiService.getPatchedApi(blockhash2, 1385137); - // const validators2 = await patchedApi.query.session.validators(); - // // prettier-ignore - // const expectedValidators1= ['FiHWU9AjN7z2no8zyiVEXtiTE46izxDgEcF1KM4r2r1GK59', 'EQBwtmKWCyRrQ8yGWg7LkB8p7hpEKXZz4qUg9WR8hZmieCM', 'EviBmmkq5o5ak2jUo71SPuDEdwGTr8Yz8U5tXBgF6fy8kKV', 'EfK27sX89DpagD3TCF4hF4rGZ1CnCGtYZvo94HZLU3GQuMj', 'Feu9bCUFaYSbkeqSY485kJjUoizp9CG4z3iSnGMwTqWSLeH', 'GTzRQPzkcuynHgkEHhsPBFpKdh4sAacVRsnd8vYfPpTMeEY', 'DaCSCEQBRmMaBLRQQ5y7swdtfRzjcsewVgCCmngeigwLiax', 'GRzsaGxLApkBfsUSCHKLnxhe4QECX4E2kQ5LuV4qqcijN2B', 'GCiTn1UJQT9TE5iamqoKweVoWGRZr9DF8uKXL4cG98fXczf', 'D948vxMSA6u7G5gqPGQdAUDMJbiR7wgqZ1La8XeBiXr9FTF', 'FLpAi7Zi4AB1JqJHWMrub4Umj4X73mZ5dAWE7Q6uS5e82pE', 'FUfXiFsaoWbUeaWiWBDizP7VbTSLxMirbJEpLAk1g6YueJp', 'Few2tfYD3wfyQXPCVkiqK8UGfuj5FK6ecadwfAmJQHBtASX', 'EGZEgucx8vTCSak5uBwwkPkZ7FiYCWYmhpMjWFupdMAq2BN', 'FD3A8DXs16wGvcoi9stjpwz2pmxXFymTkVyVM4Tq5z6LWCK', 'EdEQVcrr4pvzDLdb5xFkncKYhCE6uyuE1eKRTqg4PDvBgMa', 'DKUQiUWNPGvGYrgaxWqduJVRqWUYXUeKprX9EJENhxYvVyS', 'Dg5QS2TKCMQbbZau7acRXHPN4xQxqqase8awmzLXXgmXb7w', 'FtqCc5yLcLc1FkLyftyNuCtYFCudo3unwwPQLzCbnWppjoc', 'FXezGfeLvze1DWUwwEc8MczpLSMnZrSDrcA7Ghyc84NaXGt', 'FAtJupteW5urNYVQvUcLaw2X9xtdwjumK2gvJpuBnAwFHvq', 'FDDy3cQa7JXiChYU2xq1B2WUUJBpZpZ51qn2tiN1DqDMEpS', 'DrQHiQu5VkaRuv1H3iELXVqsvD3SV3E8xNjJqXUgECSg23R', 'Fsspzse4QY1KqagdyrVqDt7cmVBr3HSVsfJ38WKgxsLVaXo', 'Ed6JFR7JmeGtmrubAbXtJRjq9FPWhGRWMdmYnLRcsqaabT8', 'Gc6YgfbTJ6pYXcwib6mk3KoiwncLm4dfdcN3nwFjvfi4Agd', 'Fgqjkry96qFLpRqPZstNzgaqKXiVyrpzTqD55neMdW8PK6g', 'Gth5jQA6v9EFbpqSPgXcsvpGSrbTdWwmBADnqa36ptjs5m5', 'EuJcihtEgC121KMSa2TscWHmTF3ecJzzgHeNnQwLp4tBReG', 'JJ2VvJMZxxW2pst7z6zxrD4VVPhH6YtemYsLeKWeQ9MKX3n', 'GqGHrVZ3h2LznE2snJZ6emccobBKpgx5pmumTApDNcPFuPr', 'ESNZ8Eg46ByUYoAhr8MPbGpGF82pgmmjE3uVVepPCnJC61r', 'EaWWcRin5KwuXYFZA7ANuMCydQHjM5MofStJGusASGeXrrs', 'EMa2d6yYb3CPxyArDCzsMfngnDKUbRL6QdogfYAPKZmmN1E', 'J4hAvZoHCviZSoPHoSwLida8cEkZR1NXJcGrcfx9saHTk7D', 'Dojkd9b69TqwZ9W7BJuUomD6N59WBZ39G4sts69QDYJxKjW', 'Dksma151w4n2LRADiR2aYbdhKff47QQ6cTmBo9PpfJUb7cd', 'HWFQjF7phgRTPPjFFD2bHG9aUsEbM1p4Zwj5MjpL6iu66wH', 'Gt6HqWBhdu4Sy1u8ASTbS1qf2Ac5gwdegwr8tWN8saMxPt5', 'FAp5gVpwhwdmnJ1Ycet9z6Uva5tnfyCfA3AaY7WGi7u3DU4', 'Etij9aH36W1NjjWbR7wB5j41CmfpqAx8D4V4HCJhUydSH9Y', 'Cwr82cUKvfgnQSnLeN84CmtNaUGjYBD2qaBjsTxG43ZNh2M', 'FJaSzBUAJ1Nwa1u5TbKAFZG5MBtcUouTixdP7hAkmce2SDS', 'F8PTaGuZQo5fgRBFuhNnhd5euFiR3KLQNMVhYD5BduPKpHr', 'H9R6HgnZKtrcfBJP2M6WCvLJvp72Q96eURbCxmj6KCFVWjh', 'JKjFSGnsXeqhhPgvBmKb6vUnrTZHu17eydEDnpcorCnZXLG', 'EY35xeDhXibMDS5GmdHM2UzpvT4VoV9fGXDy3Muq6cyLPja', 'G7Ur4BnMSfP2qE7ruSob5gwGQ5nzkGWu7Yqh14FcMqnDtgB', 'EJGDDXSMXhwnJMrDs2KjMaznMtms9iFrYNhRL3shkMi9xLt', 'DXrJrPLLBHuapmYJ6tfuUStKubhykWmpgLckJpgFgjp2JvV', 'GCNHHRBtpDcgADCaRPMNNk52JiitGrcv3DMQxwE6owXAfbt', 'DiCVHECatzBxCKZeCmQhvqbAo9KK6CHubAWtQF85N3YbKFW', 'JECeyN45Ycx5t1M1hj2pBbsEZpdeGzDsYA1Wrt2Tdte2wV7', 'D8xUmqpe2aJd2QEPpG4pN3xZvboeQ21wwPhbNRCixrLq8Sj', 'HqZG9NMeeHLuHq4v3JmwVkHvGoEGAnrnNfYSvd2VYADNi7Z', 'FSpw3yUXP6NUHpkCcYhoeihK7ni5XugwDLSRpPaypyLGTGr', 'Cdaq3iUobZLYD2d8oqRQf1VKuRo6H64KsMBgJyxap4ZnARX', 'EtgM5E6pecndYpKCLkfYeRfKSmVxT1mVvaxceJFnhuKqTpG', 'Ff9DYio1TgYTyDU9z8Howt9pXCnuUPmsCY1ijfLBxSsJahj', 'H6bJZpE7PTFZgkLWGbeP3D1PqPGsFGqYAArFYa3ksCskmbt', 'DzmvnHyHyPN2kBHYQpXmrrUvV8KNzDgTPE2Ri2cjDuXhhLt', 'J6RoE9MSpnZhX7hniJAJjBCcTqpr49SNhLvaVeJgFd69TJZ', 'J6xn7Mr8pfed6gvvRPZ8HEEb89RCwheTBtxymg9Xw36hUUS', 'EdUs96fjEhyaTVxZsFo3fxEABLSpdopBFuhE7FFexCUyDv6', 'HvdGhdYcsJcSVBYnUEtHGpzV5A4XunjYWi8HAK8bGLvXdAb', 'FSfBJoCU9sRhCYWwQ55iBNGU5L8eu56iGnYGK9zizHxu8dY', 'GPdebankLfiSGaEPQWJBVULEmX2VpNdnyqsa1uiFJGDhTdT', 'Fk3yTFztZdZa4a7yBpisz9ceMyjgYLtZ9CKSCfFNVhoW2ZC', 'DokiayXWoMvotzchNdLSH4P4Fe7EvMESZvZL4Fn3NekoFtf', 'GfYXsuFn8MVensbKc6gKjPpxXMNh1LzcrBn4BfhNMgK1zKH', 'DuRV4MSm54UoX3MpFe3P7rxjBFLfnKRThxG66s4n3yF8qbJ', 'HhTownCNpkSbjLmtG6KdMhh7FJ2SLXxZcGXhHHeqpbchqcK', 'HyTJYoYwA8GGgDH2XVnUhsPgMq7nnnE4Qq2BdwmpdHNzSdo', 'GFwtzkxkTCFmXhVARYifwBK5D1JgCUmKynWhnv1CZgm9JNS', 'H9bhxgaMbND1u7TXxmMpcQCTiLfQtGmdmwAyKkRnKsndSXa', 'Fk6p456PTU6Sju2b83Cy8rU3NGFsXmWk9BrcqaMqhWW1jWf', 'DKinge6g7FNNj3hJZJUze6GByxkLR7ipCqrnuSQKGRMg37G', 'EUwcW86EFGDoDfUP2UJYuBwhCWC7cW9SdFH9cPh6UPBvBHj', 'FcjmeNzPk3vgdENm1rHeiMCxFK96beUoi2kb59FmCoZtkGF', 'F2GF2vuTCCmx8PnUNpWHTd5hTzjdbufa2uxdq2uT7PC5s9k', 'J1aHBD7YQ3xnSwgFJNokjsEo7NjLTf36ZEHD2LTpeo7KAq8', 'HJ1dGPxVr13KHGiCTGQfZjZMKGc8J52CsHEjcEXNMDyeGxf', 'FagAVsTYT8QghxypUtLcfnmnnhPhPpf854UNuptpQKuNndK', 'CmfwTdJ1F7Qd2HLAQ6A8FdNtz9hKvTMr2FkWtBQR1vECYjo', 'GbpLB9AZwVBBfecbMoTv3HCVb6irwN6y5YeA7uDNoUuRFrL', 'D3JqthKZjAEge84RQ3dheuQmaX2nVhk9A3sHY1rGNbStiFg', 'DEFQigjrErCANqTMiTRuy7BB5L46q9C36Bxqe41GV1yR6vA', 'F7BeW4g5ViG8xGJQAzguGPxiX9QNdoPNc3YqF1bV8d9XkVV', 'DGC4rANssfdpry7FQFznHo2b3QbDHyQZM58esJU6RskB41y', 'HvjQwyG8NDFSD3ZP7VTbfBXHw4mZZd7LRMTcaj9TdfLynzu', 'Faa8iXWy2wxo7ryLEhGCNeb55d8rnVy9SN25NiCmmqP6QMV', 'FwPTgWjafLgtxoRHK7pkUc2NJ9YzD7wHeCny2fMk41T9jKW', 'ErVvRnhXrJS7W9rTtnDECpZTFyLACtDcXEPtzEyYw4b8zcg', 'GSWsxFWwvfpppd4q5iBa3fiBp3twEGvtYZFWNRVF17And24', 'HHARzd4icVZULpMVEGZRiLhjfb3iDDohg1bdHRBusrMUvfd', 'G9vLBYmeiQcD8t53djad6sH2MALaeJy9zaEUyknEVma9sa6', 'HZvvFHgPdhDr6DHN43xT1sP5fDyzLDFv5t5xwmXBrm6dusm', 'ESaTdKYYtRYhJbYjMzgKauNyZHbaNzx2vknC9eioqKusWSt', 'FSETB7JeTuTsJBYzUcKBtHXBYtBft3pZ87FUxP2GaY4acFh', 'GqomGHs3CpaoG7kemv9hb6LCaBSazXMPaaCyDrP6CxRrgcF', 'DDkGq46ftxusKM4n4jfEr7MBW1DPGuVQDeExMFQbRtnsenD', 'F8DXBsUQrvVvL9AvkEqxykmy1AWcBcn2CqjG3nyzYRFVJeS', 'G7eJUS1A7CdcRb2Y3zEDvfAJrM1QtacgG6mPD1RsPTJXxPQ', 'Db2P54HPMkR8kqbP5RfWuXRFKhZ8NLQ77aT7VBZYfpKqTGP', 'EdWNepHg6UUyqK433qDpBjJ4ZUmyvnoQPLDFs69dExG1Dii', 'FzBBpxixSuZkeXxXeiUbvFYxcd3JAP5BEAcgDuhRudJTwmZ', 'Eg2z2dcScFf4foDN4Gxn6JoJ7JeDN1U7m49jNssUZMLtNrD', 'HeCK315sYXruJvZKB5uXtEBnpWwYHFaKfNNZ54G76Qr7Nkn', 'HshTdrZiSJntTRh5oNytD2QuT38VDJHoGQmfcrtrZbViSGL', 'Foc4anJqDfTMY3CvpCZzK9kUSudwc2oUTJ19K1E3JYFKy9j', 'FyRaMYvPqpNGq6PFGCcUWcJJWKgEz29ZFbdsnoNAczC2wJZ', 'CoqysGbay3t3Q7hXgEmGJJquhYYpo8PqLwvW1WsUwR7KvXm', 'GcgPeEtLketwNDVVdV2jEnaTU5RMdGQdpYqVshssBWy1txZ', 'H72hS8xLmSiSBqbBXHND2KbN8PAoevi52B685cbGki6T9nt', 'H4V7fZJPLiGtBvQfsadb7oGfV1StiXJTuca76Daa449rz27', 'J2HVhQBYpx5PkyxHYLsp555pvWzc2zvGfNUnTwgzvRqVGqm', 'GiBnzCGFofhmAvsUv9FUShUb8YJYYwWex3ThQNkbDDNprS6', 'HnnFkvtzrSrNpSUdG47E9ioBmDoDBnRUL6Lmy7GeqGcFc5c', 'GeYJhboY5bEc5WZFbrdxhEF9m6Y4NnbKzfCu1rBHxGWgviK', 'DGiLC1uvohfgHiirDtsr5HJRYXUFy9NdXj6YC6azcaRpvJZ', 'HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK', 'EoeAhrhJv2p6Sg5T67mxkLwrPnjKbH7iZSh8q1JTyvELvrR', 'FXCgfz7AzQA1fNaUqubSgXxGh77sjWVVkypgueWLmAcwv79', 'EXkCSUQ6Z1hKvGWMNkUDKrTMVHRduQHWc8G6vgo4NccUmhU', 'HAGcVQikZmEEgBBaChwjTVdwdA53Qopg2AYUtqw738C5kUq', 'GCsSfxv6h9mQ27s93ggBwzfguT6V61kmh8iadKSXAgQgKs5', 'E2ZKmzMzajqW838jXVSM5DyoUJUdEQddXNknEjoTwj2zBLj', 'GhyKZDoTghgvYqh1ensnGU1Vc1EY3Nwvhw5XdjTR8yfnEpV', 'GxujeV9rVRqsQHMbTiAiHATuZyrcHC68ZUJHtqS4LufuWLk', 'E7aXaaVBzDbhF8HevpcwDnWEu9mBRE6ai69JToi4fyz8c5P', 'DatW7XKJaJbfHLoVzVCHwAcwMySW9CRb6gFs9TpNNcCz9Mv', 'D8BfryaM5xN62UuKUpLK5zbZEUSBtA76yP9YddQTKXi9pkB', 'EtJ4HxHYEDvYWRJAdmV4hYpTbGMJCmEgnLC8zAf6u5ZyT7C', 'FtcERzFaCxB2ZR17PVeNxjAntfQ8a9KwS5i1bTYGWq15Yab', 'Gk6v5CXUy2cPMtVxXtN7ZUn7K5y7UFEm78xp98Uatjt2yuV', 'HqHeKZnc38rX2BJrmJiXfkqHUEUn56B9Nck6WgdiGeKUYBE', 'FwUst6h6JfHAK2tyhM9zCrKb1zSCgSe5kaoXZeqnVpbGGgt', 'CihSipv2H9mYBkRznedBZFxCNUrqvdmSH1Ptx5kSNRr3DEx', 'JKsMAG8Kpm9szen7Crx2FUrhzdwK9hAocA4X1mmQYYvRsrE', 'CpYNXnYC1mPPRSXMHvm9EUuhEqHjvj6kCN4kshqMdEpPYSF', 'CaSNtNAiKEsQiTcEU9DamgFeji9Hh63QFo91XrmftCTNBva', 'EKBtVYjZ6MMzRf334L1Zztf29kim8LrV5myftD3ABrmTHZd', 'DB2mp5nNhbFN86J9hxoAog8JALMhDXgwvWMxrRMLNUFMEY4', 'Dab4bfYTZRUDMWjYAUQuFbDreQ9mt7nULWu3Dw7jodbzVe9', 'EqWK9adqE7ZFBXAhTw5KXh6ZkMRKdxA555yHgj5tWQyPJYH', 'D5Xo7N2jginhYchuMNud2dYtby899koFcaRo2YWNmUquo5H', 'CsHw8cfzbnKdkCuUq24yuaPyJ1E5a55sNPqejJZ4h7CRtEs', 'JKcDN2BUrteeUZa5fxuTsPjpUZpNGE9NHVY1NUboHEQbmhN', 'CuCgiLpBEcfLEjwS8CBsEN4EWSvTF7vHeN6damkrv934kfZ', 'HEmqZS2Lw5nhGuddLjTm2KCcmsUddQXJM5bGVeA5GBWam6w', 'GS9UR4YmAib1NKWiQmxVpNytcriChSBPDZQyGJhYnunXPQ9', 'HPWceq92prqJVYnYfoZGzEwRGC5jCwGjArZcZzYAC7hXR9e', 'GKingZDLzrPimpMMCxWYT7ck8jXra2vvNkCUztUwyDT2Qet', 'Gh2cm56nMokKQ4frPx7r7UsXtimH6ckaXyKKogGn5dQ3yrD', 'Go5ov2WmFx2H9LfvaS3ec24TropY6Fgjcv56wBchyUv18a7', 'Fd9kKxogYUZLCoMz3uvjFTCkSGXRvgrKh7GEdbSK2yHd4oq', 'Cdhjt72TSezVDkUzdgyoSwXByfwQJjuXSYcDs5L8snyB8Yx', 'EzR9J3Afvash2tYCk8ZZwPYyq3zy92adVUXKcYjbYN46JWL', 'ELhnYFneiAP819s1t7Zmn4rs1tBbcrWVnkeGw4JYKdVp6jL', 'EicrAEbyauqktQpp4CdvsF2CQy3Ju7tGGMohj3h5sAPnKHL']; - // // prettier-ignore - // const expectedValidators2 = ['J2HVhQBYpx5PkyxHYLsp555pvWzc2zvGfNUnTwgzvRqVGqm', 'F8PTaGuZQo5fgRBFuhNnhd5euFiR3KLQNMVhYD5BduPKpHr', 'F7ia6uitDknF5HhGQnTPuBdqFM3nTqpMP8oeWgjU4gWiaVm', 'EafgFRX24PTgJAjGoaDuQLXQiLX4daSFQQttzGVticSD18o', 'F7BeW4g5ViG8xGJQAzguGPxiX9QNdoPNc3YqF1bV8d9XkVV', 'EqyCQvYn1cHBdzFVQHQeL1nHDcxHhjWR8V48KbDyHyuyCGV', 'HAGcVQikZmEEgBBaChwjTVdwdA53Qopg2AYUtqw738C5kUq', 'FAYyBS6arn3X4fvtdybaBUdw5zqVsv3PPwRXXXYRTzTGFDv', 'EZ7uBY7ZLohavWAugjTSUVVSABLfad77S6RQf4pDe3cV9q4', 'Faaf2qgwtaFum78U8TdEPnUd4u7HPk65cdaFj7KbEA6wi2Y', 'HA5jB52fFL1v4EoEHV4WgEiFZr7wGLiuBDZtSmnwKypvat7', 'EicrAEbyauqktQpp4CdvsF2CQy3Ju7tGGMohj3h5sAPnKHL', 'HWAGAxX2PAzNVg7w3ZyTprH5yvwbVwQ8rbWwuZxtQKbQupW', 'EXkCSUQ6Z1hKvGWMNkUDKrTMVHRduQHWc8G6vgo4NccUmhU', 'EdEQVcrr4pvzDLdb5xFkncKYhCE6uyuE1eKRTqg4PDvBgMa', 'DfiSM1qqP11ECaekbA64L2ENcsWEpGk8df8wf1LAfV2sBd4', 'E457XaKbj2yTB2URy8N4UuzmyuFRkcdxYs67UvSgVr7HyFb', 'FiBHHbxDiVysvn5YBV78YFVUUykZRfQYhjxymu8VXnTqNMr', 'DDkGq46ftxusKM4n4jfEr7MBW1DPGuVQDeExMFQbRtnsenD', 'H4V7fZJPLiGtBvQfsadb7oGfV1StiXJTuca76Daa449rz27', 'Hadx1N8xZq6tRtXWkm6s5madXTXqVhauDNmesZnpMYTufcv', 'Ed6JFR7JmeGtmrubAbXtJRjq9FPWhGRWMdmYnLRcsqaabT8', 'FpVmbKAqwoQaTBGwrTGsSu4nN1PCGY8XrQa4AaJVuzyVhh2', 'DimyMqRfrnqudRLVf5TxAM3T7X23PKvFDp85DDGabFKMQ2a', 'GhoRyTGK583sJec8aSiyyJCsP2PQXJ2RK7iPGUjLtuX8XCn', 'HeKaZXya7rPQq7h7KgKnb3jG7n7VBFPr7PFTFYd6ZQbZRiU', 'FXCgfz7AzQA1fNaUqubSgXxGh77sjWVVkypgueWLmAcwv79', 'DEFQigjrErCANqTMiTRuy7BB5L46q9C36Bxqe41GV1yR6vA', 'CoooBnE4hYaaQSKUDyCmZNdn8uE94rWa5ez3jrpFDE88vVA', 'GffdZaTf5oBcHVfx4VjnA6AMpHEBa3PiaBzTBUPkt24fUxp', 'HqGhgHg6YvnhaXSnaAUvyTDiR4FirB6Ssh2XNDedTzwCDv2', 'CinNnPhc4aGFQb7FWhUpnfwCNwXN3brcnCR1MkazkstcDJa', 'Fsspzse4QY1KqagdyrVqDt7cmVBr3HSVsfJ38WKgxsLVaXo', 'EoeAhrhJv2p6Sg5T67mxkLwrPnjKbH7iZSh8q1JTyvELvrR', 'GfXJERNZeUXh75pdFwksC9y42sftVti9K2AWntarJeM3gM4', 'Dg5QS2TKCMQbbZau7acRXHPN4xQxqqase8awmzLXXgmXb7w', 'Hqa9LGT3qF96agPYYbdfmUzh5P94MX9sqfF1WN4JnfRRVir', 'Gt6HqWBhdu4Sy1u8ASTbS1qf2Ac5gwdegwr8tWN8saMxPt5', 'Eyvj7oeaHyoqJbNPKPi3zjBks2bNoju3X29xJhsxD8d6GeQ', 'DGiLC1uvohfgHiirDtsr5HJRYXUFy9NdXj6YC6azcaRpvJZ', 'JLKcPk652UTtQfyrk7keyU6vqAEj5JXzDAvQdPxB1DJTnZ3', 'EPehck28w8fjRZCqZ3VZA7XpwGeipuVU4ETSwv7GkF5BdcG', 'CmfwTdJ1F7Qd2HLAQ6A8FdNtz9hKvTMr2FkWtBQR1vECYjo', 'F7Wa1su7NRSr6LWuhPWdXcQALDyzm8Vmev7WtV5jVPtJELs', 'HRMhY2CtVMp2yVSieKvq8Y8FHAhRKrGGMd6MoQe3iN6uJ2D', 'GiBnzCGFofhmAvsUv9FUShUb8YJYYwWex3ThQNkbDDNprS6', 'GC8hwHbQ4TdbYJJPDS96G7Uj9bivnW5z56UEkqujjwhQPp5', 'FmQHyUXoRkGTRySqVUy7NBAVhkKFvTtRtkzVTjZgBzbDzum', 'HgWWnAXFGikrPVD2FrZ6CRk7KnYdVDn7zVyye8hqFPMc5g1', 'FUfXiFsaoWbUeaWiWBDizP7VbTSLxMirbJEpLAk1g6YueJp', 'G7Ur4BnMSfP2qE7ruSob5gwGQ5nzkGWu7Yqh14FcMqnDtgB', 'FrL6qzw8bAFS6MTpbwLzEuAU9SCnALD5qMj9ZYFyt6zk5o4', 'DaCSCEQBRmMaBLRQQ5y7swdtfRzjcsewVgCCmngeigwLiax', 'J1aHBD7YQ3xnSwgFJNokjsEo7NjLTf36ZEHD2LTpeo7KAq8', 'HvjQwyG8NDFSD3ZP7VTbfBXHw4mZZd7LRMTcaj9TdfLynzu', 'D5NGokAYvFZmvFynjApN2DG4r1H1cQ9pyum7KC3KmtDYLkn', 'DFaiE6wT1caQ9u7eLkuphVQqbywWKzYjm5vRsMgk43GSb84', 'DwZBcfHnJtRmR7P23VgHQEzaeGPXQvH8jDvuob2qiyTHJMM', 'EibDgpnEGwqvWDcPUq7EThEB6kPEnqKuZog48E5jga8uWe8', 'GcqKn3HHodwcFc3Pg3Evcbc43m7qJNMiMv744e5WMSS7TGn', 'DSpbbk6HKKyS78c4KDLSxCetqbwnsemv2iocVXwNe2FAvWC', 'HJ1dGPxVr13KHGiCTGQfZjZMKGc8J52CsHEjcEXNMDyeGxf', 'DB2mp5nNhbFN86J9hxoAog8JALMhDXgwvWMxrRMLNUFMEY4', 'HWpid7FWbuA7GxN1yykrYqSe6cY3ybUaX3qErCoiiFDSqSh', 'JHTXKwYBhRZKWPW3nbtwtfE8dfRDYCS65cJXueMhg11k4cs', 'FtqCc5yLcLc1FkLyftyNuCtYFCudo3unwwPQLzCbnWppjoc', 'EzR9J3Afvash2tYCk8ZZwPYyq3zy92adVUXKcYjbYN46JWL', 'DGC4rANssfdpry7FQFznHo2b3QbDHyQZM58esJU6RskB41y', 'DbuPiksDXhFFEWgjsEghUypTJjQKyULiNESYji3Gaose2NV', 'HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK', 'ESaTdKYYtRYhJbYjMzgKauNyZHbaNzx2vknC9eioqKusWSt', 'DriCrAgdVV57NeQm5bWn5KQpVndVnXnm55BjRpe6qzZ5ktJ', 'HTrpbES27bqMvCioQGHpmJbBzwji6V5DeuXUfB1gsZ5Vkh1', 'EUwcW86EFGDoDfUP2UJYuBwhCWC7cW9SdFH9cPh6UPBvBHj', 'GeYJhboY5bEc5WZFbrdxhEF9m6Y4NnbKzfCu1rBHxGWgviK', 'JDA8ByXeJcn2BfNabC6WbBJKEBwM4k7oBVenVgJdzL32RJc', 'FLpAi7Zi4AB1JqJHWMrub4Umj4X73mZ5dAWE7Q6uS5e82pE', 'CmD9vaMYoiKe7HiFnfkftwvhKbxN9bhyjcDrfFRGbifJEG8', 'EUoo6xidm7okewmbh89tUW3sqaDLYKAvTCCNYc8zh4nPU4s', 'F4xrhkWsW2PSqZBuBMVJGE3LQy7R2ZWo3J8d6KEsDznrDF8', 'F4LocUbsPrcC8xVap4wiTgDakzn3xFyXneuYDHRaHxnb6dH', 'H9bhxgaMbND1u7TXxmMpcQCTiLfQtGmdmwAyKkRnKsndSXa', 'ErVvRnhXrJS7W9rTtnDECpZTFyLACtDcXEPtzEyYw4b8zcg', 'J6RoE9MSpnZhX7hniJAJjBCcTqpr49SNhLvaVeJgFd69TJZ', 'Few2tfYD3wfyQXPCVkiqK8UGfuj5FK6ecadwfAmJQHBtASX', 'Etij9aH36W1NjjWbR7wB5j41CmfpqAx8D4V4HCJhUydSH9Y', 'Gc6YgfbTJ6pYXcwib6mk3KoiwncLm4dfdcN3nwFjvfi4Agd', 'DAT4gSgyMskggCmTQKfEM6hQgRy1NWdhtfMTAuPLsUAGUPy', 'HqFz5RBczgtKrHQGav7DFZwSwrDXxKjLWc95mMDidVdfpwC', 'GLiebiQp5f6G5vNcc7BgRE9T3hrZSYDwP6evERn3hEczdaM', 'G7mWyu1Pom5XreLHUzDEcvFp6WaMuLuo4QKxtDB9yJZnH69', 'FXezGfeLvze1DWUwwEc8MczpLSMnZrSDrcA7Ghyc84NaXGt', 'HnnFkvtzrSrNpSUdG47E9ioBmDoDBnRUL6Lmy7GeqGcFc5c', 'Gth5jQA6v9EFbpqSPgXcsvpGSrbTdWwmBADnqa36ptjs5m5', 'E2ZKmzMzajqW838jXVSM5DyoUJUdEQddXNknEjoTwj2zBLj', 'Eodfj4xjkw8ZFLLSS5RfP6vCMw8aM6qfM7BfeQMf6ivFWHy', 'GXaUd6gyCaEoBVzXnkLVGneCF3idnLNtNZs5RHTugb9dCpY', 'D948vxMSA6u7G5gqPGQdAUDMJbiR7wgqZ1La8XeBiXr9FTF', 'Fgqjkry96qFLpRqPZstNzgaqKXiVyrpzTqD55neMdW8PK6g', 'EfK27sX89DpagD3TCF4hF4rGZ1CnCGtYZvo94HZLU3GQuMj', 'DTLcUu92NoQw4gg6VmNgXeYQiNywDhfYMQBPYg2Y1W6AkJF', 'CrzGYAYYnguxoR5pGx4UbwLs2DkoxoLiLJd8kjZMQzDuq8r', 'E58yuhUAwWzhn2V4thF3VciAJU75eePPipMhxWZe9JKVVfq', 'JKjFSGnsXeqhhPgvBmKb6vUnrTZHu17eydEDnpcorCnZXLG', 'H6bJZpE7PTFZgkLWGbeP3D1PqPGsFGqYAArFYa3ksCskmbt', 'Fy2rsYCoowQBtuFXqLE65ehAY9T6KWcGiNCQAyPDCkfpm4s', 'FKJNhxaXraoh85DRvChSzoDKHMAk9cZYxoq5LQW7uqeAQMD', 'FBichC4g5HBmdWCu3ebdADWQbvjbN7KdodNKWBYpLFgxCcd', 'G7eJUS1A7CdcRb2Y3zEDvfAJrM1QtacgG6mPD1RsPTJXxPQ', 'G866nkBvVKUqTFwAukeLM7n6QH9JyJDUJ2EvGFzKdymzqc3', 'FAGzHVggwv1QRmkGjom1Foc24jzZS1CJGcWUzrGdW8FyXEm', 'FwPTgWjafLgtxoRHK7pkUc2NJ9YzD7wHeCny2fMk41T9jKW', 'GAfhRsNqB9hwEmRFPhMZCvicFJ1kVtRF3UChYyKHq612ZV9', 'FAp5gVpwhwdmnJ1Ycet9z6Uva5tnfyCfA3AaY7WGi7u3DU4', 'GU7kw1ZYDKchyzhrAQ3imiY7s4fsoeFCvgeaU5XkTi9ABuB', 'EGZEgucx8vTCSak5uBwwkPkZ7FiYCWYmhpMjWFupdMAq2BN', 'E8QEnkMMyWWrHPTbA7jo547SpkoGcE6yoTXHmrQeXY2sGnT', 'FAtJupteW5urNYVQvUcLaw2X9xtdwjumK2gvJpuBnAwFHvq', 'GTzRQPzkcuynHgkEHhsPBFpKdh4sAacVRsnd8vYfPpTMeEY', 'FX7rJbfiTFCqBuCWHLgR8SosDyZh842nv79mdQF4vxnZrhS', 'DrkY92Yq67zJ7T8XWN7SAXbnNDJhzkADutwhhhPyW3tQKTw', 'GfYXsuFn8MVensbKc6gKjPpxXMNh1LzcrBn4BfhNMgK1zKH', 'Fk6p456PTU6Sju2b83Cy8rU3NGFsXmWk9BrcqaMqhWW1jWf', 'FagAVsTYT8QghxypUtLcfnmnnhPhPpf854UNuptpQKuNndK', 'DokiayXWoMvotzchNdLSH4P4Fe7EvMESZvZL4Fn3NekoFtf', 'DTMCVLVqNj5L3kpuftg49bY9xozwhRyF52sEHdBySbpbPkt', 'FD3A8DXs16wGvcoi9stjpwz2pmxXFymTkVyVM4Tq5z6LWCK', 'EFjHdypk8xLf3ocDEFPaKFWVcfamH8mpvfUeXHvRWpSBk2M', 'Eo9RxTKq2WppUvRRycUmLFHJvHtBVoxURhDe78ZKmjoJfWN', 'Faa8iXWy2wxo7ryLEhGCNeb55d8rnVy9SN25NiCmmqP6QMV', 'CdEm1ErGKML3waXabLvn3NyqdAGXBQJVngLaM86YM5Yb9dr', 'Et5ne6GRrWZ178npoYdnG8RRU92gzqBiSRf4hTaU3Yonsf2', 'GbpLB9AZwVBBfecbMoTv3HCVb6irwN6y5YeA7uDNoUuRFrL', 'EyibGsAttxpNBkgjMxNTArskxkdEFFbwghYuuaZyvu9rmo2', 'H9R6HgnZKtrcfBJP2M6WCvLJvp72Q96eURbCxmj6KCFVWjh', 'HyTJYoYwA8GGgDH2XVnUhsPgMq7nnnE4Qq2BdwmpdHNzSdo', 'FSETB7JeTuTsJBYzUcKBtHXBYtBft3pZ87FUxP2GaY4acFh', 'Eo4boG437k7gFy75VqPrWP5gHSGi9Sm6CZzLFFsCGYaSPzM', 'HeeJfizAEvorbkinL4GfRUYpxUiFST3dpnUHrh9ga2Z8Cpm', 'D3JqthKZjAEge84RQ3dheuQmaX2nVhk9A3sHY1rGNbStiFg', 'FChhpqk6Er57sXMC71F2aQ7EsNBQZTe3wUGXfKEvLH7W8zE', 'F7Nnn8nQL3Bjxap8Ax1HDZcXdqXZxtqBgn5VXqx8bLhZh8N', 'EonK7NScfhd7ZRfgnLhm4cKRFJWK1z59zPximUZRg8VjHQj', 'FPRN9EfcCTswkRXfrkwoouep8uhVJRvMy1hnhB4Hb73biwK', 'FFdDXFK1VKG5QgjvqwxdVjo8hGrBveaBFfHnWyz1MAmLL82', 'FiHWU9AjN7z2no8zyiVEXtiTE46izxDgEcF1KM4r2r1GK59', 'F8DXBsUQrvVvL9AvkEqxykmy1AWcBcn2CqjG3nyzYRFVJeS', 'DrQHiQu5VkaRuv1H3iELXVqsvD3SV3E8xNjJqXUgECSg23R', 'GptHKfncW4Xwif6ohcZx6apt4B7jU7Pugvw1usQygP8WWQ7', 'FhmaBgRFjZYFUWJp91ZHUbuW2Dm32VH4BVhnRQJqfpMmEok', 'DiCVHECatzBxCKZeCmQhvqbAo9KK6CHubAWtQF85N3YbKFW', 'DKinge6g7FNNj3hJZJUze6GByxkLR7ipCqrnuSQKGRMg37G', 'GCiTn1UJQT9TE5iamqoKweVoWGRZr9DF8uKXL4cG98fXczf', 'EviBmmkq5o5ak2jUo71SPuDEdwGTr8Yz8U5tXBgF6fy8kKV', 'Cwr82cUKvfgnQSnLeN84CmtNaUGjYBD2qaBjsTxG43ZNh2M', 'GZ5xCKCC8JRpJSMgAoDJAFAuQV8gD9Xz2cJca4mR7oRhzL9', 'DbAdiLJQDFzLyaLsoFCzrpBLuaBXXqQKdpewUSxqiWJadmp', 'DKUQiUWNPGvGYrgaxWqduJVRqWUYXUeKprX9EJENhxYvVyS', 'F2GF2vuTCCmx8PnUNpWHTd5hTzjdbufa2uxdq2uT7PC5s9k', 'Cs1jHXYHxZyWKsGPvYY1BknhLdpNa1iXGja4Kn8hQZs7BsH']; - // const vs1 = validators1.map((v) => v.toString()); - // const vs2 = validators2.map((v) => v.toString()); - // - // expect(expectedValidators1).toEqual(vs1); - // expect(expectedValidators2).toEqual(vs2); - // }); - // - it('support http provider', async () => { - const apiService = await prepareApiService(HTTP_ENDPOINT); - const api = apiService.getApi(); - const blockhash = await api.rpc.chain.getBlockHash(1); - const block = await api.rpc.chain.getBlock(blockhash); - const mockBlock = wrapBlock(block, []) as unknown as SubstrateBlock; - const runtimeVersion = { specVersion: 1 } as unknown as RuntimeVersion; - - const patchedApi = await apiService.getPatchedApi( - mockBlock, - runtimeVersion, - ); - await expect(patchedApi.query.system.events()).resolves.toHaveLength(2); - }); - // - // /* This test can be reenabled once https://github.com/polkadot-js/api/pull/4540 has been released and the api is updated */ - // it.skip('can correctly call rpc methods that use block number', async () => { - // const apiService = await prepareApiService( - // 'wss://moonbeam-alpha.api.onfinality.io/public-ws', - // ); - // const api = apiService.getApi(); - // - // const blockNumber = 1545235; - // const blockhash = await api.rpc.chain.getBlockHash(blockNumber); - // const patchedApi = await apiService.getPatchedApi(blockhash, blockNumber); - // - // /* Block number should be ignored and `blockNumber` above used */ - // const balance = await patchedApi.rpc.eth.getBalance( - // '0x59ce189fd40611162017deb88d826C3485f41e0D', - // 1645023, - // ); - // expect(balance.toString()).toEqual('878428609000000000'); - // }); -}); diff --git a/packages/node/src/indexer/api.service.ts b/packages/node/src/indexer/api.service.ts deleted file mode 100644 index ff570d26..00000000 --- a/packages/node/src/indexer/api.service.ts +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { Injectable, OnApplicationShutdown } from '@nestjs/common'; -import { EventEmitter2 } from '@nestjs/event-emitter'; -import { ApiPromise, WsProvider } from '@polkadot/api'; -import { ApiOptions, RpcMethodResult } from '@polkadot/api/types'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; -import { AnyFunction, DefinitionRpcExt } from '@polkadot/types/types'; -import { - IndexerEvent, - NetworkMetadataPayload, - getLogger, -} from '@subql/node-core'; -import { SubstrateBlock } from '@subql/types'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { ApiAt } from './types'; -import { HttpProvider } from './x-provider/http'; - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const { version: packageVersion } = require('../../package.json'); - -const NOT_SUPPORT = (name: string) => () => { - throw new Error(`${name}() is not supported`); -}; - -// https://github.com/polkadot-js/api/blob/12750bc83d8d7f01957896a80a7ba948ba3690b7/packages/rpc-provider/src/ws/index.ts#L43 -const RETRY_DELAY = 2_500; - -const logger = getLogger('api'); - -@Injectable() -export class ApiService implements OnApplicationShutdown { - private api: ApiPromise; - private currentBlockHash: string; - private currentBlockNumber: number; - private apiOption: ApiOptions; - networkMeta: NetworkMetadataPayload; - - constructor( - protected project: SubqueryProject, - private eventEmitter: EventEmitter2, - ) {} - - async onApplicationShutdown(): Promise { - await Promise.all([this.api?.disconnect()]); - } - - async init(): Promise { - let chainTypes, network; - try { - chainTypes = this.project.chainTypes; - network = this.project.network; - } catch (e) { - logger.error(e); - process.exit(1); - } - - let provider: WsProvider | HttpProvider; - let throwOnConnect = false; - - const headers = { - 'User-Agent': `SubQuery-Node ${packageVersion}`, - }; - if (network.endpoint.startsWith('ws')) { - provider = new WsProvider(network.endpoint, RETRY_DELAY, headers); - } else if (network.endpoint.startsWith('http')) { - provider = new HttpProvider(network.endpoint, headers); - throwOnConnect = true; - } - - this.apiOption = { - provider, - throwOnConnect, - noInitWarn: true, - ...chainTypes, - }; - this.api = await ApiPromise.create(this.apiOption); - - this.eventEmitter.emit(IndexerEvent.ApiConnected, { value: 1 }); - this.api.on('connected', () => { - this.eventEmitter.emit(IndexerEvent.ApiConnected, { value: 1 }); - }); - this.api.on('disconnected', () => { - this.eventEmitter.emit(IndexerEvent.ApiConnected, { value: 0 }); - }); - - this.networkMeta = { - chain: this.api.runtimeChain.toString(), - specName: this.api.runtimeVersion.specName.toString(), - genesisHash: this.api.genesisHash.toString(), - }; - - if (network.chainId && network.chainId !== this.networkMeta.genesisHash) { - const err = new Error( - `Network chainId doesn't match expected genesisHash. expected="${ - network.chainId ?? network.genesisHash - }" actual="${this.networkMeta.genesisHash}`, - ); - logger.error(err, err.message); - throw err; - } - - return this; - } - - getApi(): ApiPromise { - return this.api; - } - - async getPatchedApi( - block: SubstrateBlock, - runtimeVersion: RuntimeVersion, - ): Promise { - this.currentBlockHash = block.block.hash.toString(); - this.currentBlockNumber = block.block.header.number.toNumber(); - - const apiAt = (await this.api.at( - this.currentBlockHash, - runtimeVersion, - )) as ApiAt; - this.patchApiRpc(this.api, apiAt); - return apiAt; - } - - private redecorateRpcFunction( - original: RpcMethodResult, - ): RpcMethodResult { - const methodName = this.getRPCFunctionName(original); - if (original.meta.params) { - const hashIndex = original.meta.params.findIndex( - ({ isHistoric }) => isHistoric, - ); - if (hashIndex > -1) { - const isBlockNumber = - original.meta.params[hashIndex].type === 'BlockNumber'; - - const ret = (async (...args: any[]) => { - const argsClone = [...args]; - - if (isBlockNumber) { - if (argsClone[hashIndex] === undefined) { - argsClone[hashIndex] = this.currentBlockNumber; - } else if (argsClone[hashIndex] > this.currentBlockNumber) { - throw new Error( - `input block ${argsClone[hashIndex]} ahead of current block ${this.currentBlockNumber} is not supported`, - ); - } - } - // is block hash - else { - if (argsClone[hashIndex] === undefined) { - argsClone[hashIndex] = this.currentBlockHash; - } else { - const atBlock = await this.api.rpc.chain.getBlock( - argsClone[hashIndex], - ); - const atBlockNumber = atBlock.block.header.number.toNumber(); - if (atBlockNumber > this.currentBlockNumber) { - throw new Error( - `input block hash ${argsClone[hashIndex]} ahead of current block ${this.currentBlockNumber} is not supported`, - ); - } - } - } - - return original(...argsClone); - }) as RpcMethodResult; - ret.raw = NOT_SUPPORT(`${methodName}.raw`); - ret.meta = original.meta; - return ret; - } - } - - const ret = NOT_SUPPORT(methodName) as unknown as RpcMethodResult< - T, - AnyFunction - >; - ret.raw = NOT_SUPPORT(`${methodName}.raw`); - ret.meta = original.meta; - return ret; - } - - private patchApiRpc(api: ApiPromise, apiAt: ApiAt): void { - apiAt.rpc = Object.entries(api.rpc).reduce((acc, [module, rpcMethods]) => { - acc[module] = Object.entries(rpcMethods).reduce( - (accInner, [name, rpcPromiseResult]) => { - accInner[name] = this.redecorateRpcFunction(rpcPromiseResult); - return accInner; - }, - {}, - ); - return acc; - }, {} as ApiPromise['rpc']); - } - - private getRPCFunctionName( - original: RpcMethodResult, - ): string { - const ext = original.meta as unknown as DefinitionRpcExt; - - return `api.rpc.${ext?.section ?? '*'}.${ext?.method ?? '*'}`; - } -} diff --git a/packages/node/src/indexer/dictionary.service.test.ts b/packages/node/src/indexer/dictionary.service.test.ts deleted file mode 100644 index 8c77ffb1..00000000 --- a/packages/node/src/indexer/dictionary.service.test.ts +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { NodeConfig } from '@subql/node-core'; -import { DictionaryQueryEntry } from '@subql/types'; -import { GraphQLSchema } from 'graphql'; -import { range } from 'lodash'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { DictionaryService } from './dictionary.service'; - -function testSubqueryProject(): SubqueryProject { - return { - network: { - dictionary: `https://api.subquery.network/sq/subquery/polkadot-dictionary`, - }, - dataSources: [], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -const HAPPY_PATH_CONDITIONS: DictionaryQueryEntry[] = [ - { - entity: 'events', - conditions: [ - { field: 'module', value: 'staking' }, - { field: 'event', value: 'Bonded' }, - ], - }, - { - entity: 'events', - conditions: [ - { field: 'module', value: 'balances' }, - { field: 'event', value: 'Reward' }, - ], - }, - { - entity: 'events', - conditions: [ - { field: 'module', value: 'balances' }, - { field: 'event', value: 'Slash' }, - ], - }, - { - entity: 'extrinsics', - conditions: [ - { field: 'module', value: 'staking' }, - { field: 'call', value: 'bond' }, - ], - }, -]; - -const nodeConfig = new NodeConfig({ - subquery: 'asdf', - subqueryName: 'asdf', - networkEndpoint: 'wss://polkadot.api.onfinality.io/public-ws', - dictionaryTimeout: 10, -}); - -describe('DictionaryService', () => { - it('return dictionary query result', async () => { - const project = testSubqueryProject(); - const dictionaryService = new DictionaryService(project, nodeConfig); - - const batchSize = 30; - const startBlock = 1; - const endBlock = 10001; - const dic = await dictionaryService.getDictionary( - startBlock, - endBlock, - batchSize, - HAPPY_PATH_CONDITIONS, - ); - - expect(dic.batchBlocks.length).toBeGreaterThan(1); - }, 500000); - - it('return undefined when dictionary api failed', async () => { - const project = testSubqueryProject(); - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/dictionary-not-exist'; - const dictionaryService = new DictionaryService(project, nodeConfig); - const batchSize = 30; - const startBlock = 1; - const endBlock = 10001; - const dic = await dictionaryService.getDictionary( - startBlock, - endBlock, - batchSize, - HAPPY_PATH_CONDITIONS, - ); - expect(dic).toBeUndefined(); - }, 500000); - - it('should return meta even startblock height greater than dictionary last processed height', async () => { - const project = testSubqueryProject(); - const dictionaryService = new DictionaryService(project, nodeConfig); - const batchSize = 30; - const startBlock = 400000000; - const endBlock = 400010000; - const dic = await dictionaryService.getDictionary( - startBlock, - endBlock, - batchSize, - HAPPY_PATH_CONDITIONS, - ); - expect(dic._metadata).toBeDefined(); - }, 500000); - - it('test query the correct range', async () => { - const project = testSubqueryProject(); - const dictionaryService = new DictionaryService(project, nodeConfig); - - const batchSize = 30; - const startBlock = 1; - const endBlock = 10001; - const dic = await dictionaryService.getDictionary( - startBlock, - endBlock, - batchSize, - [ - { - entity: 'extrinsics', - conditions: [ - { field: 'module', value: 'timestamp' }, - { field: 'call', value: 'set' }, - ], - }, - ], - ); - expect(dic.batchBlocks).toEqual(range(startBlock, startBlock + batchSize)); - }, 500000); - - it('use minimum value of event/extrinsic returned block as batch end block', async () => { - const project = testSubqueryProject(); - const dictionaryService = new DictionaryService(project, nodeConfig); - const batchSize = 50; - const startBlock = 333300; - const endBlock = 340000; - const dic = await dictionaryService.getDictionary( - startBlock, - endBlock, - batchSize, - [ - { - //last event at block 333524 - entity: 'events', - conditions: [ - { field: 'module', value: 'session' }, - { field: 'event', value: 'NewSession' }, - ], - }, - { - entity: 'events', - conditions: [ - { field: 'module', value: 'staking' }, - { field: 'event', value: 'EraPayout' }, - ], - }, - { - entity: 'events', - conditions: [ - { field: 'module', value: 'staking' }, - { field: 'event', value: 'Reward' }, - ], - }, - { - //last extrinsic at block 339186 - entity: 'extrinsics', - conditions: [ - { field: 'module', value: 'staking' }, - { field: 'call', value: 'payoutStakers' }, - ], - }, - { - entity: 'extrinsics', - conditions: [ - { field: 'module', value: 'utility' }, - { field: 'call', value: 'batch' }, - ], - }, - ], - ); - expect(dic.batchBlocks[dic.batchBlocks.length - 1]).toBe(333524); - }, 500000); - - it('should return all specVersion', async () => { - const project = testSubqueryProject(); - const dictionaryService = new DictionaryService(project, nodeConfig); - - const specVersions = await dictionaryService.getSpecVersions(); - }, 500000); -}); diff --git a/packages/node/src/indexer/dictionary.service.ts b/packages/node/src/indexer/dictionary.service.ts index df62e505..2dc8d976 100644 --- a/packages/node/src/indexer/dictionary.service.ts +++ b/packages/node/src/indexer/dictionary.service.ts @@ -9,36 +9,19 @@ import { gql, } from '@apollo/client/core'; import { Injectable, OnApplicationShutdown } from '@nestjs/common'; +import { getYargsOption, getLogger, profiler } from '@subql/node-core'; import { - getYargsOption, - NodeConfig, - timeout, - getLogger, - profiler, -} from '@subql/node-core'; -import { DictionaryQueryCondition, DictionaryQueryEntry } from '@subql/types'; + DictionaryQueryCondition, + DictionaryQueryEntry, +} from '@subql/types-ethereum'; import { buildQuery, GqlNode, GqlQuery, GqlVar, MetaData } from '@subql/utils'; import fetch from 'node-fetch'; import { SubqueryProject } from '../configure/SubqueryProject'; -export type SpecVersion = { - id: string; - start: number; //start with this block - end: number; -}; - export type Dictionary = { _metadata: MetaData; batchBlocks: number[]; - //TODO - // specVersions: number[]; -}; - -export type SpecVersionDictionary = { - _metadata: MetaData; - specVersions: SpecVersion[]; }; - const logger = getLogger('dictionary'); const { argv } = getYargsOption(); @@ -105,8 +88,8 @@ function buildDictQueryFragment( filter: { ...filter, blockHeight: { - greaterThanOrEqualTo: `"${startBlock}"`, - lessThan: `"${queryEndBlock}"`, + greaterThanOrEqualTo: `${startBlock}`, + lessThan: `${queryEndBlock}`, }, }, orderBy: 'BLOCK_HEIGHT_ASC', @@ -121,10 +104,7 @@ export class DictionaryService implements OnApplicationShutdown { private client: ApolloClient; private isShutdown = false; - constructor( - protected project: SubqueryProject, - private nodeConfig: NodeConfig, - ) { + constructor(protected project: SubqueryProject) { this.client = new ApolloClient({ cache: new InMemoryCache({ resultCaching: true }), link: new HttpLink({ uri: this.project.network.dictionary, fetch }), @@ -166,33 +146,20 @@ export class DictionaryService implements OnApplicationShutdown { ); try { - const resp = await timeout( - this.client.query({ - query: gql(query), - variables, - }), - this.nodeConfig.dictionaryTimeout, - ); + const resp = await this.client.query({ + query: gql(query), + variables, + }); const blockHeightSet = new Set(); - const specVersionBlockHeightSet = new Set(); const entityEndBlock: { [entity: string]: number } = {}; for (const entity of Object.keys(resp.data)) { - if ( - entity !== 'specVersions' && - entity !== '_metadata' && - resp.data[entity].nodes.length >= 0 - ) { + if (entity !== '_metadata' && resp.data[entity].nodes.length >= 0) { for (const node of resp.data[entity].nodes) { blockHeightSet.add(Number(node.blockHeight)); - entityEndBlock[entity] = Number(node.blockHeight); //last added event blockHeight + entityEndBlock[entity] = Number(node.blockHeight); } } } - if (resp.data.specVersions && resp.data.specVersions.nodes.length >= 0) { - for (const node of resp.data.specVersions.nodes) { - specVersionBlockHeightSet.add(Number(node.blockHeight)); - } - } const _metadata = resp.data._metadata; const endBlock = Math.min( ...Object.values(entityEndBlock).map((height) => @@ -202,8 +169,6 @@ export class DictionaryService implements OnApplicationShutdown { const batchBlocks = Array.from(blockHeightSet) .filter((block) => block <= endBlock) .sort((n1, n2) => n1 - n2); - //TODO - // const specVersions = Array.from(specVersionBlockHeightSet); return { _metadata, batchBlocks, @@ -235,15 +200,6 @@ export class DictionaryService implements OnApplicationShutdown { entity: '_metadata', project: ['lastProcessedHeight', 'genesisHash'], }, - { - entity: 'specVersions', - project: [ - { - entity: 'nodes', - project: ['id', 'blockHeight'], - }, - ], - }, ]; for (const entity of Object.keys(mapped)) { const [pVars, node] = buildDictQueryFragment( @@ -258,82 +214,4 @@ export class DictionaryService implements OnApplicationShutdown { } return buildQuery(vars, nodes); } - - parseSpecVersions(raw: SpecVersionDictionary): SpecVersion[] { - if (raw === undefined) { - return []; - } - const specVersionBlockHeightSet = new Set(); - const specVersions = (raw.specVersions as any).nodes; - const _metadata = raw._metadata; - - // Add range for -1 specVersions - for (let i = 0; i < specVersions.length - 1; i++) { - specVersionBlockHeightSet.add({ - id: specVersions[i].id, - start: Number(specVersions[i].blockHeight), - end: Number(specVersions[i + 1].blockHeight) - 1, - }); - } - if (specVersions && specVersions.length >= 0) { - // Add range for the last specVersion - if (_metadata.lastProcessedHeight) { - specVersionBlockHeightSet.add({ - id: specVersions[specVersions.length - 1].id, - start: Number(specVersions[specVersions.length - 1].blockHeight), - end: Number(_metadata.lastProcessedHeight), - }); - } - } - return Array.from(specVersionBlockHeightSet); - } - - async getSpecVersionsRaw(): Promise { - const { query } = this.specVersionQuery(); - try { - const resp = await timeout( - this.client.query({ - query: gql(query), - }), - this.nodeConfig.dictionaryTimeout, - ); - - const _metadata = resp.data._metadata; - const specVersions = resp.data.specVersions; - return { _metadata, specVersions }; - } catch (err) { - logger.warn(err, `failed to fetch specVersion result`); - return undefined; - } - } - - async getSpecVersions(): Promise { - try { - return this.parseSpecVersions(await this.getSpecVersionsRaw()); - } catch { - return undefined; - } - } - - private specVersionQuery(): GqlQuery { - const nodes: GqlNode[] = [ - { - entity: '_metadata', - project: ['lastProcessedHeight', 'genesisHash'], - }, - { - entity: 'specVersions', - project: [ - { - entity: 'nodes', - project: ['id', 'blockHeight'], - }, - ], - args: { - orderBy: 'BLOCK_HEIGHT_ASC', - }, - }, - ]; - return buildQuery([], nodes); - } } diff --git a/packages/node/src/indexer/ds-processor.service.spec.ts b/packages/node/src/indexer/ds-processor.service.spec.ts deleted file mode 100644 index fc1bba95..00000000 --- a/packages/node/src/indexer/ds-processor.service.spec.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import { isCustomDs } from '@subql/common-substrate'; -import { SubstrateCustomDatasource } from '@subql/types'; -import { GraphQLSchema } from 'graphql'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { DsProcessorService } from './ds-processor.service'; - -function getTestProject( - extraDataSources?: SubstrateCustomDatasource[], -): SubqueryProject { - return { - network: { - genesisHash: '0x', - endpoint: 'wss://polkadot.api.onfinality.io/public-ws', - }, - dataSources: [ - { - kind: 'substrate/Jsonfy', - processor: { file: 'test/jsonfy.js' }, - startBlock: 1, - mapping: { - entryScript: '', - handlers: [{ handler: 'testSandbox', kind: 'substrate/JsonfyEvent' }], - }, - }, - ...extraDataSources, - ] as any, - id: 'test', - root: path.resolve(__dirname, '../../'), - schema: new GraphQLSchema({}), - templates: [], - }; -} - -describe('DsProcessorService', () => { - let service: DsProcessorService; - let project: SubqueryProject; - - beforeEach(() => { - project = getTestProject([]); - service = new DsProcessorService(project); - }); - - it('can validate custom ds', async () => { - await expect( - service.validateProjectCustomDatasources(), - ).resolves.not.toThrow(); - }); - - it('can catch an invalid datasource kind', async () => { - const badDs: SubstrateCustomDatasource = { - kind: 'substrate/invalid', - processor: { file: 'contract-processors/dist/jsonfy.js' }, - assets: new Map([]), - mapping: { - file: '', - handlers: [], - }, - }; - - project = getTestProject([badDs]); - service = new DsProcessorService(project); - - await expect(service.validateProjectCustomDatasources()).rejects.toThrow(); - }); - - it('can run a custom ds processor', () => { - const ds = project.dataSources[0]; - - if (!isCustomDs(ds)) { - throw new Error('Expected custom data source'); - } - - expect(() => service.getDsProcessor(ds)).not.toThrow(); - }); -}); diff --git a/packages/node/src/indexer/ds-processor.service.ts b/packages/node/src/indexer/ds-processor.service.ts index 2784cb65..b01ba067 100644 --- a/packages/node/src/indexer/ds-processor.service.ts +++ b/packages/node/src/indexer/ds-processor.service.ts @@ -4,21 +4,19 @@ import fs from 'fs'; import path from 'path'; import { Injectable } from '@nestjs/common'; -import { AnyTuple } from '@polkadot/types-codec/types'; import { + EthereumHandlerKind, isCustomDs, - SubstrateCustomDataSource, - SubstrateDataSource, - SubstrateDatasourceProcessor, - SubstrateNetworkFilter, -} from '@subql/common-substrate'; + SubqlEthereumCustomDataSource, + SubqlEthereumDataSource, + SubqlDatasourceProcessor, +} from '@subql/common-ethereum'; import { getLogger } from '@subql/node-core'; import { SecondLayerHandlerProcessor_0_0_0, SecondLayerHandlerProcessor_1_0_0, - SubstrateCustomDatasource, - SubstrateHandlerKind, -} from '@subql/types'; + SubqlCustomDatasource, +} from '@subql/types-ethereum'; import { VMScript } from 'vm2'; import { SubqueryProject } from '../configure/SubqueryProject'; @@ -33,45 +31,42 @@ export interface DsPluginSandboxOption { const logger = getLogger('ds-sandbox'); export function isSecondLayerHandlerProcessor_0_0_0< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, E, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource, + DS extends SubqlCustomDatasource = SubqlEthereumCustomDataSource, >( processor: - | SecondLayerHandlerProcessor_0_0_0 - | SecondLayerHandlerProcessor_1_0_0, -): processor is SecondLayerHandlerProcessor_0_0_0 { + | SecondLayerHandlerProcessor_0_0_0 + | SecondLayerHandlerProcessor_1_0_0, +): processor is SecondLayerHandlerProcessor_0_0_0 { // Exisiting datasource processors had no concept of specVersion, therefore undefined is equivalent to 0.0.0 return processor.specVersion === undefined; } export function isSecondLayerHandlerProcessor_1_0_0< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, E, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource, + DS extends SubqlEthereumCustomDataSource = SubqlEthereumCustomDataSource, >( processor: - | SecondLayerHandlerProcessor_0_0_0 - | SecondLayerHandlerProcessor_1_0_0, -): processor is SecondLayerHandlerProcessor_1_0_0 { + | SecondLayerHandlerProcessor_0_0_0 + | SecondLayerHandlerProcessor_1_0_0, +): processor is SecondLayerHandlerProcessor_1_0_0 { return processor.specVersion === '1.0.0'; } export function asSecondLayerHandlerProcessor_1_0_0< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, E, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource, + DS extends SubqlEthereumCustomDataSource = SubqlEthereumCustomDataSource, >( processor: - | SecondLayerHandlerProcessor_0_0_0 - | SecondLayerHandlerProcessor_1_0_0, -): SecondLayerHandlerProcessor_1_0_0 { + | SecondLayerHandlerProcessor_0_0_0 + | SecondLayerHandlerProcessor_1_0_0, +): SecondLayerHandlerProcessor_1_0_0 { if (isSecondLayerHandlerProcessor_1_0_0(processor)) { return processor; } @@ -104,10 +99,7 @@ export class DsPluginSandbox extends Sandbox { this.freeze(logger, 'logger'); } - getDsPlugin< - D extends string, - T extends SubstrateNetworkFilter, - >(): SubstrateDatasourceProcessor { + getDsPlugin(): SubqlDatasourceProcessor { return this.run(this.script); } } @@ -115,15 +107,12 @@ export class DsPluginSandbox extends Sandbox { @Injectable() export class DsProcessorService { private processorCache: { - [entry: string]: SubstrateDatasourceProcessor< - string, - SubstrateNetworkFilter - >; + [entry: string]: SubqlDatasourceProcessor; } = {}; constructor(private project: SubqueryProject) {} async validateCustomDs( - datasources: SubstrateCustomDataSource[], + datasources: SubqlEthereumCustomDataSource[], ): Promise { for (const ds of datasources) { const processor = this.getDsProcessor(ds); @@ -157,13 +146,15 @@ export class DsProcessorService { async validateProjectCustomDatasources(): Promise { await this.validateCustomDs( - (this.project.dataSources as SubstrateDataSource[]).filter(isCustomDs), + (this.project.dataSources as SubqlEthereumDataSource[]).filter( + isCustomDs, + ), ); } - getDsProcessor( - ds: SubstrateCustomDataSource, - ): SubstrateDatasourceProcessor { + getDsProcessor( + ds: SubqlEthereumCustomDataSource, + ): SubqlDatasourceProcessor { if (!isCustomDs(ds)) { throw new Error(`data source is not a custom data source`); } @@ -174,20 +165,20 @@ export class DsProcessorService { script: null /* TODO get working with Readers, same as with sandbox */, }); try { - this.processorCache[ds.processor.file] = sandbox.getDsPlugin(); + this.processorCache[ds.processor.file] = sandbox.getDsPlugin(); } catch (e) { - logger.error(e, `not supported ds @${ds.kind}`); + logger.error(`not supported ds @${ds.kind}`); throw e; } } return this.processorCache[ ds.processor.file - ] as unknown as SubstrateDatasourceProcessor; + ] as unknown as SubqlDatasourceProcessor; } // eslint-disable-next-line @typescript-eslint/require-await async getAssets( - ds: SubstrateCustomDataSource, + ds: SubqlEthereumCustomDataSource, ): Promise> { if (!isCustomDs(ds)) { throw new Error(`data source is not a custom data source`); diff --git a/packages/node/src/indexer/dynamic-ds.service.ts b/packages/node/src/indexer/dynamic-ds.service.ts index 2e5f7474..df06b385 100644 --- a/packages/node/src/indexer/dynamic-ds.service.ts +++ b/packages/node/src/indexer/dynamic-ds.service.ts @@ -3,7 +3,7 @@ import assert from 'assert'; import { Injectable } from '@nestjs/common'; -import { isCustomDs, isRuntimeDs } from '@subql/common-substrate'; +import { isCustomDs, isRuntimeDs } from '@subql/common-ethereum'; import { getLogger, MetadataRepo } from '@subql/node-core'; import { Transaction } from 'sequelize/types'; import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject'; @@ -52,7 +52,7 @@ export class DynamicDsService { return ds; } catch (e) { - logger.error(e, 'Failed to create dynamic ds'); + logger.error(e.message); process.exit(1); } } @@ -66,7 +66,7 @@ export class DynamicDsService { params.map((params) => this.getDatasource(params)), ); } catch (e) { - logger.error(e, `Unable to get dynamic datasources`); + logger.error(`Unable to get dynamic datasources:\n${e.message}`); process.exit(1); } } diff --git a/packages/node/src/indexer/fetch.module.ts b/packages/node/src/indexer/fetch.module.ts index 44999280..0e458725 100644 --- a/packages/node/src/indexer/fetch.module.ts +++ b/packages/node/src/indexer/fetch.module.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Module } from '@nestjs/common'; +import { EventEmitter2 } from '@nestjs/event-emitter'; import { BenchmarkService, MmrService, @@ -9,8 +10,10 @@ import { PoiService, getYargsOption, DbModule, + ApiService, } from '@subql/node-core'; -import { ApiService } from './api.service'; +import { SubqueryProject } from '../configure/SubqueryProject'; +import { EthereumApiService } from '../ethereum/api.service.ethereum'; import { DictionaryService } from './dictionary.service'; import { DsProcessorService } from './ds-processor.service'; import { DynamicDsService } from './dynamic-ds.service'; @@ -22,17 +25,26 @@ import { BlockDispatcherService, WorkerBlockDispatcherService, } from './worker/block-dispatcher.service'; - const { argv } = getYargsOption(); @Module({ imports: [DbModule.forFeature(['Subquery'])], providers: [ StoreService, - ApiService, + { + provide: ApiService, + useFactory: async (project: SubqueryProject) => { + const apiService = new EthereumApiService(project); + + await apiService.init(); + return apiService; + }, + inject: [SubqueryProject], + }, IndexerManager, { provide: 'IBlockDispatcher', + inject: [SubqueryProject, EventEmitter2], useClass: argv.workers ? WorkerBlockDispatcherService : BlockDispatcherService, diff --git a/packages/node/src/indexer/fetch.service.spec.ts b/packages/node/src/indexer/fetch.service.spec.ts deleted file mode 100644 index 48c0ec12..00000000 --- a/packages/node/src/indexer/fetch.service.spec.ts +++ /dev/null @@ -1,710 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import { EventEmitter2 } from '@nestjs/event-emitter'; -import { SchedulerRegistry } from '@nestjs/schedule'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; -import { BN } from '@polkadot/util'; -import { - SubstrateDatasourceKind, - SubstrateHandlerKind, -} from '@subql/common-substrate'; -import { IndexerEvent, NodeConfig } from '@subql/node-core'; -import { GraphQLSchema } from 'graphql'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { calcInterval, fetchBlocksBatches } from '../utils/substrate'; -import { ApiService } from './api.service'; -import { Dictionary, DictionaryService } from './dictionary.service'; -import { DsProcessorService } from './ds-processor.service'; -import { DynamicDsService } from './dynamic-ds.service'; -import { FetchService } from './fetch.service'; -import { IndexerManager } from './indexer.manager'; -import { ProjectService } from './project.service'; -import { BlockContent } from './types'; -import { BlockDispatcherService } from './worker/block-dispatcher.service'; - -jest.mock('../utils/substrate', () => - jest.createMockFromModule('../utils/substrate'), -); - -const nodeConfig = new NodeConfig({ - subquery: 'asdf', - subqueryName: 'asdf', - networkEndpoint: 'wss://polkadot.api.onfinality.io/public-ws', - dictionaryTimeout: 10, -}); - -function mockRejectedApiService(): ApiService { - const mockApi = { - rpc: { - chain: { - getFinalizedHead: jest.fn(() => `0x112344`), - getBlock: jest.fn(() => Promise.reject('some error')), - }, - }, - on: jest.fn(), - }; - return { - getApi: () => mockApi, - } as any; -} - -function mockIndexerManager(): IndexerManager & { - register: (handler: IndexerManager['indexBlock']) => void; -} { - let _fn: any; - - return { - register: (fn) => (_fn = fn), - indexBlock: (block: BlockContent, runtimeVersion: RuntimeVersion) => { - _fn?.(block, runtimeVersion); - - return Promise.resolve({ dynamicDsCreated: false }); - }, - } as any; -} - -function mockApiService(): ApiService { - const mockApi = { - consts: { - babe: { - epochDuration: 0x0000000000000960, - expectedBlockTime: 0x0000000000001770, - maxAuthorities: 0x000186a0, - }, - timestamp: { - minimumPeriod: 0x0000000000000bb8, - }, - }, - query: { - parachainSystem: undefined, - }, - rpc: { - state: { - getRuntimeVersion: jest.fn(() => { - return { - specVersion: { - toNumber: jest.fn(() => 12), - }, - }; - }), - }, - chain: { - getFinalizedHead: jest.fn(() => `0x112344`), - getBlock: jest.fn(() => { - return { - block: { - header: { - number: { - toNumber: jest.fn(() => { - return 256; - }), - }, - }, - }, - }; - }), - getBlockHash: jest.fn(() => `0x123456`), - }, - }, - on: jest.fn(), - runtimeChain: { - toString: jest.fn(() => `Polkadot`), - }, - runtimeVersion: { - specName: { - toString: jest.fn(() => `polkadot`), - }, - }, - genesisHash: { - toString: jest.fn(() => `0x12345`), - }, - }; - return { - getApi: () => mockApi, - } as any; -} - -const mockDictionaryRet: Dictionary = { - _metadata: { - lastProcessedHeight: 998, - lastProcessedTimestamp: 123124151, - targetHeight: 998, - chain: 'Polkadot', - specName: 'polkadot', - genesisHash: '0x12345', - indexerHealthy: true, - indexerNodeVersion: '0.16.1', - queryNodeVersion: '0.6.0', - rowCountEstimate: [{ table: '', estimate: 0 }], - }, - //simulate after last process height update to 1000 - batchBlocks: [1000], -}; - -const mockDictionaryNoBatches: Dictionary = { - _metadata: { - lastProcessedHeight: 15000, - lastProcessedTimestamp: 123124151, - targetHeight: 16000, - chain: 'Polkadot', - specName: 'polkadot', - genesisHash: '0x12345', - indexerHealthy: true, - indexerNodeVersion: '0.16.1', - queryNodeVersion: '0.6.0', - rowCountEstimate: [{ table: '', estimate: 0 }], - }, - batchBlocks: [], -}; - -const mockDictionaryBatches: Dictionary = { - _metadata: { - lastProcessedHeight: 15000, - lastProcessedTimestamp: 123124151, - targetHeight: 16000, - chain: 'Polkadot', - specName: 'polkadot', - genesisHash: '0x12345', - indexerHealthy: true, - indexerNodeVersion: '0.16.1', - queryNodeVersion: '0.6.0', - rowCountEstimate: [{ table: '', estimate: 0 }], - }, - batchBlocks: [14000, 14200, 14300, 14500, 14600, 14700, 14800, 14900], -}; - -function mockDictionaryService( - cb?: (mock: jest.Mock) => void, -): DictionaryService { - const mockDictionary = jest.fn(() => { - if (cb) { - cb(mockDictionary); - } - return mockDictionaryRet; - }); - return { - getDictionary: mockDictionary, - getSpecVersions: jest.fn(() => [{ id: '1', start: 1, end: 29231 }]), - getSpecVersionsRaw: jest.fn(() => mockDictionaryRet), - } as any; -} - -function mockDictionaryService1(): DictionaryService { - return { - getDictionary: jest.fn(() => mockDictionaryBatches), - getSpecVersions: jest.fn(() => [{ id: '1', start: 1, end: 29231 }]), - getSpecVersionsRaw: jest.fn(() => mockDictionaryBatches), - } as any; -} - -function mockDictionaryService2(): DictionaryService { - return { - getDictionary: jest.fn(() => undefined), - } as any; -} - -function mockDictionaryService3(): DictionaryService { - return { - getDictionary: jest.fn(() => mockDictionaryNoBatches), - getSpecVersions: jest.fn(() => [{ id: '1', start: 1, end: 29231 }]), - getSpecVersionsRaw: jest.fn(() => mockDictionaryNoBatches), - } as any; -} - -function testSubqueryProject(): SubqueryProject { - return { - network: { - endpoint: 'wss://polkadot.api.onfinality.io/public-ws', - }, - chainTypes: { - types: { - TestType: 'u32', - }, - }, - dataSources: [], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -function testSubqueryProjectV0_2_0(): SubqueryProject { - return { - network: { - genesisHash: '0x', - dictionary: `https://api.subquery.network/sq/subquery/dictionary-polkadot`, - }, - dataSources: [ - { - kind: 'substrate/Jsonfy', - processor: { - file: 'test/jsonfy.js', - }, - startBlock: 1, - mapping: { - entryScript: '', - handlers: [ - { - handler: 'handleEvent', - kind: 'substrate/JsonfyEvent', - }, - ], - }, - }, - ] as any, - id: 'test', - schema: new GraphQLSchema({}), - root: path.resolve(__dirname, '../../'), - templates: [], - }; -} - -function mockProjectService(): ProjectService { - return { - blockOffset: 1, - getProcessedBlockCount: jest.fn(() => Promise.resolve(0)), - upsertMetadataBlockOffset: jest.fn(), - setBlockOffset: jest.fn(), - } as any; -} - -function createFetchService( - apiService = mockApiService(), - indexerManager: IndexerManager, - dictionaryService: DictionaryService, - project: SubqueryProject, - batchSize?: number, -) { - const dsProcessorService = new DsProcessorService(project); - const dynamicDsService = new DynamicDsService(dsProcessorService, project); - (dynamicDsService as any).getDynamicDatasources = jest.fn(() => []); - const nodeConfig = new NodeConfig({ - subquery: '', - subqueryName: '', - batchSize, - }); - const eventEmitter = new EventEmitter2(); - - return new FetchService( - apiService, - nodeConfig, - project, - new BlockDispatcherService( - apiService, - nodeConfig, - indexerManager, - eventEmitter, - mockProjectService(), - ), - dictionaryService, - dsProcessorService, - dynamicDsService, - eventEmitter, - new SchedulerRegistry(), - ); -} - -describe('FetchService', () => { - let apiService: ApiService; - let project: SubqueryProject; - let fetchService: FetchService; - - beforeEach(() => { - apiService = mockApiService(); - project = testSubqueryProject(); - (fetchBlocksBatches as jest.Mock).mockImplementation((api, blockArray) => - blockArray.map((height) => ({ - block: { block: { header: { number: { toNumber: () => height } } } }, - })), - ); - (calcInterval as jest.Mock).mockImplementation((api) => new BN(7_000)); - }); - - afterEach(() => { - (fetchService as unknown as any)?.blockDispatcher?.onApplicationShutdown(); - fetchService?.onApplicationShutdown(); - }); - - it('get finalized head when reconnect', async () => { - fetchService = createFetchService( - apiService, - mockIndexerManager(), - new DictionaryService(project, nodeConfig), - project, - ); - await fetchService.init(1); - expect( - apiService.getApi().rpc.chain.getFinalizedHead, - ).toHaveBeenCalledTimes(1); - expect(apiService.getApi().rpc.chain.getBlock).toHaveBeenCalledTimes(1); - }); - - // This doesn't test anything - it.skip('log errors when failed to get finalized block', async () => { - fetchService = createFetchService( - mockRejectedApiService(), - mockIndexerManager(), - new DictionaryService(project, nodeConfig), - project, - ); - await fetchService.init(1); - }); - - it('load batchSize of blocks with original method', () => { - const batchSize = 50; - const dictionaryService = new DictionaryService(project, nodeConfig); - - fetchService = createFetchService( - apiService, - mockIndexerManager(), - dictionaryService, - project, - batchSize, - ); - (fetchService as any).latestFinalizedHeight = 1000; - const end = (fetchService as any).nextEndBlockHeight(100, batchSize); - expect(end).toEqual(100 + batchSize - 1); - }); - - it('loop until shutdown', async () => { - const batchSize = 20; - (fetchBlocksBatches as jest.Mock).mockImplementation((api, blockArray) => - blockArray.map((height) => ({ - block: { block: { header: { number: { toNumber: () => height } } } }, - })), - ); - const dictionaryService = new DictionaryService(project, nodeConfig); - - const indexerManager = mockIndexerManager(); - - fetchService = createFetchService( - apiService, - indexerManager, - dictionaryService, - project, - batchSize, - ); - fetchService.prefetchMeta = jest.fn(); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 10) { - fetchService.onApplicationShutdown(); - (fetchService as any).blockDispatcher.onApplicationShutdown(); - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(1); - await pendingCondition; - - // const loopPromise = fetchService.startLoop(1); - // // eslint-disable-next-line @typescript-eslint/require-await - // fetchService.register(async (content) => { - // if (content.block.block.header.number.toNumber() === 10) { - // fetchService.onApplicationShutdown(); - // } - // }); - // await loopPromise; - fetchService.onApplicationShutdown(); - }, 500000); - - it("skip use dictionary once if dictionary 's lastProcessedHeight < startBlockHeight", async () => { - const batchSize = 20; - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/dictionary-polkadot'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleCall', - kind: SubstrateHandlerKind.Call, - filter: { - module: 'utility', - method: 'batchAll', - }, - }, - ], - }, - }, - ]; - const dictionaryService = mockDictionaryService((mock) => { - mockDictionaryRet._metadata.lastProcessedHeight++; - }); - const eventEmitter = new EventEmitter2(); - const schedulerRegistry = new SchedulerRegistry(); - const dsProcessorService = new DsProcessorService(project); - const dynamicDsService = new DynamicDsService(dsProcessorService, project); - (dynamicDsService as any).getDynamicDatasources = jest.fn(() => []); - const nodeConfig = new NodeConfig({ - subquery: '', - subqueryName: '', - batchSize, - }); - - const blockDispatcher = new BlockDispatcherService( - apiService, - nodeConfig, - mockIndexerManager(), - eventEmitter, - mockProjectService(), - ); - fetchService = new FetchService( - apiService, - nodeConfig, - project, - blockDispatcher, - dictionaryService, - dsProcessorService, - dynamicDsService, - eventEmitter, - schedulerRegistry, - ); - - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - const dictionaryValidationSpy = jest.spyOn( - fetchService as any, - `dictionaryValidation`, - ); - await fetchService.init(1000); - (fetchService as any).latestFinalizedHeight = 1005; - blockDispatcher.latestBufferedHeight = undefined; - // (fetchService as any).latestProcessedHeight = undefined; - // const loopPromise = fetchService.startLoop(1000); - await new Promise((resolve) => { - eventEmitter.on(IndexerEvent.BlocknumberQueueSize, (nextBufferSize) => { - // [1000,1001,1002,1003,1004] - if (nextBufferSize.value >= 5) { - resolve(undefined); - } - }); - }); - - expect(dictionaryValidationSpy).toHaveBeenCalledTimes(2); - expect(nextEndBlockHeightSpy).toHaveBeenCalledTimes(1); - //we expect after use the original method, next loop will still use dictionary by default - expect((fetchService as any).useDictionary).toBeTruthy(); - }, 500000); - - it('set last buffered Height to dictionary last processed height when dictionary returned batch is empty, and then start use original method', async () => { - const batchSize = 20; - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/dictionary-polkadot'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleBond', - kind: SubstrateHandlerKind.Event, - filter: { - module: 'staking', - method: 'Bonded', - }, - }, - ], - }, - }, - ]; - const dictionaryService = mockDictionaryService3(); - const schedulerRegistry = new SchedulerRegistry(); - const eventEmitter = new EventEmitter2(); - const dsProcessorService = new DsProcessorService(project); - const dynamicDsService = new DynamicDsService(dsProcessorService, project); - (dynamicDsService as any).getDynamicDatasources = jest.fn(() => []); - const nodeConfig = new NodeConfig({ - subquery: '', - subqueryName: '', - batchSize, - }); - - const blockDispatcher = new BlockDispatcherService( - apiService, - nodeConfig, - mockIndexerManager(), - eventEmitter, - mockProjectService(), - ); - fetchService = new FetchService( - apiService, - nodeConfig, - project, - blockDispatcher, - dictionaryService, - dsProcessorService, - dynamicDsService, - eventEmitter, - schedulerRegistry, - ); - await fetchService.init(1000); - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - fetchService.prefetchMeta = jest.fn(); - (fetchService as any).latestFinalizedHeight = 16000; - blockDispatcher.latestBufferedHeight = undefined; - // (fetchService as any).latestProcessedHeight = undefined; - // const loopPromise = fetchService.startLoop(1000); - await new Promise((resolve) => { - eventEmitter.on(IndexerEvent.BlocknumberQueueSize, (nextBufferSize) => { - if (nextBufferSize.value >= 5) { - resolve(undefined); - } - }); - }); - // await loopPromise; - expect(nextEndBlockHeightSpy).toHaveBeenCalledTimes(1); - // lastProcessed height (use dictionary once) + batchsize (use original once) - expect(blockDispatcher.latestBufferedHeight).toBe(15020); - }, 500000); - - it('fill the dictionary returned batches to nextBlockBuffer', async () => { - const batchSize = 20; - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/dictionary-polkadot'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: ' ', - handlers: [ - { - handler: 'handleBond', - kind: SubstrateHandlerKind.Event, - filter: { - module: 'staking', - method: 'Bonded', - }, - }, - ], - }, - }, - ]; - const dictionaryService = mockDictionaryService1(); - const schedulerRegistry = new SchedulerRegistry(); - const dsProcessorService = new DsProcessorService(project); - const dynamicDsService = new DynamicDsService(dsProcessorService, project); - (dynamicDsService as any).getDynamicDatasources = jest.fn(() => []); - const eventEmitter = new EventEmitter2(); - const nodeConfig = new NodeConfig({ - subquery: '', - subqueryName: '', - batchSize, - }); - const blockDispatcher = new BlockDispatcherService( - apiService, - nodeConfig, - mockIndexerManager(), - eventEmitter, - mockProjectService(), - ); - fetchService = new FetchService( - apiService, - nodeConfig, - project, - blockDispatcher, - dictionaryService, - dsProcessorService, - dynamicDsService, - eventEmitter, - schedulerRegistry, - ); - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - await fetchService.init(1000); - (fetchService as any).latestFinalizedHeight = 16000; - blockDispatcher.latestBufferedHeight = undefined; - // (fetchService as any).latestProcessedHeight = undefined; - // const loopPromise = fetchService.startLoop(1000); - await new Promise((resolve) => { - eventEmitter.on(IndexerEvent.BlocknumberQueueSize, (nextBufferSize) => { - if (nextBufferSize.value >= 8) { - resolve(undefined); - } - }); - }); - // await loopPromise; - expect(nextEndBlockHeightSpy).toBeCalledTimes(0); - //alway use dictionary - expect((fetchService as any).useDictionary).toBeTruthy(); - expect(blockDispatcher.latestBufferedHeight).toBe(14900); - }, 500000); - - it('can support custom data sources', async () => { - project = testSubqueryProjectV0_2_0(); - - const indexerManager = mockIndexerManager(); - - fetchService = createFetchService( - apiService, - indexerManager, - new DictionaryService(project, nodeConfig), - project, - 20, - ); - - const baseHandlerFilters = jest.spyOn( - fetchService as any, - `getBaseHandlerFilters`, - ); - - const getDsProcessor = jest.spyOn( - (fetchService as any).dsProcessorService, - `getDsProcessor`, - ); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 10) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(1); - - await pendingCondition; - - // const loopPromise = fetchService.startLoop(1); - // void fetchService.register(async (content) => { - // if (content.block.block.header.number.toNumber() === 10) { - // fetchService.onApplicationShutdown(); - // } - // }); - // await loopPromise; - - expect(baseHandlerFilters).toHaveBeenCalledTimes(1); - expect(getDsProcessor).toHaveBeenCalledTimes(3); - fetchService.onApplicationShutdown(); - }, 500000); -}); diff --git a/packages/node/src/indexer/fetch.service.test.ts b/packages/node/src/indexer/fetch.service.test.ts deleted file mode 100644 index ae1c9fab..00000000 --- a/packages/node/src/indexer/fetch.service.test.ts +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { INestApplication } from '@nestjs/common'; -import { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter'; -import { SchedulerRegistry } from '@nestjs/schedule'; -import { Test } from '@nestjs/testing'; -import { ApiOptions } from '@polkadot/api/types'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; -import { delay } from '@subql/common'; -import { - SubstrateDatasourceKind, - SubstrateHandlerKind, -} from '@subql/common-substrate'; -import { NodeConfig } from '@subql/node-core'; -import { GraphQLSchema } from 'graphql'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import * as SubstrateUtil from '../utils/substrate'; -import { ApiService } from './api.service'; -import { DictionaryService } from './dictionary.service'; -import { DsProcessorService } from './ds-processor.service'; -import { DynamicDsService } from './dynamic-ds.service'; -import { FetchService } from './fetch.service'; -import { IndexerManager } from './indexer.manager'; -import { ProjectService } from './project.service'; -import { BlockContent } from './types'; -import { BlockDispatcherService } from './worker/block-dispatcher.service'; - -const WS_ENDPOINT = 'wss://polkadot.api.onfinality.io/public-ws'; -const HTTP_ENDPOINT = 'https://polkadot.api.onfinality.io/public'; - -function testSubqueryProject(): SubqueryProject { - return { - network: { - endpoint: WS_ENDPOINT, - }, - chainTypes: { - types: { - TestType: 'u32', - }, - }, - dataSources: [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - handlers: [ - { handler: 'handleTest', kind: SubstrateHandlerKind.Event }, - ], - file: '', - }, - }, - ], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -function mockIndexerManager(): IndexerManager & { - register: (handler: IndexerManager['indexBlock']) => void; -} { - let _fn: any; - - return { - register: (fn) => (_fn = fn), - indexBlock: (block: BlockContent, runtimeVersion: RuntimeVersion) => { - _fn?.(block, runtimeVersion); - - return Promise.resolve({ dynamicDsCreated: false }); - }, - } as any; -} - -function mockProjectService(): ProjectService { - return { - blockOffset: 1, - getProcessedBlockCount: jest.fn(() => Promise.resolve(0)), - upsertMetadataBlockOffset: jest.fn(), - setBlockOffset: jest.fn(), - } as any; -} - -jest.setTimeout(200000); -const nodeConfig = new NodeConfig({ - subquery: 'asdf', - subqueryName: 'asdf', - networkEndpoint: WS_ENDPOINT, - dictionaryTimeout: 10, - batchSize: 5, -}); - -async function createApp( - project = testSubqueryProject(), - indexerManager: IndexerManager, -): Promise { - const nestModule = await Test.createTestingModule({ - providers: [ - { - provide: SubqueryProject, - useFactory: () => project, - }, - { - provide: IndexerManager, - useFactory: () => indexerManager, - }, - { - provide: NodeConfig, - useFactory: () => nodeConfig, - }, - { - provide: 'IBlockDispatcher', - useFactory: (apiService, nodeConfig, eventEmitter, indexerManager) => - new BlockDispatcherService( - apiService, - nodeConfig, - indexerManager, - eventEmitter, - mockProjectService(), - ), - inject: [ApiService, NodeConfig, EventEmitter2, IndexerManager], - }, - ApiService, - DsProcessorService, - { - provide: DynamicDsService, - useFactory: (dsProcessorService, project) => { - const dynamicDsService = new DynamicDsService( - dsProcessorService, - project, - ); - (dynamicDsService as any).getDynamicDatasources = jest.fn(() => []); - - return dynamicDsService; - }, - inject: [DsProcessorService, SubqueryProject], - }, - { - provide: DictionaryService, - useFactory: () => new DictionaryService(project, nodeConfig), - }, - SchedulerRegistry, - FetchService, - ], - imports: [EventEmitterModule.forRoot()], - }).compile(); - - const app = nestModule.createNestApplication(); - - await app.init(); - await app.get(ApiService).init(); - - return app; -} - -describe('FetchService', () => { - let app: INestApplication; - let fetchService: FetchService; - - afterEach(async () => { - fetchService?.onApplicationShutdown(); - app?.get('IBlockDispatcher').onApplicationShutdown(); - await delay(2); - await app?.close(); - }); - - it('fetch meta data once when spec version not changed in range', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - - app = await createApp(project, indexerManager); - - fetchService = app.get(FetchService); - const apiService = app.get(ApiService); - const apiOptions = (apiService as any).apiOption as ApiOptions; - const provider = apiOptions.provider; - const getSendSpy = jest.spyOn(provider, 'send'); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 10) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(1); - await pendingCondition; - - const getMetadataCalls = getSendSpy.mock.calls.filter( - (call) => call[0] === 'state_getMetadata', - ); - expect(getMetadataCalls.length).toBe(1); - }); - - it('fetch metadata two times when spec version changed in range', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - - app = await createApp(project, indexerManager); - - fetchService = app.get(FetchService); - const apiService = app.get(ApiService); - const apiOptions = (apiService as any).apiOption as ApiOptions; - const provider = apiOptions.provider; - const getSendSpy = jest.spyOn(provider, 'send'); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 29240) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(29230); - await pendingCondition; - - const getMetadataCalls = getSendSpy.mock.calls.filter( - (call) => call[0] === 'state_getMetadata', - ); - expect(getMetadataCalls.length).toBe(2); - }, 100000); - - it('not use dictionary if dictionary is not defined in project config', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //filter is defined - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - const dictionaryValidationSpy = jest.spyOn( - fetchService as any, - `dictionaryValidation`, - ); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 29240) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(29230); - await pendingCondition; - - expect(dictionaryValidationSpy).toBeCalledTimes(1); - expect(nextEndBlockHeightSpy).toBeCalled(); - }, 500000); - - it('not use dictionary if filters not defined in datasource', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/dictionary-polkadot'; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - const dictionaryValidationSpy = jest.spyOn( - fetchService as any, - `dictionaryValidation`, - ); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 29240) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(29230); - await pendingCondition; - - expect(dictionaryValidationSpy).toBeCalledTimes(1); - expect(nextEndBlockHeightSpy).toBeCalled(); - // fetchService.onApplicationShutdown() - // await delay(0.5) - }, 500000); - - it('not use dictionary if block handler is defined in datasource', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/dictionary-polkadot'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleBlock', - kind: SubstrateHandlerKind.Block, - }, - ], - }, - }, - ]; - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - const dictionaryValidationSpy = jest.spyOn( - fetchService as any, - `dictionaryValidation`, - ); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 29240) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(29230); - await pendingCondition; - - expect(dictionaryValidationSpy).toBeCalledTimes(1); - expect(nextEndBlockHeightSpy).toBeCalled(); - }, 500000); - - it('not use dictionary if one of the handler filter module or method is not defined', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - //missing method will set useDictionary to false - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - const dictionaryValidationSpy = jest.spyOn( - fetchService as any, - `dictionaryValidation`, - ); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 29240) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(29230); - await pendingCondition; - - expect(dictionaryValidationSpy).toBeCalledTimes(1); - expect(nextEndBlockHeightSpy).toBeCalled(); - }, 500000); - - // at init - it('set useDictionary to false if dictionary metadata not match with the api', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to different network - //set to a kusama network and use polkadot dictionary - project.network.endpoint = 'wss://kusama.api.onfinality.io/public-ws'; - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - const nextEndBlockHeightSpy = jest.spyOn( - fetchService as any, - `nextEndBlockHeight`, - ); - const dictionaryValidationSpy = jest.spyOn( - fetchService as any, - `dictionaryValidation`, - ); - - const pendingCondition = new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/require-await - indexerManager.register(async (content) => { - if (content.block.block.header.number.toNumber() === 29240) { - resolve(undefined); - } - - return { dynamicDsCreated: false, operationHash: null }; - }); - }); - - await fetchService.init(29230); - await pendingCondition; - - expect(dictionaryValidationSpy).toBeCalledTimes(1); - expect(nextEndBlockHeightSpy).toBeCalled(); - expect(dictionaryValidationSpy).toReturnWith(false); - expect((fetchService as any).specVersionMap.length).toBe(0); - }, 500000); - - it('use dictionary and specVersionMap to get block specVersion', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - await fetchService.init(1); - const getSpecFromMapSpy = jest.spyOn(fetchService, 'getSpecFromMap'); - const specVersion = await fetchService.getSpecVersion(8638105); - expect(getSpecFromMapSpy).toBeCalledTimes(1); - }, 500000); - - it('use api to get block specVersion when blockHeight out of specVersionMap', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - await fetchService.init(1); - const getSpecFromMapSpy = jest.spyOn(fetchService, 'getSpecFromMap'); - const getSpecFromApiSpy = jest.spyOn(fetchService, 'getSpecFromApi'); - - // current last specVersion 9200, we should always use api for check next spec - - await expect(fetchService.getSpecVersion(90156860)).rejects.toThrow(); - // It checked with dictionary specVersionMap once, and fall back to use api method - expect(getSpecFromMapSpy).toBeCalledTimes(1); - // this large blockHeight should be thrown - expect(getSpecFromApiSpy).toBeCalledTimes(1); - }, 500000); - - it('only fetch SpecVersion from dictionary once', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - // make sure use dictionary is true - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - const dictionaryService = (fetchService as any).dictionaryService; - const getSpecVersionSpy = jest.spyOn(dictionaryService, 'getSpecVersions'); - - await fetchService.init(1); - fetchService.onApplicationShutdown(); - - await fetchService.getSpecVersion(8638105); - await fetchService.getSpecVersion(8638200); - - expect(getSpecVersionSpy).toBeCalledTimes(1); - }, 500000); - - it('update specVersionMap once when specVersion map is out', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - (fetchService as any).templateDynamicDatasouces = []; - fetchService.updateDictionary(); - - fetchService.onApplicationShutdown(); - - (fetchService as any).latestFinalizedHeight = 10437859; - //mock specVersion map - (fetchService as any).specVersionMap = [ - { id: '9180', start: 9738718, end: 10156856 }, - ]; - const spec = await fetchService.getSpecVersion(10337859); - const specVersionMap = (fetchService as any).specVersionMap; - // If the last finalized block specVersion are same, we expect it will update the specVersion map - const latestSpecVersion = - await fetchService.api.rpc.state.getRuntimeVersion(); - // This should be match if dictionary is fully synced - expect(Number(specVersionMap[specVersionMap.length - 1].id)).toBe( - latestSpecVersion.specVersion.toNumber(), - ); - }, 500000); - - it('prefetch meta for different specVersion range', async () => { - const project = testSubqueryProject(); - const indexerManager = mockIndexerManager(); - //set dictionary to a different network - project.network.dictionary = - 'https://api.subquery.network/sq/subquery/polkadot-dictionary'; - project.dataSources = [ - { - name: 'runtime', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { - handler: 'handleEvent', - kind: SubstrateHandlerKind.Event, - filter: { module: 'staking', method: 'Reward' }, - }, - ], - }, - }, - ]; - - app = await createApp(project, indexerManager); - fetchService = app.get(FetchService); - - await fetchService.init(1); - fetchService.onApplicationShutdown(); - - (fetchService as any).latestFinalizedHeight = 10437859; - //mock specVersion map - (fetchService as any).specVersionMap = [ - { id: '9140', start: 8115870, end: 8638103 }, - { id: '9151', start: 8638104, end: 9280180 }, - { id: '9170', start: 9280180, end: 9738717 }, - { id: '9180', start: 9738718, end: 10156856 }, - { id: '9190', start: 10156857, end: 10437859 }, - ]; - const getPrefechMetaSpy = jest.spyOn(SubstrateUtil, 'prefetchMetadata'); - (fetchService as any).parentSpecVersion = 9140; - await fetchService.prefetchMeta(9738720); // in 9180 - // Should be called 91151,9170,9180 - expect(getPrefechMetaSpy).toBeCalledTimes(3); - }, 500000); -}); diff --git a/packages/node/src/indexer/fetch.service.ts b/packages/node/src/indexer/fetch.service.ts index 8620c64c..f46d86cf 100644 --- a/packages/node/src/indexer/fetch.service.ts +++ b/packages/node/src/indexer/fetch.service.ts @@ -4,86 +4,95 @@ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; import { Interval, SchedulerRegistry } from '@nestjs/schedule'; -import { ApiPromise } from '@polkadot/api'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; - import { - isRuntimeDataSourceV0_2_0, - RuntimeDataSourceV0_0_1, isCustomDs, - isRuntimeDs, - isRuntimeDataSourceV0_3_0, - SubstrateCallFilter, - SubstrateEventFilter, - SubstrateHandlerKind, - SubstrateHandler, - SubstrateDataSource, - SubstrateRuntimeHandlerFilter, - SubstrateBlockFilter, -} from '@subql/common-substrate'; + EthereumHandlerKind, + SubqlHandlerFilter, +} from '@subql/common-ethereum'; import { + ApiService, delay, checkMemoryUsage, NodeConfig, IndexerEvent, getYargsOption, getLogger, - profiler, } from '@subql/node-core'; import { DictionaryQueryEntry, - SubstrateBlock, - SubstrateCustomHandler, -} from '@subql/types'; -import { MetaData } from '@subql/utils'; + ApiWrapper, + EthereumLogFilter, + EthereumTransactionFilter, +} from '@subql/types-ethereum'; import { range, sortBy, uniqBy } from 'lodash'; import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject'; -import { isBaseHandler, isCustomHandler } from '../utils/project'; -import * as SubstrateUtil from '../utils/substrate'; -import { calcInterval } from '../utils/substrate'; -import { ApiService } from './api.service'; -import { DictionaryService, SpecVersion } from './dictionary.service'; +import { calcInterval } from '../ethereum/utils.ethereum'; +import { eventToTopic, functionToSighash } from '../utils/string'; +import { Dictionary, DictionaryService } from './dictionary.service'; import { DsProcessorService } from './ds-processor.service'; import { DynamicDsService } from './dynamic-ds.service'; import { IBlockDispatcher } from './worker/block-dispatcher.service'; const logger = getLogger('fetch'); -let BLOCK_TIME_VARIANCE = 5000; //ms +let BLOCK_TIME_VARIANCE = 5000; const DICTIONARY_MAX_QUERY_SIZE = 10000; const CHECK_MEMORY_INTERVAL = 60000; const MINIMUM_BATCH_SIZE = 5; -const SPEC_VERSION_BLOCK_GAP = 100; const INTERVAL_PERCENT = 0.9; const { argv } = getYargsOption(); function eventFilterToQueryEntry( - filter: SubstrateEventFilter, + filter: EthereumLogFilter, ): DictionaryQueryEntry { + const conditions = []; + if (filter.address) { + conditions.push({ + field: 'address', + value: filter.address.toLowerCase(), + }); + } + if (filter.topics) { + for (let i = 0; i < Math.min(filter.topics.length, 4); i++) { + const topic = filter.topics[i]; + if (!topic) { + continue; + } + const field = `topics${i}`; + conditions.push({ field, value: eventToTopic(topic) }); + } + } return { - entity: 'events', - conditions: [ - { field: 'module', value: filter.module }, - { - field: 'event', - value: filter.method, - }, - ], + entity: 'evmLogs', + conditions, }; } function callFilterToQueryEntry( - filter: SubstrateCallFilter, + filter: EthereumTransactionFilter, ): DictionaryQueryEntry { + const conditions = []; + if (filter.from) { + conditions.push({ + field: 'from', + value: filter.from.toLowerCase(), + }); + } + if (filter.to) { + conditions.push({ + field: 'to', + value: filter.to.toLowerCase(), + }); + } + if (filter.function) { + conditions.push({ + field: 'func', + value: functionToSighash(filter.function), + }); + } return { - entity: 'extrinsics', - conditions: [ - { field: 'module', value: filter.module }, - { - field: 'call', - value: filter.method, - }, - ], + entity: 'evmTransactions', + conditions, }; } @@ -92,12 +101,9 @@ export class FetchService implements OnApplicationShutdown { private latestBestHeight: number; private latestFinalizedHeight: number; private isShutdown = false; - private parentSpecVersion: number; private useDictionary: boolean; private dictionaryQueryEntries?: DictionaryQueryEntry[]; private batchSizeScale: number; - private specVersionMap: SpecVersion[]; - private currentRuntimeVersion: RuntimeVersion; private templateDynamicDatasouces: SubqlProjectDs[]; constructor( @@ -106,7 +112,6 @@ export class FetchService implements OnApplicationShutdown { private project: SubqueryProject, @Inject('IBlockDispatcher') private blockDispatcher: IBlockDispatcher, private dictionaryService: DictionaryService, - private dsProcessorService: DsProcessorService, private dynamicDsService: DynamicDsService, private eventEmitter: EventEmitter2, private schedulerRegistry: SchedulerRegistry, @@ -115,17 +120,11 @@ export class FetchService implements OnApplicationShutdown { } onApplicationShutdown(): void { - try { - this.schedulerRegistry.deleteInterval('getFinalizedBlockHead'); - this.schedulerRegistry.deleteInterval('getBestBlockHead'); - } catch (e) { - //ignore if interval not exist - } this.isShutdown = true; } - get api(): ApiPromise { - return this.apiService.getApi(); + get api(): ApiWrapper { + return this.apiService.api; } async syncDynamicDatascourcesFromMeta(): Promise { @@ -133,58 +132,27 @@ export class FetchService implements OnApplicationShutdown { await this.dynamicDsService.getDynamicDatasources(); } + // TODO: if custom ds doesn't support dictionary, use baseFilter, if yes, let getDictionaryQueryEntries(): DictionaryQueryEntry[] { const queryEntries: DictionaryQueryEntry[] = []; - const dataSources = this.project.dataSources.filter( - (ds) => - isRuntimeDataSourceV0_3_0(ds) || - isRuntimeDataSourceV0_2_0(ds) || - !(ds as RuntimeDataSourceV0_0_1).filter?.specName || - (ds as RuntimeDataSourceV0_0_1).filter.specName === - this.api.runtimeVersion.specName.toString(), - ); - + const dataSources = this.project.dataSources; for (const ds of dataSources.concat(this.templateDynamicDatasouces)) { - const plugin = isCustomDs(ds) - ? this.dsProcessorService.getDsProcessor(ds) - : undefined; for (const handler of ds.mapping.handlers) { - const baseHandlerKind = this.getBaseHandlerKind(ds, handler); - let filterList: SubstrateRuntimeHandlerFilter[]; - if (isCustomDs(ds)) { - const processor = plugin.handlerProcessors[handler.kind]; - if (processor.dictionaryQuery) { - const queryEntry = processor.dictionaryQuery( - (handler as SubstrateCustomHandler).filter, - ds, - ); - if (queryEntry) { - queryEntries.push(queryEntry); - continue; - } - } - filterList = - this.getBaseHandlerFilters( - ds, - handler.kind, - ); - } else { - filterList = [handler.filter]; - } + let filterList: SubqlHandlerFilter[]; + filterList = [handler.filter]; filterList = filterList.filter((f) => f); if (!filterList.length) return []; - switch (baseHandlerKind) { - case SubstrateHandlerKind.Block: - for (const filter of filterList as SubstrateBlockFilter[]) { - if (filter.modulo === undefined) { - return []; - } - } - break; - case SubstrateHandlerKind.Call: { - for (const filter of filterList as SubstrateCallFilter[]) { - if (filter.module !== undefined && filter.method !== undefined) { + switch (handler.kind) { + case EthereumHandlerKind.Block: + return []; + case EthereumHandlerKind.Call: { + for (const filter of filterList as EthereumTransactionFilter[]) { + if ( + filter.from !== undefined || + filter.to !== undefined || + filter.function + ) { queryEntries.push(callFilterToQueryEntry(filter)); } else { return []; @@ -192,9 +160,9 @@ export class FetchService implements OnApplicationShutdown { } break; } - case SubstrateHandlerKind.Event: { - for (const filter of filterList as SubstrateEventFilter[]) { - if (filter.module !== undefined && filter.method !== undefined) { + case EthereumHandlerKind.Event: { + for (const filter of filterList as EthereumLogFilter[]) { + if (filter.address || filter.topics) { queryEntries.push(eventFilterToQueryEntry(filter)); } else { return []; @@ -225,25 +193,15 @@ export class FetchService implements OnApplicationShutdown { async init(startHeight: number): Promise { if (this.api) { - const CHAIN_INTERVAL = calcInterval(this.api) - .muln(INTERVAL_PERCENT) - .toNumber(); + const CHAIN_INTERVAL = calcInterval(this.api) * INTERVAL_PERCENT; BLOCK_TIME_VARIANCE = Math.min(BLOCK_TIME_VARIANCE, CHAIN_INTERVAL); this.schedulerRegistry.addInterval( - 'getFinalizedBlockHead', - setInterval( - () => void this.getFinalizedBlockHead(), - BLOCK_TIME_VARIANCE, - ), - ); - this.schedulerRegistry.addInterval( - 'getBestBlockHead', + 'getLatestBlockHead', setInterval(() => void this.getBestBlockHead(), BLOCK_TIME_VARIANCE), ); } - await this.syncDynamicDatascourcesFromMeta(); this.updateDictionary(); this.eventEmitter.emit(IndexerEvent.UsingDictionary, { @@ -252,24 +210,7 @@ export class FetchService implements OnApplicationShutdown { await this.getFinalizedBlockHead(); await this.getBestBlockHead(); - const validChecker = this.dictionaryValidation( - await this.dictionaryService.getSpecVersionsRaw(), - ); - - if (this.useDictionary && validChecker) { - const specVersionResponse = - await this.dictionaryService.getSpecVersions(); - if (specVersionResponse !== undefined) { - this.specVersionMap = specVersionResponse; - } - } else { - this.specVersionMap = []; - } - - await this.blockDispatcher.init( - this.getRuntimeVersion.bind(this), - this.resetForNewDs.bind(this), - ); + await this.blockDispatcher.init(this.resetForNewDs.bind(this)); void this.startLoop(startHeight); } @@ -285,16 +226,14 @@ export class FetchService implements OnApplicationShutdown { } } + @Interval(BLOCK_TIME_VARIANCE * 1000) async getFinalizedBlockHead(): Promise { if (!this.api) { logger.debug(`Skip fetch finalized block until API is ready`); return; } try { - const finalizedHead = await this.api.rpc.chain.getFinalizedHead(); - const finalizedBlock = await this.api.rpc.chain.getBlock(finalizedHead); - const currentFinalizedHeight = - finalizedBlock.block.header.number.toNumber(); + const currentFinalizedHeight = await this.api.getFinalizedBlockHeight(); if (this.latestFinalizedHeight !== currentFinalizedHeight) { this.latestFinalizedHeight = currentFinalizedHeight; this.eventEmitter.emit(IndexerEvent.BlockTarget, { @@ -302,18 +241,18 @@ export class FetchService implements OnApplicationShutdown { }); } } catch (e) { - logger.error(e, `Having a problem when getting finalized block`); + logger.error(e, `Having a problem when get finalized block`); } } + @Interval(BLOCK_TIME_VARIANCE * 1000) async getBestBlockHead(): Promise { if (!this.api) { logger.debug(`Skip fetch best block until API is ready`); return; } try { - const bestHeader = await this.api.rpc.chain.getHeader(); - const currentBestHeight = bestHeader.number.toNumber(); + const currentBestHeight = await this.api.getLastHeight(); if (this.latestBestHeight !== currentBestHeight) { this.latestBestHeight = currentBestHeight; this.eventEmitter.emit(IndexerEvent.BlockBest, { @@ -325,7 +264,7 @@ export class FetchService implements OnApplicationShutdown { } } - private async startLoop(initBlockHeight: number): Promise { + async startLoop(initBlockHeight: number): Promise { await this.fillNextBlockBuffer(initBlockHeight); } @@ -337,7 +276,7 @@ export class FetchService implements OnApplicationShutdown { } for (const handler of ds.mapping.handlers) { if ( - handler.kind === SubstrateHandlerKind.Block && + handler.kind === EthereumHandlerKind.Block && handler.filter && handler.filter.modulo ) { @@ -360,8 +299,6 @@ export class FetchService implements OnApplicationShutdown { } async fillNextBlockBuffer(initBlockHeight: number): Promise { - await this.prefetchMeta(initBlockHeight); - let startBlockHeight: number; let scaledBatchSize: number; @@ -448,103 +385,6 @@ export class FetchService implements OnApplicationShutdown { } } - async getSpecFromApi(height: number): Promise { - const parentBlockHash = await this.api.rpc.chain.getBlockHash( - Math.max(height - 1, 0), - ); - const runtimeVersion = await this.api.rpc.state.getRuntimeVersion( - parentBlockHash, - ); - const specVersion = runtimeVersion.specVersion.toNumber(); - return specVersion; - } - - getSpecFromMap( - blockHeight: number, - specVersions: SpecVersion[], - ): number | undefined { - //return undefined if can not find inside range - const spec = specVersions.find( - (spec) => blockHeight >= spec.start && blockHeight <= spec.end, - ); - return spec ? Number(spec.id) : undefined; - } - - async getSpecVersion(blockHeight: number): Promise { - let currentSpecVersion: number; - // we want to keep the specVersionMap in memory, and use it even useDictionary been disabled - // therefore instead of check .useDictionary, we check it length before use it. - if (this.specVersionMap && this.specVersionMap.length !== 0) { - currentSpecVersion = this.getSpecFromMap( - blockHeight, - this.specVersionMap, - ); - } - if (currentSpecVersion === undefined) { - currentSpecVersion = await this.getSpecFromApi(blockHeight); - // Assume dictionary is synced - if (blockHeight + SPEC_VERSION_BLOCK_GAP < this.latestFinalizedHeight) { - const response = this.useDictionary - ? await this.dictionaryService.getSpecVersions() - : undefined; - if (response !== undefined) { - this.specVersionMap = response; - } - } - } - return currentSpecVersion; - } - - async getRuntimeVersion(block: SubstrateBlock): Promise { - if ( - !this.currentRuntimeVersion || - this.currentRuntimeVersion.specVersion.toNumber() !== block.specVersion - ) { - this.currentRuntimeVersion = await this.api.rpc.state.getRuntimeVersion( - block.block.header.parentHash, - ); - } - return this.currentRuntimeVersion; - } - - @profiler(argv.profiler) - async specChanged(height: number): Promise { - const specVersion = await this.getSpecVersion(height); - if (this.parentSpecVersion !== specVersion) { - await this.prefetchMeta(height); - this.parentSpecVersion = specVersion; - return true; - } - return false; - } - - @profiler(argv.profiler) - async prefetchMeta(height: number): Promise { - const blockHash = await this.api.rpc.chain.getBlockHash(height); - if ( - this.parentSpecVersion && - this.specVersionMap && - this.specVersionMap.length !== 0 - ) { - const parentSpecVersion = this.specVersionMap.find( - (spec) => Number(spec.id) === this.parentSpecVersion, - ); - for (const specVersion of this.specVersionMap) { - if ( - specVersion.start > parentSpecVersion.end && - specVersion.start <= height - ) { - const blockHash = await this.api.rpc.chain.getBlockHash( - specVersion.start, - ); - await SubstrateUtil.prefetchMetadata(this.api, blockHash); - } - } - } else { - await SubstrateUtil.prefetchMetadata(this.api, blockHash); - } - } - private nextEndBlockHeight( startBlockHeight: number, scaledBatchSize: number, @@ -557,74 +397,32 @@ export class FetchService implements OnApplicationShutdown { return endBlockHeight; } - async resetForNewDs(blockHeight: number): Promise { - await this.syncDynamicDatascourcesFromMeta(); - this.updateDictionary(); - this.blockDispatcher.flushQueue(blockHeight); - } - private dictionaryValidation( - dictionary: { _metadata: MetaData }, - startBlockHeight?: number, + { _metadata: metaData }: Dictionary, + startBlockHeight: number, ): boolean { - if (dictionary !== undefined) { - const { _metadata: metaData } = dictionary; - - if (metaData.genesisHash !== this.api.genesisHash.toString()) { - logger.warn(`Dictionary is disabled since now`); - this.useDictionary = false; - this.eventEmitter.emit(IndexerEvent.UsingDictionary, { - value: Number(this.useDictionary), - }); - this.eventEmitter.emit(IndexerEvent.SkipDictionary); - return false; - } - - if (startBlockHeight !== undefined) { - if (metaData.lastProcessedHeight < startBlockHeight) { - logger.warn( - `Dictionary indexed block is behind current indexing block height`, - ); - this.eventEmitter.emit(IndexerEvent.SkipDictionary); - return false; - } - } - return true; + if (metaData.genesisHash !== this.api.getGenesisHash()) { + logger.warn(`Dictionary is disabled since now`); + this.useDictionary = false; + this.eventEmitter.emit(IndexerEvent.UsingDictionary, { + value: Number(this.useDictionary), + }); + this.eventEmitter.emit(IndexerEvent.SkipDictionary); + return false; } - return false; - } - - private getBaseHandlerKind( - ds: SubstrateDataSource, - handler: SubstrateHandler, - ): SubstrateHandlerKind { - if (isRuntimeDs(ds) && isBaseHandler(handler)) { - return handler.kind; - } else if (isCustomDs(ds) && isCustomHandler(handler)) { - const plugin = this.dsProcessorService.getDsProcessor(ds); - const baseHandler = - plugin.handlerProcessors[handler.kind]?.baseHandlerKind; - if (!baseHandler) { - throw new Error( - `handler type ${handler.kind} not found in processor for ${ds.kind}`, - ); - } - return baseHandler; + if (metaData.lastProcessedHeight < startBlockHeight) { + logger.warn( + `Dictionary indexed block is behind current indexing block height`, + ); + this.eventEmitter.emit(IndexerEvent.SkipDictionary); + return false; } + return true; } - private getBaseHandlerFilters( - ds: SubstrateDataSource, - handlerKind: string, - ): T[] { - if (isCustomDs(ds)) { - const plugin = this.dsProcessorService.getDsProcessor(ds); - const processor = plugin.handlerProcessors[handlerKind]; - return processor.baseFilter instanceof Array - ? (processor.baseFilter as T[]) - : ([processor.baseFilter] as T[]); - } else { - throw new Error(`expect custom datasource here`); - } + async resetForNewDs(blockHeight: number): Promise { + await this.syncDynamicDatascourcesFromMeta(); + this.updateDictionary(); + this.blockDispatcher.flushQueue(blockHeight); } } diff --git a/packages/node/src/indexer/indexer.manager.spec.ts b/packages/node/src/indexer/indexer.manager.spec.ts deleted file mode 100644 index f997d3ef..00000000 --- a/packages/node/src/indexer/indexer.manager.spec.ts +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { EventEmitter2 } from '@nestjs/event-emitter'; -import { - SubstrateDatasourceKind, - SubstrateHandlerKind, -} from '@subql/common-substrate'; -import { - StoreService, - PoiService, - MmrService, - SubqueryFactory, - NodeConfig, -} from '@subql/node-core'; -import { GraphQLSchema } from 'graphql'; -import { Sequelize } from 'sequelize'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { ApiService } from './api.service'; -import { DsProcessorService } from './ds-processor.service'; -import { DynamicDsService } from './dynamic-ds.service'; -import { IndexerManager } from './indexer.manager'; -import { ProjectService } from './project.service'; -import { SandboxService } from './sandbox.service'; - -jest.mock('sequelize', () => { - const mSequelize = { - authenticate: jest.fn(), - define: () => ({ - findOne: jest.fn(), - create: (input: any) => input, - }), - query: () => [{ nextval: 1 }], - showAllSchemas: () => ['subquery_1'], - model: () => ({ upsert: jest.fn() }), - sync: jest.fn(), - transaction: () => ({ - commit: jest.fn(), - rollback: jest.fn(), - afterCommit: jest.fn(), - }), - // createSchema: jest.fn(), - }; - const actualSequelize = jest.requireActual('sequelize'); - return { - Sequelize: jest.fn(() => mSequelize), - DataTypes: actualSequelize.DataTypes, - QueryTypes: actualSequelize.QueryTypes, - }; -}); - -jest.setTimeout(200000); - -const nodeConfig = new NodeConfig({ - subquery: 'asdf', - subqueryName: 'asdf', - networkEndpoint: 'wss://polkadot.api.onfinality.io/public-ws', -}); - -function testSubqueryProject_1(): SubqueryProject { - return { - network: { - endpoint: 'wss://polkadot.api.onfinality.io/public-ws', - }, - dataSources: [ - { - name: 'runtime0', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - file: '', - entryScript: '', - handlers: [ - { handler: 'testSandbox', kind: SubstrateHandlerKind.Event }, - ], - }, - }, - { - name: 'runtime1', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - entryScript: '', - file: '', - handlers: [ - { handler: 'testSandbox', kind: SubstrateHandlerKind.Event }, - ], - }, - }, - ], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -function testSubqueryProject_2(): SubqueryProject { - return { - network: { - endpoint: 'wss://polkadot.api.onfinality.io/public-ws', - dictionary: `https://api.subquery.network/sq/subquery/dictionary-polkadot`, - genesisHash: - '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', - }, - dataSources: [ - { - name: 'runtime0', - kind: SubstrateDatasourceKind.Runtime, - startBlock: 1, - mapping: { - file: '', - entryScript: `console.log('test handler runtime0')`, - handlers: [ - { handler: 'testSandbox', kind: SubstrateHandlerKind.Event }, - ], - }, - }, - ], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -function createIndexerManager(project: SubqueryProject): IndexerManager { - const sequilize = new Sequelize(); - const eventEmitter = new EventEmitter2(); - - const apiService = new ApiService(project, eventEmitter); - const dsProcessorService = new DsProcessorService(project); - const dynamicDsService = new DynamicDsService(dsProcessorService, project); - - const poiService = new PoiService(nodeConfig, sequilize); - const storeService = new StoreService(sequilize, nodeConfig); - const subqueryRepo = SubqueryFactory(sequilize); - const mmrService = new MmrService(nodeConfig, sequilize); - const sandboxService = new SandboxService( - apiService, - storeService, - nodeConfig, - project, - ); - const projectService = new ProjectService( - dsProcessorService, - apiService, - poiService, - mmrService, - sequilize, - project, - storeService, - nodeConfig, - dynamicDsService, - subqueryRepo, - eventEmitter, - ); - - return new IndexerManager( - storeService, - apiService, - poiService, - sequilize, - project, - nodeConfig, - sandboxService, - dsProcessorService, - dynamicDsService, - subqueryRepo, - projectService, - ); -} - -/* - * These tests aren't run because of setup requirements with such a large number of dependencies - */ -describe('IndexerManager', () => { - let indexerManager: IndexerManager; - - afterEach(() => { - (indexerManager as any)?.fetchService.onApplicationShutdown(); - }); - - xit('should be able to start the manager (v0.0.1)', async () => { - indexerManager = createIndexerManager(testSubqueryProject_1()); - await expect(indexerManager.start()).resolves.toBe(undefined); - - expect(Object.keys((indexerManager as any).vms).length).toBe(1); - }); - - xit('should be able to start the manager (v0.2.0)', async () => { - indexerManager = createIndexerManager(testSubqueryProject_2()); - await expect(indexerManager.start()).resolves.toBe(undefined); - - expect(Object.keys((indexerManager as any).vms).length).toBe(1); - }); -}); diff --git a/packages/node/src/indexer/indexer.manager.ts b/packages/node/src/indexer/indexer.manager.ts index 565c36dc..01e15509 100644 --- a/packages/node/src/indexer/indexer.manager.ts +++ b/packages/node/src/indexer/indexer.manager.ts @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { Inject, Injectable } from '@nestjs/common'; -import { ApiPromise } from '@polkadot/api'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; import { hexToU8a, u8aEq } from '@polkadot/util'; import { isBlockHandlerProcessor, @@ -11,13 +9,13 @@ import { isEventHandlerProcessor, isCustomDs, isRuntimeDs, - SubstrateCustomDataSource, - SubstrateCustomHandler, - SubstrateHandlerKind, - SubstrateNetworkFilter, - SubstrateRuntimeHandlerInputMap, -} from '@subql/common-substrate'; + SubqlEthereumCustomDataSource, + SubqlCustomHandler, + EthereumHandlerKind, + EthereumRuntimeHandlerInputMap, +} from '@subql/common-ethereum'; import { + ApiService, PoiBlock, StoreService, PoiService, @@ -29,14 +27,16 @@ import { profilerWrap, } from '@subql/node-core'; import { - SubstrateBlock, - SubstrateEvent, - SubstrateExtrinsic, -} from '@subql/types'; + ApiWrapper, + EthereumTransaction, + EthereumLog, + SubqlRuntimeHandler, + EthereumBlockWrapper, + EthereumBlock, +} from '@subql/types-ethereum'; import { Sequelize } from 'sequelize'; import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject'; -import * as SubstrateUtil from '../utils/substrate'; -import { ApiService } from './api.service'; +import { EthereumBlockWrapped } from '../ethereum/block.ethereum'; import { asSecondLayerHandlerProcessor_1_0_0, DsProcessorService, @@ -44,7 +44,6 @@ import { import { DynamicDsService } from './dynamic-ds.service'; import { ProjectService } from './project.service'; import { IndexerSandbox, SandboxService } from './sandbox.service'; -import { ApiAt, BlockContent } from './types'; const NULL_MERKEL_ROOT = hexToU8a('0x00'); @@ -53,7 +52,7 @@ const { argv } = getYargsOption(); @Injectable() export class IndexerManager { - private api: ApiPromise; + private api: ApiWrapper; private filteredDataSources: SubqlProjectDs[]; constructor( @@ -64,50 +63,46 @@ export class IndexerManager { private project: SubqueryProject, private nodeConfig: NodeConfig, private sandboxService: SandboxService, - private dsProcessorService: DsProcessorService, private dynamicDsService: DynamicDsService, + private dsProcessorService: DsProcessorService, @Inject('Subquery') protected subqueryRepo: SubqueryRepo, private projectService: ProjectService, ) { logger.info('indexer manager start'); - this.api = this.apiService.getApi(); + + this.api = this.apiService.api; } @profiler(argv.profiler) async indexBlock( - blockContent: BlockContent, - runtimeVersion: RuntimeVersion, + blockContent: EthereumBlockWrapper, ): Promise<{ dynamicDsCreated: boolean; operationHash: Uint8Array }> { - const { block } = blockContent; + const { blockHeight } = blockContent; let dynamicDsCreated = false; - const blockHeight = block.block.header.number.toNumber(); const tx = await this.sequelize.transaction(); this.storeService.setTransaction(tx); this.storeService.setBlockHeight(blockHeight); let operationHash = NULL_MERKEL_ROOT; let poiBlockHash: Uint8Array; + try { - this.filteredDataSources = this.filterDataSources( - block.block.header.number.toNumber(), - ); + this.filteredDataSources = this.filterDataSources(blockHeight); const datasources = this.filteredDataSources.concat( ...(await this.dynamicDsService.getDynamicDatasources()), ); - let apiAt: ApiAt; - await this.indexBlockData( blockContent, datasources, + // eslint-disable-next-line @typescript-eslint/require-await async (ds: SubqlProjectDs) => { - // Injected runtimeVersion from fetch service might be outdated - apiAt = - apiAt ?? - (await this.apiService.getPatchedApi(block, runtimeVersion)); - - const vm = this.sandboxService.getDsProcessor(ds, apiAt); + const vm = this.sandboxService.getDsProcessorWrapper( + ds, + this.api, + blockContent, + ); // Inject function to create ds into vm vm.freeze( @@ -148,7 +143,7 @@ export class IndexerManager { if (!u8aEq(operationHash, NULL_MERKEL_ROOT)) { const poiBlock = PoiBlock.create( blockHeight, - block.block.header.hash.toHex(), + blockContent.block.hash, operationHash, await this.poiService.getLatestPoiBlockHash(), this.project.id, @@ -179,27 +174,23 @@ export class IndexerManager { await this.projectService.init(); } - private filterDataSources(nextProcessingHeight: number): SubqlProjectDs[] { - let filteredDs: SubqlProjectDs[]; - filteredDs = this.project.dataSources.filter( - (ds) => ds.startBlock <= nextProcessingHeight, - ); - + private filterDataSources(processedHeight: number): SubqlProjectDs[] { + let filteredDs = this.project.dataSources; + if (filteredDs.length === 0) { + logger.error( + `Did not find any dataSource match with network specName ${this.api.getSpecName()}`, + ); + process.exit(1); + } + filteredDs = filteredDs.filter((ds) => ds.startBlock <= processedHeight); if (filteredDs.length === 0) { - logger.error(`Did not find any matching datasouces`); + logger.error( + `Your start block is greater than the current indexed block height in your database. Either change your startBlock (project.yaml) to <= ${processedHeight} + or delete your database and start again from the currently specified startBlock`, + ); process.exit(1); } // perform filter for custom ds - filteredDs = filteredDs.filter((ds) => { - if (isCustomDs(ds)) { - return this.dsProcessorService - .getDsProcessor(ds) - .dsFilterProcessor(ds, this.api); - } else { - return true; - } - }); - if (!filteredDs.length) { logger.error(`Did not find any datasources with associated processor`); process.exit(1); @@ -208,78 +199,62 @@ export class IndexerManager { } private async indexBlockData( - { block, events, extrinsics }: BlockContent, + { block, logs, transactions }: EthereumBlockWrapper, dataSources: SubqlProjectDs[], getVM: (d: SubqlProjectDs) => Promise, ): Promise { await this.indexBlockContent(block, dataSources, getVM); - // Run initialization events - const initEvents = events.filter((evt) => evt.phase.isInitialization); - for (const event of initEvents) { - await this.indexEvent(event, dataSources, getVM); - } - - for (const extrinsic of extrinsics) { - await this.indexExtrinsic(extrinsic, dataSources, getVM); - - // Process extrinsic events - const extrinsicEvents = events - .filter((e) => e.extrinsic?.idx === extrinsic.idx) - .sort((a, b) => a.idx - b.idx); - - for (const event of extrinsicEvents) { - await this.indexEvent(event, dataSources, getVM); - } + for (const log of logs) { + await this.indexEvent(log, dataSources, getVM); } - // Run finalization events - const finalizeEvents = events.filter((evt) => evt.phase.isFinalization); - for (const event of finalizeEvents) { - await this.indexEvent(event, dataSources, getVM); + for (const tx of transactions) { + await this.indexExtrinsic(tx, dataSources, getVM); } } private async indexBlockContent( - block: SubstrateBlock, + block: EthereumBlock, dataSources: SubqlProjectDs[], getVM: (d: SubqlProjectDs) => Promise, ): Promise { for (const ds of dataSources) { - await this.indexData(SubstrateHandlerKind.Block, block, ds, getVM); + await this.indexData(EthereumHandlerKind.Block, block, ds, getVM); } } private async indexExtrinsic( - extrinsic: SubstrateExtrinsic, + tx: EthereumTransaction, dataSources: SubqlProjectDs[], getVM: (d: SubqlProjectDs) => Promise, ): Promise { for (const ds of dataSources) { - await this.indexData(SubstrateHandlerKind.Call, extrinsic, ds, getVM); + await this.indexData(EthereumHandlerKind.Call, tx, ds, getVM); } } private async indexEvent( - event: SubstrateEvent, + log: EthereumLog, dataSources: SubqlProjectDs[], getVM: (d: SubqlProjectDs) => Promise, ): Promise { for (const ds of dataSources) { - await this.indexData(SubstrateHandlerKind.Event, event, ds, getVM); + await this.indexData(EthereumHandlerKind.Event, log, ds, getVM); } } - private async indexData( + private async indexData( kind: K, - data: SubstrateRuntimeHandlerInputMap[K], + data: EthereumRuntimeHandlerInputMap[K], ds: SubqlProjectDs, getVM: (ds: SubqlProjectDs) => Promise, ): Promise { let vm: IndexerSandbox; if (isRuntimeDs(ds)) { - const handlers = ds.mapping.handlers.filter( - (h) => h.kind === kind && FilterTypeMap[kind](data as any, h.filter), + const handlers = (ds.mapping.handlers as SubqlRuntimeHandler[]).filter( + (h) => + h.kind === kind && FilterTypeMap[kind](data as any, h.filter as any), ); for (const handler of handlers) { @@ -299,21 +274,21 @@ export class IndexerManager { ProcessorTypeMap[kind], (data, baseFilter) => { switch (kind) { - case SubstrateHandlerKind.Block: - return !!SubstrateUtil.filterBlock( - data as SubstrateBlock, + case EthereumHandlerKind.Block: + return EthereumBlockWrapped.filterBlocksProcessor( + data as EthereumBlock, baseFilter, ); - case SubstrateHandlerKind.Call: - return !!SubstrateUtil.filterExtrinsics( - [data as SubstrateExtrinsic], + case EthereumHandlerKind.Call: + return EthereumBlockWrapped.filterTransactionsProcessor( + data as EthereumTransaction, baseFilter, - ).length; - case SubstrateHandlerKind.Event: - return !!SubstrateUtil.filterEvents( - [data as SubstrateEvent], + ); + case EthereumHandlerKind.Event: + return EthereumBlockWrapped.filterLogsProcessor( + data as EthereumLog, baseFilter, - ).length; + ); default: throw new Error('Unsupported handler kind'); } @@ -327,21 +302,22 @@ export class IndexerManager { } } - private filterCustomDsHandlers( - ds: SubstrateCustomDataSource, - data: SubstrateRuntimeHandlerInputMap[K], + private filterCustomDsHandlers( + ds: SubqlEthereumCustomDataSource, + data: EthereumRuntimeHandlerInputMap[K], baseHandlerCheck: ProcessorTypeMap[K], baseFilter: ( - data: SubstrateRuntimeHandlerInputMap[K], + data: EthereumRuntimeHandlerInputMap[K], baseFilter: any, ) => boolean, - ): SubstrateCustomHandler[] { + ): SubqlCustomHandler[] { const plugin = this.dsProcessorService.getDsProcessor(ds); return ds.mapping.handlers .filter((handler) => { const processor = plugin.handlerProcessors[handler.kind]; if (baseHandlerCheck(processor)) { processor.baseFilter; + return baseFilter(data, processor.baseFilter); } return false; @@ -363,11 +339,11 @@ export class IndexerManager { }); } - private async transformAndExecuteCustomDs( - ds: SubstrateCustomDataSource, + private async transformAndExecuteCustomDs( + ds: SubqlEthereumCustomDataSource, vm: IndexerSandbox, - handler: SubstrateCustomHandler, - data: SubstrateRuntimeHandlerInputMap[K], + handler: SubqlCustomHandler, + data: EthereumRuntimeHandlerInputMap[K], ): Promise { const plugin = this.dsProcessorService.getDsProcessor(ds); const assets = await this.dsProcessorService.getAssets(ds); @@ -379,8 +355,8 @@ export class IndexerManager { .transformer({ input: data, ds, - filter: handler.filter, api: this.api, + filter: handler.filter, assets, }) .catch((e) => { @@ -397,19 +373,19 @@ export class IndexerManager { } type ProcessorTypeMap = { - [SubstrateHandlerKind.Block]: typeof isBlockHandlerProcessor; - [SubstrateHandlerKind.Event]: typeof isEventHandlerProcessor; - [SubstrateHandlerKind.Call]: typeof isCallHandlerProcessor; + [EthereumHandlerKind.Block]: typeof isBlockHandlerProcessor; + [EthereumHandlerKind.Event]: typeof isEventHandlerProcessor; + [EthereumHandlerKind.Call]: typeof isCallHandlerProcessor; }; const ProcessorTypeMap = { - [SubstrateHandlerKind.Block]: isBlockHandlerProcessor, - [SubstrateHandlerKind.Event]: isEventHandlerProcessor, - [SubstrateHandlerKind.Call]: isCallHandlerProcessor, + [EthereumHandlerKind.Block]: isBlockHandlerProcessor, + [EthereumHandlerKind.Event]: isEventHandlerProcessor, + [EthereumHandlerKind.Call]: isCallHandlerProcessor, }; const FilterTypeMap = { - [SubstrateHandlerKind.Block]: SubstrateUtil.filterBlock, - [SubstrateHandlerKind.Event]: SubstrateUtil.filterEvent, - [SubstrateHandlerKind.Call]: SubstrateUtil.filterExtrinsic, + [EthereumHandlerKind.Block]: EthereumBlockWrapped.filterBlocksProcessor, + [EthereumHandlerKind.Event]: EthereumBlockWrapped.filterLogsProcessor, + [EthereumHandlerKind.Call]: EthereumBlockWrapped.filterTransactionsProcessor, }; diff --git a/packages/node/src/indexer/indexer.module.ts b/packages/node/src/indexer/indexer.module.ts index 9c5157e6..8b93f016 100644 --- a/packages/node/src/indexer/indexer.module.ts +++ b/packages/node/src/indexer/indexer.module.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 import { Module } from '@nestjs/common'; -import { EventEmitter2 } from '@nestjs/event-emitter'; import { + ApiService, DbModule, StoreService, PoiService, MmrService, } from '@subql/node-core'; import { SubqueryProject } from '../configure/SubqueryProject'; -import { ApiService } from './api.service'; +import { EthereumApiService } from '../ethereum'; import { DictionaryService } from './dictionary.service'; import { DsProcessorService } from './ds-processor.service'; import { DynamicDsService } from './dynamic-ds.service'; @@ -26,15 +26,12 @@ import { WorkerService } from './worker/worker.service'; StoreService, { provide: ApiService, - useFactory: async ( - project: SubqueryProject, - eventEmitter: EventEmitter2, - ) => { - const apiService = new ApiService(project, eventEmitter); + useFactory: async (project: SubqueryProject) => { + const apiService = new EthereumApiService(project); await apiService.init(); return apiService; }, - inject: [SubqueryProject, EventEmitter2], + inject: [SubqueryProject], }, DictionaryService, SandboxService, @@ -45,6 +42,6 @@ import { WorkerService } from './worker/worker.service'; ProjectService, WorkerService, ], - exports: [StoreService, MmrService], + exports: [StoreService], }) export class IndexerModule {} diff --git a/packages/node/src/indexer/project.service.test.ts b/packages/node/src/indexer/project.service.test.ts deleted file mode 100644 index 157ea594..00000000 --- a/packages/node/src/indexer/project.service.test.ts +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { Test } from '@nestjs/testing'; -import { SubqueryRepo, DbModule, NodeConfig } from '@subql/node-core'; -import { GraphQLSchema } from 'graphql'; -import { Sequelize } from 'sequelize'; -import { SubqueryProject } from '../configure/SubqueryProject'; -import { ProjectService } from './project.service'; - -function testSubqueryProject(): SubqueryProject { - return { - network: { - endpoint: 'wss://polkadot.api.onfinality.io/public-ws', - dictionary: `https://api.subquery.network/sq/subquery/dictionary-polkadot`, - }, - dataSources: [], - id: 'test', - root: './', - schema: new GraphQLSchema({}), - templates: [], - }; -} - -const prepare = async (): Promise => { - const module = await Test.createTestingModule({ - providers: [ - { - provide: SubqueryProject, - useFactory: () => testSubqueryProject(), - }, - { - provide: ProjectService, - useFactory: ( - sequelize: Sequelize, - project: SubqueryProject, - subqueryRepo: SubqueryRepo, - ) => { - const projectService = new ProjectService( - undefined, - undefined, - undefined, - undefined, - sequelize, - project, - undefined, - undefined, - undefined, - subqueryRepo, - undefined, - ); - - return projectService; - }, - inject: [Sequelize, SubqueryProject, 'Subquery'], - }, - ], - imports: [ - DbModule.forRoot({ - host: process.env.DB_HOST ?? '127.0.0.1', - port: process.env.DB_PORT ? Number(process.env.DB_PORT) : 5432, - username: process.env.DB_USER ?? 'postgres', - password: process.env.DB_PASS ?? 'postgres', - database: process.env.DB_DATABASE ?? 'postgres', - }), - DbModule.forFeature(['Subquery']), - ], - }).compile(); - - const app = module.createNestApplication(); - await app.init(); - return app.get(ProjectService); -}; - -function prepareProject( - name: string, - dbSchema: string, - nextBlockHeight: number, -) { - return { - name, - dbSchema, - hash: '0x', - nextBlockHeight, - network: 'test', - networkGenesis: '0x1234', - }; -} - -const TEST_PROJECT = 'test-user/TEST_PROJECT'; - -describe('ProjectService Integration Tests', () => { - let projectService: ProjectService; - let subqueryRepo: SubqueryRepo; - - async function createSchema(name: string): Promise { - await subqueryRepo.sequelize.createSchema(`"${name}"`, undefined); - } - - async function checkSchemaExist(schema: string): Promise { - const schemas = await subqueryRepo.sequelize.showAllSchemas(undefined); - return (schemas as unknown as string[]).includes(schema); - } - - beforeAll(async () => { - projectService = await prepare(); - subqueryRepo = (projectService as any).subqueryRepo; - }); - - beforeEach(async () => { - delete (projectService as any).nodeConfig; - await subqueryRepo.destroy({ where: { name: TEST_PROJECT } }); - await subqueryRepo.sequelize.dropSchema(`"${TEST_PROJECT}"`, undefined); - }); - - it("read existing project's schema from subqueries table", async () => { - const schemaName = 'subql_99999'; - (projectService as any).nodeConfig = new NodeConfig({ - subquery: '/test/dir/test-query-project', - subqueryName: TEST_PROJECT, - }); - - await subqueryRepo.create(prepareProject(TEST_PROJECT, schemaName, 1)); - - await expect( - (projectService as any).getExistingProjectSchema(), - ).resolves.toBe(schemaName); - }); - - it("read existing project's schema from nodeConfig", async () => { - (projectService as any).nodeConfig = new NodeConfig({ - subquery: '/test/dir/test-query-project', - subqueryName: TEST_PROJECT, - }); - - await createSchema(TEST_PROJECT); - await subqueryRepo.create(prepareProject(TEST_PROJECT, 'subql_99999', 1)); - - await expect( - (projectService as any).getExistingProjectSchema(), - ).resolves.toBe(TEST_PROJECT); - }); - - it("read existing project's schema when --local", async () => { - (projectService as any).nodeConfig = new NodeConfig({ - subquery: '/test/dir/test-query-project', - subqueryName: TEST_PROJECT, - localMode: true, - }); - await createSchema(TEST_PROJECT); - await subqueryRepo.create(prepareProject(TEST_PROJECT, 'subql_99999', 1)); - - await expect( - (projectService as any).getExistingProjectSchema(), - ).resolves.toBe('public'); - }); - - it('create project schema', async () => { - (projectService as any).nodeConfig = new NodeConfig({ - subquery: '/test/dir/test-query-project', - subqueryName: TEST_PROJECT, - }); - await expect((projectService as any).createProjectSchema()).resolves.toBe( - TEST_PROJECT, - ); - await expect(checkSchemaExist(TEST_PROJECT)).resolves.toBe(true); - }); -}); diff --git a/packages/node/src/indexer/project.service.ts b/packages/node/src/indexer/project.service.ts index 40615d42..de2971de 100644 --- a/packages/node/src/indexer/project.service.ts +++ b/packages/node/src/indexer/project.service.ts @@ -7,6 +7,7 @@ import { isMainThread } from 'worker_threads'; import { Inject, Injectable } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; import { + ApiService, MetadataFactory, MetadataRepo, SubqueryRepo, @@ -20,8 +21,7 @@ import { } from '@subql/node-core'; import { getAllEntitiesRelations } from '@subql/utils'; import { QueryTypes, Sequelize } from 'sequelize'; -import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject'; -import { ApiService } from './api.service'; +import { SubqueryProject } from '../configure/SubqueryProject'; import { DsProcessorService } from './ds-processor.service'; import { DynamicDsService } from './dynamic-ds.service'; @@ -269,7 +269,8 @@ export class ProjectService { // Check if the configured genesisHash matches the currently stored genesisHash assert( // Configured project yaml genesisHash only exists in specVersion v0.2.0, fallback to api fetched genesisHash on v0.0.1 - (this.project.network.chainId ?? genesisHash) === keyValue.genesisHash, + (this.project.network.genesisHash ?? genesisHash) === + keyValue.genesisHash, 'Specified project manifest chain id / genesis hash does not match database stored genesis hash, consider cleaning project schema using --force-clean', ); } @@ -366,7 +367,7 @@ export class ProjectService { } private getStartBlockFromDataSources() { - const startBlocksList = this.getDataSourcesForSpecName().map( + const startBlocksList = this.project.dataSources.map( (item) => item.startBlock ?? 1, ); if (startBlocksList.length === 0) { @@ -379,15 +380,6 @@ export class ProjectService { } } - private getDataSourcesForSpecName(): SubqlProjectDs[] { - return this.project.dataSources.filter( - (ds) => - !ds.filter?.specName || - ds.filter.specName === - this.apiService.getApi().runtimeVersion.specName.toString(), - ); - } - private async reindex(targetBlockHeight: number): Promise { const lastProcessedHeight = await this.getLastProcessedHeight(); if (!this.storeService.historical) { diff --git a/packages/node/src/indexer/sandbox.service.spec.ts b/packages/node/src/indexer/sandbox.service.spec.ts deleted file mode 100644 index 652f9169..00000000 --- a/packages/node/src/indexer/sandbox.service.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import * as path from 'path'; -import { NodeConfig } from '@subql/node-core'; -import { IndexerSandbox } from './sandbox.service'; - -describe('sandbox for subql-node', () => { - let vm: IndexerSandbox; - - afterEach(() => { - vm.removeAllListeners(); - }); - - it('wait until promise resolved', async () => { - const root = path.resolve(__dirname, '../../test/sandbox'); - const entry = './main.js'; - vm = new IndexerSandbox( - { - store: undefined, - root, - entry, - script: fs.readFileSync(path.join(root, entry)).toString(), - }, - new NodeConfig({ subquery: '', subqueryName: '' }), - ); - let sandboxFuncionEndAt: Date; - vm.on('console.log', (line) => { - if (line === 'OK') { - sandboxFuncionEndAt = new Date(); - } - }); - await vm.securedExec('testSandbox', []); - const secureExecEndAt = new Date(); - expect(sandboxFuncionEndAt).toBeTruthy(); - expect(secureExecEndAt.getTime()).toBeGreaterThanOrEqual( - sandboxFuncionEndAt.getTime(), - ); - }); -}); diff --git a/packages/node/src/indexer/sandbox.service.ts b/packages/node/src/indexer/sandbox.service.ts index 4e870ce6..3e5bad48 100644 --- a/packages/node/src/indexer/sandbox.service.ts +++ b/packages/node/src/indexer/sandbox.service.ts @@ -5,8 +5,8 @@ import path from 'path'; import { Injectable } from '@nestjs/common'; import { isDatasourceV0_2_0, - SubstrateDataSource, -} from '@subql/common-substrate'; + SubqlEthereumDataSource, +} from '@subql/common-ethereum'; import { timeout, NodeConfig, @@ -14,14 +14,12 @@ import { getYargsOption, getLogger, } from '@subql/node-core'; -import { Store } from '@subql/types'; +import { ApiWrapper, EthereumBlockWrapper, Store } from '@subql/types-ethereum'; import { levelFilter } from '@subql/utils'; import { merge } from 'lodash'; import { NodeVM, NodeVMOptions, VMScript } from 'vm2'; import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject'; import { getProjectEntry } from '../utils/project'; -import { ApiService } from './api.service'; -import { ApiAt } from './types'; const { argv } = getYargsOption(); @@ -90,7 +88,9 @@ export class IndexerSandbox extends Sandbox { } catch (e) { e.handler = funcName; if (this.config.logLevel && levelFilter('debug', this.config.logLevel)) { - e.handlerArgs = JSON.stringify(args); + e.handlerArgs = JSON.stringify(args, (key, value) => + typeof value === 'bigint' ? `${value.toString()}n` : value, + ); } throw e; } finally { @@ -112,19 +112,21 @@ export class SandboxService { private processorCache: Record = {}; constructor( - private readonly apiService: ApiService, private readonly storeService: StoreService, private readonly nodeConfig: NodeConfig, private readonly project: SubqueryProject, ) {} - getDsProcessor(ds: SubqlProjectDs, api: ApiAt): IndexerSandbox { + getDsProcessorWrapper( + ds: SubqlProjectDs, + api: ApiWrapper, + blockContent: EthereumBlockWrapper, + ): IndexerSandbox { const entry = this.getDataSourceEntry(ds); let processor = this.processorCache[entry]; if (!processor) { processor = new IndexerSandbox( { - // api: await this.apiService.getPatchedApi(), store: this.storeService.getStore(), root: this.project.root, script: ds.mapping.entryScript, @@ -134,14 +136,11 @@ export class SandboxService { ); this.processorCache[entry] = processor; } - processor.freeze(api, 'api'); - if (argv.unsafe) { - processor.freeze(this.apiService.getApi(), 'unsafeApi'); - } + api.freezeApi(processor, blockContent); return processor; } - private getDataSourceEntry(ds: SubstrateDataSource): string { + private getDataSourceEntry(ds: SubqlEthereumDataSource): string { if (isDatasourceV0_2_0(ds)) { return ds.mapping.file; } else { diff --git a/packages/node/src/indexer/types.ts b/packages/node/src/indexer/types.ts index c9f5ad79..c3aec85c 100644 --- a/packages/node/src/indexer/types.ts +++ b/packages/node/src/indexer/types.ts @@ -1,18 +1,15 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiPromise } from '@polkadot/api'; -import { ApiDecoration } from '@polkadot/api/types'; -import { - SubstrateBlock, - SubstrateEvent, - SubstrateExtrinsic, -} from '@subql/types'; +import { Entity } from '@subql/types-ethereum'; -export interface BlockContent { - block: SubstrateBlock; - extrinsics: SubstrateExtrinsic[]; - events: SubstrateEvent[]; +export enum OperationType { + Set = 'Set', + Remove = 'Remove', } -export type ApiAt = ApiDecoration<'promise'> & { rpc: ApiPromise['rpc'] }; +export type OperationEntity = { + operation: OperationType; + entityType: string; + data: Entity | string; +}; diff --git a/packages/node/src/indexer/worker/block-dispatcher.service.ts b/packages/node/src/indexer/worker/block-dispatcher.service.ts index df699fad..e8204828 100644 --- a/packages/node/src/indexer/worker/block-dispatcher.service.ts +++ b/packages/node/src/indexer/worker/block-dispatcher.service.ts @@ -6,9 +6,9 @@ import path from 'path'; import { Injectable, OnApplicationShutdown } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; import { Interval } from '@nestjs/schedule'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; import { hexToU8a, u8aEq } from '@polkadot/util'; import { + ApiService, getLogger, NodeConfig, IndexerEvent, @@ -16,14 +16,11 @@ import { delay, getYargsOption, profilerWrap, - AutoQueue, - Queue, } from '@subql/node-core'; -import { SubstrateBlock } from '@subql/types'; +import { EthereumBlockWrapper } from '@subql/types-ethereum'; import chalk from 'chalk'; import { last } from 'lodash'; -import * as SubstrateUtil from '../../utils/substrate'; -import { ApiService } from '../api.service'; +import { AutoQueue, Queue } from '../../utils/autoQueue'; import { IndexerManager } from '../indexer.manager'; import { ProjectService } from '../project.service'; import { @@ -32,7 +29,6 @@ import { InitWorker, NumFetchedBlocks, NumFetchingBlocks, - SetCurrentRuntimeVersion, GetWorkerStatus, } from './worker'; @@ -47,7 +43,6 @@ type IIndexerWorker = { fetchBlock: FetchBlock; numFetchedBlocks: NumFetchedBlocks; numFetchingBlocks: NumFetchingBlocks; - setCurrentRuntimeVersion: SetCurrentRuntimeVersion; getStatus: GetWorkerStatus; }; @@ -68,7 +63,6 @@ async function createIndexerWorker(): Promise { 'fetchBlock', 'numFetchedBlocks', 'numFetchingBlocks', - 'setCurrentRuntimeVersion', 'getStatus', ], ); @@ -78,13 +72,8 @@ async function createIndexerWorker(): Promise { return indexerWorker; } -type GetRuntimeVersion = (block: SubstrateBlock) => Promise; - export interface IBlockDispatcher { - init( - runtimeVersionGetter: GetRuntimeVersion, - onDynamicDsCreated: (height: number) => Promise, - ): Promise; + init(onDynamicDsCreated: (height: number) => Promise): Promise; enqueueBlocks(heights: number[]): void; @@ -111,12 +100,11 @@ export class BlockDispatcherService private fetching = false; private isShutdown = false; - private getRuntimeVersion: GetRuntimeVersion; private onDynamicDsCreated: (height: number) => Promise; private _latestBufferedHeight: number; private _processedBlockCount: number; - private fetchBlocksBatches = SubstrateUtil.fetchBlocksBatches; + private fetchBlocksBatches: ApiService['api']['fetchBlocks']; private latestProcessedHeight: number; constructor( @@ -131,21 +119,24 @@ export class BlockDispatcherService const { argv } = getYargsOption(); + const fetchBlocks = this.apiService.api.fetchBlocks.bind( + this.apiService.api, + ); if (argv.profiler) { this.fetchBlocksBatches = profilerWrap( - SubstrateUtil.fetchBlocksBatches, - 'SubstrateUtil', + fetchBlocks, + 'EthereumUtil', 'fetchBlocksBatches', ); + } else { + this.fetchBlocksBatches = fetchBlocks; } } // eslint-disable-next-line @typescript-eslint/require-await async init( - runtimeVersionGetter: GetRuntimeVersion, onDynamicDsCreated: (height: number) => Promise, ): Promise { - this.getRuntimeVersion = runtimeVersionGetter; this.onDynamicDsCreated = onDynamicDsCreated; const blockAmount = await this.projectService.getProcessedBlockCount(); this.setProcessedBlockCount(blockAmount ?? 0); @@ -159,11 +150,7 @@ export class BlockDispatcherService enqueueBlocks(heights: number[]): void { if (!heights.length) return; - logger.info( - `Enqueing blocks ${heights[0]}...${last(heights)}, total ${ - heights.length - } blocks`, - ); + logger.info(`Enqueing blocks ${heights[0]}...${last(heights)}`); this.fetchQueue.putMany(heights); this.latestBufferedHeight = last(heights); @@ -171,7 +158,7 @@ export class BlockDispatcherService void this.fetchBlocksFromQueue().catch((e) => { logger.error(e, 'Failed to fetch blocks from queue'); if (!this.isShutdown) { - process.exit(1); + throw e; } }); } @@ -221,27 +208,25 @@ export class BlockDispatcherService }], total ${blockNums.length} blocks`, ); - const blocks = await this.fetchBlocksBatches( - this.apiService.getApi(), - blockNums, - ); + const blocks = await this.fetchBlocksBatches(blockNums); if (bufferedHeight > this._latestBufferedHeight) { logger.debug(`Queue was reset for new DS, discarding fetched blocks`); continue; } + const blockTasks = blocks.map((block) => async () => { - const height = block.block.block.header.number.toNumber(); + const height = block.blockHeight; try { this.eventEmitter.emit(IndexerEvent.BlockProcessing, { height, timestamp: Date.now(), }); - const runtimeVersion = await this.getRuntimeVersion(block.block); - const { dynamicDsCreated, operationHash } = - await this.indexerManager.indexBlock(block, runtimeVersion); + await this.indexerManager.indexBlock( + block as EthereumBlockWrapper, + ); // In memory _processedBlockCount increase, db metadata increase BlockCount in indexer.manager this.setProcessedBlockCount(this._processedBlockCount + 1); @@ -320,7 +305,6 @@ export class WorkerBlockDispatcherService { private workers: IndexerWorker[]; private numWorkers: number; - private getRuntimeVersion: GetRuntimeVersion; private onDynamicDsCreated: (height: number) => Promise; private taskCounter = 0; @@ -339,14 +323,12 @@ export class WorkerBlockDispatcherService } async init( - runtimeVersionGetter: GetRuntimeVersion, onDynamicDsCreated: (height: number) => Promise, ): Promise { this.workers = await Promise.all( new Array(this.numWorkers).fill(0).map(() => createIndexerWorker()), ); - this.getRuntimeVersion = runtimeVersionGetter; this.onDynamicDsCreated = onDynamicDsCreated; const blockAmount = await this.projectService.getProcessedBlockCount(); @@ -442,19 +424,6 @@ export class WorkerBlockDispatcherService ); } - if (result) { - const runtimeVersion = await this.getRuntimeVersion({ - specVersion: result.specVersion, - block: { - header: { - parentHash: result.parentHash, - }, - }, - } as any); - - await worker.setCurrentRuntimeVersion(runtimeVersion.toHex()); - } - // logger.info( // `worker ${workerIdx} processing block ${height}, fetched blocks: ${await worker.numFetchedBlocks()}, fetching blocks: ${await worker.numFetchingBlocks()}`, // ); @@ -522,11 +491,6 @@ export class WorkerBlockDispatcherService this.eventEmitter.emit(IndexerEvent.BlocknumberQueueSize, { value: this.queueSize, }); - - // There is only a single queue with workers so we treat them as the same - this.eventEmitter.emit(IndexerEvent.BlockQueueSize, { - value: this.queueSize, - }); this._latestBufferedHeight = height; } diff --git a/packages/node/src/indexer/worker/worker.service.ts b/packages/node/src/indexer/worker/worker.service.ts index e38526e4..2cd4f230 100644 --- a/packages/node/src/indexer/worker/worker.service.ts +++ b/packages/node/src/indexer/worker/worker.service.ts @@ -3,16 +3,12 @@ import { threadId } from 'node:worker_threads'; import { Injectable } from '@nestjs/common'; -import { RuntimeVersion } from '@polkadot/types/interfaces'; -import { NodeConfig, getLogger, AutoQueue } from '@subql/node-core'; -import { fetchBlocksBatches } from '../../utils/substrate'; -import { ApiService } from '../api.service'; +import { ApiService, NodeConfig, getLogger } from '@subql/node-core'; +import { EthereumBlockWrapper, BlockWrapper } from '@subql/types-ethereum'; +import { AutoQueue } from '../../utils/autoQueue'; import { IndexerManager } from '../indexer.manager'; -import { BlockContent } from '../types'; -export type FetchBlockResponse = - | { specVersion: number; parentHash: string } - | undefined; +export type FetchBlockResponse = { parentHash: string } | undefined; export type ProcessBlockResponse = { dynamicDsCreated: boolean; @@ -30,8 +26,7 @@ const logger = getLogger(`Worker Service #${threadId}`); @Injectable() export class WorkerService { - private fetchedBlocks: Record = {}; - private currentRuntimeVersion: RuntimeVersion | undefined; + private fetchedBlocks: Record = {}; private _isIndexing = false; private queue: AutoQueue; @@ -49,45 +44,24 @@ export class WorkerService { return await this.queue.put(async () => { // If a dynamic ds is created we might be asked to fetch blocks again, use existing result if (!this.fetchedBlocks[height]) { - const [block] = await fetchBlocksBatches(this.apiService.getApi(), [ - height, - ]); + const [block] = await this.apiService.api.fetchBlocks([height]); this.fetchedBlocks[height] = block; } const block = this.fetchedBlocks[height]; - // We have the current version, don't need a new one when processing - if ( - this.currentRuntimeVersion?.specVersion.toNumber() === - block.block.specVersion - ) { - return; - } - // Return info to get the runtime version, this lets the worker thread know - return { - specVersion: block.block.specVersion, - parentHash: block.block.block.header.parentHash.toHex(), - }; + return undefined; }); } catch (e) { logger.error(e, `Failed to fetch block ${height}`); } } - setCurrentRuntimeVersion(runtimeHex: string): void { - const runtimeVersion = this.apiService - .getApi() - .registry.createType('RuntimeVersion', runtimeHex[0]); - - this.currentRuntimeVersion = runtimeVersion; - } - async processBlock(height: number): Promise { try { this._isIndexing = true; - const block = this.fetchedBlocks[height]; + const block = this.fetchedBlocks[height] as EthereumBlockWrapper; if (!block) { throw new Error(`Block ${height} has not been fetched`); @@ -95,10 +69,7 @@ export class WorkerService { delete this.fetchedBlocks[height]; - const response = await this.indexerManager.indexBlock( - block, - this.currentRuntimeVersion, - ); + const response = await this.indexerManager.indexBlock(block); this._isIndexing = false; return { diff --git a/packages/node/src/indexer/worker/worker.ts b/packages/node/src/indexer/worker/worker.ts index bb588b99..73c236f2 100644 --- a/packages/node/src/indexer/worker/worker.ts +++ b/packages/node/src/indexer/worker/worker.ts @@ -57,13 +57,6 @@ async function processBlock(height: number): Promise { return workerService.processBlock(height); } -// eslint-disable-next-line @typescript-eslint/require-await -async function setCurrentRuntimeVersion(runtimeHex: string): Promise { - assert(workerService, 'Not initialised'); - - return workerService.setCurrentRuntimeVersion(runtimeHex); -} - // eslint-disable-next-line @typescript-eslint/require-await async function numFetchedBlocks(): Promise { return workerService.numFetchedBlocks; @@ -91,7 +84,6 @@ registerWorker({ processBlock, numFetchedBlocks, numFetchingBlocks, - setCurrentRuntimeVersion, getStatus, }); @@ -101,7 +93,6 @@ export type FetchBlock = typeof fetchBlock; export type ProcessBlock = typeof processBlock; export type NumFetchedBlocks = typeof numFetchedBlocks; export type NumFetchingBlocks = typeof numFetchingBlocks; -export type SetCurrentRuntimeVersion = typeof setCurrentRuntimeVersion; export type GetWorkerStatus = typeof getStatus; process.on('uncaughtException', (e) => { diff --git a/packages/node/src/indexer/x-provider/http.ts b/packages/node/src/indexer/x-provider/http.ts deleted file mode 100644 index 4cac7408..00000000 --- a/packages/node/src/indexer/x-provider/http.ts +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// overwrite the official Polkadot HttpProvider: https://github.com/polkadot-js/api/blob/master/packages/rpc-provider/src/http/index.ts -// Use context and fetch to provide http1 keepAlive and maxSocket feature - -import { RpcCoder } from '@polkadot/rpc-provider/coder'; -import defaults from '@polkadot/rpc-provider/defaults'; -import { LRUCache } from '@polkadot/rpc-provider/lru'; -import type { - JsonRpcResponse, - ProviderInterface, - ProviderInterfaceCallback, - ProviderInterfaceEmitCb, - ProviderInterfaceEmitted, - ProviderStats, -} from '@polkadot/rpc-provider/types'; -import { getLogger } from '@subql/node-core'; -import { context } from 'fetch-h2'; - -const ctx = context({ - http1: { - keepAlive: true, - maxSockets: 10, - }, -}); - -const ERROR_SUBSCRIBE = - 'HTTP Provider does not have subscriptions, use WebSockets instead'; - -const l = getLogger('http-provider'); - -/** - * # @polkadot/rpc-provider - * - * @name HttpProvider - * - * @description The HTTP Provider allows sending requests using HTTP to a HTTP RPC server TCP port. It does not support subscriptions so you won't be able to listen to events such as new blocks or balance changes. It is usually preferable using the [[WsProvider]]. - * - * @example - *
- * - * ```javascript - * import Api from '@polkadot/api/promise'; - * import { HttpProvider } from '@polkadot/rpc-provider'; - * - * const provider = new HttpProvider('http://127.0.0.1:9933'); - * const api = new Api(provider); - * ``` - * - * @see [[WsProvider]] - */ -export class HttpProvider implements ProviderInterface { - readonly #callCache = new LRUCache(); - - readonly #coder: RpcCoder; - - readonly #endpoint: string; - - readonly #headers: Record; - - readonly #stats: ProviderStats; - - /** - * @param {string} endpoint The endpoint url starting with http:// - */ - constructor( - endpoint: string = defaults.HTTP_URL, - headers: Record = {}, - ) { - if (!/^(https|http):\/\//.test(endpoint)) { - throw new Error( - `Endpoint should start with 'http://' or 'https://', received '${endpoint}'`, - ); - } - - this.#coder = new RpcCoder(); - this.#endpoint = endpoint; - this.#headers = headers; - this.#stats = { - active: { requests: 0, subscriptions: 0 }, - total: { - bytesRecv: 0, - bytesSent: 0, - cached: 0, - errors: 0, - requests: 0, - subscriptions: 0, - timeout: 0, - }, - }; - } - - /** - * @summary `true` when this provider supports subscriptions - */ - get hasSubscriptions(): boolean { - return false; - } - - /** - * @description Returns a clone of the object - */ - clone(): HttpProvider { - return new HttpProvider(this.#endpoint, this.#headers); - } - - /** - * @description Manually connect from the connection - */ - async connect(): Promise { - // noop - } - - /** - * @description Manually disconnect from the connection - */ - async disconnect(): Promise { - // noop - } - - /** - * @description Returns the connection stats - */ - get stats(): ProviderStats { - return this.#stats; - } - - /** - * @summary Whether the node is connected or not. - * @return {boolean} true if connected - */ - get isConnected(): boolean { - return true; - } - - /** - * @summary Events are not supported with the HttpProvider, see [[WsProvider]]. - * @description HTTP Provider does not have 'on' emitters. WebSockets should be used instead. - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars - on(type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void { - l.error( - "HTTP Provider does not have 'on' emitters, use WebSockets instead", - ); - - return (): void => { - // noop - }; - } - - /** - * @summary Send HTTP POST Request with Body to configured HTTP Endpoint. - */ - async send( - method: string, - params: unknown[], - isCacheable?: boolean, - ): Promise { - this.#stats.total.requests++; - - const [, body] = this.#coder.encodeJson(method, params); - let resultPromise: Promise | null = isCacheable - ? (this.#callCache.get(body) as Promise) - : null; - - // eslint-disable-next-line @typescript-eslint/no-misused-promises - if (!resultPromise) { - resultPromise = this._send(body); - - if (isCacheable) { - this.#callCache.set(body, resultPromise); - } - } else { - this.#stats.total.cached++; - } - - return resultPromise; - } - - async _send(body: string): Promise { - this.#stats.active.requests++; - this.#stats.total.bytesSent += body.length; - - try { - const response = await ctx.fetch(this.#endpoint, { - body, - headers: { - Accept: 'application/json', - // Recommend dropped in HTTP2 - // 'Content-Length': `${body.length}`, - 'Content-Type': 'application/json', - ...this.#headers, - }, - method: 'POST', - }); - - if (!response.ok) { - throw new Error(`[${response.status}]: ${response.statusText}`); - } - - const result = await response.text(); - - this.#stats.total.bytesRecv += result.length; - - const decoded = this.#coder.decodeResponse( - JSON.parse(result) as JsonRpcResponse, - ) as T; - - this.#stats.active.requests--; - - return decoded; - } catch (e) { - this.#stats.active.requests--; - this.#stats.total.errors++; - - throw e; - } - } - - /** - * @summary Subscriptions are not supported with the HttpProvider, see [[WsProvider]]. - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await - async subscribe( - types: string, - method: string, - params: unknown[], - cb: ProviderInterfaceCallback, - ): Promise { - l.error(ERROR_SUBSCRIBE); - - throw new Error(ERROR_SUBSCRIBE); - } - - /** - * @summary Subscriptions are not supported with the HttpProvider, see [[WsProvider]]. - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await - async unsubscribe( - type: string, - method: string, - id: number, - ): Promise { - l.error(ERROR_SUBSCRIBE); - - throw new Error(ERROR_SUBSCRIBE); - } -} diff --git a/packages/node/src/main.ts b/packages/node/src/main.ts index cb547231..18b977cd 100644 --- a/packages/node/src/main.ts +++ b/packages/node/src/main.ts @@ -3,9 +3,13 @@ import { NestFactory } from '@nestjs/core'; import { findAvailablePort } from '@subql/common'; -import { getYargsOption, getLogger, NestLogger } from '@subql/node-core'; +import { + ApiService, + getYargsOption, + getLogger, + NestLogger, +} from '@subql/node-core'; import { AppModule } from './app.module'; -import { ApiService } from './indexer/api.service'; import { FetchService } from './indexer/fetch.service'; import { ProjectService } from './indexer/project.service'; diff --git a/packages/node/src/meta/meta.module.ts b/packages/node/src/meta/meta.module.ts index 27fb68d9..c4f95059 100644 --- a/packages/node/src/meta/meta.module.ts +++ b/packages/node/src/meta/meta.module.ts @@ -20,22 +20,25 @@ import { MetaService } from './meta.service'; @Module({ imports: [PrometheusModule.register(), FetchModule], - controllers: [ - MetaController, - HealthController, - ReadyController, - MmrQueryController, - ], + controllers: [MetaController, HealthController, ReadyController], providers: [ MetricEventListener, makeGaugeProvider({ name: 'subql_indexer_api_connected', help: 'The indexer api connection status', }), + makeGaugeProvider({ + name: 'subql_indexer_injected_api_connected', + help: 'The indexer injected api connection status', + }), makeGaugeProvider({ name: 'subql_indexer_processing_block_height', help: 'The current processing block height', }), + makeGaugeProvider({ + name: 'subql_indexer_processed_block_height', + help: 'The last processed block height', + }), makeGaugeProvider({ name: 'subql_indexer_target_block_height', help: 'The latest finalized block height', diff --git a/packages/node/src/meta/meta.service.ts b/packages/node/src/meta/meta.service.ts index 1a561dc5..1d67e7d8 100644 --- a/packages/node/src/meta/meta.service.ts +++ b/packages/node/src/meta/meta.service.ts @@ -30,6 +30,7 @@ export class MetaService { private networkMeta: NetworkMetadataPayload; private apiConnected: boolean; private usingDictionary: boolean; + private injectedApiConnected: boolean; private lastProcessedHeight: number; private lastProcessedTimestamp: number; private processedBlockCount: number; @@ -49,6 +50,7 @@ export class MetaService { polkadotSdkVersion, processedBlockCount: this.processedBlockCount, apiConnected: this.apiConnected, + injectedApiConnected: this.injectedApiConnected, usingDictionary: this.usingDictionary, ...this.networkMeta, }; diff --git a/packages/node-core/src/utils/autoQueue.ts b/packages/node/src/utils/autoQueue.ts similarity index 94% rename from packages/node-core/src/utils/autoQueue.ts rename to packages/node/src/utils/autoQueue.ts index bed8760c..fe0f4247 100644 --- a/packages/node-core/src/utils/autoQueue.ts +++ b/packages/node/src/utils/autoQueue.ts @@ -1,7 +1,7 @@ // Copyright 2020-2021 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -import {EventEmitter2} from '@nestjs/event-emitter'; +import { EventEmitter2 } from '@nestjs/event-emitter'; export class Queue { private items: T[] = []; @@ -116,7 +116,7 @@ export class AutoQueue { return tasks.map((task, index) => { return new Promise((resolve, reject) => { - this.queue.put({task, resolve, reject}); + this.queue.put({ task, resolve, reject }); if (tasks.length - 1 === index) { void this.take(); } @@ -151,7 +151,7 @@ export class AutoQueue { } catch (e) { action.reject(e); } - }) + }), ); } this.pendingPromise = false; @@ -167,7 +167,10 @@ export class AutoQueue { this._abort = true; } - on(evt: 'size', callback: (size: number) => void | Promise): () => void { + on( + evt: 'size', + callback: (size: number) => void | Promise, + ): () => void { this.eventEmitter.on(evt, callback as (size: number) => void); return () => this.eventEmitter.off(evt, callback as (size: number) => void); diff --git a/packages/node/src/utils/project.ts b/packages/node/src/utils/project.ts index b80045cf..1258c3dd 100644 --- a/packages/node/src/utils/project.ts +++ b/packages/node/src/utils/project.ts @@ -4,29 +4,22 @@ import fs from 'fs'; import os from 'os'; import path from 'path'; -import { - GithubReader, - IPFSReader, - LocalReader, - Reader, - loadFromJsonOrYaml, -} from '@subql/common'; +import { GithubReader, IPFSReader, LocalReader, Reader } from '@subql/common'; import { ChainTypes, CustomDatasourceV0_2_0, isCustomDs, - // loadChainTypesFromJs, + loadChainTypes, + loadChainTypesFromJs, parseChainTypes, - RuntimeDataSourceV0_0_1, RuntimeDataSourceV0_2_0, - SubstrateRuntimeHandler, - SubstrateCustomHandler, - SubstrateHandler, - SubstrateHandlerKind, -} from '@subql/common-substrate'; + SubqlRuntimeHandler, + SubqlCustomHandler, + SubqlHandler, + EthereumHandlerKind, +} from '@subql/common-ethereum'; import yaml from 'js-yaml'; import tar from 'tar'; -import { NodeVM, VMScript } from 'vm2'; import { SubqlProjectDs } from '../configure/SubqueryProject'; export async function prepareProjectDir(projectPath: string): Promise { @@ -67,31 +60,17 @@ export function getProjectEntry(root: string): string { } export function isBaseHandler( - handler: SubstrateHandler, -): handler is SubstrateRuntimeHandler { - return Object.values(SubstrateHandlerKind).includes(handler.kind); + handler: SubqlHandler, +): handler is SubqlRuntimeHandler { + return Object.values(EthereumHandlerKind).includes(handler.kind); } export function isCustomHandler( - handler: SubstrateHandler, -): handler is SubstrateCustomHandler { + handler: SubqlHandler, +): handler is SubqlCustomHandler { return !isBaseHandler(handler); } -export async function updateDataSourcesV0_0_1( - _dataSources: RuntimeDataSourceV0_0_1[], - reader: Reader, -): Promise { - // force convert to updated ds - const dataSources = _dataSources as SubqlProjectDs[]; - await Promise.all( - dataSources.map(async (ds) => { - ds.mapping.entryScript = await loadDataSourceScript(reader); - }), - ); - return dataSources; -} - export async function updateDataSourcesV0_2_0( _dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[], reader: Reader, @@ -110,6 +89,21 @@ export async function updateDataSourcesV0_2_0( root, entryScript, ); + if (dataSource.assets) { + for (const [, asset] of Object.entries(dataSource.assets)) { + if (reader instanceof LocalReader) { + asset.file = path.resolve(root, asset.file); + } else { + const res = await reader.getFile(asset.file); + const outputPath = path.resolve( + root, + asset.file.replace('ipfs://', ''), + ); + await fs.promises.writeFile(outputPath, res as string); + asset.file = outputPath; + } + } + } if (isCustomDs(dataSource)) { if (dataSource.processor) { dataSource.processor.file = await updateProcessor( @@ -242,60 +236,3 @@ export async function getProjectRoot(reader: Reader): Promise { return makeTempDir(); } } - -export function loadChainTypes(file: string, projectRoot: string): unknown { - const { ext } = path.parse(file); - const filePath = path.resolve(projectRoot, file); - if (fs.existsSync(filePath)) { - if (ext === '.js' || ext === '.cjs') { - //load can be self contained js file, or js depend on node_module which will require project root - return loadChainTypesFromJs(filePath, projectRoot); - } else if (ext === '.yaml' || ext === '.yml' || ext === '.json') { - return loadFromJsonOrYaml(filePath); - } else { - throw new Error(`Extension ${ext} not supported`); - } - } else { - throw new Error(`Load from file ${file} not exist`); - } -} - -export function loadChainTypesFromJs( - filePath: string, - requireRoot?: string, -): unknown { - const { base, ext } = path.parse(filePath); - const root = requireRoot ?? path.dirname(filePath); - const vm = new NodeVM({ - console: 'redirect', - wasm: false, - sandbox: {}, - require: { - context: 'sandbox', - external: true, - builtin: ['path'], - root: root, - resolve: (moduleName: string) => { - return require.resolve(moduleName, { paths: [root] }); - }, - }, - wrapper: 'commonjs', - sourceExtensions: ['js', 'cjs'], - }); - let rawContent: unknown; - try { - const script = new VMScript( - `module.exports = require('${filePath}').default;`, - path.join(root, 'sandbox'), - ).compile(); - rawContent = vm.run(script) as unknown; - } catch (err) { - throw new Error(`\n NodeVM error: ${err}`); - } - if (rawContent === undefined) { - throw new Error( - `There was no default export found from required ${base} file`, - ); - } - return rawContent; -} diff --git a/packages/node/src/utils/string.ts b/packages/node/src/utils/string.ts new file mode 100644 index 00000000..0898e366 --- /dev/null +++ b/packages/node/src/utils/string.ts @@ -0,0 +1,29 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { EventFragment, FunctionFragment } from '@ethersproject/abi'; +import { isHexString, hexStripZeros, hexDataSlice } from '@ethersproject/bytes'; +import { id } from '@ethersproject/hash'; + +export function stringNormalizedEq(a: string, b: string): boolean { + return a.toLowerCase() === b?.toLowerCase(); +} + +export function hexStringEq(a: string, b: string): boolean { + if (!isHexString(a) || !isHexString(b)) { + throw new Error('Inputs are not hex strings'); + } + return stringNormalizedEq(hexStripZeros(a), hexStripZeros(b)); +} + +export function eventToTopic(input: string): string { + if (isHexString(input)) return input; + + return id(EventFragment.fromString(input).format()); +} + +export function functionToSighash(input: string): string { + if (isHexString(input)) return input; + + return hexDataSlice(id(FunctionFragment.fromString(input).format()), 0, 4); +} diff --git a/packages/node/src/utils/substrate.test.ts b/packages/node/src/utils/substrate.test.ts deleted file mode 100644 index b0eb05ea..00000000 --- a/packages/node/src/utils/substrate.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { ApiPromise, WsProvider } from '@polkadot/api'; -import { fetchBlocks } from './substrate'; - -const endpoint = 'wss://polkadot.api.onfinality.io/public-ws'; - -jest.setTimeout(100000); - -describe('substrate utils', () => { - let api: ApiPromise; - beforeAll(async () => { - const provider = new WsProvider(endpoint); - api = await ApiPromise.create({ provider }); - }); - - afterAll(() => api?.disconnect()); - - it('query range of blocks', async () => { - const blockHash = await api.rpc.chain.getBlockHash(100000); - // await prefetchMetadata(api, blockHash); - const blocks = await fetchBlocks(api, 100000, 100019); - expect(blocks).toHaveLength(20); - for (const block of blocks) { - expect(block).toHaveProperty('block'); - expect(block).toHaveProperty('extrinsics'); - expect(block).toHaveProperty('events'); - } - }); - - it.skip('when failed to fetch, log block height and re-throw error', async () => { - //some large number of block height - await expect(fetchBlocks(api, 100000000, 100000019)).rejects.toThrow( - /Unable to retrieve header and parent from supplied hash/, - ); - }); -}); diff --git a/packages/node/src/utils/substrate.ts b/packages/node/src/utils/substrate.ts deleted file mode 100644 index d6d13972..00000000 --- a/packages/node/src/utils/substrate.ts +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { ApiPromise } from '@polkadot/api'; -import { Option, Vec } from '@polkadot/types'; -import '@polkadot/api-augment/substrate'; -import { - BlockHash, - EventRecord, - LastRuntimeUpgradeInfo, - RuntimeVersion, - SignedBlock, -} from '@polkadot/types/interfaces'; -import { BN, BN_THOUSAND, BN_TWO, bnMin } from '@polkadot/util'; -import { getLogger } from '@subql/node-core'; -import { - SpecVersionRange, - SubstrateBlockFilter, - SubstrateCallFilter, - SubstrateEventFilter, - SubstrateBlock, - SubstrateEvent, - SubstrateExtrinsic, -} from '@subql/types'; -import { last, merge, range } from 'lodash'; -import { BlockContent } from '../indexer/types'; -const logger = getLogger('fetch'); -const INTERVAL_THRESHOLD = BN_THOUSAND.div(BN_TWO); -const DEFAULT_TIME = new BN(6_000); -const A_DAY = new BN(24 * 60 * 60 * 1000); - -export function wrapBlock( - signedBlock: SignedBlock, - events: EventRecord[], - specVersion?: number, -): SubstrateBlock { - return merge(signedBlock, { - timestamp: getTimestamp(signedBlock), - specVersion: specVersion, - events, - }); -} - -function getTimestamp({ block: { extrinsics } }: SignedBlock): Date { - for (const e of extrinsics) { - const { - method: { method, section }, - } = e; - if (section === 'timestamp' && method === 'set') { - const date = new Date(e.args[0].toJSON() as number); - if (isNaN(date.getTime())) { - throw new Error('timestamp args type wrong'); - } - return date; - } - } -} - -export function wrapExtrinsics( - wrappedBlock: SubstrateBlock, - allEvents: EventRecord[], -): SubstrateExtrinsic[] { - return wrappedBlock.block.extrinsics.map((extrinsic, idx) => { - const events = filterExtrinsicEvents(idx, allEvents); - return { - idx, - extrinsic, - block: wrappedBlock, - events, - success: getExtrinsicSuccess(events), - }; - }); -} - -function getExtrinsicSuccess(events: EventRecord[]): boolean { - return ( - events.findIndex((evt) => evt.event.method === 'ExtrinsicSuccess') > -1 - ); -} - -function filterExtrinsicEvents( - extrinsicIdx: number, - events: EventRecord[], -): EventRecord[] { - return events.filter( - ({ phase }) => - phase.isApplyExtrinsic && phase.asApplyExtrinsic.eqn(extrinsicIdx), - ); -} - -export function wrapEvents( - extrinsics: SubstrateExtrinsic[], - events: EventRecord[], - block: SubstrateBlock, -): SubstrateEvent[] { - return events.reduce((acc, event, idx) => { - const { phase } = event; - const wrappedEvent: SubstrateEvent = merge(event, { idx, block }); - if (phase.isApplyExtrinsic) { - wrappedEvent.extrinsic = extrinsics[phase.asApplyExtrinsic.toNumber()]; - } - acc.push(wrappedEvent); - return acc; - }, [] as SubstrateEvent[]); -} - -function checkSpecRange( - specVersionRange: SpecVersionRange, - specVersion: number, -) { - const [lowerBond, upperBond] = specVersionRange; - return ( - (lowerBond === undefined || - lowerBond === null || - specVersion >= lowerBond) && - (upperBond === undefined || upperBond === null || specVersion <= upperBond) - ); -} - -export function filterBlock( - block: SubstrateBlock, - filter?: SubstrateBlockFilter, -): SubstrateBlock | undefined { - if (!filter) return block; - if (!filterBlockModulo(block, filter)) return; - return filter.specVersion === undefined || - block.specVersion === undefined || - checkSpecRange(filter.specVersion, block.specVersion) - ? block - : undefined; -} - -export function filterBlockModulo( - block: SubstrateBlock, - filter: SubstrateBlockFilter, -): boolean { - const { modulo } = filter; - if (!modulo) return true; - return block.block.header.number.toNumber() % modulo === 0; -} - -export function filterExtrinsic( - { block, extrinsic, success }: SubstrateExtrinsic, - filter?: SubstrateCallFilter, -): boolean { - if (!filter) return true; - return ( - (filter.specVersion === undefined || - block.specVersion === undefined || - checkSpecRange(filter.specVersion, block.specVersion)) && - (filter.module === undefined || - extrinsic.method.section === filter.module) && - (filter.method === undefined || - extrinsic.method.method === filter.method) && - (filter.success === undefined || success === filter.success) - ); -} - -export function filterExtrinsics( - extrinsics: SubstrateExtrinsic[], - filterOrFilters: SubstrateCallFilter | SubstrateCallFilter[] | undefined, -): SubstrateExtrinsic[] { - if ( - !filterOrFilters || - (filterOrFilters instanceof Array && filterOrFilters.length === 0) - ) { - return extrinsics; - } - const filters = - filterOrFilters instanceof Array ? filterOrFilters : [filterOrFilters]; - return extrinsics.filter((extrinsic) => - filters.find((filter) => filterExtrinsic(extrinsic, filter)), - ); -} - -export function filterEvent( - { block, event }: SubstrateEvent, - filter?: SubstrateEventFilter, -): boolean { - if (!filter) return true; - return ( - (filter.specVersion === undefined || - block.specVersion === undefined || - checkSpecRange(filter.specVersion, block.specVersion)) && - (filter.module ? event.section === filter.module : true) && - (filter.method ? event.method === filter.method : true) - ); -} - -export function filterEvents( - events: SubstrateEvent[], - filterOrFilters?: SubstrateEventFilter | SubstrateEventFilter[] | undefined, -): SubstrateEvent[] { - if ( - !filterOrFilters || - (filterOrFilters instanceof Array && filterOrFilters.length === 0) - ) { - return events; - } - const filters = - filterOrFilters instanceof Array ? filterOrFilters : [filterOrFilters]; - return events.filter((event) => - filters.find((filter) => filterEvent(event, filter)), - ); -} - -// TODO: prefetch all known runtime upgrades at once -export async function prefetchMetadata( - api: ApiPromise, - hash: BlockHash, -): Promise { - await api.getBlockRegistry(hash); -} - -/** - * - * @param api - * @param startHeight - * @param endHeight - * @param overallSpecVer exists if all blocks in the range have same parant specVersion - */ -//Deprecated -export async function fetchBlocks( - api: ApiPromise, - startHeight: number, - endHeight: number, - overallSpecVer?: number, -): Promise { - const blocks = await fetchBlocksRange(api, startHeight, endHeight); - const blockHashs = blocks.map((b) => b.block.header.hash); - const parentBlockHashs = blocks.map((b) => b.block.header.parentHash); - const [blockEvents, runtimeVersions] = await Promise.all([ - fetchEventsRange(api, blockHashs), - overallSpecVer - ? undefined - : fetchRuntimeVersionRange(api, parentBlockHashs), - ]); - return blocks.map((block, idx) => { - const events = blockEvents[idx]; - const parentSpecVersion = overallSpecVer - ? overallSpecVer - : runtimeVersions[idx].specVersion.toNumber(); - - const wrappedBlock = wrapBlock(block, events.toArray(), parentSpecVersion); - const wrappedExtrinsics = wrapExtrinsics(wrappedBlock, events); - const wrappedEvents = wrapEvents(wrappedExtrinsics, events, wrappedBlock); - return { - block: wrappedBlock, - extrinsics: wrappedExtrinsics, - events: wrappedEvents, - }; - }); -} - -async function getBlockByHeight( - api: ApiPromise, - height: number, -): Promise { - const blockHash = await api.rpc.chain.getBlockHash(height).catch((e) => { - logger.error(`failed to fetch BlockHash ${height}`); - throw e; - }); - return api.rpc.chain.getBlock(blockHash).catch((e) => { - logger.error(`failed to fetch Block ${blockHash}`); - throw e; - }); -} - -export async function fetchBlocksRange( - api: ApiPromise, - startHeight: number, - endHeight: number, -): Promise { - return Promise.all( - range(startHeight, endHeight + 1).map(async (height) => - getBlockByHeight(api, height), - ), - ); -} - -export async function fetchBlocksArray( - api: ApiPromise, - blockArray: number[], -): Promise { - return Promise.all( - blockArray.map(async (height) => getBlockByHeight(api, height)), - ); -} - -export async function fetchEventsRange( - api: ApiPromise, - hashs: BlockHash[], -): Promise[]> { - return Promise.all( - hashs.map((hash) => - api.query.system.events.at(hash).catch((e) => { - logger.error(`failed to fetch events at block ${hash}`); - throw e; - }), - ), - ); -} - -export async function fetchRuntimeVersionRange( - api: ApiPromise, - hashs: BlockHash[], -): Promise { - return Promise.all( - hashs.map((hash) => - api.rpc.state.getRuntimeVersion(hash).catch((e) => { - logger.error(`failed to fetch RuntimeVersion at block ${hash}`); - throw e; - }), - ), - ); -} - -export async function fetchBlocksBatches( - api: ApiPromise, - blockArray: number[], - overallSpecVer?: number, - // specVersionMap?: number[], -): Promise { - const blocks = await fetchBlocksArray(api, blockArray); - const blockHashs = blocks.map((b) => b.block.header.hash); - const parentBlockHashs = blocks.map((b) => b.block.header.parentHash); - const [blockEvents, runtimeVersions] = await Promise.all([ - fetchEventsRange(api, blockHashs), - overallSpecVer - ? undefined - : fetchRuntimeVersionRange(api, parentBlockHashs), - ]); - return blocks.map((block, idx) => { - const events = blockEvents[idx]; - const parentSpecVersion = overallSpecVer - ? overallSpecVer - : runtimeVersions[idx].specVersion.toNumber(); - const wrappedBlock = wrapBlock(block, events.toArray(), parentSpecVersion); - const wrappedExtrinsics = wrapExtrinsics(wrappedBlock, events); - const wrappedEvents = wrapEvents(wrappedExtrinsics, events, wrappedBlock); - return { - block: wrappedBlock, - extrinsics: wrappedExtrinsics, - events: wrappedEvents, - }; - }); -} - -export function calcInterval(api: ApiPromise): BN { - return bnMin( - A_DAY, - api.consts.babe?.expectedBlockTime || - (api.consts.difficulty?.targetBlockTime as any) || - api.consts.subspace?.expectedBlockTime || - (api.consts.timestamp?.minimumPeriod.gte(INTERVAL_THRESHOLD) - ? api.consts.timestamp.minimumPeriod.mul(BN_TWO) - : api.query.parachainSystem - ? DEFAULT_TIME.mul(BN_TWO) - : DEFAULT_TIME), - ); -} diff --git a/packages/node/test/jsonfy.js b/packages/node/test/jsonfy.js deleted file mode 100644 index 3c257293..00000000 --- a/packages/node/test/jsonfy.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 -Object.defineProperty(exports, '__esModule', { value: true }); -exports.JsonfyDatasourcePlugin = void 0; -exports.JsonfyDatasourcePlugin = { - kind: 'substrate/Jsonfy', - validate(ds) { - return; - }, - dsFilterProcessor(ds, api) { - return true; - }, - handlerProcessors: { - 'substrate/JsonfyEvent': { - specVersion: '1.0.0', - baseFilter: [], - baseHandlerKind: 'substrate/EventHandler', - // eslint-disable-next-line @typescript-eslint/require-await - async transformer({ original, ds }) { - return JSON.parse(JSON.stringify(original.toJSON())); - }, - filterProcessor({ filter, input, ds }) { - return ( - filter.module && - input.event.section === filter.module && - filter.method && - input.event.method === filter.method - ); - }, - filterValidator(filter) { - return; - }, - }, - }, -}; -exports.default = exports.JsonfyDatasourcePlugin; -//# sourceMappingURL=jsonfy.js.map diff --git a/packages/node/test/projectFixture/template-v1.0.0/distMock/chaintypes.js b/packages/node/test/projectFixture/template-v1.0.0/distMock/chaintypes.js deleted file mode 100644 index bbc68b66..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/distMock/chaintypes.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -exports.default = { typesBundle: {} }; diff --git a/packages/node/test/projectFixture/template-v1.0.0/distMock/index.js b/packages/node/test/projectFixture/template-v1.0.0/distMock/index.js deleted file mode 100644 index 10e5e52a..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/distMock/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -const tslib_1 = require('tslib'); -//Exports all handler functions -require('@polkadot/api-augment'); -(0, tslib_1.__exportStar)(require('./mappings/mappingHandlers'), exports); diff --git a/packages/node/test/projectFixture/template-v1.0.0/erc20.abi.json b/packages/node/test/projectFixture/template-v1.0.0/erc20.abi.json deleted file mode 100644 index 405d6b36..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/erc20.abi.json +++ /dev/null @@ -1,222 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "balance", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - }, - { - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "payable": true, - "stateMutability": "payable", - "type": "fallback" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } -] diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test1/project.yaml b/packages/node/test/projectFixture/template-v1.0.0/js/test1/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test1/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test1/types.js b/packages/node/test/projectFixture/template-v1.0.0/js/test1/types.js deleted file mode 100644 index b3a1f136..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test1/types.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, -}; - -Object.defineProperty(exports, '__esModule', { - value: true, -}); - -exports.default = types; diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test2/project.yaml b/packages/node/test/projectFixture/template-v1.0.0/js/test2/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test2/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test2/types.js b/packages/node/test/projectFixture/template-v1.0.0/js/test2/types.js deleted file mode 100644 index 618bfb75..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test2/types.js +++ /dev/null @@ -1,52 +0,0 @@ -const os = require('os'); - -console.log(os.platform); - -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, -}; - -module.exports = types; diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test3/project.yaml b/packages/node/test/projectFixture/template-v1.0.0/js/test3/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test3/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test3/types.js b/packages/node/test/projectFixture/template-v1.0.0/js/test3/types.js deleted file mode 100644 index b35f73b2..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test3/types.js +++ /dev/null @@ -1,48 +0,0 @@ -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, -}; - -module.exports.test = types; diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test4/project.yaml b/packages/node/test/projectFixture/template-v1.0.0/js/test4/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test4/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/template-v1.0.0/js/test4/types.js b/packages/node/test/projectFixture/template-v1.0.0/js/test4/types.js deleted file mode 100644 index 7191fb97..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/js/test4/types.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, - shouldIgnorefield: { - chain2: { - TestType5: 'test', - }, - }, -}; - -Object.defineProperty(exports, '__esModule', { - value: true, -}); - -exports.default = types; diff --git a/packages/node/test/projectFixture/template-v1.0.0/package.json b/packages/node/test/projectFixture/template-v1.0.0/package.json deleted file mode 100644 index b35bd0cf..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "subquery-starter", - "version": "0.0.4", - "description": "This project can be use as a starting point for developing your SubQuery project", - "main": "dist/index.js", - "scripts": { - "build": "tsc -b", - "prepack": "rm -rf dist && npm build", - "test": "jest", - "codegen": "./node_modules/.bin/subql codegen" - }, - "homepage": "https://github.com/subquery/subql-starter", - "repository": "github:subquery/subql-starter", - "files": [ - "dist", - "schema.graphql", - "project.yaml" - ], - "author": "Ian He & Jay Ji", - "license": "Apache-2.0", - "devDependencies": { - "@polkadot/api": "^8", - "@subql/types": "latest", - "typescript": "^4.1.3", - "@subql/cli": "latest" - }, - "resolutions": { - "ipfs-unixfs": "6.0.6" - } -} diff --git a/packages/node/test/projectFixture/template-v1.0.0/project.yaml b/packages/node/test/projectFixture/template-v1.0.0/project.yaml deleted file mode 100644 index 0d153901..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/project.yaml +++ /dev/null @@ -1,91 +0,0 @@ -specVersion: 1.0.0 -name: subquery-query-registry-project -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/node' - version: '>=1.0.0' - query: - name: '@subql/query' - version: '*' -schema: - file: ./schema.graphql -network: - # genesisHash: '0x956876d5b80e47e523a6629b3c3ac3e42f2850ad12e236d87a0aaac87c9f6bc9' # Moonriver - genesisHash: '0x91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527' # Moonbase Alpha - endpoint: wss://moonbeam-alpha.api.onfinality.io/public-ws - dictionary: https://api.subquery.network/sq/subquery/moonbase-alpha-dictionary - - chaintypes: - file: './types.yaml' -dataSources: - - kind: substrate/Moonbeam - startBlock: 1358833 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: settings - address: '0xde030fC2b42AE2438B32506ECf63B2f3c1665579' - assets: - settings: - file: ./src/settings.abi.json - mapping: - file: ./distMock/index.js - handlers: - - handler: handleUpdateSettings - kind: substrate/MoonbeamCall - filter: - function: setAllAddresses(address _sqToken,address _staking,address _indexerRegistry,address _queryRegistry) # add ",address _serviceAgreementRegistry" in later versions - -templates: - - name: QueryRegistry - kind: substrate/Moonbeam - startBlock: 1358829 - processor: - file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - abi: queryRegistry - # address: '0xB0b3f6bc7a8E0bCb2aa1Cd2Ae2dE56fbdA3c0651' - assets: - queryRegistry: - file: ./src/queryRegistry.abi.json - mapping: - file: ./distMock/index.js - handlers: - - handler: handleNewQuery - kind: substrate/MoonbeamEvent - filter: - topics: - - CreateQuery(uint256 queryId, address creator, bytes32 metadata, bytes32 deploymentId, bytes32 version) - - handler: handleUpdateQueryMetadata - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryMetadata(address owner, uint256 queryId, bytes32 metadata) - - handler: handleUpdateQueryDeployment - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateQueryDeployment(address owner, uint256 queryId, bytes32 deploymentId, bytes32 version) - - handler: handleStartIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StartIndexing(address indexer, bytes32 deploymentId) - - handler: handleIndexingUpdate - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateDeploymentStatus(address indexer, bytes32 deploymentId, uint256 blockheight, bytes32 mmrRoot, uint256 timestamp) - - handler: handleIndexingReady - kind: substrate/MoonbeamEvent - filter: - topics: - - UpdateIndexingStatusToReady(address indexer, bytes32 deploymentId, uint256 _timestamp) - - handler: handleStopIndexing - kind: substrate/MoonbeamEvent - filter: - topics: - - StopIndexing(address indexer, bytes32 deploymentId) diff --git a/packages/node/test/projectFixture/template-v1.0.0/types.yaml b/packages/node/test/projectFixture/template-v1.0.0/types.yaml deleted file mode 100644 index 4346d242..00000000 --- a/packages/node/test/projectFixture/template-v1.0.0/types.yaml +++ /dev/null @@ -1,28 +0,0 @@ -types: - TestType: u32 -typesAlias: - Alias: - TestType2: test -typesBundle: - spec: - '2312': - types: - - minmax: - - 232 - - 122 - types: - TestType3: test3 - chain: - mockchain: - types: - - minmax: - - 232 - - 122 - types: - TestType4: test4 -typesChain: - chain2: - TestType5: test -typesSpec: - spec3: - TestType6: test diff --git a/packages/node/test/projectFixture/v1.0.0/package.json b/packages/node/test/projectFixture/v0.0.1/package.json similarity index 85% rename from packages/node/test/projectFixture/v1.0.0/package.json rename to packages/node/test/projectFixture/v0.0.1/package.json index b35bd0cf..2076e80f 100644 --- a/packages/node/test/projectFixture/v1.0.0/package.json +++ b/packages/node/test/projectFixture/v0.0.1/package.json @@ -19,12 +19,9 @@ "author": "Ian He & Jay Ji", "license": "Apache-2.0", "devDependencies": { - "@polkadot/api": "^8", - "@subql/types": "latest", + "@polkadot/api": "^5.7.1", + "@subql/types-ethereum": "latest", "typescript": "^4.1.3", "@subql/cli": "latest" - }, - "resolutions": { - "ipfs-unixfs": "6.0.6" } } diff --git a/packages/common/test/project.yaml b/packages/node/test/projectFixture/v0.0.1/project.yaml similarity index 74% rename from packages/common/test/project.yaml rename to packages/node/test/projectFixture/v0.0.1/project.yaml index 200203b2..98c0b399 100644 --- a/packages/common/test/project.yaml +++ b/packages/node/test/projectFixture/v0.0.1/project.yaml @@ -6,24 +6,21 @@ schema: './schema.graphql' network: endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - types: { - "TestType": "u32" - } - typesAlias: { - Alias: { TestType2: 'test' }, - } - typesBundle: { - spec: { - '2312': { - types: [ { minmax: [ 232, 122 ], types: { TestType3: 'test3' } } ], - }, - }, - chain: { - mockchain: { - types: [ { minmax: [ 232, 122 ], types: { TestType4: 'test4' } } ], - }, - }, - } + types: { 'TestType': 'u32' } + typesAlias: { Alias: { TestType2: 'test' } } + typesBundle: + { + spec: + { + '2312': + { types: [{ minmax: [232, 122], types: { TestType3: 'test3' } }] }, + }, + chain: + { + mockchain: + { types: [{ minmax: [232, 122], types: { TestType4: 'test4' } }] }, + }, + } typesChain: { chain2: { TestType5: 'test' } } typesSpec: { spec3: { TestType6: 'test' } } diff --git a/packages/node/test/projectFixture/template-v1.0.0/schema.graphql b/packages/node/test/projectFixture/v0.0.1/schema.graphql similarity index 100% rename from packages/node/test/projectFixture/template-v1.0.0/schema.graphql rename to packages/node/test/projectFixture/v0.0.1/schema.graphql diff --git a/packages/node/test/projectFixture/v0.2.0/dist/chainTypes.js b/packages/node/test/projectFixture/v0.2.0/dist/chainTypes.js deleted file mode 100644 index be4fb7d2..00000000 --- a/packages/node/test/projectFixture/v0.2.0/dist/chainTypes.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e={3412:function(e,n){var t=this&&this.__rest||function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o>"}},debug:{traceTransaction:{aliasSection:"debug",description:"Debug trace tx",params:[{name:"transaction_hash",type:"H256"}],type:"Result>"}}};const a={AccountId:"EthereumAccountId",Address:"AccountId",Balance:"u128",RefCount:"u8",LookupSource:"AccountId",Account:{nonce:"U256",balance:"u128"}},{RefCount:o}=a,c=t(a,["RefCount"]),i=Object.assign(Object.assign({},c),{ExtrinsicSignature:"EthereumSignature",RoundIndex:"u32",Candidate:{id:"AccountId",fee:"Perbill",bond:"Balance",nominators:"Vec",total:"Balance",state:"ValidatorStatus"},Nominator:{nominations:"Vec",total:"Balance"},Bond:{owner:"AccountId",amount:"Balance"},ValidatorStatus:{_enum:{Active:"Null",Idle:"Null",Leaving:"RoundIndex"}},TxPoolResultContent:{pending:"HashMap>",queued:"HashMap>"},TxPoolResultInspect:{pending:"HashMap>",queued:"HashMap>"},TxPoolResultStatus:{pending:"U256",queued:"U256"},Summary:"Bytes",PoolTransaction:{hash:"H256",nonce:"U256",blockHash:"Option",blockNumber:"Option",from:"H160",to:"Option",value:"U256",gasPrice:"U256",gas:"U256",input:"Bytes"}}),{ValidatorStatus:s}=i,r=t(i,["ValidatorStatus"]),l=Object.assign(Object.assign({},r),{AccountInfo:"AccountInfoWithTripleRefCount",Candidate:{id:"AccountId",fee:"Perbill",bond:"Balance",nominators:"Vec",total:"Balance",state:"CollatorStatus"},CollatorStatus:{_enum:{Active:"Null",Idle:"Null",Leaving:"RoundIndex"}},Range:"RangeBalance",RangeBalance:{min:"Balance",ideal:"Balance",max:"Balance"},RangePerbill:{min:"Perbill",ideal:"Perbill",max:"Perbill"},InflationInfo:{expect:"RangeBalance",annual:"RangePerbill",round:"RangePerbill"},OrderedSet:"Vec",Collator:{id:"AccountId",bond:"Balance",nominators:"Vec",total:"Balance",state:"CollatorStatus"},CollatorSnapshot:{bond:"Balance",nominators:"Vec",total:"Balance"},SystemInherentData:{validationData:"PersistedValidationData",relayChain_state:"StorageProof",downwardMessages:"Vec",horizontalMessages:"BTreeMap>"},RoundInfo:{current:"RoundIndex",first:"BlockNumber",length:"u32"}}),u=Object.assign(Object.assign({},l),{AuthorId:"AccountId"}),d=Object.assign(Object.assign({},u),{AccountId32:"H256",AuthorId:"AccountId32",ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","CancelProxy","Balances","AuthorMapping"]},RelayChainAccountId:"AccountId32",RewardInfo:{totalReward:"Balance",claimedReward:"Balance"}}),m=Object.assign(Object.assign({},d),{Collator2:{id:"AccountId",bond:"Balance",nominators:"Vec",topNominators:"Vec",bottomNominators:"Vec",totalCounted:"Balance",totalBacking:"Balance",state:"CollatorStatus"},NominatorAdded:{_enum:{AddedToBottom:"Null",AddedToTop:"Balance"}},RegistrationInfo:{account:"AccountId",deposit:"Balance"},ParachainBondConfig:{account:"AccountId",percent:"Percent"}}),p=Object.assign(Object.assign({},m),{EthereumSignature:{r:"H256",s:"H256",v:"U8"},NominatorAdded:{_enum:{AddedToTop:"Balance",AddedToBottom:"Null"}}}),b=Object.assign(Object.assign({},p),{NominatorStatus:{_enum:{Active:"Null",Leaving:"RoundIndex"}},Nominator2:{nominations:"Vec",revocations:"Vec",total:"Balance",scheduledRevocationsCount:"u32",scheduledRevocationsTotal:"Balance",status:"NominatorStatus"},ExitQ:{candidates:"Vec",nominatorsLeaving:"Vec",candidateSchedule:"Vec<(AccountId, RoundIndex)>",nominatorSchedule:"Vec<(AccountId, Option, RoundIndex)>"}}),y=Object.assign(Object.assign({},b),{RewardInfo:{totalReward:"Balance",claimedReward:"Balance",contributedRelayAddresses:"Vec"}}),I=Object.assign(Object.assign({},y),{AssetType:{_enum:{Xcm:"MultiLocation"}},AssetId:"u128",TAssetBalance:"u128",ENUM_AccountId32:{network:"NetworkId",id:"[u8; 32]"},ENUM_AccountKey20:{network:"NetworkId",key:"[u8; 20]"},ENUM_AccountIndex64:{network:"NetworkId",index:"Compact"},ENUM_Plurality:{id:"BodyId",part:"BodyPart"},JunctionV0:{_enum:{Parent:"Null",Parachain:"Compact",AccountId32:"ENUM_AccountId32",AccountIndex64:"ENUM_AccountIndex64",AccountKey20:"ENUM_AccountKey20",PalletInstance:"u8",GeneralIndex:"Compact",GeneralKey:"Vec",OnlyChild:"Null",Plurality:"ENUM_Plurality"}},CurrencyId:{_enum:{SelfReserve:"Null",OtherReserve:"u128"}},AssetRegistrarMetadata:{name:"Vec",symbol:"Vec",decimals:"u8",isFrozen:"bool"},VestingBlockNumber:"u32",MultiLocation:"MultiLocationV0"}),A=Object.assign(Object.assign({},I),{JunctionV1:{_enum:{Parachain:"Compact",AccountId32:"ENUM_AccountId32",AccountIndex64:"ENUM_AccountIndex64",AccountKey20:"ENUM_AccountKey20",PalletInstance:"u8",GeneralIndex:"Compact",GeneralKey:"Vec",OnlyChild:"Null",Plurality:"ENUM_Plurality"}},MultiLocation:"MultiLocationV1"}),g=Object.assign(Object.assign({},A),{MoonbaseRuntimeAssetRegistrarMetadata:{name:"Vec",symbol:"Vec",decimals:"u8",is_frozen:"bool"},PalletCrowdloanRewardsRewardInfo:{total_reward:"Balance",claimed_reward:"Balance",contributed_relay_addresses:"Vec"},ParachainStakingNominator2:{nominations:"Vec",revocations:"Vec",total:"Balance",scheduled_revocations_count:"u32",scheduled_revocations_total:"Balance",status:"NominatorStatus"},ParachainStakingExitQ:{candidates:"Vec",nominators_leaving:"Vec",candidate_schedule:"Vec<(AccountId, RoundIndex)>",nominator_schedule:"Vec<(AccountId, Option, RoundIndex)>"},ParachainStakingCollator2:{id:"AccountId",bond:"Balance",nominators:"Vec",top_nominators:"Vec",bottom_nominators:"Vec",total_counted:"Balance",total_backing:"Balance",state:"CollatorStatus"}});n.moonbeamDefinitions={alias:n.moduleDefinitions,rpc:n.rpcDefinitions,instances:{council:["councilCollective"],technicalCommittee:["techCommitteeCollective"]},types:[{minmax:[0,4],types:a},{minmax:[5,5],types:c},{minmax:[6,19],types:i},{minmax:[19,35],types:l},{minmax:[36,36],types:u},{minmax:[37,42],types:d},{minmax:[43,154],types:m},{minmax:[155,199],types:p},{minmax:[200,399],types:b},{minmax:[400,599],types:y},{minmax:[600,799],types:I},{minmax:[800,899],types:A},{minmax:[900,void 0],types:{ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","CancelProxy","Balances","AuthorMapping"]}}}]},n.moonbeamDefinitionsDeprecated=Object.assign(Object.assign({},n.moonbeamDefinitions),{types:[...n.moonbeamDefinitions.types,{minmax:[900,void 0],types:g}]}),n.typesBundlePre900={spec:{moonbeam:n.moonbeamDefinitions,moonbeamDefinitions:n.moonbeamDefinitions,moonbase:n.moonbeamDefinitions,moonriver:n.moonbeamDefinitions}},n.typesBundleDeprecated={spec:{moonbeam:n.moonbeamDefinitionsDeprecated,moonbeamDefinitions:n.moonbeamDefinitionsDeprecated,moonbase:n.moonbeamDefinitionsDeprecated,moonriver:n.moonbeamDefinitionsDeprecated}}}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var c=n[a]={exports:{}};return e[a].call(c.exports,c,c.exports,t),c.exports}var a={};(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0});const n=t(3412);e.default={typesBundle:n.typesBundleDeprecated}})();var o=exports;for(var c in a)o[c]=a[c];a.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/packages/node/test/projectFixture/v0.2.0/dist/index.js b/packages/node/test/projectFixture/v0.2.0/dist/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/node/test/projectFixture/v0.2.0/dist/moonbeam.js b/packages/node/test/projectFixture/v0.2.0/dist/moonbeam.js deleted file mode 100644 index 2fa5fedf..00000000 --- a/packages/node/test/projectFixture/v0.2.0/dist/moonbeam.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see moonbeam.js.LICENSE.txt */ -(()=>{var t={4145:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbiCoder:()=>at,ConstructorFragment:()=>A,ErrorFragment:()=>E,EventFragment:()=>v,FormatTypes:()=>h,Fragment:()=>g,FunctionFragment:()=>_,Indexed:()=>ht,Interface:()=>mt,LogDescription:()=>lt,ParamType:()=>$,TransactionDescription:()=>ct,checkResultErrors:()=>T,defaultAbiCoder:()=>ot});var n=r(2593),i=r(3587),a=r(711);const o="abi/5.5.0",s=new a.Yd(o),d={};let u={calldata:!0,memory:!0,storage:!0},l={calldata:!0,memory:!0};function c(t,e){if("bytes"===t||"string"===t){if(u[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&l[e])return!0;return(u[e]||"payable"===e)&&s.throwArgumentError("invalid modifier","name",e),!1}function f(t,e){for(let r in e)(0,i.zG)(t,r,e[r])}const h=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=new RegExp(/^(.*)\[([0-9]*)\]$/);class ${constructor(t,e){t!==d&&s.throwError("use fromString",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,e);let r=this.type.match(p);f(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:$.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==h.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===h.full?", ":",")+")"):e+=this.type,t!==h.sighash&&(!0===this.indexed&&(e+=" indexed"),t===h.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?$.fromString(t,e):$.fromObject(t)}static fromObject(t){return $.isParamType(t)?t:new $(d,{name:t.name||null,type:S(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map($.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){s.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let r=0;r$.fromString(t,e)))}class g{constructor(t,e){t!==d&&s.throwError("use a static from method",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return g.isFragment(t)?t:"string"==typeof t?g.fromString(t):g.fromObject(t)}static fromObject(t){if(g.isFragment(t))return t;switch(t.type){case"function":return _.fromObject(t);case"event":return v.fromObject(t);case"constructor":return A.fromObject(t);case"error":return E.fromObject(t);case"fallback":case"receive":return null}return s.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?_.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?A.fromString(t.trim()):"error"===t.split(" ")[0]?E.fromString(t.substring(5).trim()):s.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class v extends g{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==h.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ",t!==h.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?v.fromString(t):v.fromObject(t)}static fromObject(t){if(v.isEventFragment(t))return t;"event"!==t.type&&s.throwArgumentError("invalid event object","value",t);const e={name:I(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map($.fromObject):[],type:"event"};return new v(d,e)}static fromString(t){let e=t.match(O);e||s.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:s.warn("unknown modifier: "+t)}})),v.fromObject({name:e[1].trim(),anonymous:r,inputs:m(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function y(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&s.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||s.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=n.O$.from(r[1]),r[0]):t}function b(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function M(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&s.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&s.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||s.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&s.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&s.throwArgumentError("unable to determine stateMutability","value",t),e}class A extends g{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});t===h.sighash&&s.throwError("cannot format a constructor for sighash",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?A.fromString(t):A.fromObject(t)}static fromObject(t){if(A.isConstructorFragment(t))return t;"constructor"!==t.type&&s.throwArgumentError("invalid constructor object","value",t);let e=M(t);e.constant&&s.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map($.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new A(d,r)}static fromString(t){let e={type:"constructor"},r=(t=y(t,e)).match(O);return r&&"constructor"===r[1].trim()||s.throwArgumentError("invalid constructor string","value",t),e.inputs=m(r[2].trim(),!1),b(r[3].trim(),e),A.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class _ extends A{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==h.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ",t!==h.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?_.fromString(t):_.fromObject(t)}static fromObject(t){if(_.isFunctionFragment(t))return t;"function"!==t.type&&s.throwArgumentError("invalid function object","value",t);let e=M(t);const r={type:t.type,name:I(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map($.fromObject):[],outputs:t.outputs?t.outputs.map($.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new _(d,r)}static fromString(t){let e={type:"function"},r=(t=y(t,e)).split(" returns ");r.length>2&&s.throwArgumentError("invalid function string","value",t);let n=r[0].match(O);if(n||s.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&I(e.name),e.inputs=m(n[2],!1),b(n[3].trim(),e),r.length>1){let n=r[1].match(O);""==n[1].trim()&&""==n[3].trim()||s.throwArgumentError("unexpected tokens","value",t),e.outputs=m(n[2],!1)}else e.outputs=[];return _.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function w(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||s.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class E extends g{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==h.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?E.fromString(t):E.fromObject(t)}static fromObject(t){if(E.isErrorFragment(t))return t;"error"!==t.type&&s.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:I(t.name),inputs:t.inputs?t.inputs.map($.fromObject):[]};return w(new E(d,e))}static fromString(t){let e={type:"error"},r=t.match(O);return r||s.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&I(e.name),e.inputs=m(r[2],!1),w(E.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function S(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const N=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function I(t){return t&&t.match(N)||s.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const O=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var x=r(3286);const C=new a.Yd(o);function T(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){const a=t.slice();a.push(i);try{r(a,n[i])}catch(t){e.push({path:a,error:t})}}};return r([],t),e}class P{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){C.throwArgumentError(t,this.localName,e)}}class R{constructor(t){(0,i.zG)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return(0,x.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData((0,x.concat)(t._data))}writeBytes(t){let e=(0,x.arrayify)(t);const r=e.length%this.wordSize;return r&&(e=(0,x.concat)([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=(0,x.arrayify)(n.O$.from(t));return e.length>this.wordSize&&C.throwError("value out-of-bounds",a.Yd.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,x.concat)([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class F{constructor(t,e,r,n){(0,i.zG)(this,"_data",(0,x.arrayify)(t)),(0,i.zG)(this,"wordSize",e||32),(0,i.zG)(this,"_coerceFunc",r),(0,i.zG)(this,"allowLoose",n),this._offset=0}get data(){return(0,x.hexlify)(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):F.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:C.throwError("data out-of-bounds",a.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new F(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return n.O$.from(this.readBytes(this.wordSize))}}var L=r(4594);class B extends P{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=(0,L.Kn)(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return(0,L.Kn)((0,x.hexZeroPad)(t.readValue().toHexString(),20))}}class D extends P{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const U=new a.Yd(o);function k(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||U.throwError("cannot encode object for signature with missing names",a.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&U.throwError("cannot encode object for signature with duplicate names",a.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else U.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&U.throwArgumentError("types/value length mismatch","tuple",r);let i=new R(t.wordSize),o=new R(t.wordSize),s=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=o.length;t.encode(o,r);let n=i.writeUpdatableValue();s.push((t=>{n(t+e)}))}else t.encode(i,r)})),s.forEach((t=>{t(i.length)}));let d=t.appendWriter(i);return d+=t.appendWriter(o),d}function Z(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readValue(),o=n.subReader(r.toNumber());try{i=e.decode(o)}catch(t){if(t.code===a.Yd.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===a.Yd.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));const i=e.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach(((t,e)=>{let n=t.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const a=r[e];a instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw a}}):r[n]=a}));for(let t=0;t{throw e}})}return Object.freeze(r)}class j extends P{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;rt._data.length&&U.throwError("insufficient data length",a.Yd.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t{t.dynamic&&(r=!0),n.push(t.type)})),super("tuple","tuple("+n.join(",")+")",e,r),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}encode(t,e){return k(t,this.coders,e)}decode(t){return t.coerce(this.name,Z(t,this.coders))}}const rt=new a.Yd(o),nt=new RegExp(/^bytes([0-9]*)$/),it=new RegExp(/^(u?int)([0-9]*)$/);class at{constructor(t){rt.checkNew(new.target,at),(0,i.zG)(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new B(t.name);case"bool":return new G(t.name);case"string":return new tt(t.name);case"bytes":return new H(t.name);case"array":return new j(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new et((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new K(t.name)}let e=t.type.match(it);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&rt.throwArgumentError("invalid "+e[1]+" bit length","param",t),new X(r/8,"int"===e[1],t.name)}if(e=t.type.match(nt),e){let r=parseInt(e[1]);return(0===r||r>32)&&rt.throwArgumentError("invalid bytes length","param",t),new z(r,t.name)}return rt.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new F(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new R(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder($.from(t))));return new et(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&rt.throwError("types/values length mismatch",a.Yd.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder($.from(t)))),n=new et(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){const n=t.map((t=>this._getCoder($.from(t))));return new et(n,"_").decode(this._getReader((0,x.arrayify)(e),r))}}const ot=new at;var st=r(2046),dt=r(8197);const ut=new a.Yd(o);class lt extends i.dk{}class ct extends i.dk{}class ft extends i.dk{}class ht extends i.dk{static isIndexed(t){return!(!t||!t._isIndexed)}}const pt={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function $t(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class mt{constructor(t){ut.checkNew(new.target,mt);let e=[];e="string"==typeof t?JSON.parse(t):t,(0,i.zG)(this,"fragments",e.map((t=>g.from(t))).filter((t=>null!=t))),(0,i.zG)(this,"_abiCoder",(0,i.tu)(new.target,"getAbiCoder")()),(0,i.zG)(this,"functions",{}),(0,i.zG)(this,"errors",{}),(0,i.zG)(this,"events",{}),(0,i.zG)(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void ut.warn("duplicate definition - constructor"):void(0,i.zG)(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();e[r]?ut.warn("duplicate definition - "+r):e[r]=t})),this.deploy||(0,i.zG)(this,"deploy",A.from({payable:!1,type:"constructor"})),(0,i.zG)(this,"_isInterface",!0)}format(t){t||(t=h.full),t===h.sighash&&ut.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===h.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return ot}static getAddress(t){return(0,L.Kn)(t)}static getSighash(t){return(0,x.hexDataSlice)((0,st.id)(t.format()),0,4)}static getEventTopic(t){return(0,st.id)(t.format())}getFunction(t){if((0,x.isHexString)(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];ut.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===r.length?ut.throwArgumentError("no matching function","name",e):r.length>1&&ut.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[_.fromString(t).format()];return e||ut.throwArgumentError("no matching function","signature",t),e}getEvent(t){if((0,x.isHexString)(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];ut.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===r.length?ut.throwArgumentError("no matching event","name",e):r.length>1&&ut.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[v.fromString(t).format()];return e||ut.throwArgumentError("no matching event","signature",t),e}getError(t){if((0,x.isHexString)(t)){const e=(0,i.tu)(this.constructor,"getSighash");for(const r in this.errors)if(t===e(this.errors[r]))return this.errors[r];ut.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===r.length?ut.throwArgumentError("no matching error","name",e):r.length>1&&ut.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[_.fromString(t).format()];return e||ut.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return(0,i.tu)(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),(0,i.tu)(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const r=(0,x.arrayify)(e);return(0,x.hexlify)(r.slice(0,4))!==this.getSighash(t)&&ut.throwArgumentError(`data signature does not match error ${t.name}.`,"data",(0,x.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),(0,x.hexlify)((0,x.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=(0,x.arrayify)(e);return(0,x.hexlify)(r.slice(0,4))!==this.getSighash(t)&&ut.throwArgumentError(`data signature does not match function ${t.name}.`,"data",(0,x.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,x.hexlify)((0,x.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,x.arrayify)(e),n=null,i=null,o=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=(0,x.hexlify)(r.slice(0,4)),e=pt[t];if(e)i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.signature,e.reason&&(n=i[0]);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.format()}catch(t){console.log(t)}break}}return ut.throwError("call revert exception",a.Yd.errors.CALL_EXCEPTION,{method:t.format(),errorArgs:i,errorName:o,errorSignature:s,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,x.hexlify)(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&ut.throwError("too many arguments for "+t.format(),a.Yd.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?(0,st.id)(e):"bytes"===t.type?(0,dt.w)((0,x.hexlify)(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),(0,x.hexZeroPad)((0,x.hexlify)(e),32));for(e.forEach(((e,i)=>{let a=t.inputs[i];a.indexed?null==e?r.push(null):"array"===a.baseType||"tuple"===a.baseType?ut.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,e):Array.isArray(e)?r.push(e.map((t=>n(a,t)))):r.push(n(a,e)):null!=e&&ut.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&ut.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,a)=>{const o=e[a];if(t.indexed)if("string"===t.type)r.push((0,st.id)(o));else if("bytes"===t.type)r.push((0,dt.w)(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[o]))}else n.push(t),i.push(o)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);(0,x.isHexString)(r[0],32)&&r[0].toLowerCase()===e||ut.throwError("fragment/topic mismatch",a.Yd.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push($.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(n.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let s=null!=r?this._abiCoder.decode(n,(0,x.concat)(r)):null,d=this._abiCoder.decode(i,e,!0),u=[],l=0,c=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==s)u[e]=new ht({_isIndexed:!0,hash:null});else if(o[e])u[e]=new ht({_isIndexed:!0,hash:s[c++]});else try{u[e]=s[c++]}catch(t){u[e]=t}else try{u[e]=d[l++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw $t(`property ${JSON.stringify(t.name)}`,r)}}):u[t.name]=r}}));for(let t=0;t{throw $t(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new ct({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:n.O$.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new lt({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=(0,x.hexlify)(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new ft({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!(!t||!t._isInterface)}}},4594:(t,e,r)=>{"use strict";r.d(e,{Kn:()=>c});var n=r(3286),i=r(2593),a=r(8197);const o=new(r(711).Yd)("address/5.5.0");function s(t){(0,n.isHexString)(t,20)||o.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=(0,n.arrayify)((0,a.w)(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const d={};for(let t=0;t<10;t++)d[String(t)]=String(t);for(let t=0;t<26;t++)d[String.fromCharCode(65+t)]=String(10+t);const u=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));var l;function c(t){let e=null;if("string"!=typeof t&&o.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=s(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&o.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>d[t])).join("");for(;e.length>=u;){let t=e.substring(0,u);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&o.throwArgumentError("bad icap checksum","address",t),e=(0,i.g$)(t.substring(4));e.length<40;)e="0"+e;e=s("0x"+e)}else o.throwArgumentError("invalid address","address",t);return e}},8794:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="bignumber/5.5.0"},2593:(t,e,r)=>{"use strict";r.d(e,{Zm:()=>f,O$:()=>p,g$:()=>y,t2:()=>b});var n=r(3550),i=r.n(n),a=r(3286),o=r(711),s=r(8794),d=i().BN;const u=new o.Yd(s.i),l={},c=9007199254740991;function f(t){return null!=t&&(p.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||(0,a.isHexString)(t)||"bigint"==typeof t||(0,a.isBytes)(t))}let h=!1;class p{constructor(t,e){u.checkNew(new.target,p),t!==l&&u.throwError("cannot call constructor directly; use BigNumber.from",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return m(g(this).fromTwos(t))}toTwos(t){return m(g(this).toTwos(t))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(t){return m(g(this).add(g(t)))}sub(t){return m(g(this).sub(g(t)))}div(t){return p.from(t).isZero()&&v("division by zero","div"),m(g(this).div(g(t)))}mul(t){return m(g(this).mul(g(t)))}mod(t){const e=g(t);return e.isNeg()&&v("cannot modulo negative values","mod"),m(g(this).umod(e))}pow(t){const e=g(t);return e.isNeg()&&v("cannot raise to negative values","pow"),m(g(this).pow(e))}and(t){const e=g(t);return(this.isNegative()||e.isNeg())&&v("cannot 'and' negative values","and"),m(g(this).and(e))}or(t){const e=g(t);return(this.isNegative()||e.isNeg())&&v("cannot 'or' negative values","or"),m(g(this).or(e))}xor(t){const e=g(t);return(this.isNegative()||e.isNeg())&&v("cannot 'xor' negative values","xor"),m(g(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&v("cannot mask negative values","mask"),m(g(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&v("cannot shift negative values","shl"),m(g(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&v("cannot shift negative values","shr"),m(g(this).shrn(t))}eq(t){return g(this).eq(g(t))}lt(t){return g(this).lt(g(t))}lte(t){return g(this).lte(g(t))}gt(t){return g(this).gt(g(t))}gte(t){return g(this).gte(g(t))}isNegative(){return"-"===this._hex[0]}isZero(){return g(this).isZero()}toNumber(){try{return g(this).toNumber()}catch(t){v("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return u.throwError("this platform does not support BigInt",o.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.Yd.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",o.Yd.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof p)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new p(l,$(t)):t.match(/^-?[0-9]+$/)?new p(l,$(new d(t))):u.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&v("underflow","BigNumber.from",t),(t>=c||t<=-c)&&v("overflow","BigNumber.from",t),p.from(String(t));const e=t;if("bigint"==typeof e)return p.from(e.toString());if((0,a.isBytes)(e))return p.from((0,a.hexlify)(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return p.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&((0,a.isHexString)(t)||"-"===t[0]&&(0,a.isHexString)(t.substring(1))))return p.from(t)}return u.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function $(t){if("string"!=typeof t)return $(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&u.throwArgumentError("invalid hex","value",t),"0x00"===(t=$(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function m(t){return p.from($(t))}function g(t){const e=p.from(t).toHexString();return"-"===e[0]?new d("-"+e.substring(3),16):new d(e.substring(2),16)}function v(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),u.throwError(t,o.Yd.errors.NUMERIC_FAULT,n)}function y(t){return new d(t,36).toString(16)}function b(t){return new d(t,16).toString(36)}},2092:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BigNumber:()=>n.O$,FixedFormat:()=>m,FixedNumber:()=>g,_base16To36:()=>n.t2,_base36To16:()=>n.g$,formatFixed:()=>p,parseFixed:()=>$});var n=r(2593),i=r(3286),a=r(711),o=r(8794);const s=new a.Yd(o.i),d={},u=n.O$.from(0),l=n.O$.from(-1);function c(t,e,r,n){const i={fault:e,operation:r};return void 0!==n&&(i.value=n),s.throwError(t,a.Yd.errors.NUMERIC_FAULT,i)}let f="0";for(;f.length<256;)f+=f;function h(t){if("number"!=typeof t)try{t=n.O$.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+f.substring(0,t):s.throwArgumentError("invalid decimal size","decimals",t)}function p(t,e){null==e&&(e=0);const r=h(e),i=(t=n.O$.from(t)).lt(u);i&&(t=t.mul(l));let a=t.mod(r).toString();for(;a.length2&&s.throwArgumentError("too many decimal points","value",t);let o=a[0],d=a[1];for(o||(o="0"),d||(d="0");"0"===d[d.length-1];)d=d.substring(0,d.length-1);for(d.length>r.length-1&&c("fractional component exceeds decimals","underflow","parseFixed"),""===d&&(d="0");d.lengthnull==t[e]?n:(typeof t[e]!==r&&s.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&s.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&s.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new m(d,e,r,n)}}class g{constructor(t,e,r,n){s.checkNew(new.target,g),t!==d&&s.throwError("cannot use FixedNumber constructor; use FixedNumber.from",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&s.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=g.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(v.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=g.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(v.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&s.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=g.from("1"+f.substring(0,t),this.format),n=y.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&s.throwArgumentError("invalid byte width","width",t);const e=n.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,i.hexZeroPad)(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return g.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||(0,n.Zm)(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),g.fromString(p(t,e),m.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=m.from(e),n=$(t,r.decimals);!r.signed&&n.lt(u)&&c("unsigned value cannot be negative","overflow","value",t);let a=null;r.signed?a=n.toTwos(r.width).toHexString():(a=n.toHexString(),a=(0,i.hexZeroPad)(a,r.width/8));const o=p(n,r.decimals);return new g(d,a,o,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=m.from(e);if((0,i.arrayify)(t).length>r.width/8)throw new Error("overflow");let a=n.O$.from(t);r.signed&&(a=a.fromTwos(r.width));const o=a.toTwos((r.signed?0:1)+r.width).toHexString(),s=p(a,r.decimals);return new g(d,o,s,r)}static from(t,e){if("string"==typeof t)return g.fromString(t,e);if((0,i.isBytes)(t))return g.fromBytes(t,e);try{return g.fromValue(t,0,e)}catch(t){if(t.code!==a.Yd.errors.INVALID_ARGUMENT)throw t}return s.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const v=g.from(1),y=g.from("0.5")},3286:(t,e,r)=>{"use strict";r.r(e),r.d(e,{arrayify:()=>u,concat:()=>l,hexConcat:()=>v,hexDataLength:()=>m,hexDataSlice:()=>g,hexStripZeros:()=>b,hexValue:()=>y,hexZeroPad:()=>M,hexlify:()=>$,isBytes:()=>d,isBytesLike:()=>o,isHexString:()=>h,joinSignature:()=>_,splitSignature:()=>A,stripZeros:()=>c,zeroPad:()=>f});const n=new(r(711).Yd)("bytes/5.5.0");function i(t){return!!t.toHexString}function a(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return a(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function o(t){return h(t)&&!(t.length%2)||d(t)}function s(t){return"number"==typeof t&&t==t&&t%1==0}function d(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!s(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function u(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),a(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t)&&(t=t.toHexString()),h(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;tu(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),a(n)}function c(t){let e=u(t);if(0===e.length)return e;let r=0;for(;re&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),a(r)}function h(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const p="0123456789abcdef";function $(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=p[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t))return t.toHexString();if(h(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(d(t)){let e="0x";for(let r=0;r>4]+p[15&n]}return e}return n.throwArgumentError("invalid hexlify value","value",t)}function m(t){if("string"!=typeof t)t=$(t);else if(!h(t)||t.length%2)return null;return(t.length-2)/2}function g(t,e,r){return"string"!=typeof t?t=$(t):(!h(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function v(t){let e="0x";return t.forEach((t=>{e+=$(t).substring(2)})),e}function y(t){const e=b($(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function b(t){"string"!=typeof t&&(t=$(t)),h(t)||n.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function A(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(o(t)){const r=u(t);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",t),e.r=$(r.slice(0,32)),e.s=$(r.slice(32,64)),e.v=r[64],e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=$(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=f(u(e._vs),32);e._vs=$(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const a=$(r);null==e.s?e.s=a:e.s!==a&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&h(e.r)?e.r=M(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&h(e.s)?e.s=M(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);const r=u(e.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=$(r);e._vs&&(h(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=M(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e}function _(t){return $(l([(t=A(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},2046:(t,e,r)=>{"use strict";r.d(e,{id:()=>a});var n=r(8197),i=r(4242);function a(t){return(0,n.w)((0,i.Y0)(t))}},5555:(t,e,r)=>{"use strict";r.r(e),r.d(e,{_TypedDataEncoder:()=>V,hashMessage:()=>S,id:()=>n.id,isValidName:()=>_,messagePrefix:()=>E,namehash:()=>w});var n=r(2046),i=r(3286),a=r(4242);function o(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach((t=>{let i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function s(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}function d(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}const u=s("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),l="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),c=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],f=o("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),h=o("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),p=o("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r{if(l.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=d(t,c);if(e)return[t+e.s];let r=f[t];if(r)return r;let n=h[t];return n?[t+n[0]]:p[t]||null}(t);return e||[t]})),e=r.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=(0,a.XL)((0,a.uu)(e),a.Uj.NFKC),e.forEach((t=>{if(d(t,$))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(d(t,u))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=(0,a.uu)(e);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}var g=r(8197),v=r(711);const y="hash/5.5.0",b=new v.Yd(y),M=new Uint8Array(32);M.fill(0);const A=new RegExp("^((.*)\\.)?([^.]+)$");function _(t){try{const e=t.split(".");for(let t=0;t256||e[2]&&e[2]!==String(n))&&x.throwArgumentError("invalid numeric width","type",t);const a=F.mask(r?n-1:n),o=r?a.add(R).mul(T):P;return function(e){const r=I.O$.from(e);return(r.lt(o)||r.gt(a))&&x.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),(0,i.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&x.throwArgumentError("invalid bytes width","type",t),function(e){return(0,i.arrayify)(e).length!==r&&x.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=(0,i.arrayify)(t),r=e.length%32;return r?(0,i.hexConcat)([e,C.slice(r)]):(0,i.hexlify)(e)}(e)}}}switch(t){case"address":return function(t){return(0,i.hexZeroPad)((0,N.Kn)(t),32)};case"bool":return function(t){return t?L:B};case"bytes":return function(t){return(0,g.w)(t)};case"string":return function(t){return(0,n.id)(t)}}return null}function G(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class V{constructor(t){(0,O.zG)(this,"types",Object.freeze((0,O.p$)(t))),(0,O.zG)(this,"_encoderCache",{}),(0,O.zG)(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((a=>{i[a.name]&&x.throwArgumentError(`duplicate variable name ${JSON.stringify(a.name)} in ${JSON.stringify(n)}`,"types",t),i[a.name]=!0;const o=a.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===n&&x.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),j(o)||(r[o]||x.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",t),r[o].push(n),e[n][o]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?x.throwArgumentError("missing primary type","types",t):i.length>1&&x.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),(0,O.zG)(this,"primaryType",i[0]),function i(a,o){o[a]&&x.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",t),o[a]=!0,Object.keys(e[a]).forEach((t=>{r[t]&&(i(t,o),Object.keys(o).forEach((e=>{n[e][t]=!0})))})),delete o[a]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=G(e,t[e])+r.map((e=>G(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=j(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&x.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let a=e.map(r);return this._types[t]&&(a=a.map(g.w)),(0,g.w)((0,i.hexConcat)(a))}}const r=this.types[t];if(r){const e=(0,n.id)(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?(0,g.w)(n):n}));return n.unshift(e),(0,i.hexConcat)(n)}}return x.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||x.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return(0,g.w)(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(j(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&x.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):x.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new V(t)}static getPrimaryType(t){return V.from(t).primaryType}static hashStruct(t,e,r){return V.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=D[r];n||x.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>U.indexOf(t.name)-U.indexOf(e.name))),V.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return(0,i.hexConcat)(["0x1901",V.hashDomain(t),V.from(e).hash(r)])}static hash(t,e,r){return(0,g.w)(V.encode(t,e,r))}static resolveNames(t,e,r,n){return a=this,o=void 0,d=function*(){t=(0,O.DC)(t);const a={};t.verifyingContract&&!(0,i.isHexString)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=V.from(e);o.visit(r,((t,e)=>("address"!==t||(0,i.isHexString)(e,20)||(a[e]="0x"),e)));for(const t in a)a[t]=yield n(t);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&a[e]?a[e]:e)),{domain:t,value:r}},new((s=void 0)||(s=Promise))((function(t,e){function r(t){try{i(d.next(t))}catch(t){e(t)}}function n(t){try{i(d.throw(t))}catch(t){e(t)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(r,n)}i((d=d.apply(a,o||[])).next())}));var a,o,s,d}static getPayload(t,e,r){V.hashDomain(t);const n={},a=[];U.forEach((e=>{const r=t[e];null!=r&&(n[e]=Z[e](r),a.push({name:e,type:D[e]}))}));const o=V.from(e),s=(0,O.DC)(e);return s.EIP712Domain?x.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=a,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return(0,i.hexlify)((0,i.arrayify)(e));if(t.match(/^u?int/))return I.O$.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&x.throwArgumentError("invalid string","value",e),e}return x.throwArgumentError("unsupported type","type",t)}))}}}},8197:(t,e,r)=>{"use strict";r.d(e,{w:()=>o});var n=r(1094),i=r.n(n),a=r(3286);function o(t){return"0x"+i().keccak_256((0,a.arrayify)(t))}},711:(t,e,r)=>{"use strict";r.d(e,{Yd:()=>f});let n=!1,i=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let o=a.default,s=null;const d=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var u,l;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(u||(u={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(l||(l={}));const c="0123456789abcdef";class f{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",t),o>a[r]||console.log.apply(console,e)}debug(...t){this._log(f.levels.DEBUG,t)}info(...t){this._log(f.levels.INFO,t)}warn(...t){this._log(f.levels.WARNING,t)}makeError(t,e,r){if(i)return this.makeError("censored error",e,{});e||(e=f.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=c[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(e){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const a=t;n.length&&(t+=" ("+n.join(", ")+")");const o=new Error(t);return o.reason=a,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,f.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),d&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:d})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,f.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",f.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",f.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",f.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return s||(s=new f("logger/5.5.0")),s}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!t)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!t,n=!!e}static setLogLevel(t){const e=a[t.toLowerCase()];null!=e?o=e:f.globalLogger().warn("invalid log level - "+t)}static from(t){return new f(t)}}f.errors=l,f.levels=u},3587:(t,e,r)=>{"use strict";r.d(e,{dk:()=>c,p$:()=>l,zG:()=>i,tu:()=>a,DC:()=>o});const n=new(r(711).Yd)("properties/5.5.0");function i(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function a(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function o(t){const e={};for(const r in t)e[r]=t[r];return e}const s={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function d(t){if(null==t||s[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rl(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&i(e,r,l(n))}return e}return n.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function l(t){return u(t)}class c{constructor(t){for(const e in t)this[e]=l(t[e])}}},4242:(t,e,r)=>{"use strict";r.d(e,{Uj:()=>a,uu:()=>c,Y0:()=>l,XL:()=>h,ZN:()=>f});var n=r(3286);const i=new(r(711).Yd)("strings/5.5.0");var a,o;function s(t,e,r,n,i){if(t===o.BAD_PREFIX||t===o.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n>6==2;n++)t++;return t}return t===o.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(a||(a={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(o||(o={}));const d=Object.freeze({error:function(t,e,r,n,a){return i.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:s,replace:function(t,e,r,n,i){return t===o.OVERLONG?(n.push(i),0):(n.push(65533),s(t,e,r))}});function u(t,e){null==e&&(e=d.error),t=(0,n.arrayify)(t);const r=[];let i=0;for(;i>7==0){r.push(n);continue}let a=null,s=null;if(192==(224&n))a=1,s=127;else if(224==(240&n))a=2,s=2047;else{if(240!=(248&n)){i+=e(128==(192&n)?o.UNEXPECTED_CONTINUE:o.BAD_PREFIX,i-1,t,r);continue}a=3,s=65535}if(i-1+a>=t.length){i+=e(o.OVERRUN,i-1,t,r);continue}let d=n&(1<<8-a-1)-1;for(let n=0;n1114111?i+=e(o.OUT_OF_RANGE,i-1-a,t,r,d):d>=55296&&d<=57343?i+=e(o.UTF16_SURROGATE,i-1-a,t,r,d):d<=s?i+=e(o.OVERLONG,i-1-a,t,r,d):r.push(d))}return r}function l(t,e=a.current){e!=a.current&&(i.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&n)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function c(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function f(t,e){return c(u(t,e))}function h(t,e=a.current){return u(l(t,e))}},7852:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,r,o):i(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0}),e.MoonbeamDatasourcePlugin=e.TopicFilterValidator=void 0;const a=r(4145),o=r(2092),s=r(3286),d=r(5799),u=r(5230),l=r(3760),c=r(180);let f=class{validate(t){try{return!(t&&("string"==typeof t?!(0,c.eventToTopic)(t):!Array.isArray(t)||!t.map((t=>!(0,c.eventToTopic)(t)))))}catch(t){return!1}}defaultMessage(){return"Value must be either null, undefined, hex string or hex string[]"}};f=n([(0,l.ValidatorConstraint)({name:"topifFilterValidator",async:!1})],f),e.TopicFilterValidator=f;class h{}n([(0,l.IsOptional)(),(0,l.IsString)(),i("design:type",String)],h.prototype,"abi",void 0),n([(0,l.IsOptional)(),(0,l.IsEthereumAddress)(),i("design:type",String)],h.prototype,"address",void 0);class p{}n([(0,l.IsOptional)(),(0,l.Validate)(f,{each:!0}),i("design:type",Array)],p.prototype,"topics",void 0);class ${}function m(t){const e=t.events.find((t=>"ethereum"===t.event.section&&"Executed"===t.event.method));if(!e)throw new Error("eth execution failed");const[r,n,i,a]=e.event.data;return{from:r.toHex(),to:n.toHex(),hash:i.toHex(),status:a}}async function g(t,e){}n([(0,l.IsOptional)(),(0,l.IsEthereumAddress)(),i("design:type",String)],$.prototype,"from",void 0),n([(0,l.IsOptional)(),(0,l.IsString)(),i("design:type",String)],$.prototype,"function",void 0);const v={};function y(t,e){var r,n,i;const o=null===(n=null===(r=t.processor)||void 0===r?void 0:r.options)||void 0===n?void 0:n.abi;if(o){if(!(null===(i=t.assets)||void 0===i?void 0:i.get(o)))throw new Error(`ABI named "${o}" not referenced in assets`);if(!v[o])try{v[o]=new a.Interface(e[o])}catch(t){throw global.logger.error(`Unable to parse ABI: ${t.message}`),new Error("ABI is invalid")}return v[o]}}const b={baseFilter:[{module:"evm",method:"Log"}],baseHandlerKind:d.SubqlHandlerKind.Event,async transformer(t,e,r,n){var i,a,o,s;const[d]=t.event.data,u=Array.isArray(b.baseFilter)?b.baseFilter:[b.baseFilter],l=null!==(a=null===(i=t.extrinsic)||void 0===i?void 0:i.events.filter((t=>u.find((e=>e.module===t.event.section&&e.method===t.event.method)))))&&void 0!==a?a:[],{hash:c}=m(t.extrinsic),f=Object.assign(Object.assign({},d.toJSON()),{blockNumber:t.block.block.header.number.toNumber(),blockHash:await g(0,t.block.block.header.number.toNumber()),blockTimestamp:t.block.timestamp,transactionIndex:null!==(s=null===(o=t.extrinsic)||void 0===o?void 0:o.idx)&&void 0!==s?s:-1,transactionHash:c,removed:!1,logIndex:l.indexOf(t)});try{const t=y(e,n);f.args=null==t?void 0:t.parseLog(f).args}catch(t){global.logger.warn(`Unable to parse log arguments, will be omitted from result: ${t.message}`)}return f},filterProcessor(t,e,r){var n,i;const[a]=e.event.data,o=a;if((null===(i=null===(n=r.processor)||void 0===n?void 0:n.options)||void 0===i?void 0:i.address)&&!(0,c.stringNormalizedEq)(r.processor.options.address,o.address.toString()))return!1;if(null==t?void 0:t.topics)for(let e=0;e(0,c.hexStringEq)((0,c.eventToTopic)(t),o.topics[e].toHex()))))return!1}return!0},filterValidator(t){if(!t)return;const e=(0,u.plainToClass)(p,t),r=(0,l.validateSync)(e,{whitelist:!0,forbidNonWhitelisted:!0});if(null==r?void 0:r.length){const t=r.map((t=>t.toString())).join("\n");throw new Error(`Invalid Moonbeam event filter.\n${t}`)}}},M={baseFilter:[{module:"ethereum",method:"transact"}],baseHandlerKind:d.SubqlHandlerKind.Call,async transformer(t,e,r,n){const[i]=t.extrinsic.method.args,a=i.toJSON();let d,u,l,c;try{const e=m(t);d=e.from,l=e.to,u=e.hash,c=e.status.isSucceed}catch(t){c=!1}const f=Object.assign(Object.assign({from:d,to:l,nonce:a.nonce,gasLimit:o.BigNumber.from(a.gasLimit),gasPrice:o.BigNumber.from(a.gasPrice),data:a.input,value:o.BigNumber.from(a.value),chainId:void 0},a.signature),{hash:u,blockNumber:t.block.block.header.number.toNumber(),blockHash:await g(0,t.block.block.header.number.toNumber()),timestamp:Math.round(t.block.timestamp.getTime()/1e3),success:c});try{const t=y(e,n);f.args=null==t?void 0:t.decodeFunctionData(t.getFunction((0,s.hexDataSlice)(f.data,0,4)),f.data)}catch(t){global.logger.warn("Unable to parse call arguments, will be omitted from result")}return f},filterProcessor(t,e,r){var n,i,a,o;try{const{from:s,to:d}=m(e);if((null==t?void 0:t.from)&&!(0,c.stringNormalizedEq)(t.from,s))return!1;const[u]=e.extrinsic.method.args;return!((null===(i=null===(n=r.processor)||void 0===n?void 0:n.options)||void 0===i?void 0:i.address)&&!(0,c.stringNormalizedEq)(r.processor.options.address,d)||null===(null===(o=null===(a=r.processor)||void 0===a?void 0:a.options)||void 0===o?void 0:o.address)&&!u.action.isCreate||(null==t?void 0:t.function)&&0!==u.input.toHex().indexOf((0,c.functionToSighash)(t.function)))}catch(t){return global.logger.warn("Unable to properly filter input"),!1}},filterValidator(t){if(!t)return;const e=(0,u.plainToClass)($,t),r=(0,l.validateSync)(e,{whitelist:!0,forbidNonWhitelisted:!0});if(null==r?void 0:r.length){const t=r.map((t=>t.toString())).join("\n");throw new Error(`Invalid Moonbeam call filter.\n${t}`)}}};e.MoonbeamDatasourcePlugin={kind:"substrate/Moonbeam",validate(t,e){if(t.processor.options){const e=(0,u.plainToClass)(h,t.processor.options),r=(0,l.validateSync)(e,{whitelist:!0,forbidNonWhitelisted:!0});if(null==r?void 0:r.length){const t=r.map((t=>t.toString())).join("\n");throw new Error(`Invalid Moonbeam call filter.\n${t}`)}}y(t,e)},dsFilterProcessor(t){return t.kind===this.kind},handlerProcessors:{"substrate/MoonbeamEvent":b,"substrate/MoonbeamCall":M}},e.default=e.MoonbeamDatasourcePlugin},180:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.functionToSighash=e.eventToTopic=e.hexStringEq=e.stringNormalizedEq=void 0;const n=r(4145),i=r(3286),a=r(5555);function o(t,e){return(null==t?void 0:t.toLowerCase())===(null==e?void 0:e.toLowerCase())}e.stringNormalizedEq=o,e.hexStringEq=function(t,e){if(!(0,i.isHexString)(t)||!(0,i.isHexString)(e))throw new Error("Inputs are not hex strings");return o((0,i.hexStripZeros)(t),(0,i.hexStripZeros)(e))},e.eventToTopic=function(t){return(0,i.isHexString)(t)?t:(0,a.id)(n.EventFragment.fromString(t).format())},e.functionToSighash=function(t){return(0,i.isHexString)(t)?t:(0,i.hexDataSlice)((0,a.id)(n.FunctionFragment.fromString(t).format()),0,4)}},5799:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2849),e),i(r(4184),e)},2849:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4184:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.SubqlHandlerKind=e.SubqlDatasourceKind=void 0,(e.SubqlDatasourceKind||(e.SubqlDatasourceKind={})).Runtime="substrate/Runtime",(r=e.SubqlHandlerKind||(e.SubqlHandlerKind={})).Block="substrate/BlockHandler",r.Call="substrate/CallHandler",r.Event="substrate/EventHandler"},3550:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(4300).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function d(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=d(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,d=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,d=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,c=67108863&d,f=Math.min(u,e.length-1),h=Math.max(0,u-t.length+1);h<=f;h++){var p=u-h|0;l+=(o=(i=0|t.words[p])*(a=0|e.words[h])+c)/67108864|0,c=67108863&o}r.words[u]=0|c,d=0|l}return 0!==d?r.words[u]=0|d:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?l[6-d.length]+d+r:d+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],h=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var $=p.modn(h).toString(t);r=(p=p.idivn(h)).isZero()?$+r:l[u-$.length]+$+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,d="le"===e,u=new t(a),l=this.clone();if(d){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,h=0|o[1],p=8191&h,$=h>>>13,m=0|o[2],g=8191&m,v=m>>>13,y=0|o[3],b=8191&y,M=y>>>13,A=0|o[4],_=8191&A,w=A>>>13,E=0|o[5],S=8191&E,N=E>>>13,I=0|o[6],O=8191&I,x=I>>>13,C=0|o[7],T=8191&C,P=C>>>13,R=0|o[8],F=8191&R,L=R>>>13,B=0|o[9],D=8191&B,U=B>>>13,k=0|s[0],Z=8191&k,j=k>>>13,G=0|s[1],V=8191&G,H=G>>>13,z=0|s[2],K=8191&z,Y=z>>>13,W=0|s[3],J=8191&W,q=W>>>13,X=0|s[4],Q=8191&X,tt=X>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],dt=8191&st,ut=st>>>13,lt=0|s[8],ct=8191<,ft=lt>>>13,ht=0|s[9],pt=8191&ht,$t=ht>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(u+(n=Math.imul(c,Z))|0)+((8191&(i=(i=Math.imul(c,j))+Math.imul(f,Z)|0))<<13)|0;u=((a=Math.imul(f,j))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,Z),i=(i=Math.imul(p,j))+Math.imul($,Z)|0,a=Math.imul($,j);var gt=(u+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,V)|0))<<13)|0;u=((a=a+Math.imul(f,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,Z),i=(i=Math.imul(g,j))+Math.imul(v,Z)|0,a=Math.imul(v,j),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul($,V)|0,a=a+Math.imul($,H)|0;var vt=(u+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(f,K)|0))<<13)|0;u=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,Z),i=(i=Math.imul(b,j))+Math.imul(M,Z)|0,a=Math.imul(M,j),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,H)|0)+Math.imul(v,V)|0,a=a+Math.imul(v,H)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul($,K)|0,a=a+Math.imul($,Y)|0;var yt=(u+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,J)|0))<<13)|0;u=((a=a+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,Z),i=(i=Math.imul(_,j))+Math.imul(w,Z)|0,a=Math.imul(w,j),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(M,V)|0,a=a+Math.imul(M,H)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul($,J)|0,a=a+Math.imul($,q)|0;var bt=(u+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(S,Z),i=(i=Math.imul(S,j))+Math.imul(N,Z)|0,a=Math.imul(N,j),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,V)|0,a=a+Math.imul(w,H)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul($,Q)|0,a=a+Math.imul($,tt)|0;var Mt=(u+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;u=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,Z),i=(i=Math.imul(O,j))+Math.imul(x,Z)|0,a=Math.imul(x,j),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,Y)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul($,rt)|0,a=a+Math.imul($,nt)|0;var At=(u+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ot)|0)+Math.imul(f,at)|0))<<13)|0;u=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(T,Z),i=(i=Math.imul(T,j))+Math.imul(P,Z)|0,a=Math.imul(P,j),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,a=a+Math.imul(x,H)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,q)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul($,at)|0,a=a+Math.imul($,ot)|0;var _t=(u+(n=n+Math.imul(c,dt)|0)|0)+((8191&(i=(i=i+Math.imul(c,ut)|0)+Math.imul(f,dt)|0))<<13)|0;u=((a=a+Math.imul(f,ut)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(F,Z),i=(i=Math.imul(F,j))+Math.imul(L,Z)|0,a=Math.imul(L,j),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,V)|0,a=a+Math.imul(P,H)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,Y)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,q)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(M,rt)|0,a=a+Math.imul(M,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul($,dt)|0,a=a+Math.imul($,ut)|0;var wt=(u+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;u=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,j))+Math.imul(U,Z)|0,a=Math.imul(U,j),n=n+Math.imul(F,V)|0,i=(i=i+Math.imul(F,H)|0)+Math.imul(L,V)|0,a=a+Math.imul(L,H)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,q)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,a=a+Math.imul(w,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(M,at)|0,a=a+Math.imul(M,ot)|0,n=n+Math.imul(g,dt)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(v,dt)|0,a=a+Math.imul(v,ut)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul($,ct)|0,a=a+Math.imul($,ft)|0;var Et=(u+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,$t)|0)+Math.imul(f,pt)|0))<<13)|0;u=((a=a+Math.imul(f,$t)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,H))+Math.imul(U,V)|0,a=Math.imul(U,H),n=n+Math.imul(F,K)|0,i=(i=i+Math.imul(F,Y)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Y)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,q)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(x,Q)|0,a=a+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(N,rt)|0,a=a+Math.imul(N,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(w,at)|0,a=a+Math.imul(w,ot)|0,n=n+Math.imul(b,dt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(M,dt)|0,a=a+Math.imul(M,ut)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(v,ct)|0,a=a+Math.imul(v,ft)|0;var St=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,$t)|0)+Math.imul($,pt)|0))<<13)|0;u=((a=a+Math.imul($,$t)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,Y))+Math.imul(U,K)|0,a=Math.imul(U,Y),n=n+Math.imul(F,J)|0,i=(i=i+Math.imul(F,q)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,q)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(x,rt)|0,a=a+Math.imul(x,nt)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(N,at)|0,a=a+Math.imul(N,ot)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(w,dt)|0,a=a+Math.imul(w,ut)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(M,ct)|0,a=a+Math.imul(M,ft)|0;var Nt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,$t)|0)+Math.imul(v,pt)|0))<<13)|0;u=((a=a+Math.imul(v,$t)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,q))+Math.imul(U,J)|0,a=Math.imul(U,q),n=n+Math.imul(F,Q)|0,i=(i=i+Math.imul(F,tt)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(x,at)|0,a=a+Math.imul(x,ot)|0,n=n+Math.imul(S,dt)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(N,dt)|0,a=a+Math.imul(N,ut)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,ct)|0,a=a+Math.imul(w,ft)|0;var It=(u+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,$t)|0)+Math.imul(M,pt)|0))<<13)|0;u=((a=a+Math.imul(M,$t)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,a=Math.imul(U,tt),n=n+Math.imul(F,rt)|0,i=(i=i+Math.imul(F,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,ot)|0,n=n+Math.imul(O,dt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(x,dt)|0,a=a+Math.imul(x,ut)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(N,ct)|0,a=a+Math.imul(N,ft)|0;var Ot=(u+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,$t)|0)+Math.imul(w,pt)|0))<<13)|0;u=((a=a+Math.imul(w,$t)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,a=Math.imul(U,nt),n=n+Math.imul(F,at)|0,i=(i=i+Math.imul(F,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(T,dt)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(P,dt)|0,a=a+Math.imul(P,ut)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(x,ct)|0,a=a+Math.imul(x,ft)|0;var xt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,$t)|0)+Math.imul(N,pt)|0))<<13)|0;u=((a=a+Math.imul(N,$t)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,at),i=(i=Math.imul(D,ot))+Math.imul(U,at)|0,a=Math.imul(U,ot),n=n+Math.imul(F,dt)|0,i=(i=i+Math.imul(F,ut)|0)+Math.imul(L,dt)|0,a=a+Math.imul(L,ut)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(P,ct)|0,a=a+Math.imul(P,ft)|0;var Ct=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,$t)|0)+Math.imul(x,pt)|0))<<13)|0;u=((a=a+Math.imul(x,$t)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,dt),i=(i=Math.imul(D,ut))+Math.imul(U,dt)|0,a=Math.imul(U,ut),n=n+Math.imul(F,ct)|0,i=(i=i+Math.imul(F,ft)|0)+Math.imul(L,ct)|0,a=a+Math.imul(L,ft)|0;var Tt=(u+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,$t)|0)+Math.imul(P,pt)|0))<<13)|0;u=((a=a+Math.imul(P,$t)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,ft))+Math.imul(U,ct)|0,a=Math.imul(U,ft);var Pt=(u+(n=n+Math.imul(F,pt)|0)|0)+((8191&(i=(i=i+Math.imul(F,$t)|0)+Math.imul(L,pt)|0))<<13)|0;u=((a=a+Math.imul(L,$t)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Rt=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,$t))+Math.imul(U,pt)|0))<<13)|0;return u=((a=Math.imul(U,$t))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,d[0]=mt,d[1]=gt,d[2]=vt,d[3]=yt,d[4]=bt,d[5]=Mt,d[6]=At,d[7]=_t,d[8]=wt,d[9]=Et,d[10]=St,d[11]=Nt,d[12]=It,d[13]=Ot,d[14]=xt,d[15]=Ct,d[16]=Tt,d[17]=Pt,d[18]=Rt,0!==u&&(d[19]=u,r.length++),r};function $(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=h),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):$(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==l||u>=i);u--){var c=0|this.words[u];this.words[u]=l<<26-a|c>>>a,l=c&s}return d&&0!==l&&(d.words[d.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(d/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,d=n.length-i.length;if("mod"!==e){(s=new a(null)).length=d+1,s.words=new Array(s.length);for(var u=0;u=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),d=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(c)),i.iushrn(1),o.iushrn(1);for(var p=0,$=1;0==(r.words[0]&$)&&p<26;++p,$<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||d.isOdd())&&(s.iadd(l),d.isub(c)),s.iushrn(1),d.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(d)):(r.isub(e),s.isub(i),d.isub(o))}return{a:s,b:d,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),d=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(d),o.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(d),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new _(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function w(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return g[t]=e,e},_.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),d=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,u).cmp(d);)l.redIAdd(d);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=o;0!==h.cmp(s);){for(var $=h,m=0;0!==$.cmp(s);m++)$=$.redSqr();n(m=0;n--){for(var u=e.words[n],l=d-1;l>=0;l--){var c=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}d=26}return i},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new w(t)},i(w,_),w.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},w.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},w.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},w.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},5230:(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{ClassTransformer:()=>d,Exclude:()=>u,Expose:()=>l,Transform:()=>p,TransformClassToClass:()=>c,TransformClassToPlain:()=>f,TransformPlainToClass:()=>h,TransformationType:()=>n,Type:()=>$,classToClass:()=>M,classToClassFromExist:()=>A,classToPlain:()=>g,classToPlainFromExist:()=>v,deserialize:()=>w,deserializeArray:()=>E,plainToClass:()=>y,plainToClassFromExist:()=>b,serialize:()=>_}),function(t){t[t.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",t[t.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",t[t.CLASS_TO_CLASS=2]="CLASS_TO_CLASS"}(n||(n={}));var i=new(function(){function t(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.findTransformMetadatas=function(t,e,r){return this.findMetadatas(this._transformMetadatas,t,e).filter((function(t){return!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?r===n.CLASS_TO_CLASS||r===n.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||r===n.CLASS_TO_PLAIN)}))},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find((function(t){return t.options&&t.options.name===e}))},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.get(t),r=e&&e.get(void 0),n=this._exposeMetadatas.get(t),i=n&&n.get(void 0);return r&&i||!r&&!i?"none":r?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter((function(t){return!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===n.CLASS_TO_CLASS||e===n.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===n.CLASS_TO_PLAIN)})).map((function(t){return t.propertyName}))},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter((function(t){return!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===n.CLASS_TO_CLASS||e===n.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===n.CLASS_TO_PLAIN)})).map((function(t){return t.propertyName}))},t.prototype.clear=function(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()},t.prototype.getMetadata=function(t,e){var r,n=t.get(e);n&&(r=Array.from(n.values()).filter((function(t){return void 0!==t.propertyName})));for(var i=[],a=0,o=this.getAncestors(e);a0&&(s=s.filter((function(t){return!u.includes(t)}))),void 0!==this.options.version&&(s=s.filter((function(e){var r=i.findExposeMetadata(t,e);return!r||!r.options||a.checkVersion(r.options.since,r.options.until)}))),s=this.options.groups&&this.options.groups.length?s.filter((function(e){var r=i.findExposeMetadata(t,e);return!r||!r.options||a.checkGroups(r.options.groups)})):s.filter((function(e){var r=i.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)}))}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(s=s.filter((function(t){return a.options.excludePrefixes.every((function(e){return t.substr(0,e.length)!==e}))}))),s.filter((function(t,e,r){return r.indexOf(t)===e}))},t.prototype.checkVersion=function(t,e){var r=!0;return r&&t&&(r=this.options.version>=t),r&&e&&(r=this.options.version{"use strict";r.r(e),r.d(e,{ARRAY_CONTAINS:()=>Xs,ARRAY_MAX_SIZE:()=>ld,ARRAY_MIN_SIZE:()=>sd,ARRAY_NOT_CONTAINS:()=>ed,ARRAY_NOT_EMPTY:()=>id,ARRAY_UNIQUE:()=>hd,Allow:()=>y,ArrayContains:()=>td,ArrayMaxSize:()=>fd,ArrayMinSize:()=>ud,ArrayNotContains:()=>nd,ArrayNotEmpty:()=>od,ArrayUnique:()=>$d,CONTAINS:()=>Rt,Contains:()=>Lt,EQUALS:()=>H,Equals:()=>K,IS_ALPHA:()=>Zt,IS_ALPHANUMERIC:()=>Ht,IS_ARRAY:()=>zs,IS_ASCII:()=>ee,IS_BASE32:()=>Va,IS_BASE64:()=>oe,IS_BIC:()=>Wa,IS_BOOLEAN:()=>Is,IS_BOOLEAN_STRING:()=>Ra,IS_BTC_ADDRESS:()=>to,IS_BYTE_LENGTH:()=>ce,IS_CREDIT_CARD:()=>me,IS_CURRENCY:()=>Me,IS_DATA_URI:()=>ao,IS_DATE:()=>Cs,IS_DATE_STRING:()=>Oa,IS_DECIMAL:()=>Jt,IS_DEFINED:()=>w,IS_DIVISIBLE_BY:()=>ct,IS_EAN:()=>co,IS_EMAIL:()=>Se,IS_EMPTY:()=>q,IS_ENUM:()=>Bs,IS_ETHEREUM_ADDRESS:()=>mo,IS_FIREBASE_PUSH_ID:()=>Rn,IS_FQDN:()=>Ce,IS_FULL_WIDTH:()=>Fe,IS_HALF_WIDTH:()=>Ue,IS_HASH:()=>Ma,IS_HEXADECIMAL:()=>tr,IS_HEX_COLOR:()=>We,IS_HSL:()=>Mo,IS_IBAN:()=>Eo,IS_IDENTITY_CARD:()=>xo,IS_IN:()=>nt,IS_INSTANCE:()=>yd,IS_INT:()=>ks,IS_IP:()=>cr,IS_ISBN:()=>Mr,IS_ISIN:()=>Sr,IS_ISO31661_ALPHA_2:()=>tn,IS_ISO31661_ALPHA_3:()=>on,IS_ISO8601:()=>Cr,IS_ISRC:()=>Fo,IS_ISSN:()=>Sa,IS_JSON:()=>Lr,IS_JWT:()=>Zr,IS_LATITUDE:()=>U,IS_LATLONG:()=>L,IS_LENGTH:()=>Vn,IS_LOCALE:()=>ko,IS_LONGITUDE:()=>j,IS_LOWERCASE:()=>zr,IS_MAC_ADDRESS:()=>or,IS_MAGNET_URI:()=>Ho,IS_MILITARY_TIME:()=>ma,IS_MIME_TYPE:()=>Jo,IS_MOBILE_PHONE:()=>Jr,IS_MONGO_ID:()=>cn,IS_MULTIBYTE:()=>mn,IS_NEGATIVE:()=>gt,IS_NOT_EMPTY:()=>tt,IS_NOT_EMPTY_OBJECT:()=>md,IS_NOT_IN:()=>ot,IS_NUMBER:()=>Rs,IS_NUMBER_STRING:()=>Ua,IS_OBJECT:()=>Ws,IS_OCTAL:()=>es,IS_PASSPORT_NUMBER:()=>os,IS_PHONE_NUMBER:()=>ha,IS_PORT:()=>mr,IS_POSITIVE:()=>pt,IS_POSTAL_CODE:()=>ls,IS_RFC_3339:()=>$s,IS_RGB_COLOR:()=>bs,IS_SEM_VER:()=>Es,IS_STRING:()=>Gs,IS_SURROGATE_PAIR:()=>Mn,IS_UPPERCASE:()=>Un,IS_URL:()=>Sn,IS_UUID:()=>Cn,IS_VARIABLE_WIDTH:()=>Ve,IsAlpha:()=>Gt,IsAlphanumeric:()=>Kt,IsArray:()=>Ys,IsAscii:()=>ne,IsBIC:()=>qa,IsBase32:()=>za,IsBase64:()=>de,IsBoolean:()=>xs,IsBooleanString:()=>La,IsBtcAddress:()=>ro,IsByteLength:()=>he,IsCreditCard:()=>ve,IsCurrency:()=>_e,IsDataURI:()=>so,IsDate:()=>Ps,IsDateString:()=>Ca,IsDecimal:()=>Xt,IsDefined:()=>S,IsDivisibleBy:()=>ht,IsEAN:()=>ho,IsEmail:()=>Ie,IsEmpty:()=>Q,IsEnum:()=>Us,IsEthereumAddress:()=>vo,IsFQDN:()=>Pe,IsFirebasePushId:()=>Ln,IsFullWidth:()=>Be,IsHSL:()=>_o,IsHalfWidth:()=>Ze,IsHash:()=>_a,IsHexColor:()=>qe,IsHexadecimal:()=>rr,IsIBAN:()=>No,IsIP:()=>hr,IsISBN:()=>_r,IsISIN:()=>Ir,IsISO31661Alpha2:()=>rn,IsISO31661Alpha3:()=>dn,IsISO8601:()=>Pr,IsISRC:()=>Bo,IsISSN:()=>Ia,IsIdentityCard:()=>To,IsIn:()=>at,IsInstance:()=>Md,IsInt:()=>js,IsJSON:()=>Dr,IsJWT:()=>Gr,IsLatLong:()=>D,IsLatitude:()=>Z,IsLocale:()=>jo,IsLongitude:()=>V,IsLowercase:()=>Yr,IsMACAddress:()=>dr,IsMagnetURI:()=>Ko,IsMilitaryTime:()=>va,IsMimeType:()=>Xo,IsMobilePhone:()=>Xr,IsMongoId:()=>hn,IsMultibyte:()=>vn,IsNegative:()=>yt,IsNotEmpty:()=>rt,IsNotEmptyObject:()=>vd,IsNotIn:()=>dt,IsNumber:()=>Ls,IsNumberString:()=>Za,IsObject:()=>qs,IsOctal:()=>ns,IsOptional:()=>N,IsPassportNumber:()=>ds,IsPhoneNumber:()=>$a,IsPort:()=>vr,IsPositive:()=>mt,IsPostalCode:()=>fs,IsRFC3339:()=>gs,IsRgbColor:()=>As,IsSemVer:()=>Ns,IsString:()=>Hs,IsSurrogatePair:()=>_n,IsUUID:()=>Pn,IsUppercase:()=>Zn,IsUrl:()=>In,IsVariableWidth:()=>ze,Length:()=>zn,MATCHES:()=>ei,MAX:()=>bt,MAX_DATE:()=>Ot,MAX_LENGTH:()=>Kn,MIN:()=>_t,MIN_DATE:()=>St,MIN_LENGTH:()=>Jn,Matches:()=>ni,Max:()=>At,MaxDate:()=>Ct,MaxLength:()=>Wn,MetadataStorage:()=>o,Min:()=>Et,MinDate:()=>It,MinLength:()=>Xn,NOT_CONTAINS:()=>Bt,NOT_EQUALS:()=>Y,NotContains:()=>Ut,NotEquals:()=>J,Validate:()=>O,ValidateBy:()=>_,ValidateIf:()=>x,ValidateNested:()=>T,ValidatePromise:()=>P,ValidationError:()=>d,ValidationTypes:()=>u,Validator:()=>$,ValidatorConstraint:()=>I,arrayContains:()=>Qs,arrayMaxSize:()=>cd,arrayMinSize:()=>dd,arrayNotContains:()=>rd,arrayNotEmpty:()=>ad,arrayUnique:()=>pd,buildMessage:()=>A,contains:()=>Ft,equals:()=>z,getFromContainer:()=>v,getMetadataStorage:()=>s,isAlpha:()=>jt,isAlphanumeric:()=>zt,isArray:()=>Ks,isAscii:()=>re,isBIC:()=>Ja,isBase32:()=>Ha,isBase64:()=>se,isBoolean:()=>Os,isBooleanString:()=>Fa,isBtcAddress:()=>eo,isByteLength:()=>fe,isCreditCard:()=>ge,isCurrency:()=>Ae,isDataURI:()=>oo,isDate:()=>Ts,isDateString:()=>xa,isDecimal:()=>qt,isDefined:()=>E,isDivisibleBy:()=>ft,isEAN:()=>fo,isEmail:()=>Ne,isEmpty:()=>X,isEnum:()=>Ds,isEthereumAddress:()=>go,isFQDN:()=>Te,isFirebasePushId:()=>Fn,isFullWidth:()=>Le,isHSL:()=>Ao,isHalfWidth:()=>ke,isHash:()=>Aa,isHexColor:()=>Je,isHexadecimal:()=>er,isIBAN:()=>So,isIP:()=>fr,isISBN:()=>Ar,isISIN:()=>Nr,isISO31661Alpha2:()=>en,isISO31661Alpha3:()=>sn,isISO8601:()=>Tr,isISRC:()=>Lo,isISSN:()=>Na,isIdentityCard:()=>Co,isIn:()=>it,isInstance:()=>bd,isInt:()=>Zs,isJSON:()=>Br,isJWT:()=>jr,isLatLong:()=>B,isLatitude:()=>k,isLocale:()=>Zo,isLongitude:()=>G,isLowercase:()=>Kr,isMACAddress:()=>sr,isMagnetURI:()=>zo,isMilitaryTime:()=>ga,isMimeType:()=>qo,isMobilePhone:()=>qr,isMongoId:()=>fn,isMultibyte:()=>gn,isNegative:()=>vt,isNotEmpty:()=>et,isNotEmptyObject:()=>gd,isNotIn:()=>st,isNumber:()=>Fs,isNumberString:()=>ka,isObject:()=>Js,isOctal:()=>rs,isPassportNumber:()=>ss,isPhoneNumber:()=>pa,isPort:()=>gr,isPositive:()=>$t,isPostalCode:()=>cs,isRFC3339:()=>ms,isRgbColor:()=>Ms,isSemVer:()=>Ss,isString:()=>Vs,isSurrogatePair:()=>An,isURL:()=>Nn,isUUID:()=>Tn,isUppercase:()=>kn,isValidationOptions:()=>nr,isVariableWidth:()=>He,length:()=>Hn,matches:()=>ri,max:()=>Mt,maxDate:()=>xt,maxLength:()=>Yn,min:()=>wt,minDate:()=>Nt,minLength:()=>qn,notContains:()=>Dt,notEquals:()=>W,registerDecorator:()=>M,registerSchema:()=>Ed,useContainer:()=>g,validate:()=>Ad,validateOrReject:()=>_d,validateSync:()=>wd});var n=function(t){this.groups=[],this.each=!1,this.context=void 0,this.type=t.type,this.target=t.target,this.propertyName=t.propertyName,this.constraints=t.constraints,this.constraintCls=t.constraintCls,this.validationTypeOptions=t.validationTypeOptions,t.validationOptions&&(this.message=t.validationOptions.message,this.groups=t.validationOptions.groups,this.always=t.validationOptions.always,this.each=t.validationOptions.each,this.context=t.validationOptions.context)},i=function(){function t(){}return t.prototype.transform=function(t){var e=[];return Object.keys(t.properties).forEach((function(r){t.properties[r].forEach((function(i){var a={message:i.message,groups:i.groups,always:i.always,each:i.each},o={type:i.type,target:t.name,propertyName:r,constraints:i.constraints,validationTypeOptions:i.options,validationOptions:a};e.push(new n(o))}))})),e},t}();function a(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0}var o=function(){function t(){this.validationMetadatas=[],this.constraintMetadatas=[]}return Object.defineProperty(t.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.length},enumerable:!1,configurable:!0}),t.prototype.addValidationSchema=function(t){var e=this;(new i).transform(t).forEach((function(t){return e.addValidationMetadata(t)}))},t.prototype.addValidationMetadata=function(t){this.validationMetadatas.push(t)},t.prototype.addConstraintMetadata=function(t){this.constraintMetadatas.push(t)},t.prototype.groupByPropertyName=function(t){var e={};return t.forEach((function(t){e[t.propertyName]||(e[t.propertyName]=[]),e[t.propertyName].push(t)})),e},t.prototype.getTargetValidationMetadatas=function(t,e,r,n,i){var a=function(t){return void 0!==t.always?t.always:(!t.groups||!t.groups.length)&&r},o=function(t){return!(!n||i&&i.length||!t.groups||!t.groups.length)},s=this.validationMetadatas.filter((function(r){return(r.target===t||r.target===e)&&(!!a(r)||!o(r)&&(!(i&&i.length>0)||r.groups&&!!r.groups.find((function(t){return-1!==i.indexOf(t)}))))})),d=this.validationMetadatas.filter((function(e){return"string"!=typeof e.target&&e.target!==t&&(!(e.target instanceof Function)||t.prototype instanceof e.target)&&(!!a(e)||!o(e)&&(!(i&&i.length>0)||e.groups&&!!e.groups.find((function(t){return-1!==i.indexOf(t)}))))})).filter((function(t){return!s.find((function(e){return e.propertyName===t.propertyName&&e.type===t.type}))}));return s.concat(d)},t.prototype.getTargetValidatorConstraints=function(t){return this.constraintMetadatas.filter((function(e){return e.target===t}))},t}();function s(){var t=a();return t.classValidatorMetadataStorage||(t.classValidatorMetadataStorage=new o),t.classValidatorMetadataStorage}var d=function(){function t(){}return t.prototype.toString=function(t,e,r){var n=this;void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===r&&(r="");var i=t?"":"",a=t?"":"",o=function(t){return" - property ".concat(i).concat(r).concat(t).concat(a," has failed the following constraints: ").concat(i).concat(Object.keys(n.constraints).join(", ")).concat(a," \n")};if(e){var s=Number.isInteger(+this.property)?"[".concat(this.property,"]"):"".concat(r?".":"").concat(this.property);return this.constraints?o(s):this.children?this.children.map((function(e){return e.toString(t,!0,"".concat(r).concat(s))})).join(""):""}return"An instance of ".concat(i).concat(this.target?this.target.constructor.name:"an object").concat(a," has failed the validation:\n")+(this.constraints?o(this.property):"")+(this.children?this.children.map((function(e){return e.toString(t,!0,n.property)})).join(""):"")},t}(),u=function(){function t(){}return t.isValid=function(t){var e=this;return"isValid"!==t&&"getMessage"!==t&&-1!==Object.keys(this).map((function(t){return e[t]})).indexOf(t)},t.CUSTOM_VALIDATION="customValidation",t.NESTED_VALIDATION="nestedValidation",t.PROMISE_VALIDATION="promiseValidation",t.CONDITIONAL_VALIDATION="conditionalValidation",t.WHITELIST="whitelistValidation",t.IS_DEFINED="isDefined",t}(),l=function(){function t(){}return t.replaceMessageSpecialTokens=function(t,e){var r;return t instanceof Function?r=t(e):"string"==typeof t&&(r=t),r&&Array.isArray(e.constraints)&&e.constraints.forEach((function(t,e){r=r.replace(new RegExp("\\$constraint".concat(e+1),"g"),function(t){return Array.isArray(t)?t.join(", "):"".concat(t)}(t))})),r&&void 0!==e.value&&null!==e.value&&"string"==typeof e.value&&(r=r.replace(/\$value/g,e.value)),r&&(r=r.replace(/\$property/g,e.property)),r&&(r=r.replace(/\$target/g,e.targetName)),r},t}();function c(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}var f,h,p=function(){function t(t,e){this.validator=t,this.validatorOptions=e,this.awaitingPromises=[],this.ignoreAsyncValidations=!1,this.metadataStorage=s()}return t.prototype.execute=function(t,e,r){var n,i=this;this.metadataStorage.hasValidationMetaData||!0!==(null===(n=this.validatorOptions)||void 0===n?void 0:n.enableDebugMessages)||console.warn("No metadata found. There is more than once class-validator version installed probably. You need to flatten your dependencies.");var a=this.validatorOptions?this.validatorOptions.groups:void 0,o=this.validatorOptions&&this.validatorOptions.strictGroups||!1,s=this.validatorOptions&&this.validatorOptions.always||!1,l=this.metadataStorage.getTargetValidationMetadatas(t.constructor,e,s,o,a),c=this.metadataStorage.groupByPropertyName(l);if(this.validatorOptions&&this.validatorOptions.forbidUnknownValues&&!l.length){var f=new d;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(f.target=t),f.value=void 0,f.property=void 0,f.children=[],f.constraints={unknownValue:"an unknown value was passed to the validate function"},void r.push(f)}this.validatorOptions&&this.validatorOptions.whitelist&&this.whitelist(t,c,r),Object.keys(c).forEach((function(e){var n=t[e],a=c[e].filter((function(t){return t.type===u.IS_DEFINED})),o=c[e].filter((function(t){return t.type!==u.IS_DEFINED&&t.type!==u.WHITELIST}));n instanceof Promise&&o.find((function(t){return t.type===u.PROMISE_VALIDATION}))?i.awaitingPromises.push(n.then((function(n){i.performValidations(t,n,e,a,o,r)}))):i.performValidations(t,n,e,a,o,r)}))},t.prototype.whitelist=function(t,e,r){var n=this,i=[];Object.keys(t).forEach((function(t){e[t]&&0!==e[t].length||i.push(t)})),i.length>0&&(this.validatorOptions&&this.validatorOptions.forbidNonWhitelisted?i.forEach((function(e){var i,a=n.generateValidationError(t,t[e],e);a.constraints=((i={})[u.WHITELIST]="property ".concat(e," should not exist"),i),a.children=void 0,r.push(a)})):i.forEach((function(e){return delete t[e]})))},t.prototype.stripEmptyErrors=function(t){var e=this;return t.filter((function(t){if(t.children&&(t.children=e.stripEmptyErrors(t.children)),0===Object.keys(t.constraints).length){if(0===t.children.length)return!1;delete t.constraints}return!0}))},t.prototype.performValidations=function(t,e,r,n,i,a){var o=i.filter((function(t){return t.type===u.CUSTOM_VALIDATION})),s=i.filter((function(t){return t.type===u.NESTED_VALIDATION})),d=i.filter((function(t){return t.type===u.CONDITIONAL_VALIDATION})),l=this.generateValidationError(t,e,r);a.push(l),this.conditionalValidations(t,e,d)&&(this.customValidations(t,e,n,l),this.mapContexts(t,e,n,l),void 0===e&&this.validatorOptions&&!0===this.validatorOptions.skipUndefinedProperties||null===e&&this.validatorOptions&&!0===this.validatorOptions.skipNullProperties||null==e&&this.validatorOptions&&!0===this.validatorOptions.skipMissingProperties||(this.customValidations(t,e,o,l),this.nestedValidations(e,s,l.children),this.mapContexts(t,e,i,l),this.mapContexts(t,e,o,l)))},t.prototype.generateValidationError=function(t,e,r){var n=new d;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(n.target=t),this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.value&&!0!==this.validatorOptions.validationError.value||(n.value=e),n.property=r,n.children=[],n.constraints={},n},t.prototype.conditionalValidations=function(t,e,r){return r.map((function(r){return r.constraints[0](t,e)})).reduce((function(t,e){return t&&e}),!0)},t.prototype.customValidations=function(t,e,r,n){var i=this;r.forEach((function(r){i.metadataStorage.getTargetValidatorConstraints(r.constraintCls).forEach((function(a){if(!(a.async&&i.ignoreAsyncValidations||i.validatorOptions&&i.validatorOptions.stopAtFirstError&&Object.keys(n.constraints||{}).length>0)){var o={targetName:t.constructor?t.constructor.name:void 0,property:r.propertyName,object:t,value:e,constraints:r.constraints};if(r.each&&(Array.isArray(e)||e instanceof Set||e instanceof Map)){var s,d=((s=e)instanceof Map?Array.from(s.values()):Array.isArray(s)?s:Array.from(s)).map((function(t){return a.instance.validate(t,o)}));if(d.some((function(t){return c(t)}))){var u=d.map((function(t){return c(t)?t:Promise.resolve(t)})),l=Promise.all(u).then((function(o){if(!o.every((function(t){return t}))){var s=i.createValidationError(t,e,r,a),d=s[0],u=s[1];n.constraints[d]=u,r.context&&(n.contexts||(n.contexts={}),n.contexts[d]=Object.assign(n.contexts[d]||{},r.context))}}));i.awaitingPromises.push(l)}else if(!d.every((function(t){return t}))){var f=i.createValidationError(t,e,r,a);m=f[0],g=f[1],n.constraints[m]=g}}else{var h=a.instance.validate(e,o);if(c(h)){var p=h.then((function(o){if(!o){var s=i.createValidationError(t,e,r,a),d=s[0],u=s[1];n.constraints[d]=u,r.context&&(n.contexts||(n.contexts={}),n.contexts[d]=Object.assign(n.contexts[d]||{},r.context))}}));i.awaitingPromises.push(p)}else if(!h){var $=i.createValidationError(t,e,r,a),m=$[0],g=$[1];n.constraints[m]=g}}}}))}))},t.prototype.nestedValidations=function(t,e,r){var n=this;void 0!==t&&e.forEach((function(i){var a;if(i.type===u.NESTED_VALIDATION||i.type===u.PROMISE_VALIDATION)if(Array.isArray(t)||t instanceof Set||t instanceof Map)(t instanceof Set?Array.from(t):t).forEach((function(i,a){n.performValidations(t,i,a.toString(),[],e,r)}));else if(t instanceof Object){var o="string"==typeof i.target?i.target:i.target.name;n.execute(t,o,r)}else{var s=new d;s.value=t,s.property=i.propertyName,s.target=i.target;var l=n.createValidationError(i.target,t,i),c=l[0],f=l[1];s.constraints=((a={})[c]=f,a),r.push(s)}}))},t.prototype.mapContexts=function(t,e,r,n){var i=this;return r.forEach((function(t){if(t.context){var e=void 0;t.type===u.CUSTOM_VALIDATION&&(e=i.metadataStorage.getTargetValidatorConstraints(t.constraintCls)[0]);var r=i.getConstraintType(t,e);n.constraints[r]&&(n.contexts||(n.contexts={}),n.contexts[r]=Object.assign(n.contexts[r]||{},t.context))}}))},t.prototype.createValidationError=function(t,e,r,n){var i=t.constructor?t.constructor.name:void 0,a=this.getConstraintType(r,n),o={targetName:i,property:r.propertyName,object:t,value:e,constraints:r.constraints},s=r.message||"";return r.message||this.validatorOptions&&(!this.validatorOptions||this.validatorOptions.dismissDefaultMessages)||n&&n.instance.defaultMessage instanceof Function&&(s=n.instance.defaultMessage(o)),[a,l.replaceMessageSpecialTokens(s,o)]},t.prototype.getConstraintType=function(t,e){return e&&e.name?e.name:t.type},t}(),$=function(){function t(){}return t.prototype.validate=function(t,e,r){return this.coreValidate(t,e,r)},t.prototype.validateOrReject=function(t,e,r){return n=this,i=void 0,o=function(){var n;return function(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]1)throw"More than one implementation of ValidatorConstraintInterface found for validator on: ".concat(t.target.name,":").concat(t.propertyName)}else{var r=t.validator;e=function(){function t(){}return t.prototype.validate=function(t,e){return r.validate(t,e)},t.prototype.defaultMessage=function(t){return r.defaultMessage?r.defaultMessage(t):""},t}(),s().addConstraintMetadata(new b(e,t.name,t.async))}var i={type:t.name&&u.isValid(t.name)?t.name:u.CUSTOM_VALIDATION,target:t.target,propertyName:t.propertyName,validationOptions:t.options,constraintCls:e,constraints:t.constraints};s().addValidationMetadata(new n(i))}function A(t,e){return function(r){var n=e&&e.each?"each value in ":"";return t(n,r)}}function _(t,e){return function(r,n){M({name:t.name,target:r.constructor,propertyName:n,options:e,constraints:t.constraints,validator:t.validator})}}var w=u.IS_DEFINED;function E(t){return null!=t}function S(t){return _({name:w,validator:{validate:function(t){return E(t)},defaultMessage:A((function(t){return t+"$property should not be null or undefined"}),t)}},t)}function N(t){return function(e,r){var i={type:u.CONDITIONAL_VALIDATION,target:e.constructor,propertyName:r,constraints:[function(t,e){return null!==t[r]&&void 0!==t[r]}],validationOptions:t};s().addValidationMetadata(new n(i))}}function I(t){return function(e){var r=t&&t.async,n=t&&t.name?t.name:"";n||(n=e.name)||(n=n.replace(/\.?([A-Z]+)/g,(function(t,e){return"_"+e.toLowerCase()})).replace(/^_/,""));var i=new b(e,n,r);s().addConstraintMetadata(i)}}function O(t,e,r){return function(i,a){var o={type:u.CUSTOM_VALIDATION,target:i.constructor,propertyName:a,constraintCls:t,constraints:Array.isArray(e)?e:void 0,validationOptions:Array.isArray(e)?r:e};s().addValidationMetadata(new n(o))}}function x(t,e){return function(r,i){var a={type:u.CONDITIONAL_VALIDATION,target:r.constructor,propertyName:i,constraints:[t],validationOptions:e};s().addValidationMetadata(new n(a))}}var C=function(){return C=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0}function mt(t){return _({name:pt,validator:{validate:function(t,e){return $t(t)},defaultMessage:A((function(t){return t+"$property must be a positive number"}),t)}},t)}var gt="isNegative";function vt(t){return"number"==typeof t&&t<0}function yt(t){return _({name:gt,validator:{validate:function(t,e){return vt(t)},defaultMessage:A((function(t){return t+"$property must be a negative number"}),t)}},t)}var bt="max";function Mt(t,e){return"number"==typeof t&&"number"==typeof e&&t<=e}function At(t,e){return _({name:bt,constraints:[t],validator:{validate:function(t,e){return Mt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must not be greater than $constraint1"}),e)}},e)}var _t="min";function wt(t,e){return"number"==typeof t&&"number"==typeof e&&t>=e}function Et(t,e){return _({name:_t,constraints:[t],validator:{validate:function(t,e){return wt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must not be less than $constraint1"}),e)}},e)}var St="minDate";function Nt(t,e){return t instanceof Date&&t.getTime()>=e.getTime()}function It(t,e){return _({name:St,constraints:[t],validator:{validate:function(t,e){return Nt(t,e.constraints[0])},defaultMessage:A((function(t){return"minimal allowed date for "+t+"$property is $constraint1"}),e)}},e)}var Ot="maxDate";function xt(t,e){return t instanceof Date&&t.getTime()<=e.getTime()}function Ct(t,e){return _({name:Ot,constraints:[t],validator:{validate:function(t,e){return xt(t,e.constraints[0])},defaultMessage:A((function(t){return"maximal allowed date for "+t+"$property is $constraint1"}),e)}},e)}var Tt=r(9466),Pt=r.n(Tt),Rt="contains";function Ft(t,e){return"string"==typeof t&&Pt()(t,e)}function Lt(t,e){return _({name:Rt,constraints:[t],validator:{validate:function(t,e){return Ft(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain a $constraint1 string"}),e)}},e)}var Bt="notContains";function Dt(t,e){return"string"==typeof t&&!Pt()(t,e)}function Ut(t,e){return _({name:Bt,constraints:[t],validator:{validate:function(t,e){return Dt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property should not contain a $constraint1 string"}),e)}},e)}var kt=r(9234),Zt="isAlpha";function jt(t,e){return"string"==typeof t&&(0,kt.ZP)(t,e)}function Gt(t,e){return _({name:Zt,constraints:[t],validator:{validate:function(t,e){return jt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain only letters (a-zA-Z)"}),e)}},e)}var Vt=r(4583),Ht="isAlphanumeric";function zt(t,e){return"string"==typeof t&&(0,Vt.ZP)(t,e)}function Kt(t,e){return _({name:Ht,constraints:[t],validator:{validate:function(t,e){return zt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain only letters and numbers"}),e)}},e)}var Yt=r(5218),Wt=r.n(Yt),Jt="isDecimal";function qt(t,e){return"string"==typeof t&&Wt()(t,e)}function Xt(t,e){return _({name:Jt,constraints:[t],validator:{validate:function(t,e){return qt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property is not a valid decimal number."}),e)}},e)}var Qt=r(4094),te=r.n(Qt),ee="isAscii";function re(t){return"string"==typeof t&&te()(t)}function ne(t){return _({name:ee,validator:{validate:function(t,e){return re(t)},defaultMessage:A((function(t){return t+"$property must contain only ASCII characters"}),t)}},t)}var ie=r(2689),ae=r.n(ie),oe="isBase64";function se(t){return"string"==typeof t&&ae()(t)}function de(t){return _({name:oe,validator:{validate:function(t,e){return se(t)},defaultMessage:A((function(t){return t+"$property must be base64 encoded"}),t)}},t)}var ue=r(3235),le=r.n(ue),ce="isByteLength";function fe(t,e,r){return"string"==typeof t&&le()(t,{min:e,max:r})}function he(t,e,r){return _({name:ce,constraints:[t,e],validator:{validate:function(t,e){return fe(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t){return t+"$property's byte length must fall into ($constraint1, $constraint2) range"}),r)}},r)}var pe=r(682),$e=r.n(pe),me="isCreditCard";function ge(t){return"string"==typeof t&&$e()(t)}function ve(t){return _({name:me,validator:{validate:function(t,e){return ge(t)},defaultMessage:A((function(t){return t+"$property must be a credit card"}),t)}},t)}var ye=r(94),be=r.n(ye),Me="isCurrency";function Ae(t,e){return"string"==typeof t&&be()(t,e)}function _e(t,e){return _({name:Me,constraints:[t],validator:{validate:function(t,e){return Ae(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a currency"}),e)}},e)}var we=r(3868),Ee=r.n(we),Se="isEmail";function Ne(t,e){return"string"==typeof t&&Ee()(t,e)}function Ie(t,e){return _({name:Se,constraints:[t],validator:{validate:function(t,e){return Ne(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an email"}),e)}},e)}var Oe=r(221),xe=r.n(Oe),Ce="isFqdn";function Te(t,e){return"string"==typeof t&&xe()(t,e)}function Pe(t,e){return _({name:Ce,constraints:[t],validator:{validate:function(t,e){return Te(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a valid domain name"}),e)}},e)}var Re=r(7146),Fe="isFullWidth";function Le(t){return"string"==typeof t&&(0,Re.default)(t)}function Be(t){return _({name:Fe,validator:{validate:function(t,e){return Le(t)},defaultMessage:A((function(t){return t+"$property must contain a full-width characters"}),t)}},t)}var De=r(2941),Ue="isHalfWidth";function ke(t){return"string"==typeof t&&(0,De.default)(t)}function Ze(t){return _({name:Ue,validator:{validate:function(t,e){return ke(t)},defaultMessage:A((function(t){return t+"$property must contain a half-width characters"}),t)}},t)}var je=r(9019),Ge=r.n(je),Ve="isVariableWidth";function He(t){return"string"==typeof t&&Ge()(t)}function ze(t){return _({name:Ve,validator:{validate:function(t,e){return He(t)},defaultMessage:A((function(t){return t+"$property must contain a full-width and half-width characters"}),t)}},t)}var Ke=r(6298),Ye=r.n(Ke),We="isHexColor";function Je(t){return"string"==typeof t&&Ye()(t)}function qe(t){return _({name:We,validator:{validate:function(t,e){return Je(t)},defaultMessage:A((function(t){return t+"$property must be a hexadecimal color"}),t)}},t)}var Xe=r(7117),Qe=r.n(Xe),tr="isHexadecimal";function er(t){return"string"==typeof t&&Qe()(t)}function rr(t){return _({name:tr,validator:{validate:function(t,e){return er(t)},defaultMessage:A((function(t){return t+"$property must be a hexadecimal number"}),t)}},t)}function nr(t){return!!t&&("each"in t||"message"in t||"groups"in t||"always"in t||"context"in t)}var ir=r(8999),ar=r.n(ir),or="isMacAddress";function sr(t,e){return"string"==typeof t&&ar()(t,e)}function dr(t,e){var r=nr(t)?void 0:t,n=nr(t)?t:e;return _({name:or,constraints:[r],validator:{validate:function(t,e){return sr(t,r)},defaultMessage:A((function(t){return t+"$property must be a MAC Address"}),n)}},n)}var ur=r(1028),lr=r.n(ur),cr="isIp";function fr(t,e){var r=e?"".concat(e):void 0;return"string"==typeof t&&lr()(t,r)}function hr(t,e){return _({name:cr,constraints:[t],validator:{validate:function(t,e){return fr(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an ip address"}),e)}},e)}var pr=r(4595),$r=r.n(pr),mr="isPort";function gr(t){return"string"==typeof t&&$r()(t)}function vr(t){return _({name:mr,validator:{validate:function(t,e){return gr(t)},defaultMessage:A((function(t){return t+"$property must be a port"}),t)}},t)}var yr=r(7612),br=r.n(yr),Mr="isIsbn";function Ar(t,e){var r=e?"".concat(e):void 0;return"string"==typeof t&&br()(t,r)}function _r(t,e){return _({name:Mr,constraints:[t],validator:{validate:function(t,e){return Ar(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an ISBN"}),e)}},e)}var wr=r(7148),Er=r.n(wr),Sr="isIsin";function Nr(t){return"string"==typeof t&&Er()(t)}function Ir(t){return _({name:Sr,validator:{validate:function(t,e){return Nr(t)},defaultMessage:A((function(t){return t+"$property must be an ISIN (stock/security identifier)"}),t)}},t)}var Or=r(5061),xr=r.n(Or),Cr="isIso8601";function Tr(t,e){return"string"==typeof t&&xr()(t,e)}function Pr(t,e){return _({name:Cr,constraints:[t],validator:{validate:function(t,e){return Tr(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a valid ISO 8601 date string"}),e)}},e)}var Rr=r(1008),Fr=r.n(Rr),Lr="isJson";function Br(t){return"string"==typeof t&&Fr()(t)}function Dr(t){return _({name:Lr,validator:{validate:function(t,e){return Br(t)},defaultMessage:A((function(t){return t+"$property must be a json string"}),t)}},t)}var Ur=r(4979),kr=r.n(Ur),Zr="isJwt";function jr(t){return"string"==typeof t&&kr()(t)}function Gr(t){return _({name:Zr,validator:{validate:function(t,e){return jr(t)},defaultMessage:A((function(t){return t+"$property must be a jwt string"}),t)}},t)}var Vr=r(3928),Hr=r.n(Vr),zr="isLowercase";function Kr(t){return"string"==typeof t&&Hr()(t)}function Yr(t){return _({name:zr,validator:{validate:function(t,e){return Kr(t)},defaultMessage:A((function(t){return t+"$property must be a lowercase string"}),t)}},t)}var Wr=r(8355),Jr="isMobilePhone";function qr(t,e,r){return"string"==typeof t&&(0,Wr.ZP)(t,e,r)}function Xr(t,e,r){return _({name:Jr,constraints:[t,e],validator:{validate:function(t,e){return qr(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t){return t+"$property must be a phone number"}),r)}},r)}var Qr=r(1727),tn="isISO31661Alpha2";function en(t){return"string"==typeof t&&(0,Qr.default)(t)}function rn(t){return _({name:tn,validator:{validate:function(t,e){return en(t)},defaultMessage:A((function(t){return t+"$property must be a valid ISO31661 Alpha2 code"}),t)}},t)}var nn=r(6776),an=r.n(nn),on="isISO31661Alpha3";function sn(t){return"string"==typeof t&&an()(t)}function dn(t){return _({name:on,validator:{validate:function(t,e){return sn(t)},defaultMessage:A((function(t){return t+"$property must be a valid ISO31661 Alpha3 code"}),t)}},t)}var un=r(9131),ln=r.n(un),cn="isMongoId";function fn(t){return"string"==typeof t&&ln()(t)}function hn(t){return _({name:cn,validator:{validate:function(t,e){return fn(t)},defaultMessage:A((function(t){return t+"$property must be a mongodb id"}),t)}},t)}var pn=r(3590),$n=r.n(pn),mn="isMultibyte";function gn(t){return"string"==typeof t&&$n()(t)}function vn(t){return _({name:mn,validator:{validate:function(t,e){return gn(t)},defaultMessage:A((function(t){return t+"$property must contain one or more multibyte chars"}),t)}},t)}var yn=r(2828),bn=r.n(yn),Mn="isSurrogatePair";function An(t){return"string"==typeof t&&bn()(t)}function _n(t){return _({name:Mn,validator:{validate:function(t,e){return An(t)},defaultMessage:A((function(t){return t+"$property must contain any surrogate pairs chars"}),t)}},t)}var wn=r(2492),En=r.n(wn),Sn="isUrl";function Nn(t,e){return"string"==typeof t&&En()(t,e)}function In(t,e){return _({name:Sn,constraints:[t],validator:{validate:function(t,e){return Nn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an URL address"}),e)}},e)}var On=r(7278),xn=r.n(On),Cn="isUuid";function Tn(t,e){return"string"==typeof t&&xn()(t,e)}function Pn(t,e){return _({name:Cn,constraints:[t],validator:{validate:function(t,e){return Tn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a UUID"}),e)}},e)}var Rn="IsFirebasePushId";function Fn(t){return"string"==typeof t&&20===t.length&&/^[a-zA-Z0-9_-]*$/.test(t)}function Ln(t){return _({name:Rn,validator:{validate:function(t,e){return Fn(t)},defaultMessage:A((function(t){return t+"$property must be a Firebase Push Id"}),t)}},t)}var Bn=r(7245),Dn=r.n(Bn),Un="isUppercase";function kn(t){return"string"==typeof t&&Dn()(t)}function Zn(t){return _({name:Un,validator:{validate:function(t,e){return kn(t)},defaultMessage:A((function(t){return t+"$property must be uppercase"}),t)}},t)}var jn=r(661),Gn=r.n(jn),Vn="isLength";function Hn(t,e,r){return"string"==typeof t&&Gn()(t,{min:e,max:r})}function zn(t,e,r){return _({name:Vn,constraints:[t,e],validator:{validate:function(t,e){return Hn(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t,e){var r=null!==e.constraints[0]&&void 0!==e.constraints[0],n=null!==e.constraints[1]&&void 0!==e.constraints[1];return r&&(!e.value||e.value.lengthe.constraints[1]?t+"$property must be shorter than or equal to $constraint2 characters":t+"$property must be longer than or equal to $constraint1 and shorter than or equal to $constraint2 characters"}),r)}},r)}var Kn="maxLength";function Yn(t,e){return"string"==typeof t&&Gn()(t,{min:0,max:e})}function Wn(t,e){return _({name:Kn,constraints:[t],validator:{validate:function(t,e){return Yn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be shorter than or equal to $constraint1 characters"}),e)}},e)}var Jn="minLength";function qn(t,e){return"string"==typeof t&&Gn()(t,{min:e})}function Xn(t,e){return _({name:Jn,constraints:[t],validator:{validate:function(t,e){return qn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be longer than or equal to $constraint1 characters"}),e)}},e)}var Qn=r(5090),ti=r.n(Qn),ei="matches";function ri(t,e,r){return"string"==typeof t&&ti()(t,e,r)}function ni(t,e,r){var n;return e&&e instanceof Object&&!r?r=e:n=e,_({name:ei,constraints:[t,n],validator:{validate:function(t,e){return ri(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t,e){return t+"$property must match $constraint1 regular expression"}),r)}},r)}const ii={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[25689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[25689]"]]]],BL:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}",[10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}"],0,0,0,["600[2-9]\\d{6}"]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-3]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:(?:1\\d|[36])\\d{3}|9101)\\d{6}|[124-8]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1 $2",["[146][2-9]|[2578]"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:1\\d|2[02-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[05]\\d|[23]1|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-59]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-59]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[47]\\d{6}|76\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0359])|(?:5[0-26-9]|[78][0-49])\\d\\d|6(?:[0-4]\\d\\d|50[0-24-69]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[0-278])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|55\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[38]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]","5(?:29|38)[89]0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:29(?:[189][05]|2[29]|3[01])|38[89][05])\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\d|5[02-9]|6[02-8]|80|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[01]\\d|6[1267]|7[0-57]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[57-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[57-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670"],MQ:["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[19]\\d|[23]1|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[017]\\d|[235][1-9]|4[0-35-9]|6[0-46-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9])|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","[2-57-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}",[5,6,7,8,9,10],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-579]|6[2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,0," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","[2-7]\\d{7}|800\\d{4}(?:\\d{2})?|2\\d{6}",[7,8,9],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]]],RE:["262","00","9769\\d{5}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]"],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","8000\\d{3}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-4]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:00|[1-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]","4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["[3-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}",[10],[["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|33)|4(?:00|4[24]|65|82)|5(?:00|29|83)|6(?:00|66|82)|777|8(?:00|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","4\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63"],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","(?:63|80)0\\d{6}|(?:21|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:005|[1-9]\\d\\d)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:005|[1-9]\\d\\d)\\d{5}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],883:["883",0,"(?:210|370\\d\\d)\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[35]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|(?:370[1-9]|51[013]0)\\d)\\d{7}|5100\\d{5}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function ai(t,e){var r=Array.prototype.slice.call(e);return r.push(ii),t.apply(this,r)}function oi(t){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oi(t)}function si(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function di(t){var e,r,n,i=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(Array.prototype.slice.call(t),4),a=i[0],o=i[1],s=i[2],d=i[3];if("string"!=typeof a)throw new TypeError("A text for parsing must be a string.");if(e=a,o&&"string"!=typeof o){if(!ui(o))throw new Error("Invalid second argument: ".concat(o));s?(r=o,n=s):n=o}else d?(r=s,n=d):(r=void 0,n=s),o&&(r=function(t){for(var e=1;eo)return 1;if(o>a)return-1;if(!isNaN(a)&&isNaN(o))return 1;if(isNaN(a)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=2&&Ri.test(t)}var Li=new RegExp("(?:"+xi()+")$","i"),Bi={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function Di(t){var e="",r=t.split(""),n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}e+=Ui(a,e)||""}return e}function Ui(t,e){if("+"===t){if(e)return;return"+"}return function(t){return Bi[t]}(t)}function ki(t,e){return Zi(t,void 0,e)}function Zi(t,e,r){var n=r.type(e),i=n&&n.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===e){if(!r.type("FIXED_LINE"))return Zi(t,"MOBILE",r);var a=r.type("MOBILE");a&&(i=function(t,e){var r=t.slice(),n=e,i=Array.isArray(n),a=0;for(n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var s=o;t.indexOf(s)<0&&r.push(s)}return r.sort((function(t,e){return t-e}))}(i,a.possibleLengths()))}else if(e&&!n)return"INVALID_LENGTH";var o=t.length,s=i[0];return s===o?"IS_POSSIBLE":s>o?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function ji(t,e){return"IS_POSSIBLE"===ki(t,e)}function Gi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Vi(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}var Hi=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function zi(t,e,r){if(e=e||{},t.country){(r=new yi(r)).selectNumberingPlan(t.country,t.countryCallingCode);var n=e.v2?t.nationalNumber:t.phone;if(Vi(n,r.nationalNumberPattern())){if(Ki(n,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?Ki(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i=0,a=Hi;i=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var o=a;if(o.leadingDigitsPatterns().length>0){var s=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(0!==e.search(s))continue}if(Vi(e,o.pattern()))return o}}(n.formats(),t);return a?function(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix,a=(r.carrierCode,r.metadata,t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(Yi,e.nationalPrefixFormattingRule()):e.format()));return n?function(t){return t.replace(new RegExp("[".concat(li,"]+"),"g")," ").trim()}(a):a}(t,a,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:e,metadata:n}):t}function Qi(t,e,r,n){return e?n(t,e,r):t}function ta(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ea(t,e){for(var r=0;r0&&n[s];if(e.nationalPrefixTransformRule()&&d)i=t.replace(r,e.nationalPrefixTransformRule()),s>1&&(a=n[1]);else{var u=n[0];i=t.slice(u.length),d&&(a=n[1])}if(d){var l=t.indexOf(n[1]);t.slice(0,l)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:i,nationalPrefix:o,carrierCode:a}}}return{nationalNumber:t}}(t,e),n=r.nationalNumber,i=r.carrierCode;if(!function(t,e,r){return!(Vi(t,r.nationalNumberPattern())&&!Vi(e,r.nationalNumberPattern()))}(t,n,e))return{nationalNumber:t};if(t.length!==n.length+(i?i.length:0)&&e.possibleLengths())switch(ki(n,e)){case"TOO_SHORT":case"INVALID_LENGTH":return{nationalNumber:t}}return{nationalNumber:n,carrierCode:i}}var oa=new RegExp("[++0-90-9٠-٩۰-۹]"),sa=new RegExp("[^0-90-9٠-٩۰-۹#]+$");function da(t,e,r){if(e=e||{},r=new yi(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry)){if(e.v2)throw new ci("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var n=function(t,e,r){if(t&&0===t.indexOf("tel:"))return function(t){var e,r,n=(t=t.replace(/^tel:/,"tel=")).split(";"),i=Array.isArray(n),a=0;for(n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var s=Gi(o.split("="),2),d=s[0],u=s[1];switch(d){case"tel":e=u;break;case"ext":r=u;break;case"phone-context":"+"===u[0]&&(e=u+e)}}if(!Fi(e))return{};var l={number:e};return r&&(l.ext=r),l}(t);var n=function(t,e,r){if(t)if(t.length>250){if(r)throw new ci("TOO_LONG")}else{if(!1===e)return t;var n=t.search(oa);if(!(n<0))return t.slice(n).replace(sa,"")}}(t,r,e);if(!n)return{};if(!Fi(n))return function(t){return Ti.test(t)}(n)?{error:"TOO_SHORT"}:{};var i=function(t){var e=t.search(Li);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(Li),i=1;i0&&"0"===o[1]))return t}}}(t,e,r,n);if(!i||i===t){if(e||r){var a=function(t,e,r,n){var i=e?Ni(e,n):r;if(0===t.indexOf(i)){(n=new yi(n)).selectNumberingPlan(e,r);var a=t.slice(i.length),o=aa(a,n).nationalNumber,s=aa(t,n).nationalNumber;if(!Vi(s,n.nationalNumberPattern())&&Vi(o,n.nationalNumberPattern())||"TOO_LONG"===ki(s,n))return{countryCallingCode:i,number:a}}return{number:t}}(t,e,r,n),o=a.countryCallingCode,s=a.number;if(o)return{countryCallingCode:o,number:s}}return{number:t}}t="+"+i}if("0"===t[1])return{};n=new yi(n);for(var d=2;d-1<=3&&d<=t.length;){var u=t.slice(1,d);if(n.hasCallingCode(u))return n.selectNumberingPlan(u),{countryCallingCode:u,number:t.slice(d)};d++}return{}}(Di(t),e,r,n.metadata),o=a.countryCallingCode,s=a.number;if(o)n.selectNumberingPlan(o);else{if(!s||!e&&!r)return{};n.selectNumberingPlan(e,r),e&&(i=e),o=r||Ni(e,n.metadata)}if(!s)return{countryCallingCode:o};var d=aa(Di(s),n),u=d.nationalNumber,l=d.carrierCode,c=function(t,e,r){var n=r.getCountryCodesForCallingCode(t);if(n)return 1===n.length?n[0]:function(t,e,r){r=new yi(r);var n=t,i=Array.isArray(n),a=0;for(n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var s=o;if(r.country(s),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return s}else if(zi({phone:e,country:s},void 0,r.metadata))return s}}(n,e,r.metadata)}(o,u,n);return c&&(i=c,"001"===c||n.country(i)),{country:i,countryCallingCode:o,nationalNumber:u,carrierCode:l}}(i,e.defaultCountry,e.defaultCallingCode,r),d=s.country,u=s.nationalNumber,l=s.countryCallingCode,c=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new ci("INVALID_COUNTRY");return{}}if(!u||u.length<2){if(e.v2)throw new ci("TOO_SHORT");return{}}if(u.length>17){if(e.v2)throw new ci("TOO_LONG");return{}}if(e.v2){var f=new ra(l,u,r.metadata);return d&&(f.country=d),c&&(f.carrierCode=c),a&&(f.ext=a),f}var h=!!(e.extended?r.hasSelectedNumberingPlan():d)&&Vi(u,r.nationalNumberPattern());return e.extended?{country:d,countryCallingCode:l,carrierCode:c,valid:h,possible:!!h||!(!0!==e.extended||!r.possibleLengths()||!ji(u,r)),phone:u,ext:a}:h?function(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}(d,u,a):{}}function ua(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function la(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ca(t,e,r){e&&e.defaultCountry&&!function(t,e){return void 0!==e.countries[t]}(e.defaultCountry,r)&&(e=function(t){for(var e=1;ee.maxDecimalPlaces)return!1}return Number.isFinite(t)}function Ls(t,e){return void 0===t&&(t={}),_({name:Rs,constraints:[t],validator:{validate:function(t,e){return Fs(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a number conforming to the specified constraints"}),e)}},e)}var Bs="isEnum";function Ds(t,e){return Object.keys(e).map((function(t){return e[t]})).indexOf(t)>=0}function Us(t,e){return _({name:Bs,constraints:[t],validator:{validate:function(t,e){return Ds(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a valid enum value"}),e)}},e)}var ks="isInt";function Zs(t){return"number"==typeof t&&Number.isInteger(t)}function js(t){return _({name:ks,validator:{validate:function(t,e){return Zs(t)},defaultMessage:A((function(t){return t+"$property must be an integer number"}),t)}},t)}var Gs="isString";function Vs(t){return t instanceof String||"string"==typeof t}function Hs(t){return _({name:Gs,validator:{validate:function(t,e){return Vs(t)},defaultMessage:A((function(t){return t+"$property must be a string"}),t)}},t)}var zs="isArray";function Ks(t){return Array.isArray(t)}function Ys(t){return _({name:zs,validator:{validate:function(t,e){return Ks(t)},defaultMessage:A((function(t){return t+"$property must be an array"}),t)}},t)}var Ws="isObject";function Js(t){return null!=t&&("object"==typeof t||"function"==typeof t)&&!Array.isArray(t)}function qs(t){return _({name:Ws,validator:{validate:function(t,e){return Js(t)},defaultMessage:A((function(t){return t+"$property must be an object"}),t)}},t)}var Xs="arrayContains";function Qs(t,e){return!!Array.isArray(t)&&e.every((function(e){return-1!==t.indexOf(e)}))}function td(t,e){return _({name:Xs,constraints:[t],validator:{validate:function(t,e){return Qs(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain $constraint1 values"}),e)}},e)}var ed="arrayNotContains";function rd(t,e){return!!Array.isArray(t)&&e.every((function(e){return-1===t.indexOf(e)}))}function nd(t,e){return _({name:ed,constraints:[t],validator:{validate:function(t,e){return rd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property should not contain $constraint1 values"}),e)}},e)}var id="arrayNotEmpty";function ad(t){return Array.isArray(t)&&t.length>0}function od(t){return _({name:id,validator:{validate:function(t,e){return ad(t)},defaultMessage:A((function(t){return t+"$property should not be empty"}),t)}},t)}var sd="arrayMinSize";function dd(t,e){return Array.isArray(t)&&t.length>=e}function ud(t,e){return _({name:sd,constraints:[t],validator:{validate:function(t,e){return dd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain at least $constraint1 elements"}),e)}},e)}var ld="arrayMaxSize";function cd(t,e){return Array.isArray(t)&&t.length<=e}function fd(t,e){return _({name:ld,constraints:[t],validator:{validate:function(t,e){return cd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain not more than $constraint1 elements"}),e)}},e)}var hd="arrayUnique";function pd(t,e){if(!Array.isArray(t))return!1;e&&(t=t.map((function(t){return null!=t?e(t):t})));var r=t.filter((function(t,e,r){return r.indexOf(t)===e}));return t.length===r.length}function $d(t,e){var r="function"==typeof t?t:void 0,n="function"!=typeof t?t:e;return _({name:hd,validator:{validate:function(t,e){return pd(t,r)},defaultMessage:A((function(t){return t+"All $property's elements must be unique"}),n)}},n)}var md="isNotEmptyObject";function gd(t,e){if(!Js(t))return!1;if(!0===(null==e?void 0:e.nullable))return!Object.values(t).every((function(t){return null==t}));for(var r in t)if(t.hasOwnProperty(r))return!0;return!1}function vd(t,e){return _({name:md,constraints:[t],validator:{validate:function(t,e){return gd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a non-empty object"}),e)}},e)}var yd="isInstance";function bd(t,e){return e&&"function"==typeof e&&t instanceof e}function Md(t,e){return _({name:yd,constraints:[t],validator:{validate:function(t,e){return bd(t,e.constraints[0])},defaultMessage:A((function(t,e){return e.constraints[0]?t+"$property must be an instance of ".concat(e.constraints[0].name):t+"".concat(yd," decorator expects and object as value, but got falsy value.")}),e)}},e)}function Ad(t,e,r){return"string"==typeof t?v($).validate(t,e,r):v($).validate(t,e)}function _d(t,e,r){return"string"==typeof t?v($).validateOrReject(t,e,r):v($).validateOrReject(t,e)}function wd(t,e,r){return"string"==typeof t?v($).validateSync(t,e,r):v($).validateSync(t,e)}function Ed(t){s().addValidationSchema(t)}},1094:(t,e,r)=>{var n;!function(){"use strict";var i="input is invalid type",a="object"==typeof window,o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var s=!a&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=global:s&&(o=self);var d=!o.JS_SHA3_NO_COMMON_JS&&t.exports,u=r.amdO,l=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),f=[4,1024,262144,67108864],h=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],$=[224,256,384,512],m=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var y=function(t,e,r){return function(n){return new R(t,e,t).update(n)[r]()}},b=function(t,e,r){return function(n,i){return new R(t,e,i).update(n)[r]()}},M=function(t,e,r){return function(e,n,i,a){return S["cshake"+t].update(e,n,i,a)[r]()}},A=function(t,e,r){return function(e,n,i,a){return S["kmac"+t].update(e,n,i,a)[r]()}},_=function(t,e,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(t,e,r){R.call(this,t,e,r)}R.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}for(var n,a,o=this.blocks,s=this.byteCount,d=t.length,u=this.blockCount,c=0,f=this.s;c>2]|=t[c]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(o[n>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=s){for(this.start=n-s,this.block=o[u],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}var n=0,a=t.length;if(e)n=a;else for(var o=0;o=57344?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},R.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15];o%e==0&&(L(r),a=0)}return i&&(t=r[a],s+=c[t>>4&15]+c[15&t],i>1&&(s+=c[t>>12&15]+c[t>>8&15]),i>2&&(s+=c[t>>20&15]+c[t>>16&15])),s},R.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var d=new Uint32Array(t);o>8&255,d[t+2]=e>>16&255,d[t+3]=e>>24&255;s%r==0&&L(n)}return a&&(t=s<<2,e=n[o],d[t]=255&e,a>1&&(d[t+1]=e>>8&255),a>2&&(d[t+2]=e>>16&255)),d},F.prototype=new R,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var L=function(t){var e,r,n,i,a,o,s,d,u,l,c,f,h,$,m,g,v,y,b,M,A,_,w,E,S,N,I,O,x,C,T,P,R,F,L,B,D,U,k,Z,j,G,V,H,z,K,Y,W,J,q,X,Q,tt,et,rt,nt,it,at,ot,st,dt,ut,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],a=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],d=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(o<<1|s>>>31),r=(h=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(d<<1|u>>>31),r=a^(u<<1|d>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|c>>>31),r=s^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=d^(f<<1|h>>>31),r=u^(h<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|a>>>31),r=c^(a<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,$=t[0],m=t[1],K=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,dt=t[30]<<9|t[31]>>>23,G=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,F=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,C=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,q=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,R=t[44]<<29|t[45]>>>3,E=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,k=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,H=t[8]<<27|t[9]>>>5,z=t[9]<<27|t[8]>>>5,N=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,at=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,Z=t[38]<<8|t[39]>>>24,j=t[39]<<8|t[38]>>>24,_=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=$^~g&y,t[1]=m^~v&b,t[10]=E^~N&O,t[11]=S^~I&x,t[20]=F^~B&U,t[21]=L^~D&k,t[30]=H^~K&W,t[31]=z^~Y&J,t[40]=et^~nt&at,t[41]=rt^~it&ot,t[2]=g^~y&M,t[3]=v^~b&A,t[12]=N^~O&C,t[13]=I^~x&T,t[22]=B^~U&Z,t[23]=D^~k&j,t[32]=K^~W&q,t[33]=Y^~J&X,t[42]=nt^~at&st,t[43]=it^~ot&dt,t[4]=y^~M&_,t[5]=b^~A&w,t[14]=O^~C&P,t[15]=x^~T&R,t[24]=U^~Z&G,t[25]=k^~j&V,t[34]=W^~q&Q,t[35]=J^~X&tt,t[44]=at^~st&ut,t[45]=ot^~dt<,t[6]=M^~_&$,t[7]=A^~w&m,t[16]=C^~P&E,t[17]=T^~R&S,t[26]=Z^~G&F,t[27]=j^~V&L,t[36]=q^~Q&H,t[37]=X^~tt&z,t[46]=st^~ut&et,t[47]=dt^~lt&rt,t[8]=_^~$&g,t[9]=w^~m&v,t[18]=P^~E&N,t[19]=R^~S&I,t[28]=G^~F&B,t[29]=V^~L&D,t[38]=Q^~H&K,t[39]=tt^~z&Y,t[48]=ut^~et&nt,t[49]=lt^~rt&it,t[0]^=p[n],t[1]^=p[n+1]};if(d)t.exports=S;else{for(I=0;I{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.commaDecimal=e.dotDecimal=e.farsiLocales=e.arabicLocales=e.englishLocales=e.decimal=e.alphanumeric=e.alpha=void 0;var r={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i};e.alpha=r;var n={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i};e.alphanumeric=n;var i={"en-US":".",ar:"٫"};e.decimal=i;var a=["AU","GB","HK","IN","NZ","ZA","ZM"];e.englishLocales=a;for(var o,s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){return(0,n.default)(t),(r=(0,a.default)(r,s)).ignoreCase?t.toLowerCase().split((0,i.default)(e).toLowerCase()).length>r.minOccurrences:t.split((0,i.default)(e)).length>r.minOccurrences};var n=o(r(5571)),i=o(r(1913)),a=o(r(4808));function o(t){return t&&t.__esModule?t:{default:t}}var s={ignoreCase:!1,minOccurrences:1};t.exports=e.default,t.exports.default=e.default},9234:(t,e,r)=>{"use strict";e.ZP=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(t);var n=t,o=r.ignore;if(o)if(o instanceof RegExp)n=n.replace(o,"");else{if("string"!=typeof o)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(o.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(e in a.alpha)return a.alpha[e].test(n);throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79);Object.keys(a.alpha)},4583:(t,e,r)=>{"use strict";e.ZP=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(t);var n=t,o=r.ignore;if(o)if(o instanceof RegExp)n=n.replace(o,"");else{if("string"!=typeof o)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(o.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(e in a.alphanumeric)return a.alphanumeric[e].test(n);throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79);Object.keys(a.alphanumeric)},4094:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[\x00-\x7F]+$/;t.exports=e.default,t.exports.default=e.default},2438:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),!!a.CountryCodes.has(t.slice(4,6).toUpperCase())&&o.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(1727),o=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;t.exports=e.default,t.exports.default=e.default},2782:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),!(t.length%8!=0||!a.test(t))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Z2-7]+=*$/;t.exports=e.default,t.exports.default=e.default},2689:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(t),e=(0,i.default)(e,d);var r=t.length;if(e.urlSafe)return s.test(t);if(r%4!=0||o.test(t))return!1;var a=t.indexOf("=");return-1===a||a===r-1||a===r-2&&"="===t[r-1]};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}var o=/[^A-Z0-9+\/=]/i,s=/^[A-Z0-9_\-]*$/i,d={urlSafe:!1};t.exports=e.default,t.exports.default=e.default},9493:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return(0,i.default)(t),e.loose?s.includes(t.toLowerCase()):o.includes(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={loose:!1},o=["true","false","1","0"],s=[].concat(o,["yes","no"]);t.exports=e.default,t.exports.default=e.default},8021:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),t.startsWith("bc1")?a.test(t):o.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(bc1)[a-z0-9]{25,39}$/,o=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;t.exports=e.default,t.exports.default=e.default},3235:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r,n;(0,i.default)(t),"object"===a(e)?(r=e.min||0,n=e.max):(r=arguments[1],n=arguments[2]);var o=encodeURI(t).split(/%..|./).length-1;return o>=r&&(void 0===n||o<=n)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}t.exports=e.default,t.exports.default=e.default},682:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e=t.replace(/[- ]+/g,"");if(!a.test(e))return!1;for(var r,n,o,s=0,d=e.length-1;d>=0;d--)r=e.substring(d,d+1),n=parseInt(r,10),s+=o&&(n*=2)>=10?n%10+1:n,o=!o;return!(s%10!=0||!e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;t.exports=e.default,t.exports.default=e.default},94:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),function(t){var e="\\d{".concat(t.digits_after_decimal[0],"}");t.digits_after_decimal.forEach((function(t,r){0!==r&&(e="".concat(e,"|\\d{").concat(t,"}"))}));var r="(".concat(t.symbol.replace(/\W/,(function(t){return"\\".concat(t)})),")").concat(t.require_symbol?"":"?"),n="-?",i="[1-9]\\d{0,2}(\\".concat(t.thousands_separator,"\\d{3})*"),a="(".concat(["0","[1-9]\\d*",i].join("|"),")?"),o="(\\".concat(t.decimal_separator,"(").concat(e,"))").concat(t.require_decimal?"":"?"),s=a+(t.allow_decimal||t.require_decimal?o:"");return t.allow_negatives&&!t.parens_for_negatives&&(t.negative_sign_after_digits?s+=n:t.negative_sign_before_digits&&(s=n+s)),t.allow_negative_sign_placeholder?s="( (?!\\-))?".concat(s):t.allow_space_after_symbol?s=" ?".concat(s):t.allow_space_after_digits&&(s+="( (?!$))?"),t.symbol_after_digits?s+=r:s=r+s,t.allow_negatives&&(t.parens_for_negatives?s="(\\(".concat(s,"\\)|").concat(s,")"):t.negative_sign_before_digits||t.negative_sign_after_digits||(s=n+s)),new RegExp("^(?!-? )(?=.*\\d)".concat(s,"$"))}(e=(0,n.default)(e,o)).test(t)};var n=a(r(4808)),i=a(r(5571));function a(t){return t&&t.__esModule?t:{default:t}}var o={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};t.exports=e.default,t.exports.default=e.default},8983:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e=t.split(",");if(e.length<2)return!1;var r=e.shift().trim().split(";"),n=r.shift();if("data:"!==n.substr(0,5))return!1;var d=n.substr(5);if(""!==d&&!a.test(d))return!1;for(var u=0;u{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,i.default)(t),(e=(0,n.default)(e,d)).locale in o.decimal)return!(0,a.default)(u,t.replace(/ /g,""))&&function(t){return new RegExp("^[-+]?([0-9]+)?(\\".concat(o.decimal[t.locale],"[0-9]{").concat(t.decimal_digits,"})").concat(t.force_decimal?"":"?","$"))}(e).test(t);throw new Error("Invalid locale '".concat(e.locale,"'"))};var n=s(r(4808)),i=s(r(5571)),a=s(r(8343)),o=r(79);function s(t){return t&&t.__esModule?t:{default:t}}var d={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},u=["","-","+"];t.exports=e.default,t.exports.default=e.default},8335:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,n.default)(t),(0,i.default)(t)%parseInt(e,10)==0};var n=a(r(5571)),i=a(r(7536));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default,t.exports.default=e.default},5807:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e,r,n=Number(t.slice(-1));return a.test(t)&&n===((r=10-(e=t).slice(0,-1).split("").map((function(t,r){return Number(t)*function(t,e){return 8===t||14===t?e%2==0?3:1:e%2==0?1:3}(e.length,r)})).reduce((function(t,e){return t+e}),0)%10)<10?r:0)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(\d{8}|\d{13}|\d{14})$/;t.exports=e.default,t.exports.default=e.default},3868:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),(e=(0,i.default)(e,u)).require_display_name||e.allow_display_name){var r=t.match(l);if(r){var d=r[1];if(t=t.replace(d,"").replace(/(^<|>$)/g,""),d.endsWith(" ")&&(d=d.substr(0,d.length-1)),!function(t){var e=t.replace(/^"(.+)"$/,"$1");if(!e.trim())return!1;if(/[\.";<>]/.test(e)){if(e===t)return!1;if(e.split('"').length!==e.split('\\"').length)return!1}return!0}(d))return!1}else if(e.require_display_name)return!1}if(!e.ignore_max_length&&t.length>254)return!1;var m=t.split("@"),g=m.pop(),v=g.toLowerCase();if(e.host_blacklist.includes(v))return!1;var y=m.join("@");if(e.domain_specific_validation&&("gmail.com"===v||"googlemail.com"===v)){var b=(y=y.toLowerCase()).split("+")[0];if(!(0,a.default)(b.replace(/\./g,""),{min:6,max:30}))return!1;for(var M=b.split("."),A=0;A{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(0x)[0-9a-f]{40}$/i;t.exports=e.default,t.exports.default=e.default},221:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(t),(e=(0,i.default)(e,o)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),!0===e.allow_wildcard&&0===t.indexOf("*.")&&(t=t.substring(2));var r=t.split("."),a=r[r.length-1];if(e.require_tld){if(r.length<2)return!1;if(!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}return!(!e.allow_numeric_tld&&/^\d+$/.test(a))&&r.every((function(t){return!(t.length>63||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!e.allow_underscores&&/_/.test(t))}))};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1};t.exports=e.default,t.exports.default=e.default},9146:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t),e=e||{};var r=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(e.locale?a.decimal[e.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(""===t||"."===t||"-"===t||"+"===t)return!1;var n=parseFloat(t.replace(",","."));return r.test(t)&&(!e.hasOwnProperty("min")||n>=e.min)&&(!e.hasOwnProperty("max")||n<=e.max)&&(!e.hasOwnProperty("lt")||ne.gt)},e.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79),o=Object.keys(a.decimal);e.locales=o},7146:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)},e.fullWidth=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;e.fullWidth=a},6648:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e=t.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/gi,"$1");return-1!==e.indexOf(",")?a.test(e):o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,o=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;t.exports=e.default,t.exports.default=e.default},2941:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)},e.halfWidth=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;e.halfWidth=a},8874:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),new RegExp("^[a-fA-F0-9]{".concat(a[e],"}$")).test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};t.exports=e.default,t.exports.default=e.default},6298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;t.exports=e.default,t.exports.default=e.default},7117:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(0x|0h)?[0-9A-F]+$/i;t.exports=e.default,t.exports.default=e.default},8177:(t,e,r)=>{"use strict";e.ZP=function(t){return(0,i.default)(t),function(t){var e=t.replace(/[\s\-]+/gi,"").toUpperCase(),r=e.slice(0,2).toUpperCase();return r in a&&a[r].test(e)}(t)&&function(t){var e=t.replace(/[^A-Z0-9]+/gi,"").toUpperCase();return 1===(e.slice(4)+e.slice(0,4)).replace(/[A-Z]/g,(function(t){return t.charCodeAt(0)-55})).match(/\d{1,7}/g).reduce((function(t,e){return Number(t+e)%97}),"")}(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};Object.keys(a)},1028:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,i.default)(e),!(r=String(r)))return t(e,4)||t(e,6);if("4"===r){if(!s.test(e))return!1;var n=e.split(".").sort((function(t,e){return t-e}));return n[3]<=255}return"6"===r&&!!u.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",o="(".concat(a,"[.]){3}").concat(a),s=new RegExp("^".concat(o,"$")),d="(?:[0-9a-fA-F]{1,4})",u=new RegExp("^("+"(?:".concat(d,":){7}(?:").concat(d,"|:)|")+"(?:".concat(d,":){6}(?:").concat(o,"|:").concat(d,"|:)|")+"(?:".concat(d,":){5}(?::").concat(o,"|(:").concat(d,"){1,2}|:)|")+"(?:".concat(d,":){4}(?:(:").concat(d,"){0,1}:").concat(o,"|(:").concat(d,"){1,3}|:)|")+"(?:".concat(d,":){3}(?:(:").concat(d,"){0,2}:").concat(o,"|(:").concat(d,"){1,4}|:)|")+"(?:".concat(d,":){2}(?:(:").concat(d,"){0,3}:").concat(o,"|(:").concat(d,"){1,5}|:)|")+"(?:".concat(d,":){1}(?:(:").concat(d,"){0,4}:").concat(o,"|(:").concat(d,"){1,6}|:)|")+"(?::((?::".concat(d,"){0,5}:").concat(o,"|(?::").concat(d,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");t.exports=e.default,t.exports.default=e.default},7612:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,i.default)(e),!(r=String(r)))return t(e,10)||t(e,13);var n,d=e.replace(/[\s-]+/g,""),u=0;if("10"===r){if(!a.test(d))return!1;for(n=0;n<9;n++)u+=(n+1)*d.charAt(n);if("X"===d.charAt(9)?u+=100:u+=10*d.charAt(9),u%11==0)return!!d}else if("13"===r){if(!o.test(d))return!1;for(n=0;n<12;n++)u+=s[n%2]*d.charAt(n);if(d.charAt(12)-(10-u%10)%10==0)return!!d}return!1};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:[0-9]{9}X|[0-9]{10})$/,o=/^(?:[0-9]{13})$/,s=[1,3];t.exports=e.default,t.exports.default=e.default},7148:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,i.default)(t),!a.test(t))return!1;for(var e=!0,r=0,n=t.length-2;n>=0;n--)if(t[n]>="A"&&t[n]<="Z")for(var o=t[n].charCodeAt(0)-55,s=0,d=[o%10,Math.trunc(o/10)];s=5?1+2*(u-5):2*u:u,e=!e}else{var l=t[n].charCodeAt(0)-"0".charCodeAt(0);r+=e?l>=5?1+2*(l-5):2*l:l,e=!e}var c=10*Math.trunc((r+9)/10)-r;return+t[t.length-1]===c};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;t.exports=e.default,t.exports.default=e.default},1727:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.has(t.toUpperCase())},e.CountryCodes=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]),o=a;e.CountryCodes=o},6776:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.has(t.toUpperCase())};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);t.exports=e.default,t.exports.default=e.default},5061:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(t);var r=e.strictSeparator?o.test(t):a.test(t);return r&&e.strict?s(t):r};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,o=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,s=function(t){var e=t.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(e){var r=Number(e[1]),n=Number(e[2]);return r%4==0&&r%100!=0||r%400==0?n<=366:n<=365}var i=t.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),a=i[1],o=i[2],s=i[3],d=o?"0".concat(o).slice(-2):o,u=s?"0".concat(s).slice(-2):s,l=new Date("".concat(a,"-").concat(d||"01","-").concat(u||"01"));return!o||!s||l.getUTCFullYear()===a&&l.getUTCMonth()+1===o&&l.getUTCDate()===s};t.exports=e.default,t.exports.default=e.default},4339:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;t.exports=e.default,t.exports.default=e.default},9887:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(t);var r=a;if(r=e.require_hyphen?r.replace("?",""):r,!(r=e.case_sensitive?new RegExp(r):new RegExp(r,"i")).test(t))return!1;for(var n=t.replace("-","").toUpperCase(),o=0,s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),e in o)return o[e](t);if("any"===e){for(var r in o)if(o.hasOwnProperty(r)&&(0,o[r])(t))return!0;return!1}throw new Error("Invalid locale '".concat(e,"'"))};var n=a(r(5571)),i=a(r(937));function a(t){return t&&t.__esModule?t:{default:t}}var o={PL:function(t){(0,n.default)(t);var e={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(null!=t&&11===t.length&&(0,i.default)(t,{allow_leading_zeroes:!0})){var r=t.split("").slice(0,-1).reduce((function(t,r,n){return t+Number(r)*e[n+1]}),0)%10,a=Number(t.charAt(t.length-1));if(0===r&&0===a||a===10-r)return!0}return!1},ES:function(t){(0,n.default)(t);var e={X:0,Y:1,Z:2},r=t.trim().toUpperCase();if(!/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/.test(r))return!1;var i=r.slice(0,-1).replace(/[X,Y,Z]/g,(function(t){return e[t]}));return r.endsWith(["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"][i%23])},FI:function(t){return(0,n.default)(t),11===t.length&&(!!t.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)&&"0123456789ABCDEFHJKLMNPRSTUVWXY"[(1e3*parseInt(t.slice(0,6),10)+parseInt(t.slice(7,10),10))%31]===t.slice(10,11))},IN:function(t){var e=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],r=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],n=t.trim();if(!/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/.test(n))return!1;var i=0;return n.replace(/\s/g,"").split("").map(Number).reverse().forEach((function(t,n){i=e[i][r[n%8][t]]})),0===i},IR:function(t){if(!t.match(/^\d{10}$/))return!1;if(t="0000".concat(t).substr(t.length-6),0===parseInt(t.substr(3,6),10))return!1;for(var e=parseInt(t.substr(9,1),10),r=0,n=0;n<9;n++)r+=parseInt(t.substr(n,1),10)*(10-n);return(r%=11)<2&&e===r||r>=2&&e===11-r},IT:function(t){return 9===t.length&&"CA00000AA"!==t&&t.search(/C[A-Z][0-9]{5}[A-Z]{2}/i)>-1},NO:function(t){var e=t.trim();if(isNaN(Number(e)))return!1;if(11!==e.length)return!1;if("00000000000"===e)return!1;var r=e.split("").map(Number),n=(11-(3*r[0]+7*r[1]+6*r[2]+1*r[3]+8*r[4]+9*r[5]+4*r[6]+5*r[7]+2*r[8])%11)%11,i=(11-(5*r[0]+4*r[1]+3*r[2]+2*r[3]+7*r[4]+6*r[5]+5*r[6]+4*r[7]+3*r[8]+2*n)%11)%11;return n===r[9]&&i===r[10]},TH:function(t){if(!t.match(/^[1-8]\d{12}$/))return!1;for(var e=0,r=0;r<12;r++)e+=parseInt(t[r],10)*(13-r);return t[12]===((11-e%11)%10).toString()},LK:function(t){return!(10!==t.length||!/^[1-9]\d{8}[vx]$/i.test(t))||!(12!==t.length||!/^[1-9]\d{11}$/i.test(t))},"he-IL":function(t){var e=t.trim();if(!/^\d{9}$/.test(e))return!1;for(var r,n=e,i=0,a=0;a9?r-9:r;return i%10==0},"ar-LY":function(t){var e=t.trim();return!!/^(1|2)\d{11}$/.test(e)},"ar-TN":function(t){var e=t.trim();return!!/^\d{8}$/.test(e)},"zh-CN":function(t){var e,r=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],n=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],i=["1","0","X","9","8","7","6","5","4","3","2"],a=function(t){return r.includes(t)},o=function(t){var e=parseInt(t.substring(0,4),10),r=parseInt(t.substring(4,6),10),n=parseInt(t.substring(6),10),i=new Date(e,r-1,n);return!(i>new Date)&&i.getFullYear()===e&&i.getMonth()===r-1&&i.getDate()===n};return!!/^\d{15}|(\d{17}(\d|x|X))$/.test(e=t)&&(15===e.length?function(t){var e=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(t);if(!e)return!1;var r=t.substring(0,2);if(!(e=a(r)))return!1;var n="19".concat(t.substring(6,12));return!!(e=o(n))}(e):function(t){var e=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(t);if(!e)return!1;var r=t.substring(0,2);if(!(e=a(r)))return!1;var s=t.substring(6,14);return!!(e=o(s))&&function(t){return function(t){for(var e=t.substring(0,17),r=0,a=0;a<17;a++)r+=parseInt(e.charAt(a),10)*parseInt(n[a],10);return i[r%11]}(t)===t.charAt(17).toUpperCase()}(t)}(e))},"zh-TW":function(t){var e={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},r=t.trim().toUpperCase();return!!/^[A-Z][0-9]{9}$/.test(r)&&Array.from(r).reduce((function(t,r,n){if(0===n){var i=e[r];return i%10*9+Math.floor(i/10)}return 9===n?(10-t%10-Number(r))%10==0:t+Number(r)*(9-n)}),0)}};t.exports=e.default,t.exports.default=e.default},937:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t);var r=(e=e||{}).hasOwnProperty("allow_leading_zeroes")&&!e.allow_leading_zeroes?a:o,n=!e.hasOwnProperty("min")||t>=e.min,s=!e.hasOwnProperty("max")||t<=e.max,d=!e.hasOwnProperty("lt")||te.gt;return r.test(t)&&n&&s&&d&&u};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,o=/^[-+]?[0-9]+$/;t.exports=e.default,t.exports.default=e.default},1008:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(t);try{e=(0,i.default)(e,s);var r=[];e.allow_primitives&&(r=[null,!1,!0]);var a=JSON.parse(t);return r.includes(a)||!!a&&"object"===o(a)}catch(t){}return!1};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var s={allow_primitives:!1};t.exports=e.default,t.exports.default=e.default},4979:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,n.default)(t);var e=t.split("."),r=e.length;return!(r>3||r<2)&&e.reduce((function(t,e){return t&&(0,i.default)(e,{urlSafe:!0})}),!0)};var n=a(r(5571)),i=a(r(2689));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default,t.exports.default=e.default},478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),e=(0,i.default)(e,l),!t.includes(","))return!1;var r=t.split(",");return!(r[0].startsWith("(")&&!r[1].endsWith(")")||r[1].endsWith(")")&&!r[0].startsWith("("))&&(e.checkDMS?d.test(r[0])&&u.test(r[1]):o.test(r[0])&&s.test(r[1]))};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}var o=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,s=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,d=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,u=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,l={checkDMS:!1};t.exports=e.default,t.exports.default=e.default},661:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r,n;(0,i.default)(t),"object"===a(e)?(r=e.min||0,n=e.max):(r=arguments[1]||0,n=arguments[2]);var o=t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],s=t.length-o.length;return s>=r&&(void 0===n||s<=n)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}t.exports=e.default,t.exports.default=e.default},7380:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),"en_US_POSIX"===t||"ca_ES_VALENCIA"===t||a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Za-z]{2,4}([_-]([A-Za-z]{4}|[\d]{3}))?([_-]([A-Za-z]{2}|[\d]{3}))?$/;t.exports=e.default,t.exports.default=e.default},3928:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),t===t.toLowerCase()};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},8999:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),e&&(e.no_colons||e.no_separators)?o.test(t):a.test(t)||s.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,o=/^([0-9a-fA-F]){12}$/,s=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/;t.exports=e.default,t.exports.default=e.default},2776:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t.trim())};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^magnet:\?xt(?:\.1)?=urn:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?($|&)/i;t.exports=e.default,t.exports.default=e.default},4554:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)||o.test(t)||s.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i,o=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,s=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;t.exports=e.default,t.exports.default=e.default},8355:(t,e,r)=>{"use strict";e.ZP=function(t,e,r){if((0,i.default)(t),r&&r.strictMode&&!t.startsWith("+"))return!1;if(Array.isArray(e))return e.some((function(e){return!(!a.hasOwnProperty(e)||!a[e].test(t))}));if(e in a)return a[e].test(t);if(!e||"any"===e){for(var n in a)if(a.hasOwnProperty(n)&&a[n].test(t))return!0;return!1}throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={"am-AM":/^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)[569]\d{7}$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)[1|3])([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|91|9[3-9])\d{7}$/,"el-GR":/^(\+?30|0)?(69\d{8})$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}))/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(5|79)\d{7}$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"ms-MY":/^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[2-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-RO":/^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/};a["en-CA"]=a["en-US"],a["fr-CA"]=a["en-CA"],a["fr-BE"]=a["nl-BE"],a["zh-HK"]=a["en-HK"],a["zh-MO"]=a["en-MO"],a["ga-IE"]=a["en-IE"],a["fr-CH"]=a["de-CH"],a["it-CH"]=a["fr-CH"],Object.keys(a)},9131:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,n.default)(t),(0,i.default)(t)&&24===t.length};var n=a(r(5571)),i=a(r(7117));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default,t.exports.default=e.default},3590:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[^\x00-\x7F]/;t.exports=e.default,t.exports.default=e.default},4986:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),e&&e.no_symbols?o.test(t):new RegExp("^[+-]?([0-9]*[".concat((e||{}).locale?a.decimal[e.locale]:".","])?[0-9]+$")).test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79),o=/^[0-9]+$/;t.exports=e.default,t.exports.default=e.default},6090:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(0o)?[0-7]+$/i;t.exports=e.default,t.exports.default=e.default},1513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t);var r=t.replace(/\s/g,"").toUpperCase();return e.toUpperCase()in a&&a[e].test(r)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/};t.exports=e.default,t.exports.default=e.default},4595:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t,{min:0,max:65535})};var n,i=(n=r(937))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},8140:(t,e,r)=>{"use strict";e.ZP=function(t,e){if((0,i.default)(t),e in d)return d[e].test(t);if("any"===e){for(var r in d)if(d.hasOwnProperty(r)&&d[r].test(t))return!0;return!1}throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^\d{4}$/,o=/^\d{5}$/,s=/^\d{6}$/,d={AD:/^AD\d{3}$/,AT:a,AU:a,AZ:/^AZ\d{4}$/,BE:a,BG:a,BR:/^\d{5}-\d{3}$/,BY:/2[1-4]{1}\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:a,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:o,DK:a,DO:o,DZ:o,EE:o,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:o,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:a,ID:o,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/\b(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}\b/,IS:/^\d{3}$/,IT:o,JP:/^\d{3}\-\d{4}$/,KE:o,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:a,LV:/^LV\-\d{4}$/,LK:o,MX:o,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:o,NL:/^\d{4}\s?[a-z]{2}$/i,NO:a,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:a,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:s,RU:s,SA:o,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:s,SI:a,SK:/^\d{3}\s?\d{2}$/,TH:o,TN:a,TW:/^\d{3}(\d{2})?$/,UA:o,US:/^\d{5}(-\d{4})?$/,ZA:a,ZM:o};Object.keys(d)},4611:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),f.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/([01][0-9]|2[0-3])/,o=/[0-5][0-9]/,s=new RegExp("[-+]".concat(a.source,":").concat(o.source)),d=new RegExp("([zZ]|".concat(s.source,")")),u=new RegExp("".concat(a.source,":").concat(o.source,":").concat(/([0-5][0-9]|60)/.source).concat(/(\.[0-9]+)?/.source)),l=new RegExp("".concat(/[0-9]{4}/.source,"-").concat(/(0[1-9]|1[0-2])/.source,"-").concat(/([12]\d|0[1-9]|3[01])/.source)),c=new RegExp("".concat(u.source).concat(d.source)),f=new RegExp("^".concat(l.source,"[ tT]").concat(c.source,"$"));t.exports=e.default,t.exports.default=e.default},6454:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,i.default)(t),e?a.test(t)||o.test(t)||s.test(t)||d.test(t):a.test(t)||o.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,o=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,s=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)/,d=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)/;t.exports=e.default,t.exports.default=e.default},6826:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,n.default)(t),a.test(t)};var n=i(r(5571));function i(t){return t&&t.__esModule?t:{default:t}}var a=(0,i(r(4731)).default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");t.exports=e.default,t.exports.default=e.default},2828:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;t.exports=e.default,t.exports.default=e.default},2492:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),!t||/[\s<>]/.test(t))return!1;if(0===t.indexOf("mailto:"))return!1;if((e=(0,o.default)(e,u)).validate_length&&t.length>=2083)return!1;if(!e.allow_fragments&&t.includes("#"))return!1;if(!e.allow_query_components&&(t.includes("?")||t.includes("&")))return!1;var r,s,f,h,p,$,m,g,v;if(m=t.split("#"),t=m.shift(),m=t.split("?"),t=m.shift(),(m=t.split("://")).length>1){if(r=m.shift().toLowerCase(),e.require_valid_protocol&&-1===e.protocols.indexOf(r))return!1}else{if(e.require_protocol)return!1;if("//"===t.substr(0,2)){if(!e.allow_protocol_relative_urls)return!1;m[0]=t.substr(2)}}if(""===(t=m.join("://")))return!1;if(m=t.split("/"),""===(t=m.shift())&&!e.require_host)return!0;if((m=t.split("@")).length>1){if(e.disallow_auth)return!1;if(""===m[0])return!1;if((s=m.shift()).indexOf(":")>=0&&s.split(":").length>2)return!1;var y=function(t){if(Array.isArray(t))return t}(v=s.split(":"))||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),2!==r.length);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(v)||function(t,e){if(t){if("string"==typeof t)return d(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,2):void 0}}(v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],M=y[1];if(""===b&&""===M)return!1}$=null,g=null;var A=(h=m.join("@")).match(l);if(A?(f="",g=A[1],$=A[2]||null):(f=(m=h.split(":")).shift(),m.length&&($=m.join(":"))),null!==$&&$.length>0){if(p=parseInt($,10),!/^[0-9]+$/.test($)||p<=0||p>65535)return!1}else if(e.require_port)return!1;return e.host_whitelist?c(f,e.host_whitelist):!!((0,a.default)(f)||(0,i.default)(f,e)||g&&(0,a.default)(g,6))&&(f=f||g,!e.host_blacklist||!c(f,e.host_blacklist))};var n=s(r(5571)),i=s(r(221)),a=s(r(1028)),o=s(r(4808));function s(t){return t&&t.__esModule?t:{default:t}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t);var r=a[[void 0,null].includes(e)?"all":e];return!!r&&r.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};t.exports=e.default,t.exports.default=e.default},7245:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),t===t.toUpperCase()};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},9019:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.fullWidth.test(t)&&o.halfWidth.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(7146),o=r(2941);t.exports=e.default,t.exports.default=e.default},5090:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){return(0,i.default)(t),"[object RegExp]"!==Object.prototype.toString.call(e)&&(e=new RegExp(e,r)),e.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},7536:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t)?parseFloat(t):NaN};var n,i=(n=r(9146))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},5571:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(!("string"==typeof t||t instanceof String)){var e=r(t);throw null===t?e="null":"object"===e&&(e=t.constructor.name),new TypeError("Expected a string but received a ".concat(e))}},t.exports=e.default,t.exports.default=e.default},8343:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t,e){return t.some((function(t){return e===t}))},t.exports=e.default,t.exports.default=e.default},4808:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t},t.exports=e.default,t.exports.default=e.default},4731:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r=t.join("");return new RegExp(r,e)},t.exports=e.default,t.exports.default=e.default},1913:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return"object"===r(t)&&null!==t?t="function"==typeof t.toString?t.toString():"[object Object]":(null==t||isNaN(t)&&!t.length)&&(t=""),String(t)},t.exports=e.default,t.exports.default=e.default},4300:t=>{"use strict";t.exports=require("buffer")}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n=r(7852),i=exports;for(var a in n)i[a]=n[a];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/packages/node/test/projectFixture/v0.2.0/package.json b/packages/node/test/projectFixture/v0.2.0/package.json index 9f35fcf7..2076e80f 100644 --- a/packages/node/test/projectFixture/v0.2.0/package.json +++ b/packages/node/test/projectFixture/v0.2.0/package.json @@ -20,7 +20,7 @@ "license": "Apache-2.0", "devDependencies": { "@polkadot/api": "^5.7.1", - "@subql/types": "latest", + "@subql/types-ethereum": "latest", "typescript": "^4.1.3", "@subql/cli": "latest" } diff --git a/packages/node/test/projectFixture/v0.3.0/dist/chainTypes.js b/packages/node/test/projectFixture/v0.3.0/dist/chainTypes.js deleted file mode 100644 index be4fb7d2..00000000 --- a/packages/node/test/projectFixture/v0.3.0/dist/chainTypes.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e={3412:function(e,n){var t=this&&this.__rest||function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o>"}},debug:{traceTransaction:{aliasSection:"debug",description:"Debug trace tx",params:[{name:"transaction_hash",type:"H256"}],type:"Result>"}}};const a={AccountId:"EthereumAccountId",Address:"AccountId",Balance:"u128",RefCount:"u8",LookupSource:"AccountId",Account:{nonce:"U256",balance:"u128"}},{RefCount:o}=a,c=t(a,["RefCount"]),i=Object.assign(Object.assign({},c),{ExtrinsicSignature:"EthereumSignature",RoundIndex:"u32",Candidate:{id:"AccountId",fee:"Perbill",bond:"Balance",nominators:"Vec",total:"Balance",state:"ValidatorStatus"},Nominator:{nominations:"Vec",total:"Balance"},Bond:{owner:"AccountId",amount:"Balance"},ValidatorStatus:{_enum:{Active:"Null",Idle:"Null",Leaving:"RoundIndex"}},TxPoolResultContent:{pending:"HashMap>",queued:"HashMap>"},TxPoolResultInspect:{pending:"HashMap>",queued:"HashMap>"},TxPoolResultStatus:{pending:"U256",queued:"U256"},Summary:"Bytes",PoolTransaction:{hash:"H256",nonce:"U256",blockHash:"Option",blockNumber:"Option",from:"H160",to:"Option",value:"U256",gasPrice:"U256",gas:"U256",input:"Bytes"}}),{ValidatorStatus:s}=i,r=t(i,["ValidatorStatus"]),l=Object.assign(Object.assign({},r),{AccountInfo:"AccountInfoWithTripleRefCount",Candidate:{id:"AccountId",fee:"Perbill",bond:"Balance",nominators:"Vec",total:"Balance",state:"CollatorStatus"},CollatorStatus:{_enum:{Active:"Null",Idle:"Null",Leaving:"RoundIndex"}},Range:"RangeBalance",RangeBalance:{min:"Balance",ideal:"Balance",max:"Balance"},RangePerbill:{min:"Perbill",ideal:"Perbill",max:"Perbill"},InflationInfo:{expect:"RangeBalance",annual:"RangePerbill",round:"RangePerbill"},OrderedSet:"Vec",Collator:{id:"AccountId",bond:"Balance",nominators:"Vec",total:"Balance",state:"CollatorStatus"},CollatorSnapshot:{bond:"Balance",nominators:"Vec",total:"Balance"},SystemInherentData:{validationData:"PersistedValidationData",relayChain_state:"StorageProof",downwardMessages:"Vec",horizontalMessages:"BTreeMap>"},RoundInfo:{current:"RoundIndex",first:"BlockNumber",length:"u32"}}),u=Object.assign(Object.assign({},l),{AuthorId:"AccountId"}),d=Object.assign(Object.assign({},u),{AccountId32:"H256",AuthorId:"AccountId32",ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","CancelProxy","Balances","AuthorMapping"]},RelayChainAccountId:"AccountId32",RewardInfo:{totalReward:"Balance",claimedReward:"Balance"}}),m=Object.assign(Object.assign({},d),{Collator2:{id:"AccountId",bond:"Balance",nominators:"Vec",topNominators:"Vec",bottomNominators:"Vec",totalCounted:"Balance",totalBacking:"Balance",state:"CollatorStatus"},NominatorAdded:{_enum:{AddedToBottom:"Null",AddedToTop:"Balance"}},RegistrationInfo:{account:"AccountId",deposit:"Balance"},ParachainBondConfig:{account:"AccountId",percent:"Percent"}}),p=Object.assign(Object.assign({},m),{EthereumSignature:{r:"H256",s:"H256",v:"U8"},NominatorAdded:{_enum:{AddedToTop:"Balance",AddedToBottom:"Null"}}}),b=Object.assign(Object.assign({},p),{NominatorStatus:{_enum:{Active:"Null",Leaving:"RoundIndex"}},Nominator2:{nominations:"Vec",revocations:"Vec",total:"Balance",scheduledRevocationsCount:"u32",scheduledRevocationsTotal:"Balance",status:"NominatorStatus"},ExitQ:{candidates:"Vec",nominatorsLeaving:"Vec",candidateSchedule:"Vec<(AccountId, RoundIndex)>",nominatorSchedule:"Vec<(AccountId, Option, RoundIndex)>"}}),y=Object.assign(Object.assign({},b),{RewardInfo:{totalReward:"Balance",claimedReward:"Balance",contributedRelayAddresses:"Vec"}}),I=Object.assign(Object.assign({},y),{AssetType:{_enum:{Xcm:"MultiLocation"}},AssetId:"u128",TAssetBalance:"u128",ENUM_AccountId32:{network:"NetworkId",id:"[u8; 32]"},ENUM_AccountKey20:{network:"NetworkId",key:"[u8; 20]"},ENUM_AccountIndex64:{network:"NetworkId",index:"Compact"},ENUM_Plurality:{id:"BodyId",part:"BodyPart"},JunctionV0:{_enum:{Parent:"Null",Parachain:"Compact",AccountId32:"ENUM_AccountId32",AccountIndex64:"ENUM_AccountIndex64",AccountKey20:"ENUM_AccountKey20",PalletInstance:"u8",GeneralIndex:"Compact",GeneralKey:"Vec",OnlyChild:"Null",Plurality:"ENUM_Plurality"}},CurrencyId:{_enum:{SelfReserve:"Null",OtherReserve:"u128"}},AssetRegistrarMetadata:{name:"Vec",symbol:"Vec",decimals:"u8",isFrozen:"bool"},VestingBlockNumber:"u32",MultiLocation:"MultiLocationV0"}),A=Object.assign(Object.assign({},I),{JunctionV1:{_enum:{Parachain:"Compact",AccountId32:"ENUM_AccountId32",AccountIndex64:"ENUM_AccountIndex64",AccountKey20:"ENUM_AccountKey20",PalletInstance:"u8",GeneralIndex:"Compact",GeneralKey:"Vec",OnlyChild:"Null",Plurality:"ENUM_Plurality"}},MultiLocation:"MultiLocationV1"}),g=Object.assign(Object.assign({},A),{MoonbaseRuntimeAssetRegistrarMetadata:{name:"Vec",symbol:"Vec",decimals:"u8",is_frozen:"bool"},PalletCrowdloanRewardsRewardInfo:{total_reward:"Balance",claimed_reward:"Balance",contributed_relay_addresses:"Vec"},ParachainStakingNominator2:{nominations:"Vec",revocations:"Vec",total:"Balance",scheduled_revocations_count:"u32",scheduled_revocations_total:"Balance",status:"NominatorStatus"},ParachainStakingExitQ:{candidates:"Vec",nominators_leaving:"Vec",candidate_schedule:"Vec<(AccountId, RoundIndex)>",nominator_schedule:"Vec<(AccountId, Option, RoundIndex)>"},ParachainStakingCollator2:{id:"AccountId",bond:"Balance",nominators:"Vec",top_nominators:"Vec",bottom_nominators:"Vec",total_counted:"Balance",total_backing:"Balance",state:"CollatorStatus"}});n.moonbeamDefinitions={alias:n.moduleDefinitions,rpc:n.rpcDefinitions,instances:{council:["councilCollective"],technicalCommittee:["techCommitteeCollective"]},types:[{minmax:[0,4],types:a},{minmax:[5,5],types:c},{minmax:[6,19],types:i},{minmax:[19,35],types:l},{minmax:[36,36],types:u},{minmax:[37,42],types:d},{minmax:[43,154],types:m},{minmax:[155,199],types:p},{minmax:[200,399],types:b},{minmax:[400,599],types:y},{minmax:[600,799],types:I},{minmax:[800,899],types:A},{minmax:[900,void 0],types:{ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","CancelProxy","Balances","AuthorMapping"]}}}]},n.moonbeamDefinitionsDeprecated=Object.assign(Object.assign({},n.moonbeamDefinitions),{types:[...n.moonbeamDefinitions.types,{minmax:[900,void 0],types:g}]}),n.typesBundlePre900={spec:{moonbeam:n.moonbeamDefinitions,moonbeamDefinitions:n.moonbeamDefinitions,moonbase:n.moonbeamDefinitions,moonriver:n.moonbeamDefinitions}},n.typesBundleDeprecated={spec:{moonbeam:n.moonbeamDefinitionsDeprecated,moonbeamDefinitions:n.moonbeamDefinitionsDeprecated,moonbase:n.moonbeamDefinitionsDeprecated,moonriver:n.moonbeamDefinitionsDeprecated}}}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var c=n[a]={exports:{}};return e[a].call(c.exports,c,c.exports,t),c.exports}var a={};(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0});const n=t(3412);e.default={typesBundle:n.typesBundleDeprecated}})();var o=exports;for(var c in a)o[c]=a[c];a.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/packages/node/test/projectFixture/v0.3.0/dist/index.js b/packages/node/test/projectFixture/v0.3.0/dist/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/node/test/projectFixture/v0.3.0/dist/moonbeam.js b/packages/node/test/projectFixture/v0.3.0/dist/moonbeam.js deleted file mode 100644 index 2fa5fedf..00000000 --- a/packages/node/test/projectFixture/v0.3.0/dist/moonbeam.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see moonbeam.js.LICENSE.txt */ -(()=>{var t={4145:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbiCoder:()=>at,ConstructorFragment:()=>A,ErrorFragment:()=>E,EventFragment:()=>v,FormatTypes:()=>h,Fragment:()=>g,FunctionFragment:()=>_,Indexed:()=>ht,Interface:()=>mt,LogDescription:()=>lt,ParamType:()=>$,TransactionDescription:()=>ct,checkResultErrors:()=>T,defaultAbiCoder:()=>ot});var n=r(2593),i=r(3587),a=r(711);const o="abi/5.5.0",s=new a.Yd(o),d={};let u={calldata:!0,memory:!0,storage:!0},l={calldata:!0,memory:!0};function c(t,e){if("bytes"===t||"string"===t){if(u[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&l[e])return!0;return(u[e]||"payable"===e)&&s.throwArgumentError("invalid modifier","name",e),!1}function f(t,e){for(let r in e)(0,i.zG)(t,r,e[r])}const h=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=new RegExp(/^(.*)\[([0-9]*)\]$/);class ${constructor(t,e){t!==d&&s.throwError("use fromString",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,e);let r=this.type.match(p);f(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:$.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==h.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===h.full?", ":",")+")"):e+=this.type,t!==h.sighash&&(!0===this.indexed&&(e+=" indexed"),t===h.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?$.fromString(t,e):$.fromObject(t)}static fromObject(t){return $.isParamType(t)?t:new $(d,{name:t.name||null,type:S(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map($.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){s.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let r=0;r$.fromString(t,e)))}class g{constructor(t,e){t!==d&&s.throwError("use a static from method",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return g.isFragment(t)?t:"string"==typeof t?g.fromString(t):g.fromObject(t)}static fromObject(t){if(g.isFragment(t))return t;switch(t.type){case"function":return _.fromObject(t);case"event":return v.fromObject(t);case"constructor":return A.fromObject(t);case"error":return E.fromObject(t);case"fallback":case"receive":return null}return s.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?_.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?A.fromString(t.trim()):"error"===t.split(" ")[0]?E.fromString(t.substring(5).trim()):s.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class v extends g{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==h.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ",t!==h.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?v.fromString(t):v.fromObject(t)}static fromObject(t){if(v.isEventFragment(t))return t;"event"!==t.type&&s.throwArgumentError("invalid event object","value",t);const e={name:I(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map($.fromObject):[],type:"event"};return new v(d,e)}static fromString(t){let e=t.match(O);e||s.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:s.warn("unknown modifier: "+t)}})),v.fromObject({name:e[1].trim(),anonymous:r,inputs:m(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function y(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&s.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||s.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=n.O$.from(r[1]),r[0]):t}function b(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function M(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&s.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&s.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||s.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&s.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&s.throwArgumentError("unable to determine stateMutability","value",t),e}class A extends g{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});t===h.sighash&&s.throwError("cannot format a constructor for sighash",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?A.fromString(t):A.fromObject(t)}static fromObject(t){if(A.isConstructorFragment(t))return t;"constructor"!==t.type&&s.throwArgumentError("invalid constructor object","value",t);let e=M(t);e.constant&&s.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map($.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new A(d,r)}static fromString(t){let e={type:"constructor"},r=(t=y(t,e)).match(O);return r&&"constructor"===r[1].trim()||s.throwArgumentError("invalid constructor string","value",t),e.inputs=m(r[2].trim(),!1),b(r[3].trim(),e),A.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class _ extends A{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==h.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ",t!==h.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?_.fromString(t):_.fromObject(t)}static fromObject(t){if(_.isFunctionFragment(t))return t;"function"!==t.type&&s.throwArgumentError("invalid function object","value",t);let e=M(t);const r={type:t.type,name:I(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map($.fromObject):[],outputs:t.outputs?t.outputs.map($.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new _(d,r)}static fromString(t){let e={type:"function"},r=(t=y(t,e)).split(" returns ");r.length>2&&s.throwArgumentError("invalid function string","value",t);let n=r[0].match(O);if(n||s.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&I(e.name),e.inputs=m(n[2],!1),b(n[3].trim(),e),r.length>1){let n=r[1].match(O);""==n[1].trim()&&""==n[3].trim()||s.throwArgumentError("unexpected tokens","value",t),e.outputs=m(n[2],!1)}else e.outputs=[];return _.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function w(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||s.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class E extends g{format(t){if(t||(t=h.sighash),h[t]||s.throwArgumentError("invalid format type","format",t),t===h.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==h.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===h.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?E.fromString(t):E.fromObject(t)}static fromObject(t){if(E.isErrorFragment(t))return t;"error"!==t.type&&s.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:I(t.name),inputs:t.inputs?t.inputs.map($.fromObject):[]};return w(new E(d,e))}static fromString(t){let e={type:"error"},r=t.match(O);return r||s.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&I(e.name),e.inputs=m(r[2],!1),w(E.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function S(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const N=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function I(t){return t&&t.match(N)||s.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const O=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var x=r(3286);const C=new a.Yd(o);function T(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){const a=t.slice();a.push(i);try{r(a,n[i])}catch(t){e.push({path:a,error:t})}}};return r([],t),e}class P{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){C.throwArgumentError(t,this.localName,e)}}class R{constructor(t){(0,i.zG)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return(0,x.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData((0,x.concat)(t._data))}writeBytes(t){let e=(0,x.arrayify)(t);const r=e.length%this.wordSize;return r&&(e=(0,x.concat)([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=(0,x.arrayify)(n.O$.from(t));return e.length>this.wordSize&&C.throwError("value out-of-bounds",a.Yd.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,x.concat)([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class F{constructor(t,e,r,n){(0,i.zG)(this,"_data",(0,x.arrayify)(t)),(0,i.zG)(this,"wordSize",e||32),(0,i.zG)(this,"_coerceFunc",r),(0,i.zG)(this,"allowLoose",n),this._offset=0}get data(){return(0,x.hexlify)(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):F.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:C.throwError("data out-of-bounds",a.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new F(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return n.O$.from(this.readBytes(this.wordSize))}}var L=r(4594);class B extends P{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=(0,L.Kn)(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return(0,L.Kn)((0,x.hexZeroPad)(t.readValue().toHexString(),20))}}class D extends P{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const U=new a.Yd(o);function k(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||U.throwError("cannot encode object for signature with missing names",a.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&U.throwError("cannot encode object for signature with duplicate names",a.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else U.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&U.throwArgumentError("types/value length mismatch","tuple",r);let i=new R(t.wordSize),o=new R(t.wordSize),s=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=o.length;t.encode(o,r);let n=i.writeUpdatableValue();s.push((t=>{n(t+e)}))}else t.encode(i,r)})),s.forEach((t=>{t(i.length)}));let d=t.appendWriter(i);return d+=t.appendWriter(o),d}function Z(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readValue(),o=n.subReader(r.toNumber());try{i=e.decode(o)}catch(t){if(t.code===a.Yd.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===a.Yd.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));const i=e.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach(((t,e)=>{let n=t.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const a=r[e];a instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw a}}):r[n]=a}));for(let t=0;t{throw e}})}return Object.freeze(r)}class j extends P{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;rt._data.length&&U.throwError("insufficient data length",a.Yd.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t{t.dynamic&&(r=!0),n.push(t.type)})),super("tuple","tuple("+n.join(",")+")",e,r),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}encode(t,e){return k(t,this.coders,e)}decode(t){return t.coerce(this.name,Z(t,this.coders))}}const rt=new a.Yd(o),nt=new RegExp(/^bytes([0-9]*)$/),it=new RegExp(/^(u?int)([0-9]*)$/);class at{constructor(t){rt.checkNew(new.target,at),(0,i.zG)(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new B(t.name);case"bool":return new G(t.name);case"string":return new tt(t.name);case"bytes":return new H(t.name);case"array":return new j(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new et((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new K(t.name)}let e=t.type.match(it);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&rt.throwArgumentError("invalid "+e[1]+" bit length","param",t),new X(r/8,"int"===e[1],t.name)}if(e=t.type.match(nt),e){let r=parseInt(e[1]);return(0===r||r>32)&&rt.throwArgumentError("invalid bytes length","param",t),new z(r,t.name)}return rt.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new F(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new R(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder($.from(t))));return new et(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&rt.throwError("types/values length mismatch",a.Yd.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder($.from(t)))),n=new et(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){const n=t.map((t=>this._getCoder($.from(t))));return new et(n,"_").decode(this._getReader((0,x.arrayify)(e),r))}}const ot=new at;var st=r(2046),dt=r(8197);const ut=new a.Yd(o);class lt extends i.dk{}class ct extends i.dk{}class ft extends i.dk{}class ht extends i.dk{static isIndexed(t){return!(!t||!t._isIndexed)}}const pt={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function $t(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class mt{constructor(t){ut.checkNew(new.target,mt);let e=[];e="string"==typeof t?JSON.parse(t):t,(0,i.zG)(this,"fragments",e.map((t=>g.from(t))).filter((t=>null!=t))),(0,i.zG)(this,"_abiCoder",(0,i.tu)(new.target,"getAbiCoder")()),(0,i.zG)(this,"functions",{}),(0,i.zG)(this,"errors",{}),(0,i.zG)(this,"events",{}),(0,i.zG)(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void ut.warn("duplicate definition - constructor"):void(0,i.zG)(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();e[r]?ut.warn("duplicate definition - "+r):e[r]=t})),this.deploy||(0,i.zG)(this,"deploy",A.from({payable:!1,type:"constructor"})),(0,i.zG)(this,"_isInterface",!0)}format(t){t||(t=h.full),t===h.sighash&&ut.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===h.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return ot}static getAddress(t){return(0,L.Kn)(t)}static getSighash(t){return(0,x.hexDataSlice)((0,st.id)(t.format()),0,4)}static getEventTopic(t){return(0,st.id)(t.format())}getFunction(t){if((0,x.isHexString)(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];ut.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===r.length?ut.throwArgumentError("no matching function","name",e):r.length>1&&ut.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[_.fromString(t).format()];return e||ut.throwArgumentError("no matching function","signature",t),e}getEvent(t){if((0,x.isHexString)(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];ut.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===r.length?ut.throwArgumentError("no matching event","name",e):r.length>1&&ut.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[v.fromString(t).format()];return e||ut.throwArgumentError("no matching event","signature",t),e}getError(t){if((0,x.isHexString)(t)){const e=(0,i.tu)(this.constructor,"getSighash");for(const r in this.errors)if(t===e(this.errors[r]))return this.errors[r];ut.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===r.length?ut.throwArgumentError("no matching error","name",e):r.length>1&&ut.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[_.fromString(t).format()];return e||ut.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return(0,i.tu)(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),(0,i.tu)(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const r=(0,x.arrayify)(e);return(0,x.hexlify)(r.slice(0,4))!==this.getSighash(t)&&ut.throwArgumentError(`data signature does not match error ${t.name}.`,"data",(0,x.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),(0,x.hexlify)((0,x.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=(0,x.arrayify)(e);return(0,x.hexlify)(r.slice(0,4))!==this.getSighash(t)&&ut.throwArgumentError(`data signature does not match function ${t.name}.`,"data",(0,x.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,x.hexlify)((0,x.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,x.arrayify)(e),n=null,i=null,o=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=(0,x.hexlify)(r.slice(0,4)),e=pt[t];if(e)i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.signature,e.reason&&(n=i[0]);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.format()}catch(t){console.log(t)}break}}return ut.throwError("call revert exception",a.Yd.errors.CALL_EXCEPTION,{method:t.format(),errorArgs:i,errorName:o,errorSignature:s,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,x.hexlify)(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&ut.throwError("too many arguments for "+t.format(),a.Yd.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?(0,st.id)(e):"bytes"===t.type?(0,dt.w)((0,x.hexlify)(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),(0,x.hexZeroPad)((0,x.hexlify)(e),32));for(e.forEach(((e,i)=>{let a=t.inputs[i];a.indexed?null==e?r.push(null):"array"===a.baseType||"tuple"===a.baseType?ut.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,e):Array.isArray(e)?r.push(e.map((t=>n(a,t)))):r.push(n(a,e)):null!=e&&ut.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&ut.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,a)=>{const o=e[a];if(t.indexed)if("string"===t.type)r.push((0,st.id)(o));else if("bytes"===t.type)r.push((0,dt.w)(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[o]))}else n.push(t),i.push(o)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);(0,x.isHexString)(r[0],32)&&r[0].toLowerCase()===e||ut.throwError("fragment/topic mismatch",a.Yd.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push($.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(n.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let s=null!=r?this._abiCoder.decode(n,(0,x.concat)(r)):null,d=this._abiCoder.decode(i,e,!0),u=[],l=0,c=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==s)u[e]=new ht({_isIndexed:!0,hash:null});else if(o[e])u[e]=new ht({_isIndexed:!0,hash:s[c++]});else try{u[e]=s[c++]}catch(t){u[e]=t}else try{u[e]=d[l++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw $t(`property ${JSON.stringify(t.name)}`,r)}}):u[t.name]=r}}));for(let t=0;t{throw $t(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new ct({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:n.O$.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new lt({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=(0,x.hexlify)(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new ft({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!(!t||!t._isInterface)}}},4594:(t,e,r)=>{"use strict";r.d(e,{Kn:()=>c});var n=r(3286),i=r(2593),a=r(8197);const o=new(r(711).Yd)("address/5.5.0");function s(t){(0,n.isHexString)(t,20)||o.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=(0,n.arrayify)((0,a.w)(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const d={};for(let t=0;t<10;t++)d[String(t)]=String(t);for(let t=0;t<26;t++)d[String.fromCharCode(65+t)]=String(10+t);const u=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));var l;function c(t){let e=null;if("string"!=typeof t&&o.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=s(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&o.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>d[t])).join("");for(;e.length>=u;){let t=e.substring(0,u);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&o.throwArgumentError("bad icap checksum","address",t),e=(0,i.g$)(t.substring(4));e.length<40;)e="0"+e;e=s("0x"+e)}else o.throwArgumentError("invalid address","address",t);return e}},8794:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="bignumber/5.5.0"},2593:(t,e,r)=>{"use strict";r.d(e,{Zm:()=>f,O$:()=>p,g$:()=>y,t2:()=>b});var n=r(3550),i=r.n(n),a=r(3286),o=r(711),s=r(8794),d=i().BN;const u=new o.Yd(s.i),l={},c=9007199254740991;function f(t){return null!=t&&(p.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||(0,a.isHexString)(t)||"bigint"==typeof t||(0,a.isBytes)(t))}let h=!1;class p{constructor(t,e){u.checkNew(new.target,p),t!==l&&u.throwError("cannot call constructor directly; use BigNumber.from",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return m(g(this).fromTwos(t))}toTwos(t){return m(g(this).toTwos(t))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(t){return m(g(this).add(g(t)))}sub(t){return m(g(this).sub(g(t)))}div(t){return p.from(t).isZero()&&v("division by zero","div"),m(g(this).div(g(t)))}mul(t){return m(g(this).mul(g(t)))}mod(t){const e=g(t);return e.isNeg()&&v("cannot modulo negative values","mod"),m(g(this).umod(e))}pow(t){const e=g(t);return e.isNeg()&&v("cannot raise to negative values","pow"),m(g(this).pow(e))}and(t){const e=g(t);return(this.isNegative()||e.isNeg())&&v("cannot 'and' negative values","and"),m(g(this).and(e))}or(t){const e=g(t);return(this.isNegative()||e.isNeg())&&v("cannot 'or' negative values","or"),m(g(this).or(e))}xor(t){const e=g(t);return(this.isNegative()||e.isNeg())&&v("cannot 'xor' negative values","xor"),m(g(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&v("cannot mask negative values","mask"),m(g(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&v("cannot shift negative values","shl"),m(g(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&v("cannot shift negative values","shr"),m(g(this).shrn(t))}eq(t){return g(this).eq(g(t))}lt(t){return g(this).lt(g(t))}lte(t){return g(this).lte(g(t))}gt(t){return g(this).gt(g(t))}gte(t){return g(this).gte(g(t))}isNegative(){return"-"===this._hex[0]}isZero(){return g(this).isZero()}toNumber(){try{return g(this).toNumber()}catch(t){v("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return u.throwError("this platform does not support BigInt",o.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.Yd.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",o.Yd.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof p)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new p(l,$(t)):t.match(/^-?[0-9]+$/)?new p(l,$(new d(t))):u.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&v("underflow","BigNumber.from",t),(t>=c||t<=-c)&&v("overflow","BigNumber.from",t),p.from(String(t));const e=t;if("bigint"==typeof e)return p.from(e.toString());if((0,a.isBytes)(e))return p.from((0,a.hexlify)(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return p.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&((0,a.isHexString)(t)||"-"===t[0]&&(0,a.isHexString)(t.substring(1))))return p.from(t)}return u.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function $(t){if("string"!=typeof t)return $(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&u.throwArgumentError("invalid hex","value",t),"0x00"===(t=$(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function m(t){return p.from($(t))}function g(t){const e=p.from(t).toHexString();return"-"===e[0]?new d("-"+e.substring(3),16):new d(e.substring(2),16)}function v(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),u.throwError(t,o.Yd.errors.NUMERIC_FAULT,n)}function y(t){return new d(t,36).toString(16)}function b(t){return new d(t,16).toString(36)}},2092:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BigNumber:()=>n.O$,FixedFormat:()=>m,FixedNumber:()=>g,_base16To36:()=>n.t2,_base36To16:()=>n.g$,formatFixed:()=>p,parseFixed:()=>$});var n=r(2593),i=r(3286),a=r(711),o=r(8794);const s=new a.Yd(o.i),d={},u=n.O$.from(0),l=n.O$.from(-1);function c(t,e,r,n){const i={fault:e,operation:r};return void 0!==n&&(i.value=n),s.throwError(t,a.Yd.errors.NUMERIC_FAULT,i)}let f="0";for(;f.length<256;)f+=f;function h(t){if("number"!=typeof t)try{t=n.O$.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+f.substring(0,t):s.throwArgumentError("invalid decimal size","decimals",t)}function p(t,e){null==e&&(e=0);const r=h(e),i=(t=n.O$.from(t)).lt(u);i&&(t=t.mul(l));let a=t.mod(r).toString();for(;a.length2&&s.throwArgumentError("too many decimal points","value",t);let o=a[0],d=a[1];for(o||(o="0"),d||(d="0");"0"===d[d.length-1];)d=d.substring(0,d.length-1);for(d.length>r.length-1&&c("fractional component exceeds decimals","underflow","parseFixed"),""===d&&(d="0");d.lengthnull==t[e]?n:(typeof t[e]!==r&&s.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&s.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&s.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new m(d,e,r,n)}}class g{constructor(t,e,r,n){s.checkNew(new.target,g),t!==d&&s.throwError("cannot use FixedNumber constructor; use FixedNumber.from",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&s.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=$(this._value,this.format.decimals),r=$(t._value,t.format.decimals);return g.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=g.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(v.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=g.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(v.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&s.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=g.from("1"+f.substring(0,t),this.format),n=y.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&s.throwArgumentError("invalid byte width","width",t);const e=n.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,i.hexZeroPad)(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return g.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||(0,n.Zm)(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),g.fromString(p(t,e),m.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=m.from(e),n=$(t,r.decimals);!r.signed&&n.lt(u)&&c("unsigned value cannot be negative","overflow","value",t);let a=null;r.signed?a=n.toTwos(r.width).toHexString():(a=n.toHexString(),a=(0,i.hexZeroPad)(a,r.width/8));const o=p(n,r.decimals);return new g(d,a,o,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=m.from(e);if((0,i.arrayify)(t).length>r.width/8)throw new Error("overflow");let a=n.O$.from(t);r.signed&&(a=a.fromTwos(r.width));const o=a.toTwos((r.signed?0:1)+r.width).toHexString(),s=p(a,r.decimals);return new g(d,o,s,r)}static from(t,e){if("string"==typeof t)return g.fromString(t,e);if((0,i.isBytes)(t))return g.fromBytes(t,e);try{return g.fromValue(t,0,e)}catch(t){if(t.code!==a.Yd.errors.INVALID_ARGUMENT)throw t}return s.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const v=g.from(1),y=g.from("0.5")},3286:(t,e,r)=>{"use strict";r.r(e),r.d(e,{arrayify:()=>u,concat:()=>l,hexConcat:()=>v,hexDataLength:()=>m,hexDataSlice:()=>g,hexStripZeros:()=>b,hexValue:()=>y,hexZeroPad:()=>M,hexlify:()=>$,isBytes:()=>d,isBytesLike:()=>o,isHexString:()=>h,joinSignature:()=>_,splitSignature:()=>A,stripZeros:()=>c,zeroPad:()=>f});const n=new(r(711).Yd)("bytes/5.5.0");function i(t){return!!t.toHexString}function a(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return a(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function o(t){return h(t)&&!(t.length%2)||d(t)}function s(t){return"number"==typeof t&&t==t&&t%1==0}function d(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!s(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function u(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),a(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t)&&(t=t.toHexString()),h(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;tu(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),a(n)}function c(t){let e=u(t);if(0===e.length)return e;let r=0;for(;re&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),a(r)}function h(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const p="0123456789abcdef";function $(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=p[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t))return t.toHexString();if(h(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(d(t)){let e="0x";for(let r=0;r>4]+p[15&n]}return e}return n.throwArgumentError("invalid hexlify value","value",t)}function m(t){if("string"!=typeof t)t=$(t);else if(!h(t)||t.length%2)return null;return(t.length-2)/2}function g(t,e,r){return"string"!=typeof t?t=$(t):(!h(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function v(t){let e="0x";return t.forEach((t=>{e+=$(t).substring(2)})),e}function y(t){const e=b($(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function b(t){"string"!=typeof t&&(t=$(t)),h(t)||n.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function A(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(o(t)){const r=u(t);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",t),e.r=$(r.slice(0,32)),e.s=$(r.slice(32,64)),e.v=r[64],e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=$(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=f(u(e._vs),32);e._vs=$(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const a=$(r);null==e.s?e.s=a:e.s!==a&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&h(e.r)?e.r=M(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&h(e.s)?e.s=M(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);const r=u(e.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=$(r);e._vs&&(h(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=M(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e}function _(t){return $(l([(t=A(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},2046:(t,e,r)=>{"use strict";r.d(e,{id:()=>a});var n=r(8197),i=r(4242);function a(t){return(0,n.w)((0,i.Y0)(t))}},5555:(t,e,r)=>{"use strict";r.r(e),r.d(e,{_TypedDataEncoder:()=>V,hashMessage:()=>S,id:()=>n.id,isValidName:()=>_,messagePrefix:()=>E,namehash:()=>w});var n=r(2046),i=r(3286),a=r(4242);function o(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach((t=>{let i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function s(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}function d(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}const u=s("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),l="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),c=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],f=o("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),h=o("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),p=o("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r{if(l.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=d(t,c);if(e)return[t+e.s];let r=f[t];if(r)return r;let n=h[t];return n?[t+n[0]]:p[t]||null}(t);return e||[t]})),e=r.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=(0,a.XL)((0,a.uu)(e),a.Uj.NFKC),e.forEach((t=>{if(d(t,$))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(d(t,u))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=(0,a.uu)(e);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}var g=r(8197),v=r(711);const y="hash/5.5.0",b=new v.Yd(y),M=new Uint8Array(32);M.fill(0);const A=new RegExp("^((.*)\\.)?([^.]+)$");function _(t){try{const e=t.split(".");for(let t=0;t256||e[2]&&e[2]!==String(n))&&x.throwArgumentError("invalid numeric width","type",t);const a=F.mask(r?n-1:n),o=r?a.add(R).mul(T):P;return function(e){const r=I.O$.from(e);return(r.lt(o)||r.gt(a))&&x.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),(0,i.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&x.throwArgumentError("invalid bytes width","type",t),function(e){return(0,i.arrayify)(e).length!==r&&x.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=(0,i.arrayify)(t),r=e.length%32;return r?(0,i.hexConcat)([e,C.slice(r)]):(0,i.hexlify)(e)}(e)}}}switch(t){case"address":return function(t){return(0,i.hexZeroPad)((0,N.Kn)(t),32)};case"bool":return function(t){return t?L:B};case"bytes":return function(t){return(0,g.w)(t)};case"string":return function(t){return(0,n.id)(t)}}return null}function G(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class V{constructor(t){(0,O.zG)(this,"types",Object.freeze((0,O.p$)(t))),(0,O.zG)(this,"_encoderCache",{}),(0,O.zG)(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((a=>{i[a.name]&&x.throwArgumentError(`duplicate variable name ${JSON.stringify(a.name)} in ${JSON.stringify(n)}`,"types",t),i[a.name]=!0;const o=a.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===n&&x.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),j(o)||(r[o]||x.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",t),r[o].push(n),e[n][o]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?x.throwArgumentError("missing primary type","types",t):i.length>1&&x.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),(0,O.zG)(this,"primaryType",i[0]),function i(a,o){o[a]&&x.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",t),o[a]=!0,Object.keys(e[a]).forEach((t=>{r[t]&&(i(t,o),Object.keys(o).forEach((e=>{n[e][t]=!0})))})),delete o[a]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=G(e,t[e])+r.map((e=>G(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=j(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&x.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let a=e.map(r);return this._types[t]&&(a=a.map(g.w)),(0,g.w)((0,i.hexConcat)(a))}}const r=this.types[t];if(r){const e=(0,n.id)(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?(0,g.w)(n):n}));return n.unshift(e),(0,i.hexConcat)(n)}}return x.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||x.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return(0,g.w)(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(j(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&x.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):x.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new V(t)}static getPrimaryType(t){return V.from(t).primaryType}static hashStruct(t,e,r){return V.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=D[r];n||x.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>U.indexOf(t.name)-U.indexOf(e.name))),V.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return(0,i.hexConcat)(["0x1901",V.hashDomain(t),V.from(e).hash(r)])}static hash(t,e,r){return(0,g.w)(V.encode(t,e,r))}static resolveNames(t,e,r,n){return a=this,o=void 0,d=function*(){t=(0,O.DC)(t);const a={};t.verifyingContract&&!(0,i.isHexString)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=V.from(e);o.visit(r,((t,e)=>("address"!==t||(0,i.isHexString)(e,20)||(a[e]="0x"),e)));for(const t in a)a[t]=yield n(t);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&a[e]?a[e]:e)),{domain:t,value:r}},new((s=void 0)||(s=Promise))((function(t,e){function r(t){try{i(d.next(t))}catch(t){e(t)}}function n(t){try{i(d.throw(t))}catch(t){e(t)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(r,n)}i((d=d.apply(a,o||[])).next())}));var a,o,s,d}static getPayload(t,e,r){V.hashDomain(t);const n={},a=[];U.forEach((e=>{const r=t[e];null!=r&&(n[e]=Z[e](r),a.push({name:e,type:D[e]}))}));const o=V.from(e),s=(0,O.DC)(e);return s.EIP712Domain?x.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=a,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return(0,i.hexlify)((0,i.arrayify)(e));if(t.match(/^u?int/))return I.O$.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&x.throwArgumentError("invalid string","value",e),e}return x.throwArgumentError("unsupported type","type",t)}))}}}},8197:(t,e,r)=>{"use strict";r.d(e,{w:()=>o});var n=r(1094),i=r.n(n),a=r(3286);function o(t){return"0x"+i().keccak_256((0,a.arrayify)(t))}},711:(t,e,r)=>{"use strict";r.d(e,{Yd:()=>f});let n=!1,i=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let o=a.default,s=null;const d=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var u,l;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(u||(u={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(l||(l={}));const c="0123456789abcdef";class f{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",t),o>a[r]||console.log.apply(console,e)}debug(...t){this._log(f.levels.DEBUG,t)}info(...t){this._log(f.levels.INFO,t)}warn(...t){this._log(f.levels.WARNING,t)}makeError(t,e,r){if(i)return this.makeError("censored error",e,{});e||(e=f.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=c[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(e){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const a=t;n.length&&(t+=" ("+n.join(", ")+")");const o=new Error(t);return o.reason=a,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,f.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),d&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:d})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,f.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",f.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",f.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",f.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return s||(s=new f("logger/5.5.0")),s}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!t)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!t,n=!!e}static setLogLevel(t){const e=a[t.toLowerCase()];null!=e?o=e:f.globalLogger().warn("invalid log level - "+t)}static from(t){return new f(t)}}f.errors=l,f.levels=u},3587:(t,e,r)=>{"use strict";r.d(e,{dk:()=>c,p$:()=>l,zG:()=>i,tu:()=>a,DC:()=>o});const n=new(r(711).Yd)("properties/5.5.0");function i(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function a(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function o(t){const e={};for(const r in t)e[r]=t[r];return e}const s={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function d(t){if(null==t||s[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rl(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&i(e,r,l(n))}return e}return n.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function l(t){return u(t)}class c{constructor(t){for(const e in t)this[e]=l(t[e])}}},4242:(t,e,r)=>{"use strict";r.d(e,{Uj:()=>a,uu:()=>c,Y0:()=>l,XL:()=>h,ZN:()=>f});var n=r(3286);const i=new(r(711).Yd)("strings/5.5.0");var a,o;function s(t,e,r,n,i){if(t===o.BAD_PREFIX||t===o.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n>6==2;n++)t++;return t}return t===o.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(a||(a={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(o||(o={}));const d=Object.freeze({error:function(t,e,r,n,a){return i.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:s,replace:function(t,e,r,n,i){return t===o.OVERLONG?(n.push(i),0):(n.push(65533),s(t,e,r))}});function u(t,e){null==e&&(e=d.error),t=(0,n.arrayify)(t);const r=[];let i=0;for(;i>7==0){r.push(n);continue}let a=null,s=null;if(192==(224&n))a=1,s=127;else if(224==(240&n))a=2,s=2047;else{if(240!=(248&n)){i+=e(128==(192&n)?o.UNEXPECTED_CONTINUE:o.BAD_PREFIX,i-1,t,r);continue}a=3,s=65535}if(i-1+a>=t.length){i+=e(o.OVERRUN,i-1,t,r);continue}let d=n&(1<<8-a-1)-1;for(let n=0;n1114111?i+=e(o.OUT_OF_RANGE,i-1-a,t,r,d):d>=55296&&d<=57343?i+=e(o.UTF16_SURROGATE,i-1-a,t,r,d):d<=s?i+=e(o.OVERLONG,i-1-a,t,r,d):r.push(d))}return r}function l(t,e=a.current){e!=a.current&&(i.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&n)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function c(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function f(t,e){return c(u(t,e))}function h(t,e=a.current){return u(l(t,e))}},7852:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,r,o):i(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0}),e.MoonbeamDatasourcePlugin=e.TopicFilterValidator=void 0;const a=r(4145),o=r(2092),s=r(3286),d=r(5799),u=r(5230),l=r(3760),c=r(180);let f=class{validate(t){try{return!(t&&("string"==typeof t?!(0,c.eventToTopic)(t):!Array.isArray(t)||!t.map((t=>!(0,c.eventToTopic)(t)))))}catch(t){return!1}}defaultMessage(){return"Value must be either null, undefined, hex string or hex string[]"}};f=n([(0,l.ValidatorConstraint)({name:"topifFilterValidator",async:!1})],f),e.TopicFilterValidator=f;class h{}n([(0,l.IsOptional)(),(0,l.IsString)(),i("design:type",String)],h.prototype,"abi",void 0),n([(0,l.IsOptional)(),(0,l.IsEthereumAddress)(),i("design:type",String)],h.prototype,"address",void 0);class p{}n([(0,l.IsOptional)(),(0,l.Validate)(f,{each:!0}),i("design:type",Array)],p.prototype,"topics",void 0);class ${}function m(t){const e=t.events.find((t=>"ethereum"===t.event.section&&"Executed"===t.event.method));if(!e)throw new Error("eth execution failed");const[r,n,i,a]=e.event.data;return{from:r.toHex(),to:n.toHex(),hash:i.toHex(),status:a}}async function g(t,e){}n([(0,l.IsOptional)(),(0,l.IsEthereumAddress)(),i("design:type",String)],$.prototype,"from",void 0),n([(0,l.IsOptional)(),(0,l.IsString)(),i("design:type",String)],$.prototype,"function",void 0);const v={};function y(t,e){var r,n,i;const o=null===(n=null===(r=t.processor)||void 0===r?void 0:r.options)||void 0===n?void 0:n.abi;if(o){if(!(null===(i=t.assets)||void 0===i?void 0:i.get(o)))throw new Error(`ABI named "${o}" not referenced in assets`);if(!v[o])try{v[o]=new a.Interface(e[o])}catch(t){throw global.logger.error(`Unable to parse ABI: ${t.message}`),new Error("ABI is invalid")}return v[o]}}const b={baseFilter:[{module:"evm",method:"Log"}],baseHandlerKind:d.SubqlHandlerKind.Event,async transformer(t,e,r,n){var i,a,o,s;const[d]=t.event.data,u=Array.isArray(b.baseFilter)?b.baseFilter:[b.baseFilter],l=null!==(a=null===(i=t.extrinsic)||void 0===i?void 0:i.events.filter((t=>u.find((e=>e.module===t.event.section&&e.method===t.event.method)))))&&void 0!==a?a:[],{hash:c}=m(t.extrinsic),f=Object.assign(Object.assign({},d.toJSON()),{blockNumber:t.block.block.header.number.toNumber(),blockHash:await g(0,t.block.block.header.number.toNumber()),blockTimestamp:t.block.timestamp,transactionIndex:null!==(s=null===(o=t.extrinsic)||void 0===o?void 0:o.idx)&&void 0!==s?s:-1,transactionHash:c,removed:!1,logIndex:l.indexOf(t)});try{const t=y(e,n);f.args=null==t?void 0:t.parseLog(f).args}catch(t){global.logger.warn(`Unable to parse log arguments, will be omitted from result: ${t.message}`)}return f},filterProcessor(t,e,r){var n,i;const[a]=e.event.data,o=a;if((null===(i=null===(n=r.processor)||void 0===n?void 0:n.options)||void 0===i?void 0:i.address)&&!(0,c.stringNormalizedEq)(r.processor.options.address,o.address.toString()))return!1;if(null==t?void 0:t.topics)for(let e=0;e(0,c.hexStringEq)((0,c.eventToTopic)(t),o.topics[e].toHex()))))return!1}return!0},filterValidator(t){if(!t)return;const e=(0,u.plainToClass)(p,t),r=(0,l.validateSync)(e,{whitelist:!0,forbidNonWhitelisted:!0});if(null==r?void 0:r.length){const t=r.map((t=>t.toString())).join("\n");throw new Error(`Invalid Moonbeam event filter.\n${t}`)}}},M={baseFilter:[{module:"ethereum",method:"transact"}],baseHandlerKind:d.SubqlHandlerKind.Call,async transformer(t,e,r,n){const[i]=t.extrinsic.method.args,a=i.toJSON();let d,u,l,c;try{const e=m(t);d=e.from,l=e.to,u=e.hash,c=e.status.isSucceed}catch(t){c=!1}const f=Object.assign(Object.assign({from:d,to:l,nonce:a.nonce,gasLimit:o.BigNumber.from(a.gasLimit),gasPrice:o.BigNumber.from(a.gasPrice),data:a.input,value:o.BigNumber.from(a.value),chainId:void 0},a.signature),{hash:u,blockNumber:t.block.block.header.number.toNumber(),blockHash:await g(0,t.block.block.header.number.toNumber()),timestamp:Math.round(t.block.timestamp.getTime()/1e3),success:c});try{const t=y(e,n);f.args=null==t?void 0:t.decodeFunctionData(t.getFunction((0,s.hexDataSlice)(f.data,0,4)),f.data)}catch(t){global.logger.warn("Unable to parse call arguments, will be omitted from result")}return f},filterProcessor(t,e,r){var n,i,a,o;try{const{from:s,to:d}=m(e);if((null==t?void 0:t.from)&&!(0,c.stringNormalizedEq)(t.from,s))return!1;const[u]=e.extrinsic.method.args;return!((null===(i=null===(n=r.processor)||void 0===n?void 0:n.options)||void 0===i?void 0:i.address)&&!(0,c.stringNormalizedEq)(r.processor.options.address,d)||null===(null===(o=null===(a=r.processor)||void 0===a?void 0:a.options)||void 0===o?void 0:o.address)&&!u.action.isCreate||(null==t?void 0:t.function)&&0!==u.input.toHex().indexOf((0,c.functionToSighash)(t.function)))}catch(t){return global.logger.warn("Unable to properly filter input"),!1}},filterValidator(t){if(!t)return;const e=(0,u.plainToClass)($,t),r=(0,l.validateSync)(e,{whitelist:!0,forbidNonWhitelisted:!0});if(null==r?void 0:r.length){const t=r.map((t=>t.toString())).join("\n");throw new Error(`Invalid Moonbeam call filter.\n${t}`)}}};e.MoonbeamDatasourcePlugin={kind:"substrate/Moonbeam",validate(t,e){if(t.processor.options){const e=(0,u.plainToClass)(h,t.processor.options),r=(0,l.validateSync)(e,{whitelist:!0,forbidNonWhitelisted:!0});if(null==r?void 0:r.length){const t=r.map((t=>t.toString())).join("\n");throw new Error(`Invalid Moonbeam call filter.\n${t}`)}}y(t,e)},dsFilterProcessor(t){return t.kind===this.kind},handlerProcessors:{"substrate/MoonbeamEvent":b,"substrate/MoonbeamCall":M}},e.default=e.MoonbeamDatasourcePlugin},180:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.functionToSighash=e.eventToTopic=e.hexStringEq=e.stringNormalizedEq=void 0;const n=r(4145),i=r(3286),a=r(5555);function o(t,e){return(null==t?void 0:t.toLowerCase())===(null==e?void 0:e.toLowerCase())}e.stringNormalizedEq=o,e.hexStringEq=function(t,e){if(!(0,i.isHexString)(t)||!(0,i.isHexString)(e))throw new Error("Inputs are not hex strings");return o((0,i.hexStripZeros)(t),(0,i.hexStripZeros)(e))},e.eventToTopic=function(t){return(0,i.isHexString)(t)?t:(0,a.id)(n.EventFragment.fromString(t).format())},e.functionToSighash=function(t){return(0,i.isHexString)(t)?t:(0,i.hexDataSlice)((0,a.id)(n.FunctionFragment.fromString(t).format()),0,4)}},5799:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2849),e),i(r(4184),e)},2849:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4184:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.SubqlHandlerKind=e.SubqlDatasourceKind=void 0,(e.SubqlDatasourceKind||(e.SubqlDatasourceKind={})).Runtime="substrate/Runtime",(r=e.SubqlHandlerKind||(e.SubqlHandlerKind={})).Block="substrate/BlockHandler",r.Call="substrate/CallHandler",r.Event="substrate/EventHandler"},3550:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(4300).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function d(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=d(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,d=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,d=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,c=67108863&d,f=Math.min(u,e.length-1),h=Math.max(0,u-t.length+1);h<=f;h++){var p=u-h|0;l+=(o=(i=0|t.words[p])*(a=0|e.words[h])+c)/67108864|0,c=67108863&o}r.words[u]=0|c,d=0|l}return 0!==d?r.words[u]=0|d:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?l[6-d.length]+d+r:d+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],h=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var $=p.modn(h).toString(t);r=(p=p.idivn(h)).isZero()?$+r:l[u-$.length]+$+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,d="le"===e,u=new t(a),l=this.clone();if(d){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,h=0|o[1],p=8191&h,$=h>>>13,m=0|o[2],g=8191&m,v=m>>>13,y=0|o[3],b=8191&y,M=y>>>13,A=0|o[4],_=8191&A,w=A>>>13,E=0|o[5],S=8191&E,N=E>>>13,I=0|o[6],O=8191&I,x=I>>>13,C=0|o[7],T=8191&C,P=C>>>13,R=0|o[8],F=8191&R,L=R>>>13,B=0|o[9],D=8191&B,U=B>>>13,k=0|s[0],Z=8191&k,j=k>>>13,G=0|s[1],V=8191&G,H=G>>>13,z=0|s[2],K=8191&z,Y=z>>>13,W=0|s[3],J=8191&W,q=W>>>13,X=0|s[4],Q=8191&X,tt=X>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],dt=8191&st,ut=st>>>13,lt=0|s[8],ct=8191<,ft=lt>>>13,ht=0|s[9],pt=8191&ht,$t=ht>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(u+(n=Math.imul(c,Z))|0)+((8191&(i=(i=Math.imul(c,j))+Math.imul(f,Z)|0))<<13)|0;u=((a=Math.imul(f,j))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,Z),i=(i=Math.imul(p,j))+Math.imul($,Z)|0,a=Math.imul($,j);var gt=(u+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,V)|0))<<13)|0;u=((a=a+Math.imul(f,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,Z),i=(i=Math.imul(g,j))+Math.imul(v,Z)|0,a=Math.imul(v,j),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul($,V)|0,a=a+Math.imul($,H)|0;var vt=(u+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(f,K)|0))<<13)|0;u=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,Z),i=(i=Math.imul(b,j))+Math.imul(M,Z)|0,a=Math.imul(M,j),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,H)|0)+Math.imul(v,V)|0,a=a+Math.imul(v,H)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul($,K)|0,a=a+Math.imul($,Y)|0;var yt=(u+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,J)|0))<<13)|0;u=((a=a+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,Z),i=(i=Math.imul(_,j))+Math.imul(w,Z)|0,a=Math.imul(w,j),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(M,V)|0,a=a+Math.imul(M,H)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul($,J)|0,a=a+Math.imul($,q)|0;var bt=(u+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(S,Z),i=(i=Math.imul(S,j))+Math.imul(N,Z)|0,a=Math.imul(N,j),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,V)|0,a=a+Math.imul(w,H)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul($,Q)|0,a=a+Math.imul($,tt)|0;var Mt=(u+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;u=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,Z),i=(i=Math.imul(O,j))+Math.imul(x,Z)|0,a=Math.imul(x,j),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,Y)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul($,rt)|0,a=a+Math.imul($,nt)|0;var At=(u+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ot)|0)+Math.imul(f,at)|0))<<13)|0;u=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(T,Z),i=(i=Math.imul(T,j))+Math.imul(P,Z)|0,a=Math.imul(P,j),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,a=a+Math.imul(x,H)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,q)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul($,at)|0,a=a+Math.imul($,ot)|0;var _t=(u+(n=n+Math.imul(c,dt)|0)|0)+((8191&(i=(i=i+Math.imul(c,ut)|0)+Math.imul(f,dt)|0))<<13)|0;u=((a=a+Math.imul(f,ut)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(F,Z),i=(i=Math.imul(F,j))+Math.imul(L,Z)|0,a=Math.imul(L,j),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,V)|0,a=a+Math.imul(P,H)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,Y)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,q)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(M,rt)|0,a=a+Math.imul(M,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul($,dt)|0,a=a+Math.imul($,ut)|0;var wt=(u+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;u=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,j))+Math.imul(U,Z)|0,a=Math.imul(U,j),n=n+Math.imul(F,V)|0,i=(i=i+Math.imul(F,H)|0)+Math.imul(L,V)|0,a=a+Math.imul(L,H)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,q)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,a=a+Math.imul(w,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(M,at)|0,a=a+Math.imul(M,ot)|0,n=n+Math.imul(g,dt)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(v,dt)|0,a=a+Math.imul(v,ut)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul($,ct)|0,a=a+Math.imul($,ft)|0;var Et=(u+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,$t)|0)+Math.imul(f,pt)|0))<<13)|0;u=((a=a+Math.imul(f,$t)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,H))+Math.imul(U,V)|0,a=Math.imul(U,H),n=n+Math.imul(F,K)|0,i=(i=i+Math.imul(F,Y)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Y)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,q)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(x,Q)|0,a=a+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(N,rt)|0,a=a+Math.imul(N,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(w,at)|0,a=a+Math.imul(w,ot)|0,n=n+Math.imul(b,dt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(M,dt)|0,a=a+Math.imul(M,ut)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(v,ct)|0,a=a+Math.imul(v,ft)|0;var St=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,$t)|0)+Math.imul($,pt)|0))<<13)|0;u=((a=a+Math.imul($,$t)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,Y))+Math.imul(U,K)|0,a=Math.imul(U,Y),n=n+Math.imul(F,J)|0,i=(i=i+Math.imul(F,q)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,q)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(x,rt)|0,a=a+Math.imul(x,nt)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(N,at)|0,a=a+Math.imul(N,ot)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(w,dt)|0,a=a+Math.imul(w,ut)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(M,ct)|0,a=a+Math.imul(M,ft)|0;var Nt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,$t)|0)+Math.imul(v,pt)|0))<<13)|0;u=((a=a+Math.imul(v,$t)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,q))+Math.imul(U,J)|0,a=Math.imul(U,q),n=n+Math.imul(F,Q)|0,i=(i=i+Math.imul(F,tt)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(x,at)|0,a=a+Math.imul(x,ot)|0,n=n+Math.imul(S,dt)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(N,dt)|0,a=a+Math.imul(N,ut)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,ct)|0,a=a+Math.imul(w,ft)|0;var It=(u+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,$t)|0)+Math.imul(M,pt)|0))<<13)|0;u=((a=a+Math.imul(M,$t)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,a=Math.imul(U,tt),n=n+Math.imul(F,rt)|0,i=(i=i+Math.imul(F,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,ot)|0,n=n+Math.imul(O,dt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(x,dt)|0,a=a+Math.imul(x,ut)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(N,ct)|0,a=a+Math.imul(N,ft)|0;var Ot=(u+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,$t)|0)+Math.imul(w,pt)|0))<<13)|0;u=((a=a+Math.imul(w,$t)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,a=Math.imul(U,nt),n=n+Math.imul(F,at)|0,i=(i=i+Math.imul(F,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(T,dt)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(P,dt)|0,a=a+Math.imul(P,ut)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(x,ct)|0,a=a+Math.imul(x,ft)|0;var xt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,$t)|0)+Math.imul(N,pt)|0))<<13)|0;u=((a=a+Math.imul(N,$t)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,at),i=(i=Math.imul(D,ot))+Math.imul(U,at)|0,a=Math.imul(U,ot),n=n+Math.imul(F,dt)|0,i=(i=i+Math.imul(F,ut)|0)+Math.imul(L,dt)|0,a=a+Math.imul(L,ut)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(P,ct)|0,a=a+Math.imul(P,ft)|0;var Ct=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,$t)|0)+Math.imul(x,pt)|0))<<13)|0;u=((a=a+Math.imul(x,$t)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,dt),i=(i=Math.imul(D,ut))+Math.imul(U,dt)|0,a=Math.imul(U,ut),n=n+Math.imul(F,ct)|0,i=(i=i+Math.imul(F,ft)|0)+Math.imul(L,ct)|0,a=a+Math.imul(L,ft)|0;var Tt=(u+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,$t)|0)+Math.imul(P,pt)|0))<<13)|0;u=((a=a+Math.imul(P,$t)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,ft))+Math.imul(U,ct)|0,a=Math.imul(U,ft);var Pt=(u+(n=n+Math.imul(F,pt)|0)|0)+((8191&(i=(i=i+Math.imul(F,$t)|0)+Math.imul(L,pt)|0))<<13)|0;u=((a=a+Math.imul(L,$t)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Rt=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,$t))+Math.imul(U,pt)|0))<<13)|0;return u=((a=Math.imul(U,$t))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,d[0]=mt,d[1]=gt,d[2]=vt,d[3]=yt,d[4]=bt,d[5]=Mt,d[6]=At,d[7]=_t,d[8]=wt,d[9]=Et,d[10]=St,d[11]=Nt,d[12]=It,d[13]=Ot,d[14]=xt,d[15]=Ct,d[16]=Tt,d[17]=Pt,d[18]=Rt,0!==u&&(d[19]=u,r.length++),r};function $(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=h),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):$(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==l||u>=i);u--){var c=0|this.words[u];this.words[u]=l<<26-a|c>>>a,l=c&s}return d&&0!==l&&(d.words[d.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(d/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,d=n.length-i.length;if("mod"!==e){(s=new a(null)).length=d+1,s.words=new Array(s.length);for(var u=0;u=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),d=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(c)),i.iushrn(1),o.iushrn(1);for(var p=0,$=1;0==(r.words[0]&$)&&p<26;++p,$<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||d.isOdd())&&(s.iadd(l),d.isub(c)),s.iushrn(1),d.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(d)):(r.isub(e),s.isub(i),d.isub(o))}return{a:s,b:d,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),d=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(d),o.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(d),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new _(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function w(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return g[t]=e,e},_.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),d=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,u).cmp(d);)l.redIAdd(d);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=o;0!==h.cmp(s);){for(var $=h,m=0;0!==$.cmp(s);m++)$=$.redSqr();n(m=0;n--){for(var u=e.words[n],l=d-1;l>=0;l--){var c=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}d=26}return i},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new w(t)},i(w,_),w.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},w.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},w.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},w.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},5230:(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{ClassTransformer:()=>d,Exclude:()=>u,Expose:()=>l,Transform:()=>p,TransformClassToClass:()=>c,TransformClassToPlain:()=>f,TransformPlainToClass:()=>h,TransformationType:()=>n,Type:()=>$,classToClass:()=>M,classToClassFromExist:()=>A,classToPlain:()=>g,classToPlainFromExist:()=>v,deserialize:()=>w,deserializeArray:()=>E,plainToClass:()=>y,plainToClassFromExist:()=>b,serialize:()=>_}),function(t){t[t.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",t[t.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",t[t.CLASS_TO_CLASS=2]="CLASS_TO_CLASS"}(n||(n={}));var i=new(function(){function t(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.findTransformMetadatas=function(t,e,r){return this.findMetadatas(this._transformMetadatas,t,e).filter((function(t){return!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?r===n.CLASS_TO_CLASS||r===n.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||r===n.CLASS_TO_PLAIN)}))},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find((function(t){return t.options&&t.options.name===e}))},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.get(t),r=e&&e.get(void 0),n=this._exposeMetadatas.get(t),i=n&&n.get(void 0);return r&&i||!r&&!i?"none":r?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter((function(t){return!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===n.CLASS_TO_CLASS||e===n.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===n.CLASS_TO_PLAIN)})).map((function(t){return t.propertyName}))},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter((function(t){return!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===n.CLASS_TO_CLASS||e===n.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===n.CLASS_TO_PLAIN)})).map((function(t){return t.propertyName}))},t.prototype.clear=function(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()},t.prototype.getMetadata=function(t,e){var r,n=t.get(e);n&&(r=Array.from(n.values()).filter((function(t){return void 0!==t.propertyName})));for(var i=[],a=0,o=this.getAncestors(e);a0&&(s=s.filter((function(t){return!u.includes(t)}))),void 0!==this.options.version&&(s=s.filter((function(e){var r=i.findExposeMetadata(t,e);return!r||!r.options||a.checkVersion(r.options.since,r.options.until)}))),s=this.options.groups&&this.options.groups.length?s.filter((function(e){var r=i.findExposeMetadata(t,e);return!r||!r.options||a.checkGroups(r.options.groups)})):s.filter((function(e){var r=i.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)}))}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(s=s.filter((function(t){return a.options.excludePrefixes.every((function(e){return t.substr(0,e.length)!==e}))}))),s.filter((function(t,e,r){return r.indexOf(t)===e}))},t.prototype.checkVersion=function(t,e){var r=!0;return r&&t&&(r=this.options.version>=t),r&&e&&(r=this.options.version{"use strict";r.r(e),r.d(e,{ARRAY_CONTAINS:()=>Xs,ARRAY_MAX_SIZE:()=>ld,ARRAY_MIN_SIZE:()=>sd,ARRAY_NOT_CONTAINS:()=>ed,ARRAY_NOT_EMPTY:()=>id,ARRAY_UNIQUE:()=>hd,Allow:()=>y,ArrayContains:()=>td,ArrayMaxSize:()=>fd,ArrayMinSize:()=>ud,ArrayNotContains:()=>nd,ArrayNotEmpty:()=>od,ArrayUnique:()=>$d,CONTAINS:()=>Rt,Contains:()=>Lt,EQUALS:()=>H,Equals:()=>K,IS_ALPHA:()=>Zt,IS_ALPHANUMERIC:()=>Ht,IS_ARRAY:()=>zs,IS_ASCII:()=>ee,IS_BASE32:()=>Va,IS_BASE64:()=>oe,IS_BIC:()=>Wa,IS_BOOLEAN:()=>Is,IS_BOOLEAN_STRING:()=>Ra,IS_BTC_ADDRESS:()=>to,IS_BYTE_LENGTH:()=>ce,IS_CREDIT_CARD:()=>me,IS_CURRENCY:()=>Me,IS_DATA_URI:()=>ao,IS_DATE:()=>Cs,IS_DATE_STRING:()=>Oa,IS_DECIMAL:()=>Jt,IS_DEFINED:()=>w,IS_DIVISIBLE_BY:()=>ct,IS_EAN:()=>co,IS_EMAIL:()=>Se,IS_EMPTY:()=>q,IS_ENUM:()=>Bs,IS_ETHEREUM_ADDRESS:()=>mo,IS_FIREBASE_PUSH_ID:()=>Rn,IS_FQDN:()=>Ce,IS_FULL_WIDTH:()=>Fe,IS_HALF_WIDTH:()=>Ue,IS_HASH:()=>Ma,IS_HEXADECIMAL:()=>tr,IS_HEX_COLOR:()=>We,IS_HSL:()=>Mo,IS_IBAN:()=>Eo,IS_IDENTITY_CARD:()=>xo,IS_IN:()=>nt,IS_INSTANCE:()=>yd,IS_INT:()=>ks,IS_IP:()=>cr,IS_ISBN:()=>Mr,IS_ISIN:()=>Sr,IS_ISO31661_ALPHA_2:()=>tn,IS_ISO31661_ALPHA_3:()=>on,IS_ISO8601:()=>Cr,IS_ISRC:()=>Fo,IS_ISSN:()=>Sa,IS_JSON:()=>Lr,IS_JWT:()=>Zr,IS_LATITUDE:()=>U,IS_LATLONG:()=>L,IS_LENGTH:()=>Vn,IS_LOCALE:()=>ko,IS_LONGITUDE:()=>j,IS_LOWERCASE:()=>zr,IS_MAC_ADDRESS:()=>or,IS_MAGNET_URI:()=>Ho,IS_MILITARY_TIME:()=>ma,IS_MIME_TYPE:()=>Jo,IS_MOBILE_PHONE:()=>Jr,IS_MONGO_ID:()=>cn,IS_MULTIBYTE:()=>mn,IS_NEGATIVE:()=>gt,IS_NOT_EMPTY:()=>tt,IS_NOT_EMPTY_OBJECT:()=>md,IS_NOT_IN:()=>ot,IS_NUMBER:()=>Rs,IS_NUMBER_STRING:()=>Ua,IS_OBJECT:()=>Ws,IS_OCTAL:()=>es,IS_PASSPORT_NUMBER:()=>os,IS_PHONE_NUMBER:()=>ha,IS_PORT:()=>mr,IS_POSITIVE:()=>pt,IS_POSTAL_CODE:()=>ls,IS_RFC_3339:()=>$s,IS_RGB_COLOR:()=>bs,IS_SEM_VER:()=>Es,IS_STRING:()=>Gs,IS_SURROGATE_PAIR:()=>Mn,IS_UPPERCASE:()=>Un,IS_URL:()=>Sn,IS_UUID:()=>Cn,IS_VARIABLE_WIDTH:()=>Ve,IsAlpha:()=>Gt,IsAlphanumeric:()=>Kt,IsArray:()=>Ys,IsAscii:()=>ne,IsBIC:()=>qa,IsBase32:()=>za,IsBase64:()=>de,IsBoolean:()=>xs,IsBooleanString:()=>La,IsBtcAddress:()=>ro,IsByteLength:()=>he,IsCreditCard:()=>ve,IsCurrency:()=>_e,IsDataURI:()=>so,IsDate:()=>Ps,IsDateString:()=>Ca,IsDecimal:()=>Xt,IsDefined:()=>S,IsDivisibleBy:()=>ht,IsEAN:()=>ho,IsEmail:()=>Ie,IsEmpty:()=>Q,IsEnum:()=>Us,IsEthereumAddress:()=>vo,IsFQDN:()=>Pe,IsFirebasePushId:()=>Ln,IsFullWidth:()=>Be,IsHSL:()=>_o,IsHalfWidth:()=>Ze,IsHash:()=>_a,IsHexColor:()=>qe,IsHexadecimal:()=>rr,IsIBAN:()=>No,IsIP:()=>hr,IsISBN:()=>_r,IsISIN:()=>Ir,IsISO31661Alpha2:()=>rn,IsISO31661Alpha3:()=>dn,IsISO8601:()=>Pr,IsISRC:()=>Bo,IsISSN:()=>Ia,IsIdentityCard:()=>To,IsIn:()=>at,IsInstance:()=>Md,IsInt:()=>js,IsJSON:()=>Dr,IsJWT:()=>Gr,IsLatLong:()=>D,IsLatitude:()=>Z,IsLocale:()=>jo,IsLongitude:()=>V,IsLowercase:()=>Yr,IsMACAddress:()=>dr,IsMagnetURI:()=>Ko,IsMilitaryTime:()=>va,IsMimeType:()=>Xo,IsMobilePhone:()=>Xr,IsMongoId:()=>hn,IsMultibyte:()=>vn,IsNegative:()=>yt,IsNotEmpty:()=>rt,IsNotEmptyObject:()=>vd,IsNotIn:()=>dt,IsNumber:()=>Ls,IsNumberString:()=>Za,IsObject:()=>qs,IsOctal:()=>ns,IsOptional:()=>N,IsPassportNumber:()=>ds,IsPhoneNumber:()=>$a,IsPort:()=>vr,IsPositive:()=>mt,IsPostalCode:()=>fs,IsRFC3339:()=>gs,IsRgbColor:()=>As,IsSemVer:()=>Ns,IsString:()=>Hs,IsSurrogatePair:()=>_n,IsUUID:()=>Pn,IsUppercase:()=>Zn,IsUrl:()=>In,IsVariableWidth:()=>ze,Length:()=>zn,MATCHES:()=>ei,MAX:()=>bt,MAX_DATE:()=>Ot,MAX_LENGTH:()=>Kn,MIN:()=>_t,MIN_DATE:()=>St,MIN_LENGTH:()=>Jn,Matches:()=>ni,Max:()=>At,MaxDate:()=>Ct,MaxLength:()=>Wn,MetadataStorage:()=>o,Min:()=>Et,MinDate:()=>It,MinLength:()=>Xn,NOT_CONTAINS:()=>Bt,NOT_EQUALS:()=>Y,NotContains:()=>Ut,NotEquals:()=>J,Validate:()=>O,ValidateBy:()=>_,ValidateIf:()=>x,ValidateNested:()=>T,ValidatePromise:()=>P,ValidationError:()=>d,ValidationTypes:()=>u,Validator:()=>$,ValidatorConstraint:()=>I,arrayContains:()=>Qs,arrayMaxSize:()=>cd,arrayMinSize:()=>dd,arrayNotContains:()=>rd,arrayNotEmpty:()=>ad,arrayUnique:()=>pd,buildMessage:()=>A,contains:()=>Ft,equals:()=>z,getFromContainer:()=>v,getMetadataStorage:()=>s,isAlpha:()=>jt,isAlphanumeric:()=>zt,isArray:()=>Ks,isAscii:()=>re,isBIC:()=>Ja,isBase32:()=>Ha,isBase64:()=>se,isBoolean:()=>Os,isBooleanString:()=>Fa,isBtcAddress:()=>eo,isByteLength:()=>fe,isCreditCard:()=>ge,isCurrency:()=>Ae,isDataURI:()=>oo,isDate:()=>Ts,isDateString:()=>xa,isDecimal:()=>qt,isDefined:()=>E,isDivisibleBy:()=>ft,isEAN:()=>fo,isEmail:()=>Ne,isEmpty:()=>X,isEnum:()=>Ds,isEthereumAddress:()=>go,isFQDN:()=>Te,isFirebasePushId:()=>Fn,isFullWidth:()=>Le,isHSL:()=>Ao,isHalfWidth:()=>ke,isHash:()=>Aa,isHexColor:()=>Je,isHexadecimal:()=>er,isIBAN:()=>So,isIP:()=>fr,isISBN:()=>Ar,isISIN:()=>Nr,isISO31661Alpha2:()=>en,isISO31661Alpha3:()=>sn,isISO8601:()=>Tr,isISRC:()=>Lo,isISSN:()=>Na,isIdentityCard:()=>Co,isIn:()=>it,isInstance:()=>bd,isInt:()=>Zs,isJSON:()=>Br,isJWT:()=>jr,isLatLong:()=>B,isLatitude:()=>k,isLocale:()=>Zo,isLongitude:()=>G,isLowercase:()=>Kr,isMACAddress:()=>sr,isMagnetURI:()=>zo,isMilitaryTime:()=>ga,isMimeType:()=>qo,isMobilePhone:()=>qr,isMongoId:()=>fn,isMultibyte:()=>gn,isNegative:()=>vt,isNotEmpty:()=>et,isNotEmptyObject:()=>gd,isNotIn:()=>st,isNumber:()=>Fs,isNumberString:()=>ka,isObject:()=>Js,isOctal:()=>rs,isPassportNumber:()=>ss,isPhoneNumber:()=>pa,isPort:()=>gr,isPositive:()=>$t,isPostalCode:()=>cs,isRFC3339:()=>ms,isRgbColor:()=>Ms,isSemVer:()=>Ss,isString:()=>Vs,isSurrogatePair:()=>An,isURL:()=>Nn,isUUID:()=>Tn,isUppercase:()=>kn,isValidationOptions:()=>nr,isVariableWidth:()=>He,length:()=>Hn,matches:()=>ri,max:()=>Mt,maxDate:()=>xt,maxLength:()=>Yn,min:()=>wt,minDate:()=>Nt,minLength:()=>qn,notContains:()=>Dt,notEquals:()=>W,registerDecorator:()=>M,registerSchema:()=>Ed,useContainer:()=>g,validate:()=>Ad,validateOrReject:()=>_d,validateSync:()=>wd});var n=function(t){this.groups=[],this.each=!1,this.context=void 0,this.type=t.type,this.target=t.target,this.propertyName=t.propertyName,this.constraints=t.constraints,this.constraintCls=t.constraintCls,this.validationTypeOptions=t.validationTypeOptions,t.validationOptions&&(this.message=t.validationOptions.message,this.groups=t.validationOptions.groups,this.always=t.validationOptions.always,this.each=t.validationOptions.each,this.context=t.validationOptions.context)},i=function(){function t(){}return t.prototype.transform=function(t){var e=[];return Object.keys(t.properties).forEach((function(r){t.properties[r].forEach((function(i){var a={message:i.message,groups:i.groups,always:i.always,each:i.each},o={type:i.type,target:t.name,propertyName:r,constraints:i.constraints,validationTypeOptions:i.options,validationOptions:a};e.push(new n(o))}))})),e},t}();function a(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0}var o=function(){function t(){this.validationMetadatas=[],this.constraintMetadatas=[]}return Object.defineProperty(t.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.length},enumerable:!1,configurable:!0}),t.prototype.addValidationSchema=function(t){var e=this;(new i).transform(t).forEach((function(t){return e.addValidationMetadata(t)}))},t.prototype.addValidationMetadata=function(t){this.validationMetadatas.push(t)},t.prototype.addConstraintMetadata=function(t){this.constraintMetadatas.push(t)},t.prototype.groupByPropertyName=function(t){var e={};return t.forEach((function(t){e[t.propertyName]||(e[t.propertyName]=[]),e[t.propertyName].push(t)})),e},t.prototype.getTargetValidationMetadatas=function(t,e,r,n,i){var a=function(t){return void 0!==t.always?t.always:(!t.groups||!t.groups.length)&&r},o=function(t){return!(!n||i&&i.length||!t.groups||!t.groups.length)},s=this.validationMetadatas.filter((function(r){return(r.target===t||r.target===e)&&(!!a(r)||!o(r)&&(!(i&&i.length>0)||r.groups&&!!r.groups.find((function(t){return-1!==i.indexOf(t)}))))})),d=this.validationMetadatas.filter((function(e){return"string"!=typeof e.target&&e.target!==t&&(!(e.target instanceof Function)||t.prototype instanceof e.target)&&(!!a(e)||!o(e)&&(!(i&&i.length>0)||e.groups&&!!e.groups.find((function(t){return-1!==i.indexOf(t)}))))})).filter((function(t){return!s.find((function(e){return e.propertyName===t.propertyName&&e.type===t.type}))}));return s.concat(d)},t.prototype.getTargetValidatorConstraints=function(t){return this.constraintMetadatas.filter((function(e){return e.target===t}))},t}();function s(){var t=a();return t.classValidatorMetadataStorage||(t.classValidatorMetadataStorage=new o),t.classValidatorMetadataStorage}var d=function(){function t(){}return t.prototype.toString=function(t,e,r){var n=this;void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===r&&(r="");var i=t?"":"",a=t?"":"",o=function(t){return" - property ".concat(i).concat(r).concat(t).concat(a," has failed the following constraints: ").concat(i).concat(Object.keys(n.constraints).join(", ")).concat(a," \n")};if(e){var s=Number.isInteger(+this.property)?"[".concat(this.property,"]"):"".concat(r?".":"").concat(this.property);return this.constraints?o(s):this.children?this.children.map((function(e){return e.toString(t,!0,"".concat(r).concat(s))})).join(""):""}return"An instance of ".concat(i).concat(this.target?this.target.constructor.name:"an object").concat(a," has failed the validation:\n")+(this.constraints?o(this.property):"")+(this.children?this.children.map((function(e){return e.toString(t,!0,n.property)})).join(""):"")},t}(),u=function(){function t(){}return t.isValid=function(t){var e=this;return"isValid"!==t&&"getMessage"!==t&&-1!==Object.keys(this).map((function(t){return e[t]})).indexOf(t)},t.CUSTOM_VALIDATION="customValidation",t.NESTED_VALIDATION="nestedValidation",t.PROMISE_VALIDATION="promiseValidation",t.CONDITIONAL_VALIDATION="conditionalValidation",t.WHITELIST="whitelistValidation",t.IS_DEFINED="isDefined",t}(),l=function(){function t(){}return t.replaceMessageSpecialTokens=function(t,e){var r;return t instanceof Function?r=t(e):"string"==typeof t&&(r=t),r&&Array.isArray(e.constraints)&&e.constraints.forEach((function(t,e){r=r.replace(new RegExp("\\$constraint".concat(e+1),"g"),function(t){return Array.isArray(t)?t.join(", "):"".concat(t)}(t))})),r&&void 0!==e.value&&null!==e.value&&"string"==typeof e.value&&(r=r.replace(/\$value/g,e.value)),r&&(r=r.replace(/\$property/g,e.property)),r&&(r=r.replace(/\$target/g,e.targetName)),r},t}();function c(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}var f,h,p=function(){function t(t,e){this.validator=t,this.validatorOptions=e,this.awaitingPromises=[],this.ignoreAsyncValidations=!1,this.metadataStorage=s()}return t.prototype.execute=function(t,e,r){var n,i=this;this.metadataStorage.hasValidationMetaData||!0!==(null===(n=this.validatorOptions)||void 0===n?void 0:n.enableDebugMessages)||console.warn("No metadata found. There is more than once class-validator version installed probably. You need to flatten your dependencies.");var a=this.validatorOptions?this.validatorOptions.groups:void 0,o=this.validatorOptions&&this.validatorOptions.strictGroups||!1,s=this.validatorOptions&&this.validatorOptions.always||!1,l=this.metadataStorage.getTargetValidationMetadatas(t.constructor,e,s,o,a),c=this.metadataStorage.groupByPropertyName(l);if(this.validatorOptions&&this.validatorOptions.forbidUnknownValues&&!l.length){var f=new d;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(f.target=t),f.value=void 0,f.property=void 0,f.children=[],f.constraints={unknownValue:"an unknown value was passed to the validate function"},void r.push(f)}this.validatorOptions&&this.validatorOptions.whitelist&&this.whitelist(t,c,r),Object.keys(c).forEach((function(e){var n=t[e],a=c[e].filter((function(t){return t.type===u.IS_DEFINED})),o=c[e].filter((function(t){return t.type!==u.IS_DEFINED&&t.type!==u.WHITELIST}));n instanceof Promise&&o.find((function(t){return t.type===u.PROMISE_VALIDATION}))?i.awaitingPromises.push(n.then((function(n){i.performValidations(t,n,e,a,o,r)}))):i.performValidations(t,n,e,a,o,r)}))},t.prototype.whitelist=function(t,e,r){var n=this,i=[];Object.keys(t).forEach((function(t){e[t]&&0!==e[t].length||i.push(t)})),i.length>0&&(this.validatorOptions&&this.validatorOptions.forbidNonWhitelisted?i.forEach((function(e){var i,a=n.generateValidationError(t,t[e],e);a.constraints=((i={})[u.WHITELIST]="property ".concat(e," should not exist"),i),a.children=void 0,r.push(a)})):i.forEach((function(e){return delete t[e]})))},t.prototype.stripEmptyErrors=function(t){var e=this;return t.filter((function(t){if(t.children&&(t.children=e.stripEmptyErrors(t.children)),0===Object.keys(t.constraints).length){if(0===t.children.length)return!1;delete t.constraints}return!0}))},t.prototype.performValidations=function(t,e,r,n,i,a){var o=i.filter((function(t){return t.type===u.CUSTOM_VALIDATION})),s=i.filter((function(t){return t.type===u.NESTED_VALIDATION})),d=i.filter((function(t){return t.type===u.CONDITIONAL_VALIDATION})),l=this.generateValidationError(t,e,r);a.push(l),this.conditionalValidations(t,e,d)&&(this.customValidations(t,e,n,l),this.mapContexts(t,e,n,l),void 0===e&&this.validatorOptions&&!0===this.validatorOptions.skipUndefinedProperties||null===e&&this.validatorOptions&&!0===this.validatorOptions.skipNullProperties||null==e&&this.validatorOptions&&!0===this.validatorOptions.skipMissingProperties||(this.customValidations(t,e,o,l),this.nestedValidations(e,s,l.children),this.mapContexts(t,e,i,l),this.mapContexts(t,e,o,l)))},t.prototype.generateValidationError=function(t,e,r){var n=new d;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(n.target=t),this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.value&&!0!==this.validatorOptions.validationError.value||(n.value=e),n.property=r,n.children=[],n.constraints={},n},t.prototype.conditionalValidations=function(t,e,r){return r.map((function(r){return r.constraints[0](t,e)})).reduce((function(t,e){return t&&e}),!0)},t.prototype.customValidations=function(t,e,r,n){var i=this;r.forEach((function(r){i.metadataStorage.getTargetValidatorConstraints(r.constraintCls).forEach((function(a){if(!(a.async&&i.ignoreAsyncValidations||i.validatorOptions&&i.validatorOptions.stopAtFirstError&&Object.keys(n.constraints||{}).length>0)){var o={targetName:t.constructor?t.constructor.name:void 0,property:r.propertyName,object:t,value:e,constraints:r.constraints};if(r.each&&(Array.isArray(e)||e instanceof Set||e instanceof Map)){var s,d=((s=e)instanceof Map?Array.from(s.values()):Array.isArray(s)?s:Array.from(s)).map((function(t){return a.instance.validate(t,o)}));if(d.some((function(t){return c(t)}))){var u=d.map((function(t){return c(t)?t:Promise.resolve(t)})),l=Promise.all(u).then((function(o){if(!o.every((function(t){return t}))){var s=i.createValidationError(t,e,r,a),d=s[0],u=s[1];n.constraints[d]=u,r.context&&(n.contexts||(n.contexts={}),n.contexts[d]=Object.assign(n.contexts[d]||{},r.context))}}));i.awaitingPromises.push(l)}else if(!d.every((function(t){return t}))){var f=i.createValidationError(t,e,r,a);m=f[0],g=f[1],n.constraints[m]=g}}else{var h=a.instance.validate(e,o);if(c(h)){var p=h.then((function(o){if(!o){var s=i.createValidationError(t,e,r,a),d=s[0],u=s[1];n.constraints[d]=u,r.context&&(n.contexts||(n.contexts={}),n.contexts[d]=Object.assign(n.contexts[d]||{},r.context))}}));i.awaitingPromises.push(p)}else if(!h){var $=i.createValidationError(t,e,r,a),m=$[0],g=$[1];n.constraints[m]=g}}}}))}))},t.prototype.nestedValidations=function(t,e,r){var n=this;void 0!==t&&e.forEach((function(i){var a;if(i.type===u.NESTED_VALIDATION||i.type===u.PROMISE_VALIDATION)if(Array.isArray(t)||t instanceof Set||t instanceof Map)(t instanceof Set?Array.from(t):t).forEach((function(i,a){n.performValidations(t,i,a.toString(),[],e,r)}));else if(t instanceof Object){var o="string"==typeof i.target?i.target:i.target.name;n.execute(t,o,r)}else{var s=new d;s.value=t,s.property=i.propertyName,s.target=i.target;var l=n.createValidationError(i.target,t,i),c=l[0],f=l[1];s.constraints=((a={})[c]=f,a),r.push(s)}}))},t.prototype.mapContexts=function(t,e,r,n){var i=this;return r.forEach((function(t){if(t.context){var e=void 0;t.type===u.CUSTOM_VALIDATION&&(e=i.metadataStorage.getTargetValidatorConstraints(t.constraintCls)[0]);var r=i.getConstraintType(t,e);n.constraints[r]&&(n.contexts||(n.contexts={}),n.contexts[r]=Object.assign(n.contexts[r]||{},t.context))}}))},t.prototype.createValidationError=function(t,e,r,n){var i=t.constructor?t.constructor.name:void 0,a=this.getConstraintType(r,n),o={targetName:i,property:r.propertyName,object:t,value:e,constraints:r.constraints},s=r.message||"";return r.message||this.validatorOptions&&(!this.validatorOptions||this.validatorOptions.dismissDefaultMessages)||n&&n.instance.defaultMessage instanceof Function&&(s=n.instance.defaultMessage(o)),[a,l.replaceMessageSpecialTokens(s,o)]},t.prototype.getConstraintType=function(t,e){return e&&e.name?e.name:t.type},t}(),$=function(){function t(){}return t.prototype.validate=function(t,e,r){return this.coreValidate(t,e,r)},t.prototype.validateOrReject=function(t,e,r){return n=this,i=void 0,o=function(){var n;return function(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]1)throw"More than one implementation of ValidatorConstraintInterface found for validator on: ".concat(t.target.name,":").concat(t.propertyName)}else{var r=t.validator;e=function(){function t(){}return t.prototype.validate=function(t,e){return r.validate(t,e)},t.prototype.defaultMessage=function(t){return r.defaultMessage?r.defaultMessage(t):""},t}(),s().addConstraintMetadata(new b(e,t.name,t.async))}var i={type:t.name&&u.isValid(t.name)?t.name:u.CUSTOM_VALIDATION,target:t.target,propertyName:t.propertyName,validationOptions:t.options,constraintCls:e,constraints:t.constraints};s().addValidationMetadata(new n(i))}function A(t,e){return function(r){var n=e&&e.each?"each value in ":"";return t(n,r)}}function _(t,e){return function(r,n){M({name:t.name,target:r.constructor,propertyName:n,options:e,constraints:t.constraints,validator:t.validator})}}var w=u.IS_DEFINED;function E(t){return null!=t}function S(t){return _({name:w,validator:{validate:function(t){return E(t)},defaultMessage:A((function(t){return t+"$property should not be null or undefined"}),t)}},t)}function N(t){return function(e,r){var i={type:u.CONDITIONAL_VALIDATION,target:e.constructor,propertyName:r,constraints:[function(t,e){return null!==t[r]&&void 0!==t[r]}],validationOptions:t};s().addValidationMetadata(new n(i))}}function I(t){return function(e){var r=t&&t.async,n=t&&t.name?t.name:"";n||(n=e.name)||(n=n.replace(/\.?([A-Z]+)/g,(function(t,e){return"_"+e.toLowerCase()})).replace(/^_/,""));var i=new b(e,n,r);s().addConstraintMetadata(i)}}function O(t,e,r){return function(i,a){var o={type:u.CUSTOM_VALIDATION,target:i.constructor,propertyName:a,constraintCls:t,constraints:Array.isArray(e)?e:void 0,validationOptions:Array.isArray(e)?r:e};s().addValidationMetadata(new n(o))}}function x(t,e){return function(r,i){var a={type:u.CONDITIONAL_VALIDATION,target:r.constructor,propertyName:i,constraints:[t],validationOptions:e};s().addValidationMetadata(new n(a))}}var C=function(){return C=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0}function mt(t){return _({name:pt,validator:{validate:function(t,e){return $t(t)},defaultMessage:A((function(t){return t+"$property must be a positive number"}),t)}},t)}var gt="isNegative";function vt(t){return"number"==typeof t&&t<0}function yt(t){return _({name:gt,validator:{validate:function(t,e){return vt(t)},defaultMessage:A((function(t){return t+"$property must be a negative number"}),t)}},t)}var bt="max";function Mt(t,e){return"number"==typeof t&&"number"==typeof e&&t<=e}function At(t,e){return _({name:bt,constraints:[t],validator:{validate:function(t,e){return Mt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must not be greater than $constraint1"}),e)}},e)}var _t="min";function wt(t,e){return"number"==typeof t&&"number"==typeof e&&t>=e}function Et(t,e){return _({name:_t,constraints:[t],validator:{validate:function(t,e){return wt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must not be less than $constraint1"}),e)}},e)}var St="minDate";function Nt(t,e){return t instanceof Date&&t.getTime()>=e.getTime()}function It(t,e){return _({name:St,constraints:[t],validator:{validate:function(t,e){return Nt(t,e.constraints[0])},defaultMessage:A((function(t){return"minimal allowed date for "+t+"$property is $constraint1"}),e)}},e)}var Ot="maxDate";function xt(t,e){return t instanceof Date&&t.getTime()<=e.getTime()}function Ct(t,e){return _({name:Ot,constraints:[t],validator:{validate:function(t,e){return xt(t,e.constraints[0])},defaultMessage:A((function(t){return"maximal allowed date for "+t+"$property is $constraint1"}),e)}},e)}var Tt=r(9466),Pt=r.n(Tt),Rt="contains";function Ft(t,e){return"string"==typeof t&&Pt()(t,e)}function Lt(t,e){return _({name:Rt,constraints:[t],validator:{validate:function(t,e){return Ft(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain a $constraint1 string"}),e)}},e)}var Bt="notContains";function Dt(t,e){return"string"==typeof t&&!Pt()(t,e)}function Ut(t,e){return _({name:Bt,constraints:[t],validator:{validate:function(t,e){return Dt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property should not contain a $constraint1 string"}),e)}},e)}var kt=r(9234),Zt="isAlpha";function jt(t,e){return"string"==typeof t&&(0,kt.ZP)(t,e)}function Gt(t,e){return _({name:Zt,constraints:[t],validator:{validate:function(t,e){return jt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain only letters (a-zA-Z)"}),e)}},e)}var Vt=r(4583),Ht="isAlphanumeric";function zt(t,e){return"string"==typeof t&&(0,Vt.ZP)(t,e)}function Kt(t,e){return _({name:Ht,constraints:[t],validator:{validate:function(t,e){return zt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain only letters and numbers"}),e)}},e)}var Yt=r(5218),Wt=r.n(Yt),Jt="isDecimal";function qt(t,e){return"string"==typeof t&&Wt()(t,e)}function Xt(t,e){return _({name:Jt,constraints:[t],validator:{validate:function(t,e){return qt(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property is not a valid decimal number."}),e)}},e)}var Qt=r(4094),te=r.n(Qt),ee="isAscii";function re(t){return"string"==typeof t&&te()(t)}function ne(t){return _({name:ee,validator:{validate:function(t,e){return re(t)},defaultMessage:A((function(t){return t+"$property must contain only ASCII characters"}),t)}},t)}var ie=r(2689),ae=r.n(ie),oe="isBase64";function se(t){return"string"==typeof t&&ae()(t)}function de(t){return _({name:oe,validator:{validate:function(t,e){return se(t)},defaultMessage:A((function(t){return t+"$property must be base64 encoded"}),t)}},t)}var ue=r(3235),le=r.n(ue),ce="isByteLength";function fe(t,e,r){return"string"==typeof t&&le()(t,{min:e,max:r})}function he(t,e,r){return _({name:ce,constraints:[t,e],validator:{validate:function(t,e){return fe(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t){return t+"$property's byte length must fall into ($constraint1, $constraint2) range"}),r)}},r)}var pe=r(682),$e=r.n(pe),me="isCreditCard";function ge(t){return"string"==typeof t&&$e()(t)}function ve(t){return _({name:me,validator:{validate:function(t,e){return ge(t)},defaultMessage:A((function(t){return t+"$property must be a credit card"}),t)}},t)}var ye=r(94),be=r.n(ye),Me="isCurrency";function Ae(t,e){return"string"==typeof t&&be()(t,e)}function _e(t,e){return _({name:Me,constraints:[t],validator:{validate:function(t,e){return Ae(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a currency"}),e)}},e)}var we=r(3868),Ee=r.n(we),Se="isEmail";function Ne(t,e){return"string"==typeof t&&Ee()(t,e)}function Ie(t,e){return _({name:Se,constraints:[t],validator:{validate:function(t,e){return Ne(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an email"}),e)}},e)}var Oe=r(221),xe=r.n(Oe),Ce="isFqdn";function Te(t,e){return"string"==typeof t&&xe()(t,e)}function Pe(t,e){return _({name:Ce,constraints:[t],validator:{validate:function(t,e){return Te(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a valid domain name"}),e)}},e)}var Re=r(7146),Fe="isFullWidth";function Le(t){return"string"==typeof t&&(0,Re.default)(t)}function Be(t){return _({name:Fe,validator:{validate:function(t,e){return Le(t)},defaultMessage:A((function(t){return t+"$property must contain a full-width characters"}),t)}},t)}var De=r(2941),Ue="isHalfWidth";function ke(t){return"string"==typeof t&&(0,De.default)(t)}function Ze(t){return _({name:Ue,validator:{validate:function(t,e){return ke(t)},defaultMessage:A((function(t){return t+"$property must contain a half-width characters"}),t)}},t)}var je=r(9019),Ge=r.n(je),Ve="isVariableWidth";function He(t){return"string"==typeof t&&Ge()(t)}function ze(t){return _({name:Ve,validator:{validate:function(t,e){return He(t)},defaultMessage:A((function(t){return t+"$property must contain a full-width and half-width characters"}),t)}},t)}var Ke=r(6298),Ye=r.n(Ke),We="isHexColor";function Je(t){return"string"==typeof t&&Ye()(t)}function qe(t){return _({name:We,validator:{validate:function(t,e){return Je(t)},defaultMessage:A((function(t){return t+"$property must be a hexadecimal color"}),t)}},t)}var Xe=r(7117),Qe=r.n(Xe),tr="isHexadecimal";function er(t){return"string"==typeof t&&Qe()(t)}function rr(t){return _({name:tr,validator:{validate:function(t,e){return er(t)},defaultMessage:A((function(t){return t+"$property must be a hexadecimal number"}),t)}},t)}function nr(t){return!!t&&("each"in t||"message"in t||"groups"in t||"always"in t||"context"in t)}var ir=r(8999),ar=r.n(ir),or="isMacAddress";function sr(t,e){return"string"==typeof t&&ar()(t,e)}function dr(t,e){var r=nr(t)?void 0:t,n=nr(t)?t:e;return _({name:or,constraints:[r],validator:{validate:function(t,e){return sr(t,r)},defaultMessage:A((function(t){return t+"$property must be a MAC Address"}),n)}},n)}var ur=r(1028),lr=r.n(ur),cr="isIp";function fr(t,e){var r=e?"".concat(e):void 0;return"string"==typeof t&&lr()(t,r)}function hr(t,e){return _({name:cr,constraints:[t],validator:{validate:function(t,e){return fr(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an ip address"}),e)}},e)}var pr=r(4595),$r=r.n(pr),mr="isPort";function gr(t){return"string"==typeof t&&$r()(t)}function vr(t){return _({name:mr,validator:{validate:function(t,e){return gr(t)},defaultMessage:A((function(t){return t+"$property must be a port"}),t)}},t)}var yr=r(7612),br=r.n(yr),Mr="isIsbn";function Ar(t,e){var r=e?"".concat(e):void 0;return"string"==typeof t&&br()(t,r)}function _r(t,e){return _({name:Mr,constraints:[t],validator:{validate:function(t,e){return Ar(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an ISBN"}),e)}},e)}var wr=r(7148),Er=r.n(wr),Sr="isIsin";function Nr(t){return"string"==typeof t&&Er()(t)}function Ir(t){return _({name:Sr,validator:{validate:function(t,e){return Nr(t)},defaultMessage:A((function(t){return t+"$property must be an ISIN (stock/security identifier)"}),t)}},t)}var Or=r(5061),xr=r.n(Or),Cr="isIso8601";function Tr(t,e){return"string"==typeof t&&xr()(t,e)}function Pr(t,e){return _({name:Cr,constraints:[t],validator:{validate:function(t,e){return Tr(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a valid ISO 8601 date string"}),e)}},e)}var Rr=r(1008),Fr=r.n(Rr),Lr="isJson";function Br(t){return"string"==typeof t&&Fr()(t)}function Dr(t){return _({name:Lr,validator:{validate:function(t,e){return Br(t)},defaultMessage:A((function(t){return t+"$property must be a json string"}),t)}},t)}var Ur=r(4979),kr=r.n(Ur),Zr="isJwt";function jr(t){return"string"==typeof t&&kr()(t)}function Gr(t){return _({name:Zr,validator:{validate:function(t,e){return jr(t)},defaultMessage:A((function(t){return t+"$property must be a jwt string"}),t)}},t)}var Vr=r(3928),Hr=r.n(Vr),zr="isLowercase";function Kr(t){return"string"==typeof t&&Hr()(t)}function Yr(t){return _({name:zr,validator:{validate:function(t,e){return Kr(t)},defaultMessage:A((function(t){return t+"$property must be a lowercase string"}),t)}},t)}var Wr=r(8355),Jr="isMobilePhone";function qr(t,e,r){return"string"==typeof t&&(0,Wr.ZP)(t,e,r)}function Xr(t,e,r){return _({name:Jr,constraints:[t,e],validator:{validate:function(t,e){return qr(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t){return t+"$property must be a phone number"}),r)}},r)}var Qr=r(1727),tn="isISO31661Alpha2";function en(t){return"string"==typeof t&&(0,Qr.default)(t)}function rn(t){return _({name:tn,validator:{validate:function(t,e){return en(t)},defaultMessage:A((function(t){return t+"$property must be a valid ISO31661 Alpha2 code"}),t)}},t)}var nn=r(6776),an=r.n(nn),on="isISO31661Alpha3";function sn(t){return"string"==typeof t&&an()(t)}function dn(t){return _({name:on,validator:{validate:function(t,e){return sn(t)},defaultMessage:A((function(t){return t+"$property must be a valid ISO31661 Alpha3 code"}),t)}},t)}var un=r(9131),ln=r.n(un),cn="isMongoId";function fn(t){return"string"==typeof t&&ln()(t)}function hn(t){return _({name:cn,validator:{validate:function(t,e){return fn(t)},defaultMessage:A((function(t){return t+"$property must be a mongodb id"}),t)}},t)}var pn=r(3590),$n=r.n(pn),mn="isMultibyte";function gn(t){return"string"==typeof t&&$n()(t)}function vn(t){return _({name:mn,validator:{validate:function(t,e){return gn(t)},defaultMessage:A((function(t){return t+"$property must contain one or more multibyte chars"}),t)}},t)}var yn=r(2828),bn=r.n(yn),Mn="isSurrogatePair";function An(t){return"string"==typeof t&&bn()(t)}function _n(t){return _({name:Mn,validator:{validate:function(t,e){return An(t)},defaultMessage:A((function(t){return t+"$property must contain any surrogate pairs chars"}),t)}},t)}var wn=r(2492),En=r.n(wn),Sn="isUrl";function Nn(t,e){return"string"==typeof t&&En()(t,e)}function In(t,e){return _({name:Sn,constraints:[t],validator:{validate:function(t,e){return Nn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be an URL address"}),e)}},e)}var On=r(7278),xn=r.n(On),Cn="isUuid";function Tn(t,e){return"string"==typeof t&&xn()(t,e)}function Pn(t,e){return _({name:Cn,constraints:[t],validator:{validate:function(t,e){return Tn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a UUID"}),e)}},e)}var Rn="IsFirebasePushId";function Fn(t){return"string"==typeof t&&20===t.length&&/^[a-zA-Z0-9_-]*$/.test(t)}function Ln(t){return _({name:Rn,validator:{validate:function(t,e){return Fn(t)},defaultMessage:A((function(t){return t+"$property must be a Firebase Push Id"}),t)}},t)}var Bn=r(7245),Dn=r.n(Bn),Un="isUppercase";function kn(t){return"string"==typeof t&&Dn()(t)}function Zn(t){return _({name:Un,validator:{validate:function(t,e){return kn(t)},defaultMessage:A((function(t){return t+"$property must be uppercase"}),t)}},t)}var jn=r(661),Gn=r.n(jn),Vn="isLength";function Hn(t,e,r){return"string"==typeof t&&Gn()(t,{min:e,max:r})}function zn(t,e,r){return _({name:Vn,constraints:[t,e],validator:{validate:function(t,e){return Hn(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t,e){var r=null!==e.constraints[0]&&void 0!==e.constraints[0],n=null!==e.constraints[1]&&void 0!==e.constraints[1];return r&&(!e.value||e.value.lengthe.constraints[1]?t+"$property must be shorter than or equal to $constraint2 characters":t+"$property must be longer than or equal to $constraint1 and shorter than or equal to $constraint2 characters"}),r)}},r)}var Kn="maxLength";function Yn(t,e){return"string"==typeof t&&Gn()(t,{min:0,max:e})}function Wn(t,e){return _({name:Kn,constraints:[t],validator:{validate:function(t,e){return Yn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be shorter than or equal to $constraint1 characters"}),e)}},e)}var Jn="minLength";function qn(t,e){return"string"==typeof t&&Gn()(t,{min:e})}function Xn(t,e){return _({name:Jn,constraints:[t],validator:{validate:function(t,e){return qn(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be longer than or equal to $constraint1 characters"}),e)}},e)}var Qn=r(5090),ti=r.n(Qn),ei="matches";function ri(t,e,r){return"string"==typeof t&&ti()(t,e,r)}function ni(t,e,r){var n;return e&&e instanceof Object&&!r?r=e:n=e,_({name:ei,constraints:[t,n],validator:{validate:function(t,e){return ri(t,e.constraints[0],e.constraints[1])},defaultMessage:A((function(t,e){return t+"$property must match $constraint1 regular expression"}),r)}},r)}const ii={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[25689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[25689]"]]]],BL:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}",[10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}"],0,0,0,["600[2-9]\\d{6}"]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-3]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:(?:1\\d|[36])\\d{3}|9101)\\d{6}|[124-8]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1 $2",["[146][2-9]|[2578]"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:1\\d|2[02-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[05]\\d|[23]1|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-59]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-59]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[47]\\d{6}|76\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0359])|(?:5[0-26-9]|[78][0-49])\\d\\d|6(?:[0-4]\\d\\d|50[0-24-69]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[0-278])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|55\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[38]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]","5(?:29|38)[89]0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:29(?:[189][05]|2[29]|3[01])|38[89][05])\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\d|5[02-9]|6[02-8]|80|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[01]\\d|6[1267]|7[0-57]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[57-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[57-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670"],MQ:["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[19]\\d|[23]1|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[017]\\d|[235][1-9]|4[0-35-9]|6[0-46-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9])|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","[2-57-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}",[5,6,7,8,9,10],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-579]|6[2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,0," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","[2-7]\\d{7}|800\\d{4}(?:\\d{2})?|2\\d{6}",[7,8,9],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]]],RE:["262","00","9769\\d{5}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]"],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","8000\\d{3}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-4]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:00|[1-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]","4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["[3-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}",[10],[["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|33)|4(?:00|4[24]|65|82)|5(?:00|29|83)|6(?:00|66|82)|777|8(?:00|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","4\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63"],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","(?:63|80)0\\d{6}|(?:21|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:005|[1-9]\\d\\d)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:005|[1-9]\\d\\d)\\d{5}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],883:["883",0,"(?:210|370\\d\\d)\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[35]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|(?:370[1-9]|51[013]0)\\d)\\d{7}|5100\\d{5}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function ai(t,e){var r=Array.prototype.slice.call(e);return r.push(ii),t.apply(this,r)}function oi(t){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oi(t)}function si(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function di(t){var e,r,n,i=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(Array.prototype.slice.call(t),4),a=i[0],o=i[1],s=i[2],d=i[3];if("string"!=typeof a)throw new TypeError("A text for parsing must be a string.");if(e=a,o&&"string"!=typeof o){if(!ui(o))throw new Error("Invalid second argument: ".concat(o));s?(r=o,n=s):n=o}else d?(r=s,n=d):(r=void 0,n=s),o&&(r=function(t){for(var e=1;eo)return 1;if(o>a)return-1;if(!isNaN(a)&&isNaN(o))return 1;if(isNaN(a)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=2&&Ri.test(t)}var Li=new RegExp("(?:"+xi()+")$","i"),Bi={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function Di(t){var e="",r=t.split(""),n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}e+=Ui(a,e)||""}return e}function Ui(t,e){if("+"===t){if(e)return;return"+"}return function(t){return Bi[t]}(t)}function ki(t,e){return Zi(t,void 0,e)}function Zi(t,e,r){var n=r.type(e),i=n&&n.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===e){if(!r.type("FIXED_LINE"))return Zi(t,"MOBILE",r);var a=r.type("MOBILE");a&&(i=function(t,e){var r=t.slice(),n=e,i=Array.isArray(n),a=0;for(n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var s=o;t.indexOf(s)<0&&r.push(s)}return r.sort((function(t,e){return t-e}))}(i,a.possibleLengths()))}else if(e&&!n)return"INVALID_LENGTH";var o=t.length,s=i[0];return s===o?"IS_POSSIBLE":s>o?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function ji(t,e){return"IS_POSSIBLE"===ki(t,e)}function Gi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Vi(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}var Hi=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function zi(t,e,r){if(e=e||{},t.country){(r=new yi(r)).selectNumberingPlan(t.country,t.countryCallingCode);var n=e.v2?t.nationalNumber:t.phone;if(Vi(n,r.nationalNumberPattern())){if(Ki(n,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?Ki(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i=0,a=Hi;i=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var o=a;if(o.leadingDigitsPatterns().length>0){var s=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(0!==e.search(s))continue}if(Vi(e,o.pattern()))return o}}(n.formats(),t);return a?function(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix,a=(r.carrierCode,r.metadata,t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(Yi,e.nationalPrefixFormattingRule()):e.format()));return n?function(t){return t.replace(new RegExp("[".concat(li,"]+"),"g")," ").trim()}(a):a}(t,a,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:e,metadata:n}):t}function Qi(t,e,r,n){return e?n(t,e,r):t}function ta(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ea(t,e){for(var r=0;r0&&n[s];if(e.nationalPrefixTransformRule()&&d)i=t.replace(r,e.nationalPrefixTransformRule()),s>1&&(a=n[1]);else{var u=n[0];i=t.slice(u.length),d&&(a=n[1])}if(d){var l=t.indexOf(n[1]);t.slice(0,l)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:i,nationalPrefix:o,carrierCode:a}}}return{nationalNumber:t}}(t,e),n=r.nationalNumber,i=r.carrierCode;if(!function(t,e,r){return!(Vi(t,r.nationalNumberPattern())&&!Vi(e,r.nationalNumberPattern()))}(t,n,e))return{nationalNumber:t};if(t.length!==n.length+(i?i.length:0)&&e.possibleLengths())switch(ki(n,e)){case"TOO_SHORT":case"INVALID_LENGTH":return{nationalNumber:t}}return{nationalNumber:n,carrierCode:i}}var oa=new RegExp("[++0-90-9٠-٩۰-۹]"),sa=new RegExp("[^0-90-9٠-٩۰-۹#]+$");function da(t,e,r){if(e=e||{},r=new yi(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry)){if(e.v2)throw new ci("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var n=function(t,e,r){if(t&&0===t.indexOf("tel:"))return function(t){var e,r,n=(t=t.replace(/^tel:/,"tel=")).split(";"),i=Array.isArray(n),a=0;for(n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var s=Gi(o.split("="),2),d=s[0],u=s[1];switch(d){case"tel":e=u;break;case"ext":r=u;break;case"phone-context":"+"===u[0]&&(e=u+e)}}if(!Fi(e))return{};var l={number:e};return r&&(l.ext=r),l}(t);var n=function(t,e,r){if(t)if(t.length>250){if(r)throw new ci("TOO_LONG")}else{if(!1===e)return t;var n=t.search(oa);if(!(n<0))return t.slice(n).replace(sa,"")}}(t,r,e);if(!n)return{};if(!Fi(n))return function(t){return Ti.test(t)}(n)?{error:"TOO_SHORT"}:{};var i=function(t){var e=t.search(Li);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(Li),i=1;i0&&"0"===o[1]))return t}}}(t,e,r,n);if(!i||i===t){if(e||r){var a=function(t,e,r,n){var i=e?Ni(e,n):r;if(0===t.indexOf(i)){(n=new yi(n)).selectNumberingPlan(e,r);var a=t.slice(i.length),o=aa(a,n).nationalNumber,s=aa(t,n).nationalNumber;if(!Vi(s,n.nationalNumberPattern())&&Vi(o,n.nationalNumberPattern())||"TOO_LONG"===ki(s,n))return{countryCallingCode:i,number:a}}return{number:t}}(t,e,r,n),o=a.countryCallingCode,s=a.number;if(o)return{countryCallingCode:o,number:s}}return{number:t}}t="+"+i}if("0"===t[1])return{};n=new yi(n);for(var d=2;d-1<=3&&d<=t.length;){var u=t.slice(1,d);if(n.hasCallingCode(u))return n.selectNumberingPlan(u),{countryCallingCode:u,number:t.slice(d)};d++}return{}}(Di(t),e,r,n.metadata),o=a.countryCallingCode,s=a.number;if(o)n.selectNumberingPlan(o);else{if(!s||!e&&!r)return{};n.selectNumberingPlan(e,r),e&&(i=e),o=r||Ni(e,n.metadata)}if(!s)return{countryCallingCode:o};var d=aa(Di(s),n),u=d.nationalNumber,l=d.carrierCode,c=function(t,e,r){var n=r.getCountryCodesForCallingCode(t);if(n)return 1===n.length?n[0]:function(t,e,r){r=new yi(r);var n=t,i=Array.isArray(n),a=0;for(n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var s=o;if(r.country(s),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return s}else if(zi({phone:e,country:s},void 0,r.metadata))return s}}(n,e,r.metadata)}(o,u,n);return c&&(i=c,"001"===c||n.country(i)),{country:i,countryCallingCode:o,nationalNumber:u,carrierCode:l}}(i,e.defaultCountry,e.defaultCallingCode,r),d=s.country,u=s.nationalNumber,l=s.countryCallingCode,c=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new ci("INVALID_COUNTRY");return{}}if(!u||u.length<2){if(e.v2)throw new ci("TOO_SHORT");return{}}if(u.length>17){if(e.v2)throw new ci("TOO_LONG");return{}}if(e.v2){var f=new ra(l,u,r.metadata);return d&&(f.country=d),c&&(f.carrierCode=c),a&&(f.ext=a),f}var h=!!(e.extended?r.hasSelectedNumberingPlan():d)&&Vi(u,r.nationalNumberPattern());return e.extended?{country:d,countryCallingCode:l,carrierCode:c,valid:h,possible:!!h||!(!0!==e.extended||!r.possibleLengths()||!ji(u,r)),phone:u,ext:a}:h?function(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}(d,u,a):{}}function ua(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function la(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ca(t,e,r){e&&e.defaultCountry&&!function(t,e){return void 0!==e.countries[t]}(e.defaultCountry,r)&&(e=function(t){for(var e=1;ee.maxDecimalPlaces)return!1}return Number.isFinite(t)}function Ls(t,e){return void 0===t&&(t={}),_({name:Rs,constraints:[t],validator:{validate:function(t,e){return Fs(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a number conforming to the specified constraints"}),e)}},e)}var Bs="isEnum";function Ds(t,e){return Object.keys(e).map((function(t){return e[t]})).indexOf(t)>=0}function Us(t,e){return _({name:Bs,constraints:[t],validator:{validate:function(t,e){return Ds(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a valid enum value"}),e)}},e)}var ks="isInt";function Zs(t){return"number"==typeof t&&Number.isInteger(t)}function js(t){return _({name:ks,validator:{validate:function(t,e){return Zs(t)},defaultMessage:A((function(t){return t+"$property must be an integer number"}),t)}},t)}var Gs="isString";function Vs(t){return t instanceof String||"string"==typeof t}function Hs(t){return _({name:Gs,validator:{validate:function(t,e){return Vs(t)},defaultMessage:A((function(t){return t+"$property must be a string"}),t)}},t)}var zs="isArray";function Ks(t){return Array.isArray(t)}function Ys(t){return _({name:zs,validator:{validate:function(t,e){return Ks(t)},defaultMessage:A((function(t){return t+"$property must be an array"}),t)}},t)}var Ws="isObject";function Js(t){return null!=t&&("object"==typeof t||"function"==typeof t)&&!Array.isArray(t)}function qs(t){return _({name:Ws,validator:{validate:function(t,e){return Js(t)},defaultMessage:A((function(t){return t+"$property must be an object"}),t)}},t)}var Xs="arrayContains";function Qs(t,e){return!!Array.isArray(t)&&e.every((function(e){return-1!==t.indexOf(e)}))}function td(t,e){return _({name:Xs,constraints:[t],validator:{validate:function(t,e){return Qs(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain $constraint1 values"}),e)}},e)}var ed="arrayNotContains";function rd(t,e){return!!Array.isArray(t)&&e.every((function(e){return-1===t.indexOf(e)}))}function nd(t,e){return _({name:ed,constraints:[t],validator:{validate:function(t,e){return rd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property should not contain $constraint1 values"}),e)}},e)}var id="arrayNotEmpty";function ad(t){return Array.isArray(t)&&t.length>0}function od(t){return _({name:id,validator:{validate:function(t,e){return ad(t)},defaultMessage:A((function(t){return t+"$property should not be empty"}),t)}},t)}var sd="arrayMinSize";function dd(t,e){return Array.isArray(t)&&t.length>=e}function ud(t,e){return _({name:sd,constraints:[t],validator:{validate:function(t,e){return dd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain at least $constraint1 elements"}),e)}},e)}var ld="arrayMaxSize";function cd(t,e){return Array.isArray(t)&&t.length<=e}function fd(t,e){return _({name:ld,constraints:[t],validator:{validate:function(t,e){return cd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must contain not more than $constraint1 elements"}),e)}},e)}var hd="arrayUnique";function pd(t,e){if(!Array.isArray(t))return!1;e&&(t=t.map((function(t){return null!=t?e(t):t})));var r=t.filter((function(t,e,r){return r.indexOf(t)===e}));return t.length===r.length}function $d(t,e){var r="function"==typeof t?t:void 0,n="function"!=typeof t?t:e;return _({name:hd,validator:{validate:function(t,e){return pd(t,r)},defaultMessage:A((function(t){return t+"All $property's elements must be unique"}),n)}},n)}var md="isNotEmptyObject";function gd(t,e){if(!Js(t))return!1;if(!0===(null==e?void 0:e.nullable))return!Object.values(t).every((function(t){return null==t}));for(var r in t)if(t.hasOwnProperty(r))return!0;return!1}function vd(t,e){return _({name:md,constraints:[t],validator:{validate:function(t,e){return gd(t,e.constraints[0])},defaultMessage:A((function(t){return t+"$property must be a non-empty object"}),e)}},e)}var yd="isInstance";function bd(t,e){return e&&"function"==typeof e&&t instanceof e}function Md(t,e){return _({name:yd,constraints:[t],validator:{validate:function(t,e){return bd(t,e.constraints[0])},defaultMessage:A((function(t,e){return e.constraints[0]?t+"$property must be an instance of ".concat(e.constraints[0].name):t+"".concat(yd," decorator expects and object as value, but got falsy value.")}),e)}},e)}function Ad(t,e,r){return"string"==typeof t?v($).validate(t,e,r):v($).validate(t,e)}function _d(t,e,r){return"string"==typeof t?v($).validateOrReject(t,e,r):v($).validateOrReject(t,e)}function wd(t,e,r){return"string"==typeof t?v($).validateSync(t,e,r):v($).validateSync(t,e)}function Ed(t){s().addValidationSchema(t)}},1094:(t,e,r)=>{var n;!function(){"use strict";var i="input is invalid type",a="object"==typeof window,o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var s=!a&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=global:s&&(o=self);var d=!o.JS_SHA3_NO_COMMON_JS&&t.exports,u=r.amdO,l=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),f=[4,1024,262144,67108864],h=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],$=[224,256,384,512],m=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var y=function(t,e,r){return function(n){return new R(t,e,t).update(n)[r]()}},b=function(t,e,r){return function(n,i){return new R(t,e,i).update(n)[r]()}},M=function(t,e,r){return function(e,n,i,a){return S["cshake"+t].update(e,n,i,a)[r]()}},A=function(t,e,r){return function(e,n,i,a){return S["kmac"+t].update(e,n,i,a)[r]()}},_=function(t,e,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(t,e,r){R.call(this,t,e,r)}R.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}for(var n,a,o=this.blocks,s=this.byteCount,d=t.length,u=this.blockCount,c=0,f=this.s;c>2]|=t[c]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(o[n>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=s){for(this.start=n-s,this.block=o[u],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}var n=0,a=t.length;if(e)n=a;else for(var o=0;o=57344?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},R.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15];o%e==0&&(L(r),a=0)}return i&&(t=r[a],s+=c[t>>4&15]+c[15&t],i>1&&(s+=c[t>>12&15]+c[t>>8&15]),i>2&&(s+=c[t>>20&15]+c[t>>16&15])),s},R.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var d=new Uint32Array(t);o>8&255,d[t+2]=e>>16&255,d[t+3]=e>>24&255;s%r==0&&L(n)}return a&&(t=s<<2,e=n[o],d[t]=255&e,a>1&&(d[t+1]=e>>8&255),a>2&&(d[t+2]=e>>16&255)),d},F.prototype=new R,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var L=function(t){var e,r,n,i,a,o,s,d,u,l,c,f,h,$,m,g,v,y,b,M,A,_,w,E,S,N,I,O,x,C,T,P,R,F,L,B,D,U,k,Z,j,G,V,H,z,K,Y,W,J,q,X,Q,tt,et,rt,nt,it,at,ot,st,dt,ut,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],a=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],d=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(o<<1|s>>>31),r=(h=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(d<<1|u>>>31),r=a^(u<<1|d>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|c>>>31),r=s^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=d^(f<<1|h>>>31),r=u^(h<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|a>>>31),r=c^(a<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,$=t[0],m=t[1],K=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,dt=t[30]<<9|t[31]>>>23,G=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,F=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,C=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,q=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,R=t[44]<<29|t[45]>>>3,E=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,k=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,H=t[8]<<27|t[9]>>>5,z=t[9]<<27|t[8]>>>5,N=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,at=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,Z=t[38]<<8|t[39]>>>24,j=t[39]<<8|t[38]>>>24,_=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=$^~g&y,t[1]=m^~v&b,t[10]=E^~N&O,t[11]=S^~I&x,t[20]=F^~B&U,t[21]=L^~D&k,t[30]=H^~K&W,t[31]=z^~Y&J,t[40]=et^~nt&at,t[41]=rt^~it&ot,t[2]=g^~y&M,t[3]=v^~b&A,t[12]=N^~O&C,t[13]=I^~x&T,t[22]=B^~U&Z,t[23]=D^~k&j,t[32]=K^~W&q,t[33]=Y^~J&X,t[42]=nt^~at&st,t[43]=it^~ot&dt,t[4]=y^~M&_,t[5]=b^~A&w,t[14]=O^~C&P,t[15]=x^~T&R,t[24]=U^~Z&G,t[25]=k^~j&V,t[34]=W^~q&Q,t[35]=J^~X&tt,t[44]=at^~st&ut,t[45]=ot^~dt<,t[6]=M^~_&$,t[7]=A^~w&m,t[16]=C^~P&E,t[17]=T^~R&S,t[26]=Z^~G&F,t[27]=j^~V&L,t[36]=q^~Q&H,t[37]=X^~tt&z,t[46]=st^~ut&et,t[47]=dt^~lt&rt,t[8]=_^~$&g,t[9]=w^~m&v,t[18]=P^~E&N,t[19]=R^~S&I,t[28]=G^~F&B,t[29]=V^~L&D,t[38]=Q^~H&K,t[39]=tt^~z&Y,t[48]=ut^~et&nt,t[49]=lt^~rt&it,t[0]^=p[n],t[1]^=p[n+1]};if(d)t.exports=S;else{for(I=0;I{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.commaDecimal=e.dotDecimal=e.farsiLocales=e.arabicLocales=e.englishLocales=e.decimal=e.alphanumeric=e.alpha=void 0;var r={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i};e.alpha=r;var n={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i};e.alphanumeric=n;var i={"en-US":".",ar:"٫"};e.decimal=i;var a=["AU","GB","HK","IN","NZ","ZA","ZM"];e.englishLocales=a;for(var o,s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){return(0,n.default)(t),(r=(0,a.default)(r,s)).ignoreCase?t.toLowerCase().split((0,i.default)(e).toLowerCase()).length>r.minOccurrences:t.split((0,i.default)(e)).length>r.minOccurrences};var n=o(r(5571)),i=o(r(1913)),a=o(r(4808));function o(t){return t&&t.__esModule?t:{default:t}}var s={ignoreCase:!1,minOccurrences:1};t.exports=e.default,t.exports.default=e.default},9234:(t,e,r)=>{"use strict";e.ZP=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(t);var n=t,o=r.ignore;if(o)if(o instanceof RegExp)n=n.replace(o,"");else{if("string"!=typeof o)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(o.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(e in a.alpha)return a.alpha[e].test(n);throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79);Object.keys(a.alpha)},4583:(t,e,r)=>{"use strict";e.ZP=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(t);var n=t,o=r.ignore;if(o)if(o instanceof RegExp)n=n.replace(o,"");else{if("string"!=typeof o)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(o.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(e in a.alphanumeric)return a.alphanumeric[e].test(n);throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79);Object.keys(a.alphanumeric)},4094:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[\x00-\x7F]+$/;t.exports=e.default,t.exports.default=e.default},2438:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),!!a.CountryCodes.has(t.slice(4,6).toUpperCase())&&o.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(1727),o=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;t.exports=e.default,t.exports.default=e.default},2782:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),!(t.length%8!=0||!a.test(t))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Z2-7]+=*$/;t.exports=e.default,t.exports.default=e.default},2689:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(t),e=(0,i.default)(e,d);var r=t.length;if(e.urlSafe)return s.test(t);if(r%4!=0||o.test(t))return!1;var a=t.indexOf("=");return-1===a||a===r-1||a===r-2&&"="===t[r-1]};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}var o=/[^A-Z0-9+\/=]/i,s=/^[A-Z0-9_\-]*$/i,d={urlSafe:!1};t.exports=e.default,t.exports.default=e.default},9493:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return(0,i.default)(t),e.loose?s.includes(t.toLowerCase()):o.includes(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={loose:!1},o=["true","false","1","0"],s=[].concat(o,["yes","no"]);t.exports=e.default,t.exports.default=e.default},8021:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),t.startsWith("bc1")?a.test(t):o.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(bc1)[a-z0-9]{25,39}$/,o=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;t.exports=e.default,t.exports.default=e.default},3235:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r,n;(0,i.default)(t),"object"===a(e)?(r=e.min||0,n=e.max):(r=arguments[1],n=arguments[2]);var o=encodeURI(t).split(/%..|./).length-1;return o>=r&&(void 0===n||o<=n)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}t.exports=e.default,t.exports.default=e.default},682:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e=t.replace(/[- ]+/g,"");if(!a.test(e))return!1;for(var r,n,o,s=0,d=e.length-1;d>=0;d--)r=e.substring(d,d+1),n=parseInt(r,10),s+=o&&(n*=2)>=10?n%10+1:n,o=!o;return!(s%10!=0||!e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;t.exports=e.default,t.exports.default=e.default},94:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),function(t){var e="\\d{".concat(t.digits_after_decimal[0],"}");t.digits_after_decimal.forEach((function(t,r){0!==r&&(e="".concat(e,"|\\d{").concat(t,"}"))}));var r="(".concat(t.symbol.replace(/\W/,(function(t){return"\\".concat(t)})),")").concat(t.require_symbol?"":"?"),n="-?",i="[1-9]\\d{0,2}(\\".concat(t.thousands_separator,"\\d{3})*"),a="(".concat(["0","[1-9]\\d*",i].join("|"),")?"),o="(\\".concat(t.decimal_separator,"(").concat(e,"))").concat(t.require_decimal?"":"?"),s=a+(t.allow_decimal||t.require_decimal?o:"");return t.allow_negatives&&!t.parens_for_negatives&&(t.negative_sign_after_digits?s+=n:t.negative_sign_before_digits&&(s=n+s)),t.allow_negative_sign_placeholder?s="( (?!\\-))?".concat(s):t.allow_space_after_symbol?s=" ?".concat(s):t.allow_space_after_digits&&(s+="( (?!$))?"),t.symbol_after_digits?s+=r:s=r+s,t.allow_negatives&&(t.parens_for_negatives?s="(\\(".concat(s,"\\)|").concat(s,")"):t.negative_sign_before_digits||t.negative_sign_after_digits||(s=n+s)),new RegExp("^(?!-? )(?=.*\\d)".concat(s,"$"))}(e=(0,n.default)(e,o)).test(t)};var n=a(r(4808)),i=a(r(5571));function a(t){return t&&t.__esModule?t:{default:t}}var o={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};t.exports=e.default,t.exports.default=e.default},8983:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e=t.split(",");if(e.length<2)return!1;var r=e.shift().trim().split(";"),n=r.shift();if("data:"!==n.substr(0,5))return!1;var d=n.substr(5);if(""!==d&&!a.test(d))return!1;for(var u=0;u{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,i.default)(t),(e=(0,n.default)(e,d)).locale in o.decimal)return!(0,a.default)(u,t.replace(/ /g,""))&&function(t){return new RegExp("^[-+]?([0-9]+)?(\\".concat(o.decimal[t.locale],"[0-9]{").concat(t.decimal_digits,"})").concat(t.force_decimal?"":"?","$"))}(e).test(t);throw new Error("Invalid locale '".concat(e.locale,"'"))};var n=s(r(4808)),i=s(r(5571)),a=s(r(8343)),o=r(79);function s(t){return t&&t.__esModule?t:{default:t}}var d={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},u=["","-","+"];t.exports=e.default,t.exports.default=e.default},8335:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,n.default)(t),(0,i.default)(t)%parseInt(e,10)==0};var n=a(r(5571)),i=a(r(7536));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default,t.exports.default=e.default},5807:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e,r,n=Number(t.slice(-1));return a.test(t)&&n===((r=10-(e=t).slice(0,-1).split("").map((function(t,r){return Number(t)*function(t,e){return 8===t||14===t?e%2==0?3:1:e%2==0?1:3}(e.length,r)})).reduce((function(t,e){return t+e}),0)%10)<10?r:0)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(\d{8}|\d{13}|\d{14})$/;t.exports=e.default,t.exports.default=e.default},3868:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),(e=(0,i.default)(e,u)).require_display_name||e.allow_display_name){var r=t.match(l);if(r){var d=r[1];if(t=t.replace(d,"").replace(/(^<|>$)/g,""),d.endsWith(" ")&&(d=d.substr(0,d.length-1)),!function(t){var e=t.replace(/^"(.+)"$/,"$1");if(!e.trim())return!1;if(/[\.";<>]/.test(e)){if(e===t)return!1;if(e.split('"').length!==e.split('\\"').length)return!1}return!0}(d))return!1}else if(e.require_display_name)return!1}if(!e.ignore_max_length&&t.length>254)return!1;var m=t.split("@"),g=m.pop(),v=g.toLowerCase();if(e.host_blacklist.includes(v))return!1;var y=m.join("@");if(e.domain_specific_validation&&("gmail.com"===v||"googlemail.com"===v)){var b=(y=y.toLowerCase()).split("+")[0];if(!(0,a.default)(b.replace(/\./g,""),{min:6,max:30}))return!1;for(var M=b.split("."),A=0;A{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(0x)[0-9a-f]{40}$/i;t.exports=e.default,t.exports.default=e.default},221:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(t),(e=(0,i.default)(e,o)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),!0===e.allow_wildcard&&0===t.indexOf("*.")&&(t=t.substring(2));var r=t.split("."),a=r[r.length-1];if(e.require_tld){if(r.length<2)return!1;if(!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}return!(!e.allow_numeric_tld&&/^\d+$/.test(a))&&r.every((function(t){return!(t.length>63||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!e.allow_underscores&&/_/.test(t))}))};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1};t.exports=e.default,t.exports.default=e.default},9146:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t),e=e||{};var r=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(e.locale?a.decimal[e.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(""===t||"."===t||"-"===t||"+"===t)return!1;var n=parseFloat(t.replace(",","."));return r.test(t)&&(!e.hasOwnProperty("min")||n>=e.min)&&(!e.hasOwnProperty("max")||n<=e.max)&&(!e.hasOwnProperty("lt")||ne.gt)},e.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79),o=Object.keys(a.decimal);e.locales=o},7146:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)},e.fullWidth=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;e.fullWidth=a},6648:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,i.default)(t);var e=t.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/gi,"$1");return-1!==e.indexOf(",")?a.test(e):o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,o=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;t.exports=e.default,t.exports.default=e.default},2941:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)},e.halfWidth=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;e.halfWidth=a},8874:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),new RegExp("^[a-fA-F0-9]{".concat(a[e],"}$")).test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};t.exports=e.default,t.exports.default=e.default},6298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;t.exports=e.default,t.exports.default=e.default},7117:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(0x|0h)?[0-9A-F]+$/i;t.exports=e.default,t.exports.default=e.default},8177:(t,e,r)=>{"use strict";e.ZP=function(t){return(0,i.default)(t),function(t){var e=t.replace(/[\s\-]+/gi,"").toUpperCase(),r=e.slice(0,2).toUpperCase();return r in a&&a[r].test(e)}(t)&&function(t){var e=t.replace(/[^A-Z0-9]+/gi,"").toUpperCase();return 1===(e.slice(4)+e.slice(0,4)).replace(/[A-Z]/g,(function(t){return t.charCodeAt(0)-55})).match(/\d{1,7}/g).reduce((function(t,e){return Number(t+e)%97}),"")}(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};Object.keys(a)},1028:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,i.default)(e),!(r=String(r)))return t(e,4)||t(e,6);if("4"===r){if(!s.test(e))return!1;var n=e.split(".").sort((function(t,e){return t-e}));return n[3]<=255}return"6"===r&&!!u.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",o="(".concat(a,"[.]){3}").concat(a),s=new RegExp("^".concat(o,"$")),d="(?:[0-9a-fA-F]{1,4})",u=new RegExp("^("+"(?:".concat(d,":){7}(?:").concat(d,"|:)|")+"(?:".concat(d,":){6}(?:").concat(o,"|:").concat(d,"|:)|")+"(?:".concat(d,":){5}(?::").concat(o,"|(:").concat(d,"){1,2}|:)|")+"(?:".concat(d,":){4}(?:(:").concat(d,"){0,1}:").concat(o,"|(:").concat(d,"){1,3}|:)|")+"(?:".concat(d,":){3}(?:(:").concat(d,"){0,2}:").concat(o,"|(:").concat(d,"){1,4}|:)|")+"(?:".concat(d,":){2}(?:(:").concat(d,"){0,3}:").concat(o,"|(:").concat(d,"){1,5}|:)|")+"(?:".concat(d,":){1}(?:(:").concat(d,"){0,4}:").concat(o,"|(:").concat(d,"){1,6}|:)|")+"(?::((?::".concat(d,"){0,5}:").concat(o,"|(?::").concat(d,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");t.exports=e.default,t.exports.default=e.default},7612:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,i.default)(e),!(r=String(r)))return t(e,10)||t(e,13);var n,d=e.replace(/[\s-]+/g,""),u=0;if("10"===r){if(!a.test(d))return!1;for(n=0;n<9;n++)u+=(n+1)*d.charAt(n);if("X"===d.charAt(9)?u+=100:u+=10*d.charAt(9),u%11==0)return!!d}else if("13"===r){if(!o.test(d))return!1;for(n=0;n<12;n++)u+=s[n%2]*d.charAt(n);if(d.charAt(12)-(10-u%10)%10==0)return!!d}return!1};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:[0-9]{9}X|[0-9]{10})$/,o=/^(?:[0-9]{13})$/,s=[1,3];t.exports=e.default,t.exports.default=e.default},7148:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,i.default)(t),!a.test(t))return!1;for(var e=!0,r=0,n=t.length-2;n>=0;n--)if(t[n]>="A"&&t[n]<="Z")for(var o=t[n].charCodeAt(0)-55,s=0,d=[o%10,Math.trunc(o/10)];s=5?1+2*(u-5):2*u:u,e=!e}else{var l=t[n].charCodeAt(0)-"0".charCodeAt(0);r+=e?l>=5?1+2*(l-5):2*l:l,e=!e}var c=10*Math.trunc((r+9)/10)-r;return+t[t.length-1]===c};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;t.exports=e.default,t.exports.default=e.default},1727:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.has(t.toUpperCase())},e.CountryCodes=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]),o=a;e.CountryCodes=o},6776:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.has(t.toUpperCase())};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);t.exports=e.default,t.exports.default=e.default},5061:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(t);var r=e.strictSeparator?o.test(t):a.test(t);return r&&e.strict?s(t):r};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,o=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,s=function(t){var e=t.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(e){var r=Number(e[1]),n=Number(e[2]);return r%4==0&&r%100!=0||r%400==0?n<=366:n<=365}var i=t.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),a=i[1],o=i[2],s=i[3],d=o?"0".concat(o).slice(-2):o,u=s?"0".concat(s).slice(-2):s,l=new Date("".concat(a,"-").concat(d||"01","-").concat(u||"01"));return!o||!s||l.getUTCFullYear()===a&&l.getUTCMonth()+1===o&&l.getUTCDate()===s};t.exports=e.default,t.exports.default=e.default},4339:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;t.exports=e.default,t.exports.default=e.default},9887:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(t);var r=a;if(r=e.require_hyphen?r.replace("?",""):r,!(r=e.case_sensitive?new RegExp(r):new RegExp(r,"i")).test(t))return!1;for(var n=t.replace("-","").toUpperCase(),o=0,s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),e in o)return o[e](t);if("any"===e){for(var r in o)if(o.hasOwnProperty(r)&&(0,o[r])(t))return!0;return!1}throw new Error("Invalid locale '".concat(e,"'"))};var n=a(r(5571)),i=a(r(937));function a(t){return t&&t.__esModule?t:{default:t}}var o={PL:function(t){(0,n.default)(t);var e={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(null!=t&&11===t.length&&(0,i.default)(t,{allow_leading_zeroes:!0})){var r=t.split("").slice(0,-1).reduce((function(t,r,n){return t+Number(r)*e[n+1]}),0)%10,a=Number(t.charAt(t.length-1));if(0===r&&0===a||a===10-r)return!0}return!1},ES:function(t){(0,n.default)(t);var e={X:0,Y:1,Z:2},r=t.trim().toUpperCase();if(!/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/.test(r))return!1;var i=r.slice(0,-1).replace(/[X,Y,Z]/g,(function(t){return e[t]}));return r.endsWith(["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"][i%23])},FI:function(t){return(0,n.default)(t),11===t.length&&(!!t.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)&&"0123456789ABCDEFHJKLMNPRSTUVWXY"[(1e3*parseInt(t.slice(0,6),10)+parseInt(t.slice(7,10),10))%31]===t.slice(10,11))},IN:function(t){var e=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],r=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],n=t.trim();if(!/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/.test(n))return!1;var i=0;return n.replace(/\s/g,"").split("").map(Number).reverse().forEach((function(t,n){i=e[i][r[n%8][t]]})),0===i},IR:function(t){if(!t.match(/^\d{10}$/))return!1;if(t="0000".concat(t).substr(t.length-6),0===parseInt(t.substr(3,6),10))return!1;for(var e=parseInt(t.substr(9,1),10),r=0,n=0;n<9;n++)r+=parseInt(t.substr(n,1),10)*(10-n);return(r%=11)<2&&e===r||r>=2&&e===11-r},IT:function(t){return 9===t.length&&"CA00000AA"!==t&&t.search(/C[A-Z][0-9]{5}[A-Z]{2}/i)>-1},NO:function(t){var e=t.trim();if(isNaN(Number(e)))return!1;if(11!==e.length)return!1;if("00000000000"===e)return!1;var r=e.split("").map(Number),n=(11-(3*r[0]+7*r[1]+6*r[2]+1*r[3]+8*r[4]+9*r[5]+4*r[6]+5*r[7]+2*r[8])%11)%11,i=(11-(5*r[0]+4*r[1]+3*r[2]+2*r[3]+7*r[4]+6*r[5]+5*r[6]+4*r[7]+3*r[8]+2*n)%11)%11;return n===r[9]&&i===r[10]},TH:function(t){if(!t.match(/^[1-8]\d{12}$/))return!1;for(var e=0,r=0;r<12;r++)e+=parseInt(t[r],10)*(13-r);return t[12]===((11-e%11)%10).toString()},LK:function(t){return!(10!==t.length||!/^[1-9]\d{8}[vx]$/i.test(t))||!(12!==t.length||!/^[1-9]\d{11}$/i.test(t))},"he-IL":function(t){var e=t.trim();if(!/^\d{9}$/.test(e))return!1;for(var r,n=e,i=0,a=0;a9?r-9:r;return i%10==0},"ar-LY":function(t){var e=t.trim();return!!/^(1|2)\d{11}$/.test(e)},"ar-TN":function(t){var e=t.trim();return!!/^\d{8}$/.test(e)},"zh-CN":function(t){var e,r=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],n=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],i=["1","0","X","9","8","7","6","5","4","3","2"],a=function(t){return r.includes(t)},o=function(t){var e=parseInt(t.substring(0,4),10),r=parseInt(t.substring(4,6),10),n=parseInt(t.substring(6),10),i=new Date(e,r-1,n);return!(i>new Date)&&i.getFullYear()===e&&i.getMonth()===r-1&&i.getDate()===n};return!!/^\d{15}|(\d{17}(\d|x|X))$/.test(e=t)&&(15===e.length?function(t){var e=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(t);if(!e)return!1;var r=t.substring(0,2);if(!(e=a(r)))return!1;var n="19".concat(t.substring(6,12));return!!(e=o(n))}(e):function(t){var e=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(t);if(!e)return!1;var r=t.substring(0,2);if(!(e=a(r)))return!1;var s=t.substring(6,14);return!!(e=o(s))&&function(t){return function(t){for(var e=t.substring(0,17),r=0,a=0;a<17;a++)r+=parseInt(e.charAt(a),10)*parseInt(n[a],10);return i[r%11]}(t)===t.charAt(17).toUpperCase()}(t)}(e))},"zh-TW":function(t){var e={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},r=t.trim().toUpperCase();return!!/^[A-Z][0-9]{9}$/.test(r)&&Array.from(r).reduce((function(t,r,n){if(0===n){var i=e[r];return i%10*9+Math.floor(i/10)}return 9===n?(10-t%10-Number(r))%10==0:t+Number(r)*(9-n)}),0)}};t.exports=e.default,t.exports.default=e.default},937:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t);var r=(e=e||{}).hasOwnProperty("allow_leading_zeroes")&&!e.allow_leading_zeroes?a:o,n=!e.hasOwnProperty("min")||t>=e.min,s=!e.hasOwnProperty("max")||t<=e.max,d=!e.hasOwnProperty("lt")||te.gt;return r.test(t)&&n&&s&&d&&u};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,o=/^[-+]?[0-9]+$/;t.exports=e.default,t.exports.default=e.default},1008:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(t);try{e=(0,i.default)(e,s);var r=[];e.allow_primitives&&(r=[null,!1,!0]);var a=JSON.parse(t);return r.includes(a)||!!a&&"object"===o(a)}catch(t){}return!1};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var s={allow_primitives:!1};t.exports=e.default,t.exports.default=e.default},4979:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(0,n.default)(t);var e=t.split("."),r=e.length;return!(r>3||r<2)&&e.reduce((function(t,e){return t&&(0,i.default)(e,{urlSafe:!0})}),!0)};var n=a(r(5571)),i=a(r(2689));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default,t.exports.default=e.default},478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),e=(0,i.default)(e,l),!t.includes(","))return!1;var r=t.split(",");return!(r[0].startsWith("(")&&!r[1].endsWith(")")||r[1].endsWith(")")&&!r[0].startsWith("("))&&(e.checkDMS?d.test(r[0])&&u.test(r[1]):o.test(r[0])&&s.test(r[1]))};var n=a(r(5571)),i=a(r(4808));function a(t){return t&&t.__esModule?t:{default:t}}var o=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,s=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,d=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,u=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,l={checkDMS:!1};t.exports=e.default,t.exports.default=e.default},661:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r,n;(0,i.default)(t),"object"===a(e)?(r=e.min||0,n=e.max):(r=arguments[1]||0,n=arguments[2]);var o=t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],s=t.length-o.length;return s>=r&&(void 0===n||s<=n)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}t.exports=e.default,t.exports.default=e.default},7380:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),"en_US_POSIX"===t||"ca_ES_VALENCIA"===t||a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^[A-Za-z]{2,4}([_-]([A-Za-z]{4}|[\d]{3}))?([_-]([A-Za-z]{2}|[\d]{3}))?$/;t.exports=e.default,t.exports.default=e.default},3928:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),t===t.toLowerCase()};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},8999:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),e&&(e.no_colons||e.no_separators)?o.test(t):a.test(t)||s.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,o=/^([0-9a-fA-F]){12}$/,s=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/;t.exports=e.default,t.exports.default=e.default},2776:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t.trim())};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^magnet:\?xt(?:\.1)?=urn:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?($|&)/i;t.exports=e.default,t.exports.default=e.default},4554:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)||o.test(t)||s.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i,o=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,s=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;t.exports=e.default,t.exports.default=e.default},8355:(t,e,r)=>{"use strict";e.ZP=function(t,e,r){if((0,i.default)(t),r&&r.strictMode&&!t.startsWith("+"))return!1;if(Array.isArray(e))return e.some((function(e){return!(!a.hasOwnProperty(e)||!a[e].test(t))}));if(e in a)return a[e].test(t);if(!e||"any"===e){for(var n in a)if(a.hasOwnProperty(n)&&a[n].test(t))return!0;return!1}throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={"am-AM":/^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)[569]\d{7}$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)[1|3])([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|91|9[3-9])\d{7}$/,"el-GR":/^(\+?30|0)?(69\d{8})$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}))/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(5|79)\d{7}$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"ms-MY":/^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[2-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-RO":/^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/};a["en-CA"]=a["en-US"],a["fr-CA"]=a["en-CA"],a["fr-BE"]=a["nl-BE"],a["zh-HK"]=a["en-HK"],a["zh-MO"]=a["en-MO"],a["ga-IE"]=a["en-IE"],a["fr-CH"]=a["de-CH"],a["it-CH"]=a["fr-CH"],Object.keys(a)},9131:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,n.default)(t),(0,i.default)(t)&&24===t.length};var n=a(r(5571)),i=a(r(7117));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default,t.exports.default=e.default},3590:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[^\x00-\x7F]/;t.exports=e.default,t.exports.default=e.default},4986:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,i.default)(t),e&&e.no_symbols?o.test(t):new RegExp("^[+-]?([0-9]*[".concat((e||{}).locale?a.decimal[e.locale]:".","])?[0-9]+$")).test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(79),o=/^[0-9]+$/;t.exports=e.default,t.exports.default=e.default},6090:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^(0o)?[0-7]+$/i;t.exports=e.default,t.exports.default=e.default},1513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t);var r=t.replace(/\s/g,"").toUpperCase();return e.toUpperCase()in a&&a[e].test(r)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/};t.exports=e.default,t.exports.default=e.default},4595:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t,{min:0,max:65535})};var n,i=(n=r(937))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},8140:(t,e,r)=>{"use strict";e.ZP=function(t,e){if((0,i.default)(t),e in d)return d[e].test(t);if("any"===e){for(var r in d)if(d.hasOwnProperty(r)&&d[r].test(t))return!0;return!1}throw new Error("Invalid locale '".concat(e,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^\d{4}$/,o=/^\d{5}$/,s=/^\d{6}$/,d={AD:/^AD\d{3}$/,AT:a,AU:a,AZ:/^AZ\d{4}$/,BE:a,BG:a,BR:/^\d{5}-\d{3}$/,BY:/2[1-4]{1}\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:a,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:o,DK:a,DO:o,DZ:o,EE:o,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:o,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:a,ID:o,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/\b(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}\b/,IS:/^\d{3}$/,IT:o,JP:/^\d{3}\-\d{4}$/,KE:o,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:a,LV:/^LV\-\d{4}$/,LK:o,MX:o,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:o,NL:/^\d{4}\s?[a-z]{2}$/i,NO:a,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:a,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:s,RU:s,SA:o,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:s,SI:a,SK:/^\d{3}\s?\d{2}$/,TH:o,TN:a,TW:/^\d{3}(\d{2})?$/,UA:o,US:/^\d{5}(-\d{4})?$/,ZA:a,ZM:o};Object.keys(d)},4611:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),f.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/([01][0-9]|2[0-3])/,o=/[0-5][0-9]/,s=new RegExp("[-+]".concat(a.source,":").concat(o.source)),d=new RegExp("([zZ]|".concat(s.source,")")),u=new RegExp("".concat(a.source,":").concat(o.source,":").concat(/([0-5][0-9]|60)/.source).concat(/(\.[0-9]+)?/.source)),l=new RegExp("".concat(/[0-9]{4}/.source,"-").concat(/(0[1-9]|1[0-2])/.source,"-").concat(/([12]\d|0[1-9]|3[01])/.source)),c=new RegExp("".concat(u.source).concat(d.source)),f=new RegExp("^".concat(l.source,"[ tT]").concat(c.source,"$"));t.exports=e.default,t.exports.default=e.default},6454:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,i.default)(t),e?a.test(t)||o.test(t)||s.test(t)||d.test(t):a.test(t)||o.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,o=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,s=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)/,d=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)/;t.exports=e.default,t.exports.default=e.default},6826:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,n.default)(t),a.test(t)};var n=i(r(5571));function i(t){return t&&t.__esModule?t:{default:t}}var a=(0,i(r(4731)).default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");t.exports=e.default,t.exports.default=e.default},2828:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;t.exports=e.default,t.exports.default=e.default},2492:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if((0,n.default)(t),!t||/[\s<>]/.test(t))return!1;if(0===t.indexOf("mailto:"))return!1;if((e=(0,o.default)(e,u)).validate_length&&t.length>=2083)return!1;if(!e.allow_fragments&&t.includes("#"))return!1;if(!e.allow_query_components&&(t.includes("?")||t.includes("&")))return!1;var r,s,f,h,p,$,m,g,v;if(m=t.split("#"),t=m.shift(),m=t.split("?"),t=m.shift(),(m=t.split("://")).length>1){if(r=m.shift().toLowerCase(),e.require_valid_protocol&&-1===e.protocols.indexOf(r))return!1}else{if(e.require_protocol)return!1;if("//"===t.substr(0,2)){if(!e.allow_protocol_relative_urls)return!1;m[0]=t.substr(2)}}if(""===(t=m.join("://")))return!1;if(m=t.split("/"),""===(t=m.shift())&&!e.require_host)return!0;if((m=t.split("@")).length>1){if(e.disallow_auth)return!1;if(""===m[0])return!1;if((s=m.shift()).indexOf(":")>=0&&s.split(":").length>2)return!1;var y=function(t){if(Array.isArray(t))return t}(v=s.split(":"))||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),2!==r.length);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(v)||function(t,e){if(t){if("string"==typeof t)return d(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,2):void 0}}(v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],M=y[1];if(""===b&&""===M)return!1}$=null,g=null;var A=(h=m.join("@")).match(l);if(A?(f="",g=A[1],$=A[2]||null):(f=(m=h.split(":")).shift(),m.length&&($=m.join(":"))),null!==$&&$.length>0){if(p=parseInt($,10),!/^[0-9]+$/.test($)||p<=0||p>65535)return!1}else if(e.require_port)return!1;return e.host_whitelist?c(f,e.host_whitelist):!!((0,a.default)(f)||(0,i.default)(f,e)||g&&(0,a.default)(g,6))&&(f=f||g,!e.host_blacklist||!c(f,e.host_blacklist))};var n=s(r(5571)),i=s(r(221)),a=s(r(1028)),o=s(r(4808));function s(t){return t&&t.__esModule?t:{default:t}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(t);var r=a[[void 0,null].includes(e)?"all":e];return!!r&&r.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};t.exports=e.default,t.exports.default=e.default},7245:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),t===t.toUpperCase()};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},9019:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t),a.fullWidth.test(t)&&o.halfWidth.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},a=r(7146),o=r(2941);t.exports=e.default,t.exports.default=e.default},5090:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){return(0,i.default)(t),"[object RegExp]"!==Object.prototype.toString.call(e)&&(e=new RegExp(e,r)),e.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},7536:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)(t)?parseFloat(t):NaN};var n,i=(n=r(9146))&&n.__esModule?n:{default:n};t.exports=e.default,t.exports.default=e.default},5571:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(!("string"==typeof t||t instanceof String)){var e=r(t);throw null===t?e="null":"object"===e&&(e=t.constructor.name),new TypeError("Expected a string but received a ".concat(e))}},t.exports=e.default,t.exports.default=e.default},8343:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t,e){return t.some((function(t){return e===t}))},t.exports=e.default,t.exports.default=e.default},4808:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t},t.exports=e.default,t.exports.default=e.default},4731:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r=t.join("");return new RegExp(r,e)},t.exports=e.default,t.exports.default=e.default},1913:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return"object"===r(t)&&null!==t?t="function"==typeof t.toString?t.toString():"[object Object]":(null==t||isNaN(t)&&!t.length)&&(t=""),String(t)},t.exports=e.default,t.exports.default=e.default},4300:t=>{"use strict";t.exports=require("buffer")}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n=r(7852),i=exports;for(var a in n)i[a]=n[a];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/packages/node/test/projectFixture/v0.3.0/package.json b/packages/node/test/projectFixture/v0.3.0/package.json index 9f35fcf7..2076e80f 100644 --- a/packages/node/test/projectFixture/v0.3.0/package.json +++ b/packages/node/test/projectFixture/v0.3.0/package.json @@ -20,7 +20,7 @@ "license": "Apache-2.0", "devDependencies": { "@polkadot/api": "^5.7.1", - "@subql/types": "latest", + "@subql/types-ethereum": "latest", "typescript": "^4.1.3", "@subql/cli": "latest" } diff --git a/packages/node/test/projectFixture/v1.0.0/distMock/chaintypes.js b/packages/node/test/projectFixture/v1.0.0/distMock/chaintypes.js deleted file mode 100644 index bbc68b66..00000000 --- a/packages/node/test/projectFixture/v1.0.0/distMock/chaintypes.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -exports.default = { typesBundle: {} }; diff --git a/packages/node/test/projectFixture/v1.0.0/distMock/index.js b/packages/node/test/projectFixture/v1.0.0/distMock/index.js deleted file mode 100644 index 10e5e52a..00000000 --- a/packages/node/test/projectFixture/v1.0.0/distMock/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -const tslib_1 = require('tslib'); -//Exports all handler functions -require('@polkadot/api-augment'); -(0, tslib_1.__exportStar)(require('./mappings/mappingHandlers'), exports); diff --git a/packages/node/test/projectFixture/v1.0.0/erc20.abi.json b/packages/node/test/projectFixture/v1.0.0/erc20.abi.json deleted file mode 100644 index 405d6b36..00000000 --- a/packages/node/test/projectFixture/v1.0.0/erc20.abi.json +++ /dev/null @@ -1,222 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "balance", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - }, - { - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "payable": true, - "stateMutability": "payable", - "type": "fallback" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } -] diff --git a/packages/node/test/projectFixture/v1.0.0/js/test1/project.yaml b/packages/node/test/projectFixture/v1.0.0/js/test1/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test1/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/v1.0.0/js/test1/types.js b/packages/node/test/projectFixture/v1.0.0/js/test1/types.js deleted file mode 100644 index b3a1f136..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test1/types.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, -}; - -Object.defineProperty(exports, '__esModule', { - value: true, -}); - -exports.default = types; diff --git a/packages/node/test/projectFixture/v1.0.0/js/test2/project.yaml b/packages/node/test/projectFixture/v1.0.0/js/test2/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test2/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/v1.0.0/js/test2/types.js b/packages/node/test/projectFixture/v1.0.0/js/test2/types.js deleted file mode 100644 index 618bfb75..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test2/types.js +++ /dev/null @@ -1,52 +0,0 @@ -const os = require('os'); - -console.log(os.platform); - -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, -}; - -module.exports = types; diff --git a/packages/node/test/projectFixture/v1.0.0/js/test3/project.yaml b/packages/node/test/projectFixture/v1.0.0/js/test3/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test3/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/v1.0.0/js/test3/types.js b/packages/node/test/projectFixture/v1.0.0/js/test3/types.js deleted file mode 100644 index b35f73b2..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test3/types.js +++ /dev/null @@ -1,48 +0,0 @@ -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, -}; - -module.exports.test = types; diff --git a/packages/node/test/projectFixture/v1.0.0/js/test4/project.yaml b/packages/node/test/projectFixture/v1.0.0/js/test4/project.yaml deleted file mode 100644 index 6d575814..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test4/project.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# project.yaml -specVersion: '0.2.0' - -name: '' -version: '0.0.0' -description: '' -repository: 'https://github.com/subquery/subql-starter' - -schema: - file: ./schema.graphql - -network: - genesisHash: '0x' - endpoint: 'wss://polkadot.api.onfinality.io/public-ws' - chaintypes: - file: ./types.js - -dataSources: - - kind: substrate/Runtime - startBlock: 1 - mapping: - file: dist/index.js - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/node/test/projectFixture/v1.0.0/js/test4/types.js b/packages/node/test/projectFixture/v1.0.0/js/test4/types.js deleted file mode 100644 index 7191fb97..00000000 --- a/packages/node/test/projectFixture/v1.0.0/js/test4/types.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const types = { - types: { - TestType: 'u32', - }, - typesAlias: { - Alias: { - TestType2: 'test', - }, - }, - typesBundle: { - spec: { - 2312: { - types: [ - { - minmax: [232, 122], - types: { - TestType3: 'test3', - }, - }, - ], - }, - }, - chain: { - mockchain: { - types: [ - { - minmax: [232, 122], - types: { - TestType4: 'test4', - }, - }, - ], - }, - }, - }, - typesChain: { - chain2: { - TestType5: 'test', - }, - }, - typesSpec: { - spec3: { - TestType6: 'test', - }, - }, - shouldIgnorefield: { - chain2: { - TestType5: 'test', - }, - }, -}; - -Object.defineProperty(exports, '__esModule', { - value: true, -}); - -exports.default = types; diff --git a/packages/node/test/projectFixture/v1.0.0/project.yaml b/packages/node/test/projectFixture/v1.0.0/project.yaml deleted file mode 100644 index cc51b347..00000000 --- a/packages/node/test/projectFixture/v1.0.0/project.yaml +++ /dev/null @@ -1,57 +0,0 @@ -specVersion: 1.0.0 -name: moonriver -version: 1.0.0 -description: '' -repository: '' -runner: - node: - name: '@subql/node' - version: '>=1.0.0' - query: - name: '@subql/query' - version: '*' -schema: - file: ./schema.graphql -network: - chainId: '0x401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b' - endpoint: wss://moonriver.api.onfinality.io/public-ws - dictionary: 'https://api.subquery.network/sq/subquery/moonriver-dictionary' - chaintypes: - file: './distMock/chaintypes.js' -dataSources: - - kind: substrate/Runtime - startBlock: 69219 - mapping: - file: './distMock/index.js' - handlers: - - handler: collatorJoined - kind: substrate/EventHandler - filter: - module: parachainStaking - method: JoinedCollatorCandidates - - handler: collatorLeft - kind: substrate/CallHandler - filter: - module: parachainStaking - method: leaveCandidates - - - kind: substrate/Moonbeam - startBlock: 562683 - processor: - file: './dist/moonbeam.js' - # file: './node_modules/@subql/contract-processors/dist/moonbeam.js' - options: - # Must be a key of assets - abi: erc20 - address: '0x6bd193ee6d2104f14f94e2ca6efefae561a4334b' - assets: - erc20: - file: './erc20.abi.json' - mapping: - file: ./distMock/index.js - handlers: - - handler: erc20Transfer - kind: substrate/MoonbeamEvent - filter: - topics: - - Transfer(address indexed from,address indexed to,uint256 value) diff --git a/packages/node/test/projectFixture/v1.0.0/schema.graphql b/packages/node/test/projectFixture/v1.0.0/schema.graphql deleted file mode 100644 index 4ef53ed6..00000000 --- a/packages/node/test/projectFixture/v1.0.0/schema.graphql +++ /dev/null @@ -1,11 +0,0 @@ -type StarterEntity @entity { - id: ID! #id is a required field - field1: Int! - - field2: String #filed2 is an optional field - field3: BigInt - - field4: Date - - field5: Boolean -} diff --git a/packages/node/test/projectFixture/v1.0.0/types.yaml b/packages/node/test/projectFixture/v1.0.0/types.yaml deleted file mode 100644 index 4346d242..00000000 --- a/packages/node/test/projectFixture/v1.0.0/types.yaml +++ /dev/null @@ -1,28 +0,0 @@ -types: - TestType: u32 -typesAlias: - Alias: - TestType2: test -typesBundle: - spec: - '2312': - types: - - minmax: - - 232 - - 122 - types: - TestType3: test3 - chain: - mockchain: - types: - - minmax: - - 232 - - 122 - types: - TestType4: test4 -typesChain: - chain2: - TestType5: test -typesSpec: - spec3: - TestType6: test diff --git a/packages/node/tsconfig.json b/packages/node/tsconfig.json index 3bf15a3a..e8b6490f 100644 --- a/packages/node/tsconfig.json +++ b/packages/node/tsconfig.json @@ -7,13 +7,6 @@ "rootDir": "src", "outDir": "./dist" }, - "references": [ - { "path": "../common" }, - { "path": "../common-substrate" }, - { "path": "../node-core" }, - { "path": "../types" }, - { "path": "../utils" } - ], - "include": ["src/**/*"], - "exclude": ["node_modules", "test", "dist"] + "references": [{ "path": "../common-ethereum" }, { "path": "../types" }], + "include": ["src/**/*"] } diff --git a/packages/query/.env.example b/packages/query/.env.example deleted file mode 100644 index 3749ee48..00000000 --- a/packages/query/.env.example +++ /dev/null @@ -1,6 +0,0 @@ -DB_USER=postgres -DB_PASS=postgres -DB_DATABASE=postgres -DB_HOST=localhost -DB_PORT=5432 -PORT=3001 diff --git a/packages/query/.gitignore b/packages/query/.gitignore deleted file mode 100644 index e01fe335..00000000 --- a/packages/query/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -# compiled output -/dist -/node_modules - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# OS -.DS_Store - -# Tests -/coverage -/.nyc_output - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -.env diff --git a/packages/query/CHANGELOG.md b/packages/query/CHANGELOG.md deleted file mode 100644 index 8cd3c92a..00000000 --- a/packages/query/CHANGELOG.md +++ /dev/null @@ -1,176 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -All logs must start with the format: [x.y.z] - yyyy-mm-dd - -## [Unreleased] - -## [1.5.0] - 2022-08-11 -### Fixed -- Fix db selection in configuration when subscription is enabled (#1241) -- Fork OrderByAggregatesPlugin and modify to be compatible with historical feature (#1242) -- Fix block height being applied to all queries (#1238) -### Changed -- Move aggregation feature out from `unsafe` and apply it by default, can be control though `aggregate` flag. - -## [1.4.0] - 2022-07-27 -### Added -- Add `query-explain` flag, by enable this console will log actual SQL statement been queried. (#1192) - -## [1.3.0] - 2022-07-05 -### Changed -- Try to catch error if create server failed, also give retry build schema (#1153) -### Fixed -- Fix tests (#1160) - -## [1.2.1] - 2022-06-27 -### Fixed -- Fixed subql-query doesn't show all help docs issue (#1137) - -## [1.2.0] - 2022-06-22 -### Added -- added `max-connection` and `query-timeout` configuration for pg pool (#1108) - -## [1.1.1] - 2022-06-02 -### Changed -- Now query-complexity is indicated in header (#1088) - -## [1.1.0] - 2022-05-31 -### Added -- Experimental feature: Support query by block number, require enable by indexing node (#992) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.16.1] - 2022-05-06 -### Changed -- Bump with `@subql/utils` - -## [0.16.0] - 2022-05-02 -### Added -- Add utils package (#928) -- Allow set query-complexity for query (#923) - -## [0.15.0] - 2022-04-26 -### Added -- Add support for querying historical state (#859) - -## [0.14.1] - 2022-04-04 -### Changed -- Bump with `subql/common` - -## [0.14.0] - 2022-04-04 -### Changed -- move subscription to dedicate flag (#867) - -## [0.13.0] - 2022-03-22 -### Added -- Add GraphQL subscription support (#846) - -## [0.12.0] - 2022-02-09 -### Added -- Add `dynamicDatasources` in metadata (#773) - -## [0.11.0] - 2022-01-21 -### Added -- Enable full aggregates support when `--unsafe`, and group-by only when `--unsafe=false` (#765) - -## [0.10.0] - 2022-01-13 -### Added -- Add rowCountEstimate to Metadata (#736) -- Support allocate port automatically (#739) - - -## [0.9.0] - 2021-12-16 -### Changed -- Limit query record size to 100, though by using `--unsafe` can remove this limit. (#644) -- Update `getProjectSchema` to handle when subqueries table has been deprecated (#683) -- Update `Dockerfile` to use `node:16-alpine` (#640) -### Added -- Add query log to file (#667) -### Fixed -- Fix fetch metadata (#700) - -## [0.8.0] - 2021-11-19 -### Added -- Support enum in postgraphile plugin (#551) -### Changed -- Update `GetMetadataPlugin` to support fetch from both api and table (#555) - -## [0.7.4] - 2021-11-03 -### Changed -- Bump dependencies (#584) - -## [0.7.3] - 2021-09-25 -Upgrade priority: High. Any project rely on query `_metadata` should upgrade. -### Fixed -- Change `_metadata` back, and use `smartTagPlugin` to omit node `metadata` class. By doing this, previous project that rely on query `_metadata` won't be affected, such as Dictionaries. - -## [0.7.2] - 2021-09-22 -Upgrade priority: High. This fix the entities name conflict issue, for users who used node 0.21.0 or higher should update to query 0.7.2. -### Changed -- Changed query indexer `_metadata` to `_meta`, current `_metadata` is created from indexer service included `blockOffset` data (#489) - -## [0.7.1] - 2021-08-27 -### Fixed -- Deprecated warnings (#448) - -## [0.7.0] - 2021-06-25 -### Changed -- Update dependencies (#358) - -## [0.6.0] - 2021-06-22 -### Added -- Allow query service to query indexer metadata though add `--indexer ` (#327) -- Add `_Metadata` in the query schema (#327) -### Changed -- change `lastProcessedHeight` and `targetHeight` type to `Int`. (#347) - - -## [0.5.0] - 2021-04-20 -### Added -- Remove `condition` in query schema, please use `filter` instead (#260) -- `@jsonField` annotation is now supported in `graphql.schema` which allows you to store structured data JSON data in a single database field - - We'll automatically generate coresponding JSON interfaces when querying this data (#275) - - Read more about how you can use this in our [updated docs](https://doc.subquery.network/create/graphql.html#json-type) - -## [0.4.0] - 2021-03-25 -### Added -- support filter for condition search (#240) - -## [0.3.2] - 2021-03-11 -### Fixed -- add dependency of @subql/common for @subql/query (#233) - -## [0.3.1] - 2021-03-11 -### Fixed -- fix wrong cross package imports (#231) - -## [0.3.0] - 2021-03-11 -### Added -- refactor logger: support --output-fmt and --log-level (#220) -- use read db host (DB_HOST_READ from env) as priority (#221) - -## [0.2.0] - 2021-02-05 -### Added -- init query service project -- customise first/last plugin to give max record to query (#114) -- disable debug mode in production (#115) -- overwrite plugin to fix one to one unique key check -- update query publish and docker build process - -[Unreleased]: https://github.com/subquery/subql/compare/query/0.12.0...HEAD -[0.12.0]: https://github.com/subquery/subql/compare/query/0.11.0...query/0.12.0 -[0.11.0]: https://github.com/subquery/subql/compare/query/0.10.0...query/0.11.0 -[0.10.0]: https://github.com/subquery/subql/compare/query/0.9.0...query/0.10.0 -[0.9.0]: https://github.com/subquery/subql/compare/query/0.8.0...query/0.9.0 -[0.8.0]: https://github.com/subquery/subql/compare/query/0.7.4...query/0.8.0 -[0.7.4]: https://github.com/subquery/subql/compare/query/0.7.3...query/0.7.4 -[0.5.0]: https://github.com/subquery/subql/compare/v0.4.0...v0.5.0 -[0.4.0]: https://github.com/subquery/subql/compare/v0.3.2...v0.4.0 -[0.3.2]: https://github.com/subquery/subql/compare/v0.3.1...v0.3.2 -[0.3.1]: https://github.com/subquery/subql/compare/v0.3.0...v0.3.1 -[0.3.0]: https://github.com/subquery/subql/compare/v0.2.0...v0.3.0 diff --git a/packages/query/Dockerfile b/packages/query/Dockerfile deleted file mode 100644 index f299923c..00000000 --- a/packages/query/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -# production images -FROM node:16 as builder -ARG RELEASE_VERSION -RUN npm i -g --unsafe-perm @subql/query@${RELEASE_VERSION} - -FROM node:16-alpine -ENV TZ utc - -RUN apk add --no-cache tini -COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules - -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/lib/node_modules/@subql/query/bin/run"] -CMD ["-f","/app"] diff --git a/packages/query/LICENSE b/packages/query/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/packages/query/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/query/README.md b/packages/query/README.md deleted file mode 100644 index c0ac8c7a..00000000 --- a/packages/query/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# @subql/query - -## run an app - -for quickly setup all the required environment variables, add `.env` file in the query folder with content look like: -``` -DB_HOST=localhost -DB_PORT=5432 -DB_USER=postgres -DB_PASS=postgres -DB_DATABASE=postgres -``` - -then run the follow command -``` -$ NODE_OPTIONS="-r dotenv/config" yarn start -- --name --playground -``` diff --git a/packages/query/bin/run b/packages/query/bin/run deleted file mode 100755 index e8749374..00000000 --- a/packages/query/bin/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node - -require('../dist/main.js') - diff --git a/packages/query/bin/run.cmd b/packages/query/bin/run.cmd deleted file mode 100644 index 968fc307..00000000 --- a/packages/query/bin/run.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -node "%~dp0\run" %* diff --git a/packages/query/nest-cli.json b/packages/query/nest-cli.json deleted file mode 100644 index 56167b36..00000000 --- a/packages/query/nest-cli.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "collection": "@nestjs/schematics", - "sourceRoot": "src" -} diff --git a/packages/query/nodemon.json b/packages/query/nodemon.json deleted file mode 100644 index 0fcae7bd..00000000 --- a/packages/query/nodemon.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "watch": ["src"], - "ext": "ts", - "ignore": ["src/**/*.spec.ts"], - "exec": "node -r dotenv/config -r tsconfig-paths/register -r ts-node/register src/main.ts" -} diff --git a/packages/query/package.json b/packages/query/package.json deleted file mode 100644 index f2a077a3..00000000 --- a/packages/query/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@subql/query", - "version": "1.5.0", - "description": "", - "bin": { - "subql-query": "./bin/run" - }, - "homepage": "https://github.com/subquery/subql", - "repository": "github:subquery/subql", - "scripts": { - "prebuild": "rimraf dist", - "build": "rm -rf dist && tsc -b", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", - "start": "nest start", - "start:dev": "nodemon", - "start:prod": "node dist/main", - "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", - "test": "jest", - "test:watch": "jest --watch", - "test:cov": "jest --coverage", - "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./test/jest-e2e.json" - }, - "author": "ZheX", - "main": "dist/index.js", - "license": "Apache-2.0", - "files": [ - "/dist", - "/bin" - ], - "dependencies": { - "@graphile-contrib/pg-many-to-many": "^1.0.1", - "@graphile-contrib/pg-simplify-inflector": "^6.1.0", - "@graphile/pg-aggregates": "^0.1.0", - "@graphile/pg-pubsub": "^4.12.2", - "@nestjs/common": "^8.2.6", - "@nestjs/core": "^8.2.6", - "@nestjs/platform-express": "^8.2.6", - "@subql/common": "workspace:*", - "@subql/utils": "workspace:*", - "apollo-server-express": "^3.6.2", - "express-pino-logger": "^6.0.0", - "graphile-build": "^4.12.2", - "graphile-build-pg": "^4.12.2", - "graphile-utils": "^4.12.2", - "graphql": "^15.8.0", - "graphql-query-complexity": "^0.11.0", - "lodash": "^4.17.21", - "pg": "^8.7.1", - "postgraphile": "^4.12.9", - "postgraphile-core": "^4.12.2", - "postgraphile-plugin-connection-filter": "^2.2.2", - "reflect-metadata": "^0.1.13", - "rimraf": "^3.0.2", - "rxjs": "^7.5.2", - "subscriptions-transport-ws": "^0.11.0", - "yargs": "^16.2.0" - }, - "devDependencies": { - "@nestjs/cli": "^8.1.4", - "@nestjs/schematics": "^8.0.5", - "@nestjs/testing": "^8.2.6", - "@types/express": "^4.17.13", - "@types/express-pino-logger": "^4.0.3", - "@types/jest": "^27.4.0", - "@types/lodash": "^4.14.178", - "@types/rimraf": "^3.0.2", - "@types/yargs": "^16.0.4", - "nodemon": "^2.0.15", - "typescript": "^4.4.4" - } -} diff --git a/packages/query/src/app.module.ts b/packages/query/src/app.module.ts deleted file mode 100644 index 84b09924..00000000 --- a/packages/query/src/app.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Module} from '@nestjs/common'; -import {ConfigureModule} from './configure/configure.module'; -import {GraphqlModule} from './graphql/graphql.module'; - -@Module({ - imports: [ConfigureModule.register(), GraphqlModule], - controllers: [], -}) -export class AppModule {} diff --git a/packages/query/src/configure/config.ts b/packages/query/src/configure/config.ts deleted file mode 100644 index 9ea73c15..00000000 --- a/packages/query/src/configure/config.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {get} from 'lodash'; - -export class Config { - constructor(private readonly store: Record) {} - - get(key: string, defaultValue?: T): T { - return process.env[key.toUpperCase()] ?? get(this.store, key, defaultValue); - } -} diff --git a/packages/query/src/configure/configure.module.ts b/packages/query/src/configure/configure.module.ts deleted file mode 100644 index fe3351c4..00000000 --- a/packages/query/src/configure/configure.module.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {DynamicModule, Global, Module} from '@nestjs/common'; -import {Pool} from 'pg'; -import {getLogger} from '../utils/logger'; -import {getYargsOption} from '../yargs'; -import {Config} from './config'; -import {debugPgClient} from './x-postgraphile/debugClient'; - -@Global() -@Module({}) -export class ConfigureModule { - static register(): DynamicModule { - const {argv: opts} = getYargsOption(); - - const config = new Config({ - name: opts.name, - playground: opts.playground ?? false, - unsafe: opts.unsafe ?? false, - }); - - const pgPool = new Pool({ - user: config.get('DB_USER'), - password: config.get('DB_PASS'), - host: config.get('DB_HOST_READ') && !opts.subscription ? config.get('DB_HOST_READ') : config.get('DB_HOST'), - port: config.get('DB_PORT'), - database: config.get('DB_DATABASE'), - max: opts['max-connection'], - statement_timeout: opts['query-timeout'], - }); - pgPool.on('error', (err) => { - // tslint:disable-next-line no-console - getLogger('db').error('PostgreSQL client generated error: ', err.message); - }); - if (opts['query-explain']) { - pgPool.on('connect', (pgClient) => { - // Enhance our Postgres client with debugging stuffs. - debugPgClient(pgClient, getLogger('explain')); - pgClient._explainResults = []; - }); - } - return { - module: ConfigureModule, - providers: [ - { - provide: Config, - useValue: config, - }, - { - provide: Pool, - useValue: pgPool, - }, - ], - exports: [Config, Pool], - }; - } -} diff --git a/packages/query/src/configure/index.ts b/packages/query/src/configure/index.ts deleted file mode 100644 index 3ca4cebc..00000000 --- a/packages/query/src/configure/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './config'; diff --git a/packages/query/src/configure/x-postgraphile/debugClient.ts b/packages/query/src/configure/x-postgraphile/debugClient.ts deleted file mode 100644 index 7ff63b07..00000000 --- a/packages/query/src/configure/x-postgraphile/debugClient.ts +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// overwrite the method plugin: https://github.com/graphile/postgraphile/blob/263ba7477bc2133eebdf89d29acd0460e58501ec/src/postgraphile/withPostGraphileContext.ts#L473 -// Allow log SQL queries without resolve result -import {PoolClient} from 'pg'; -import Pino from 'pino'; - -const $$pgClientOrigQuery = Symbol(); - -declare module 'pg' { - interface ClientBase { - _explainResults: Array | null; - startExplain: () => void; - stopExplain: () => Promise>; - } -} - -interface RawExplainResult { - query: string; - values: any[]; - result: any; -} -type ExplainResult = Omit & { - plan: string; -}; - -export function debugPgClient(pgClient: PoolClient, logger: Pino.Logger): PoolClient { - // If Postgres debugging is enabled, enhance our query function by adding - // a debug statement. - if (!pgClient[$$pgClientOrigQuery]) { - // Set the original query method to a key on our client. If that key is - // already set, use that. - pgClient[$$pgClientOrigQuery] = pgClient.query; - - pgClient.startExplain = () => { - pgClient._explainResults = []; - }; - - pgClient.stopExplain = async () => { - const results = pgClient._explainResults; - pgClient._explainResults = null; - if (!results) { - return Promise.resolve([]); - } - return ( - await Promise.all( - results.map(async (r) => { - const {result: resultPromise, ...rest} = r; - const result = await resultPromise; - const firstKey = result && result[0] && Object.keys(result[0])[0]; - if (!firstKey) { - return null; - } - const plan = result.map((r: any) => r[firstKey]).join('\n'); - return { - ...rest, - plan, - }; - }) - ) - ).filter((entry: unknown): entry is ExplainResult => !!entry); - }; - - pgClient.query = function (...args: Array): any { - const [a, b, c] = args; - const variables: string[] = []; - // If we understand it (and it uses the promises API) - if ( - (typeof a === 'string' && (!c || typeof c === 'function') && (!b || Array.isArray(b))) || - (typeof a === 'object' && !b && !c) - ) { - if (pgClient._explainResults) { - const query = a && a.text ? a.text : a; - const values = a && a.text ? a.values : b; - if (query.match(/^\s*(select|insert|update|delete|with)\s/i) && !query.includes(';')) { - // Explain it - const explain = `explain ${query}`; - pgClient._explainResults.push({ - query, - values, - result: pgClient[$$pgClientOrigQuery] - .call(this, explain, values) - .then((data: any) => data.rows) - // swallow errors during explain - .catch(() => null), - }); - } - } - pgClient._explainResults.forEach(({query, values}: {query: string; values?: any[]}) => { - let res: string; - res = `\n Query: ${query} `; - if (values && values.length !== 0) { - res = res.concat(` \n Values: ${JSON.stringify(values)}`); - } - logger.info(res); - }); - - return pgClient[$$pgClientOrigQuery].apply(this, args); - } else { - // We don't understand it (e.g. `pgPool.query`), just let it happen. - logger.info(`Having trouble to understand query args`); - args.forEach((arg) => { - logger.info(`arg: ${arg}`); - }); - return pgClient[$$pgClientOrigQuery].apply(this, args); - } - }; - } - - return pgClient; -} diff --git a/packages/query/src/graphql/graphql.module.ts b/packages/query/src/graphql/graphql.module.ts deleted file mode 100644 index 5cbeb2ca..00000000 --- a/packages/query/src/graphql/graphql.module.ts +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import PgPubSub from '@graphile/pg-pubsub'; -import {Module, OnModuleDestroy, OnModuleInit} from '@nestjs/common'; -import {HttpAdapterHost} from '@nestjs/core'; -import {delay} from '@subql/common'; -import { - ApolloServerPluginCacheControl, - ApolloServerPluginLandingPageDisabled, - ApolloServerPluginLandingPageGraphQLPlayground, -} from 'apollo-server-core'; -import {ApolloServer} from 'apollo-server-express'; -import ExpressPinoLogger from 'express-pino-logger'; -import {execute, GraphQLSchema, subscribe} from 'graphql'; -import {Pool} from 'pg'; -import {makePluginHook} from 'postgraphile'; -import {getPostGraphileBuilder, PostGraphileCoreOptions} from 'postgraphile-core'; -import {SubscriptionServer} from 'subscriptions-transport-ws'; -import {Config} from '../configure'; -import {getLogger, PinoConfig} from '../utils/logger'; -import {getYargsOption} from '../yargs'; -import {plugins} from './plugins'; -import {PgSubscriptionPlugin} from './plugins/PgSubscriptionPlugin'; -import {queryComplexityPlugin} from './plugins/QueryComplexityPlugin'; -import {ProjectService} from './project.service'; - -const {argv} = getYargsOption(); -const logger = getLogger('graphql-module'); - -const SCHEMA_RETRY_INTERVAL = 10; //seconds -const SCHEMA_RETRY_NUMBER = 5; -@Module({ - providers: [ProjectService], -}) -export class GraphqlModule implements OnModuleInit, OnModuleDestroy { - private apolloServer: ApolloServer; - - constructor( - private readonly httpAdapterHost: HttpAdapterHost, - private readonly config: Config, - private readonly pgPool: Pool, - private readonly projectService: ProjectService - ) {} - - async onModuleInit(): Promise { - if (!this.httpAdapterHost) { - return; - } - try { - this.apolloServer = await this.createServer(); - } catch (e) { - throw new Error(`create apollo server failed, ${e.message}`); - } - } - - async onModuleDestroy(): Promise { - return this.apolloServer?.stop(); - } - - private async buildSchema( - dbSchema: string, - options: PostGraphileCoreOptions, - retries: number - ): Promise { - if (retries > 0) { - try { - const builder = await getPostGraphileBuilder(this.pgPool, [dbSchema], options); - const graphqlSchema = builder.buildSchema(); - return graphqlSchema; - } catch (e) { - await delay(SCHEMA_RETRY_INTERVAL); - if (retries === 1) { - logger.error(e); - } - return this.buildSchema(dbSchema, options, --retries); - } - } else { - throw new Error(`Failed to build schema ${dbSchema} ${SCHEMA_RETRY_NUMBER} times`); - } - } - - private async createServer() { - const app = this.httpAdapterHost.httpAdapter.getInstance(); - const httpServer = this.httpAdapterHost.httpAdapter.getHttpServer(); - - const dbSchema = await this.projectService.getProjectSchema(this.config.get('name')); - - let options: PostGraphileCoreOptions = { - replaceAllPlugins: plugins, - subscriptions: true, - dynamicJson: true, - }; - - if (argv.subscription) { - const pluginHook = makePluginHook([PgPubSub]); - // Must be called manually to init PgPubSub since we're using Apollo Server and not postgraphile - options = pluginHook('postgraphile:options', options, {pgPool: this.pgPool}); - options.replaceAllPlugins.push(PgSubscriptionPlugin); - while (options.appendPlugins.length) { - options.replaceAllPlugins.push(options.appendPlugins.pop()); - } - } - - const schema = await this.buildSchema(dbSchema, options, SCHEMA_RETRY_NUMBER); - - const apolloServerPlugins = [ - ApolloServerPluginCacheControl({ - defaultMaxAge: 5, - calculateHttpHeaders: true, - }), - this.config.get('playground') - ? ApolloServerPluginLandingPageGraphQLPlayground() - : ApolloServerPluginLandingPageDisabled(), - queryComplexityPlugin({schema, maxComplexity: argv['query-complexity']}), - ]; - - const server = new ApolloServer({ - schema, - context: { - pgClient: this.pgPool, - }, - plugins: apolloServerPlugins, - debug: this.config.get('NODE_ENV') !== 'production', - }); - - if (argv.subscription) { - // TODO: Replace subscriptions-transport-ws with graphql-ws when support is added to graphql-playground - SubscriptionServer.create({schema, execute, subscribe}, {server: httpServer, path: '/'}); - } - - app.use(ExpressPinoLogger(PinoConfig)); - - await server.start(); - server.applyMiddleware({ - app, - path: '/', - cors: true, - }); - return server; - } -} diff --git a/packages/query/src/graphql/graphql.test.ts b/packages/query/src/graphql/graphql.test.ts deleted file mode 100644 index f36e97b9..00000000 --- a/packages/query/src/graphql/graphql.test.ts +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ApolloServer, gql} from 'apollo-server-express'; -import {Pool} from 'pg'; -import {getPostGraphileBuilder} from 'postgraphile-core'; -import {Config} from '../configure'; -import {getYargsOption} from '../yargs'; -import {plugins} from './plugins'; - -jest.mock('../yargs', () => jest.createMockFromModule('../yargs')); - -(getYargsOption as jest.Mock).mockImplementation(() => { - return {argv: {name: 'test'}}; -}); - -describe('GraphqlModule', () => { - const dbSchema = 'subquery_1'; - - const config = new Config({}); - - const pool: Pool = new Pool({ - user: config.get('DB_USER'), - password: config.get('DB_PASS'), - host: config.get('DB_HOST_READ') ?? config.get('DB_HOST'), - port: config.get('DB_PORT'), - database: config.get('DB_DATABASE'), - }); - - pool.on('error', (err) => { - console.error('PostgreSQL client generated error: ', err.message); - }); - - async function insertMetadata(key: string, value: string) { - await pool.query(`INSERT INTO subquery_1._metadata( - key, value, "createdAt", "updatedAt") - VALUES ('${key}', '${value}', '2021-11-07 07:02:31.768+00', '2021-11-07 07:02:31.768+00');`); - } - - async function createApolloServer() { - const builder = await getPostGraphileBuilder(pool, [dbSchema], { - replaceAllPlugins: plugins, - subscriptions: true, - dynamicJson: true, - }); - - const schema = builder.buildSchema(); - - const server = new ApolloServer({ - schema, - context: { - pgClient: pool, - }, - }); - - return server; - } - - beforeEach(async () => { - await pool.query(`CREATE SCHEMA IF NOT EXISTS ${dbSchema}`); - await pool.query(`CREATE TABLE IF NOT EXISTS subquery_1._metadata ( - key character varying(255) COLLATE pg_catalog."default" NOT NULL, - value jsonb, - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL, - CONSTRAINT _metadata_pkey PRIMARY KEY (key) - )`); - }); - - afterEach(async () => { - await pool.query(`DROP TABLE subquery_1._metadata`); - }); - - afterAll(async () => { - await pool.end(); - }); - - it('can query all metadata fields from database', async () => { - await Promise.all([ - insertMetadata('lastProcessedHeight', '398'), - insertMetadata('lastProcessedTimestamp', '110101'), - insertMetadata('targetHeight', '7595931'), - insertMetadata('chain', `"Polkadot"`), - insertMetadata('specName', `"polkadot"`), - insertMetadata('genesisHash', `"0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"`), - insertMetadata('indexerHealthy', 'true'), - insertMetadata('indexerNodeVersion', `"0.21-0"`), - ]); - - const server = await createApolloServer(); - - const GET_META = gql` - query { - _metadata { - lastProcessedHeight - lastProcessedTimestamp - targetHeight - chain - specName - genesisHash - indexerHealthy - indexerNodeVersion - } - } - `; - - const mock = { - lastProcessedHeight: 398, - lastProcessedTimestamp: '110101', - targetHeight: 7595931, - chain: 'Polkadot', - specName: 'polkadot', - genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', - indexerHealthy: true, - indexerNodeVersion: '0.21-0', - }; - - const results = await server.executeOperation({query: GET_META}); - const fetchedMeta = results.data._metadata; - - expect(fetchedMeta).toMatchObject(mock); - }); - - it('wont resolve fields that arent allowed metadata', async () => { - await Promise.all([ - insertMetadata('lastProcessedHeight', '398'), - insertMetadata('chain', `"Polkadot"`), - insertMetadata('indexerHealthy', 'true'), - insertMetadata('fakeMetadata', 'true'), - ]); - - const server = await createApolloServer(); - - const GET_META = gql` - query { - _metadata { - lastProcessedHeight - chain - indexerHealthy - fakeMetadata - } - } - `; - - const results = await server.executeOperation({query: GET_META}); - expect(`${results.errors}`).toEqual(`Cannot query field "fakeMetadata" on type "_Metadata".`); - }); - - it('resolve incorrect fields in db to null when queried from graphql', async () => { - await Promise.all([ - insertMetadata('lastProcessedHeight', `"Polkadot"`), - insertMetadata('chain', 'true'), - insertMetadata('indexerHealthy', '20'), - ]); - - const server = await createApolloServer(); - - const GET_META = gql` - query { - _metadata { - lastProcessedHeight - chain - indexerHealthy - } - } - `; - - const mock = { - lastProcessedHeight: null, - chain: null, - indexerHealthy: null, - }; - - const results = await server.executeOperation({query: GET_META}); - const fetchedMeta = results.data._metadata; - - expect(fetchedMeta).toMatchObject(mock); - }); -}); diff --git a/packages/query/src/graphql/limit.test.ts b/packages/query/src/graphql/limit.test.ts deleted file mode 100644 index 11403d86..00000000 --- a/packages/query/src/graphql/limit.test.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {ApolloServer, gql} from 'apollo-server-express'; -import {Pool} from 'pg'; -import {getPostGraphileBuilder} from 'postgraphile-core'; -import {Config} from '../configure'; -import {getYargsOption} from '../yargs'; -import {plugins} from './plugins'; - -jest.mock('../yargs', () => jest.createMockFromModule('../yargs')); - -(getYargsOption as jest.Mock).mockImplementation(() => { - return {argv: {name: 'test'}}; -}); - -describe('query limits', () => { - const dbSchema = 'subquery_1'; - - const config = new Config({}); - - const pool = new Pool({ - user: config.get('DB_USER'), - password: config.get('DB_PASS'), - host: config.get('DB_HOST_READ') ?? config.get('DB_HOST'), - port: config.get('DB_PORT'), - database: config.get('DB_DATABASE'), - }); - - pool.on('error', (err) => { - console.error('PostgreSQL client generated error: ', err.message); - }); - - async function createApolloServer() { - const builder = await getPostGraphileBuilder(pool, [dbSchema], { - replaceAllPlugins: plugins, - subscriptions: true, - dynamicJson: true, - }); - - const schema = builder.buildSchema(); - - return new ApolloServer({ - schema, - context: { - pgClient: pool, - }, - }); - } - - afterAll(async () => { - await pool.end(); - }); - - describe('entity limits', () => { - async function insertPair(key: number, value: number) { - await pool.query(`INSERT INTO subquery_1.table( key, value) VALUES ('${key}', '${value}');`); - } - - beforeEach(async () => { - await pool.query(`CREATE SCHEMA IF NOT EXISTS ${dbSchema}`); - await pool.query(`CREATE TABLE IF NOT EXISTS subquery_1.table ( - key INT, - value INT )`); - - for (let i = 0; i < 200; i++) { - await insertPair(i, i); - } - }); - - afterEach(async () => { - await pool.query(`DROP TABLE subquery_1.table`); - }); - - it('unbounded query clamped to safe bound', async () => { - const LARGE_UNBOUND_QUERY = gql` - query { - tables { - nodes { - key - value - } - } - } - `; - - const server = await createApolloServer(); - const results = await server.executeOperation({query: LARGE_UNBOUND_QUERY}); - expect(results.data.tables.nodes.length).toEqual(100); - }); - - it('bounded unsafe query clamped to safe bound', async () => { - const LARGE_BOUNDED_QUERY = gql` - query { - tables(first: 200) { - nodes { - key - value - } - } - } - `; - - const server = await createApolloServer(); - const results = await server.executeOperation({query: LARGE_BOUNDED_QUERY}); - expect(results.data.tables.nodes.length).toEqual(100); - }); - - it('bounded safe query remains unchanged', async () => { - const LARGE_BOUNDED_QUERY = gql` - query { - tables(first: 50) { - nodes { - key - value - } - } - } - `; - - const server = await createApolloServer(); - const results = await server.executeOperation({query: LARGE_BOUNDED_QUERY}); - expect(results.data.tables.nodes.length).toEqual(50); - }); - }); -}); diff --git a/packages/query/src/graphql/plugins/GetMetadataPlugin.ts b/packages/query/src/graphql/plugins/GetMetadataPlugin.ts deleted file mode 100644 index 95b8dfe3..00000000 --- a/packages/query/src/graphql/plugins/GetMetadataPlugin.ts +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {URL} from 'url'; -import {MetaData} from '@subql/utils'; -import {makeExtendSchemaPlugin, gql} from 'graphile-utils'; -import fetch, {Response} from 'node-fetch'; -import {setAsyncInterval} from '../../utils/asyncInterval'; -import {argv} from '../../yargs'; - -const {version: packageVersion} = require('../../../package.json'); - -const METADATA_TYPES = { - lastProcessedHeight: 'number', - lastProcessedTimestamp: 'number', - targetHeight: 'number', - chain: 'string', - specName: 'string', - genesisHash: 'string', - indexerHealthy: 'boolean', - indexerNodeVersion: 'string', - queryNodeVersion: 'string', - dynamicDatasources: 'string', -}; - -type MetaType = number | string | boolean; - -type MetaEntry = {key: string; value: MetaType}; - -const metaCache = { - queryNodeVersion: packageVersion, -} as MetaData; - -async function fetchFromApi(): Promise { - let health: Response; - let meta: Response; - - const indexerUrl = argv('indexer') as string | undefined; - - try { - meta = await fetch(new URL(`meta`, indexerUrl)); - const result = await meta.json(); - Object.assign(metaCache, result); - } catch (e) { - metaCache.indexerHealthy = false; - console.warn(`Failed to fetch indexer meta, `, e.message); - } - - try { - health = await fetch(new URL(`health`, indexerUrl)); - metaCache.indexerHealthy = !!health.ok; - } catch (e) { - metaCache.indexerHealthy = false; - console.warn(`Failed to fetch indexer health, `, e.message); - } -} - -async function fetchFromTable(pgClient: any, schemaName: string): Promise { - const metadata = {} as MetaData; - const keys = Object.keys(METADATA_TYPES); - - const {rows} = await pgClient.query(`select key, value from "${schemaName}"._metadata WHERE key = ANY ($1)`, [keys]); - - const dbKeyValue = rows.reduce((array: MetaEntry[], curr: MetaEntry) => { - array[curr.key] = curr.value; - return array; - }, {}) as {[key: string]: MetaType}; - - for (const key in METADATA_TYPES) { - if (typeof dbKeyValue[key] === METADATA_TYPES[key]) { - metadata[key] = dbKeyValue[key]; - } - } - - metadata.queryNodeVersion = packageVersion; - - const tableEstimates = await pgClient - .query( - `select relname as table , reltuples::bigint as estimate from pg_class - where relnamespace in - (select oid from pg_namespace where nspname = $1) - and relname in - (select table_name from information_schema.tables - where table_schema = $1)`, - [schemaName] - ) - .catch((e) => { - throw new Error(`Unable to estimate table row count: ${e}`); - }); - - metadata.rowCountEstimate = tableEstimates.rows; - - return metadata; -} - -export const GetMetadataPlugin = makeExtendSchemaPlugin((build, options) => { - const [schemaName] = options.pgSchemas; - let metadataTableExists = false; - - const tableSearch = build.pgIntrospectionResultsByKind.attribute.find( - (attr: {class: {name: string}}) => attr.class.name === '_metadata' - ); - - if (tableSearch !== undefined) { - metadataTableExists = true; - } - - if (argv(`indexer`)) { - setAsyncInterval(fetchFromApi, 10000); - } - - return { - typeDefs: gql` - type TableEstimate { - table: String - estimate: Int - } - - type _Metadata { - lastProcessedHeight: Int - lastProcessedTimestamp: Date - targetHeight: Int - chain: String - specName: String - genesisHash: String - indexerHealthy: Boolean - indexerNodeVersion: String - queryNodeVersion: String - rowCountEstimate: [TableEstimate] - dynamicDatasources: String - } - extend type Query { - _metadata: _Metadata - } - `, - resolvers: { - Query: { - _metadata: async (_parentObject, _args, context, _info): Promise => { - if (metadataTableExists) { - const metadata = await fetchFromTable(context.pgClient, schemaName); - - if (Object.keys(metadata).length > 0) { - return metadata; - } - } - - if (argv(`indexer`)) { - return metaCache; - } - - return; - }, - }, - }, - }; -}); diff --git a/packages/query/src/graphql/plugins/PgAggregationPlugin.ts b/packages/query/src/graphql/plugins/PgAggregationPlugin.ts deleted file mode 100644 index 0558b5f6..00000000 --- a/packages/query/src/graphql/plugins/PgAggregationPlugin.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import AddAggregateTypesPlugin from '@graphile/pg-aggregates/dist/AddAggregateTypesPlugin'; -import AddConnectionAggregatesPlugin from '@graphile/pg-aggregates/dist/AddConnectionAggregatesPlugin'; -import AddConnectionGroupedAggregatesPlugin from '@graphile/pg-aggregates/dist/AddConnectionGroupedAggregatesPlugin'; -import AddGroupByAggregateEnumsPlugin from '@graphile/pg-aggregates/dist/AddGroupByAggregateEnumsPlugin'; -import AddGroupByAggregateEnumValuesForColumnsPlugin from '@graphile/pg-aggregates/dist/AddGroupByAggregateEnumValuesForColumnsPlugin'; -import AddHavingAggregateTypesPlugin from '@graphile/pg-aggregates/dist/AddHavingAggregateTypesPlugin'; -import AggregateSpecsPlugin from '@graphile/pg-aggregates/dist/AggregateSpecsPlugin'; -import FilterRelationalAggregatesPlugin from '@graphile/pg-aggregates/dist/FilterRelationalAggregatesPlugin'; -import InflectionPlugin from '@graphile/pg-aggregates/dist/InflectionPlugin'; -import {AggregateSpec, AggregateGroupBySpec} from '@graphile/pg-aggregates/dist/interfaces'; - -import type {Plugin} from 'graphile-build'; -import {makePluginByCombiningPlugins} from 'graphile-utils'; -import {argv} from '../../yargs'; -import OrderByAggregatesPlugin from './PgOrderByAggregatesPlugin'; - -const aggregate = argv('aggregate') as boolean; - -// overwrite the official plugin: https://github.com/graphile/pg-aggregates/blob/main/src/AggregateSpecsPlugin.ts -// Removes all aggregation functions when not using --aggregate flag. - -const AggregateSpecsPluginSafe: Plugin = (builder) => { - builder.hook('build', (build) => { - const pgAggregateSpecs: AggregateSpec[] = []; - const pgAggregateGroupBySpecs: AggregateGroupBySpec[] = []; - - return build.extend(build, { - pgAggregateSpecs, - pgAggregateGroupBySpecs, - }); - }); -}; - -const plugins = [ - InflectionPlugin, - AddGroupByAggregateEnumsPlugin, - AddGroupByAggregateEnumValuesForColumnsPlugin, - AddHavingAggregateTypesPlugin, - AddAggregateTypesPlugin, - AddConnectionAggregatesPlugin, - AddConnectionGroupedAggregatesPlugin, - OrderByAggregatesPlugin, - FilterRelationalAggregatesPlugin, -]; - -let PgAggregationPlugin: Plugin; - -if (aggregate) { - PgAggregationPlugin = makePluginByCombiningPlugins(...plugins, AggregateSpecsPlugin); -} else { - PgAggregationPlugin = makePluginByCombiningPlugins(...plugins, AggregateSpecsPluginSafe); -} - -export default PgAggregationPlugin; diff --git a/packages/query/src/graphql/plugins/PgBackwardRelationPlugin.ts b/packages/query/src/graphql/plugins/PgBackwardRelationPlugin.ts deleted file mode 100644 index 39fb285e..00000000 --- a/packages/query/src/graphql/plugins/PgBackwardRelationPlugin.ts +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// overwrite the official plugin: https://github.com/graphile/graphile-engine/blob/v4/packages/graphile-build-pg/src/plugins/PgBackwardRelationPlugin.js -// fix the one to one relationship unique key check - -import debugFactory from 'debug'; - -const debug = debugFactory('graphile-build-pg'); - -const OMIT = 0; -const DEPRECATED = 1; -const ONLY = 2; - -export default function (builder, {pgLegacyRelations, pgSimpleCollections, subscriptions}) { - const legacyRelationMode = - { - only: ONLY, - deprecated: DEPRECATED, - }[pgLegacyRelations] || OMIT; - builder.hook( - 'GraphQLObjectType:fields', - (fields, build, context) => { - const { - describePgEntity, - extend, - getSafeAliasFromAlias, - getSafeAliasFromResolveInfo, - getTypeByName, - graphql: {GraphQLList, GraphQLNonNull}, - inflection, - pgAddStartEndCursor: addStartEndCursor, - pgGetGqlTypeByTypeIdAndModifier, - pgIntrospectionResultsByKind: introspectionResultsByKind, - pgOmit: omit, - pgQueryFromResolveData: queryFromResolveData, - pgSql: sql, - sqlCommentByAddingTags, - } = build; - const { - Self, - fieldWithHooks, - scope: {isPgRowType, pgIntrospection: foreignTable}, - } = context; - if (!isPgRowType || !foreignTable || foreignTable.kind !== 'class') { - return fields; - } - // This is a relation in which WE are foreign - const foreignKeyConstraints = foreignTable.foreignConstraints.filter((con) => con.type === 'f'); - const foreignTableTypeName = inflection.tableType(foreignTable); - const gqlForeignTableType = pgGetGqlTypeByTypeIdAndModifier(foreignTable.type.id, null); - if (!gqlForeignTableType) { - debug(`Could not determine type for foreign table with id ${foreignTable.type.id}`); - return fields; - } - - return extend( - fields, - // eslint-disable-next-line complexity - foreignKeyConstraints.reduce((memo, constraint) => { - if (omit(constraint, 'read')) { - return memo; - } - const table = introspectionResultsByKind.classById[constraint.classId]; - if (!table) { - throw new Error(`Could not find the table that referenced us (constraint: ${constraint.name})`); - } - if (!table.isSelectable) { - // Could be a composite type - return memo; - } - const tableTypeName = inflection.tableType(table); - const gqlTableType = pgGetGqlTypeByTypeIdAndModifier(table.type.id, null); - if (!gqlTableType) { - debug(`Could not determine type for table with id ${constraint.classId}`); - return memo; - } - const schema = table.namespace; - - const keys = constraint.keyAttributes; - const foreignKeys = constraint.foreignKeyAttributes; - if (!keys.every((_) => _) || !foreignKeys.every((_) => _)) { - throw new Error('Could not find key columns!'); - } - if (keys.some((key) => omit(key, 'read'))) { - return memo; - } - if (foreignKeys.some((key) => omit(key, 'read'))) { - return memo; - } - const isUnique = !!table.constraints.find( - (c) => - (c.type === 'p' || c.type === 'f') && - c.keyAttributeNums.length === keys.length && - c.keyAttributeNums.every((n, i) => keys[i].num === n && keys[i].isUnique) - ); - - const isDeprecated = isUnique && legacyRelationMode === DEPRECATED; - - const singleRelationFieldName = isUnique - ? inflection.singleRelationByKeysBackwards(keys, table, foreignTable, constraint) - : null; - - const primaryKeyConstraint = table.primaryKeyConstraint; - const primaryKeys = primaryKeyConstraint && primaryKeyConstraint.keyAttributes; - - const shouldAddSingleRelation = isUnique && legacyRelationMode !== ONLY; - - const shouldAddManyRelation = !isUnique || legacyRelationMode === DEPRECATED || legacyRelationMode === ONLY; - - if (shouldAddSingleRelation && !omit(table, 'read') && singleRelationFieldName) { - memo = extend( - memo, - { - [singleRelationFieldName]: fieldWithHooks( - singleRelationFieldName, - ({addDataGenerator, getDataFromParsedResolveInfoFragment}) => { - const sqlFrom = sql.identifier(schema.name, table.name); - addDataGenerator((parsedResolveInfoFragment) => { - return { - pgQuery: (queryBuilder) => { - queryBuilder.select(() => { - const resolveData = getDataFromParsedResolveInfoFragment( - parsedResolveInfoFragment, - gqlTableType - ); - const tableAlias = sql.identifier(Symbol()); - const foreignTableAlias = queryBuilder.getTableAlias(); - const query = queryFromResolveData( - sqlFrom, - tableAlias, - resolveData, - { - useAsterisk: false, // Because it's only a single relation, no need - asJson: true, - addNullCase: true, - withPagination: false, - }, - (innerQueryBuilder) => { - innerQueryBuilder.parentQueryBuilder = queryBuilder; - if (subscriptions && table.primaryKeyConstraint) { - innerQueryBuilder.selectIdentifiers(table); - innerQueryBuilder.makeLiveCollection(table); - innerQueryBuilder.addLiveCondition( - (data) => (record) => { - return keys.every((key) => record[key.name] === data[key.name]); - }, - keys.reduce((memo, key, i) => { - memo[key.name] = sql.fragment`${foreignTableAlias}.${sql.identifier( - foreignKeys[i].name - )}`; - return memo; - }, {}) - ); - } - keys.forEach((key, i) => { - innerQueryBuilder.where( - sql.fragment`${tableAlias}.${sql.identifier( - key.name - )} = ${foreignTableAlias}.${sql.identifier(foreignKeys[i].name)}` - ); - }); - }, - queryBuilder.context, - queryBuilder.rootValue - ); - return sql.fragment`(${query})`; - }, getSafeAliasFromAlias(parsedResolveInfoFragment.alias)); - }, - }; - }); - return { - description: - constraint.tags.backwardDescription || - build.wrapDescription( - `Reads a single \`${tableTypeName}\` that is related to this \`${foreignTableTypeName}\`.`, - 'field' - ), - type: gqlTableType, - args: {}, - resolve: (data, _args, resolveContext, resolveInfo) => { - const safeAlias = getSafeAliasFromResolveInfo(resolveInfo); - const record = data[safeAlias]; - const liveRecord = resolveInfo.rootValue && resolveInfo.rootValue.liveRecord; - const liveCollection = resolveInfo.rootValue && resolveInfo.rootValue.liveCollection; - const liveConditions = resolveInfo.rootValue && resolveInfo.rootValue.liveConditions; - if (subscriptions && liveCollection && liveConditions && data.__live) { - const {__id, ...rest} = data.__live; - const condition = liveConditions[__id]; - const checker = condition(rest); - - liveCollection('pg', table, checker); - } - if (record && liveRecord) { - liveRecord('pg', table, record.__identifiers); - } - return record; - }, - }; - }, - { - pgFieldIntrospection: table, - isPgBackwardSingleRelationField: true, - } - ), - }, - `Backward relation (single) for ${describePgEntity( - constraint - )}. To rename this relation with a 'Smart Comment':\n\n ${sqlCommentByAddingTags(constraint, { - foreignSingleFieldName: 'newNameHere', - })}` - ); - } - - function makeFields(isConnection) { - const manyRelationFieldName = isConnection - ? inflection.manyRelationByKeys(keys, table, foreignTable, constraint) - : inflection.manyRelationByKeysSimple(keys, table, foreignTable, constraint); - - memo = extend( - memo, - { - [manyRelationFieldName]: fieldWithHooks( - manyRelationFieldName, - ({addDataGenerator, getDataFromParsedResolveInfoFragment}) => { - const sqlFrom = sql.identifier(schema.name, table.name); - const queryOptions = { - useAsterisk: table.canUseAsterisk, - withPagination: isConnection, - withPaginationAsFields: false, - asJsonAggregate: !isConnection, - }; - addDataGenerator((parsedResolveInfoFragment) => { - return { - pgQuery: (queryBuilder) => { - queryBuilder.select(() => { - const resolveData = getDataFromParsedResolveInfoFragment( - parsedResolveInfoFragment, - isConnection ? ConnectionType : TableType - ); - const tableAlias = sql.identifier(Symbol()); - const foreignTableAlias = queryBuilder.getTableAlias(); - const query = queryFromResolveData( - sqlFrom, - tableAlias, - resolveData, - queryOptions, - (innerQueryBuilder) => { - innerQueryBuilder.parentQueryBuilder = queryBuilder; - if (subscriptions) { - innerQueryBuilder.makeLiveCollection(table); - innerQueryBuilder.addLiveCondition( - (data) => (record) => { - return keys.every((key) => record[key.name] === data[key.name]); - }, - keys.reduce((memo, key, i) => { - memo[key.name] = sql.fragment`${foreignTableAlias}.${sql.identifier( - foreignKeys[i].name - )}`; - return memo; - }, {}) - ); - } - if (primaryKeys) { - if (subscriptions && !isConnection && table.primaryKeyConstraint) { - innerQueryBuilder.selectIdentifiers(table); - } - innerQueryBuilder.beforeLock('orderBy', () => { - // append order by primary key to the list of orders - if (!innerQueryBuilder.isOrderUnique(false)) { - innerQueryBuilder.data.cursorPrefix = ['primary_key_asc']; - primaryKeys.forEach((key) => { - innerQueryBuilder.orderBy( - sql.fragment`${innerQueryBuilder.getTableAlias()}.${sql.identifier( - key.name - )}`, - true - ); - }); - innerQueryBuilder.setOrderIsUnique(); - } - }); - } - - keys.forEach((key, i) => { - innerQueryBuilder.where( - sql.fragment`${tableAlias}.${sql.identifier( - key.name - )} = ${foreignTableAlias}.${sql.identifier(foreignKeys[i].name)}` - ); - }); - }, - queryBuilder.context, - queryBuilder.rootValue - ); - return sql.fragment`(${query})`; - }, getSafeAliasFromAlias(parsedResolveInfoFragment.alias)); - }, - }; - }); - const ConnectionType = getTypeByName(inflection.connection(gqlTableType.name)); - const TableType = pgGetGqlTypeByTypeIdAndModifier(table.type.id, null); - return { - description: - constraint.tags.backwardDescription || - build.wrapDescription( - `Reads and enables pagination through a set of \`${tableTypeName}\`.`, - 'field' - ), - type: isConnection - ? new GraphQLNonNull(ConnectionType) - : new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(TableType))), - args: {}, - resolve: (data, _args, resolveContext, resolveInfo) => { - const safeAlias = getSafeAliasFromResolveInfo(resolveInfo); - const liveCollection = resolveInfo.rootValue && resolveInfo.rootValue.liveCollection; - const liveConditions = resolveInfo.rootValue && resolveInfo.rootValue.liveConditions; - if (subscriptions && liveCollection && liveConditions && data.__live) { - const {__id, ...rest} = data.__live; - const condition = liveConditions[__id]; - const checker = condition(rest); - - liveCollection('pg', table, checker); - } - if (isConnection) { - return addStartEndCursor(data[safeAlias]); - } else { - const records = data[safeAlias]; - const liveRecord = resolveInfo.rootValue && resolveInfo.rootValue.liveRecord; - if (primaryKeys && subscriptions && liveRecord) { - records.forEach((r) => r && r.__identifiers && liveRecord('pg', table, r.__identifiers)); - } - return records; - } - }, - ...(isDeprecated - ? { - deprecationReason: singleRelationFieldName - ? `Please use ${singleRelationFieldName} instead` - : `Please use singular instead`, // This should never happen - } - : null), - }; - }, - { - isPgFieldConnection: isConnection, - isPgFieldSimpleCollection: !isConnection, - isPgBackwardRelationField: true, - pgFieldIntrospection: table, - } - ), - }, - - `Backward relation (${isConnection ? 'connection' : 'simple collection'}) for ${describePgEntity( - constraint - )}. To rename this relation with a 'Smart Comment':\n\n ${sqlCommentByAddingTags(constraint, { - [isConnection ? 'foreignFieldName' : 'foreignSimpleFieldName']: 'newNameHere', - })}` - ); - } - - if (shouldAddManyRelation && !omit(table, 'many') && !omit(constraint, 'many')) { - const simpleCollections = - constraint.tags.simpleCollections || table.tags.simpleCollections || pgSimpleCollections; - const hasConnections = simpleCollections !== 'only'; - const hasSimpleCollections = simpleCollections === 'only' || simpleCollections === 'both'; - if (hasConnections) { - makeFields(true); - } - if ( - hasSimpleCollections && - !isUnique // if unique, use the singular instead - ) { - makeFields(false); - } - } - return memo; - }, {}), - `Adding backward relations for ${Self.name}` - ); - }, - ['PgBackwardRelation'] - ); -} diff --git a/packages/query/src/graphql/plugins/PgBlockHeightPlugin.ts b/packages/query/src/graphql/plugins/PgBlockHeightPlugin.ts deleted file mode 100644 index c5dd6956..00000000 --- a/packages/query/src/graphql/plugins/PgBlockHeightPlugin.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Plugin} from 'graphile-build'; -import {QueryBuilder} from 'graphile-build-pg'; -import {GraphQLString} from 'graphql'; - -export const PgBlockHeightPlugin: Plugin = (builder) => { - // Adds blockHeight condition to join clause when joining a table that has _block_range column - builder.hook( - 'GraphQLObjectType:fields:field', - ( - field, - {pgSql: sql}, - { - addArgDataGenerator, - scope: { - isPgBackwardRelationField, - isPgBackwardSingleRelationField, - isPgForwardRelationField, - pgFieldIntrospection, - }, - } - ) => { - if (!isPgBackwardRelationField && !isPgForwardRelationField && !isPgBackwardSingleRelationField) { - return field; - } - if ( - !pgFieldIntrospection?.attributes?.some(({name}) => name === '_block_range') && - !pgFieldIntrospection?.class?.attributes?.some(({name}) => name === '_block_range') - ) { - return field; - } - - addArgDataGenerator(() => ({ - pgQuery: (queryBuilder: QueryBuilder) => { - queryBuilder.where( - sql.fragment`${queryBuilder.getTableAlias()}._block_range @> ${queryBuilder.context.args.blockHeight}` - ); - }, - })); - return field; - } - ); - // Adds blockHeight argument to single entity and connection queries for tables with _block_range column - builder.hook( - 'GraphQLObjectType:fields:field:args', - ( - args, - {extend, pgSql: sql}, - {addArgDataGenerator, scope: {isPgFieldConnection, isPgRowByUniqueConstraintField, pgFieldIntrospection}} - ) => { - if (!isPgRowByUniqueConstraintField && !isPgFieldConnection) { - return args; - } - if ( - !pgFieldIntrospection?.attributes?.some(({name}) => name === '_block_range') && - !pgFieldIntrospection?.class?.attributes?.some(({name}) => name === '_block_range') - ) { - return args; - } - - addArgDataGenerator(({blockHeight}) => ({ - pgQuery: (queryBuilder: QueryBuilder) => { - // Save blockHeight to context, so it gets passed down to children - if (!queryBuilder.context.args?.blockHeight || !queryBuilder.parentQueryBuilder) { - queryBuilder.context.args = {blockHeight: sql.fragment`${sql.value(blockHeight)}::bigint`}; - } - queryBuilder.where( - sql.fragment`${queryBuilder.getTableAlias()}._block_range @> ${queryBuilder.context.args.blockHeight}` - ); - }, - })); - return extend(args, { - blockHeight: { - description: 'Block height', - defaultValue: '9223372036854775807', - type: GraphQLString, // String because of int overflow - }, - }); - } - ); -}; diff --git a/packages/query/src/graphql/plugins/PgConnectionArgFirstLastBeforeAfter.ts b/packages/query/src/graphql/plugins/PgConnectionArgFirstLastBeforeAfter.ts deleted file mode 100644 index dbdf0ed4..00000000 --- a/packages/query/src/graphql/plugins/PgConnectionArgFirstLastBeforeAfter.ts +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// overwrite the official plugin: https://github.com/graphile/graphile-engine/blob/v4/packages/graphile-build-pg/src/plugins/PgConnectionArgFirstLastBeforeAfter.js -// to support max record rewrite, which to prevent the db performance issue. - -import {QueryBuilder} from 'graphile-build-pg'; -import {argv} from '../../yargs'; - -const MAX_ENTITY_COUNT = 100; - -const base64Decode = (str) => Buffer.from(String(str), 'base64').toString('utf8'); - -export default (builder) => { - builder.hook( - 'GraphQLObjectType:fields:field:args', - (args, build, context) => { - const { - extend, - getTypeByName, - graphql: {GraphQLInt}, - } = build; - const { - Self, - addArgDataGenerator, - scope: {fieldName, isPgFieldConnection, isPgFieldSimpleCollection, pgFieldIntrospection: source}, - } = context; - const unsafe = argv('unsafe') as boolean; - const safeClamp = (x: number) => (unsafe ? x : Math.min(x, MAX_ENTITY_COUNT)); - - if ( - !(isPgFieldConnection || isPgFieldSimpleCollection) || - !source || - (source.kind !== 'class' && source.kind !== 'procedure') - ) { - return args; - } - const Cursor = getTypeByName('Cursor'); - - addArgDataGenerator(function connectionFirstLastBeforeAfter({after, before, first, last, offset}) { - return { - pgQuery: (queryBuilder: QueryBuilder) => { - if (!first && !last && !unsafe) { - queryBuilder.first(MAX_ENTITY_COUNT); - } - if (first) { - first = safeClamp(first); - queryBuilder.first(first); - } - if (offset) { - queryBuilder.offset(offset); - } - if (isPgFieldConnection) { - if (after) { - addCursorConstraint(after, true); - } - if (before) { - addCursorConstraint(before, false); - } - if (last) { - if (first) { - throw new Error("We don't support setting both first and last"); - } - if (offset) { - throw new Error("We don't support setting both offset and last"); - } - last = safeClamp(last); - queryBuilder.last(last); - } - } - - function addCursorConstraint(cursor, isAfter) { - try { - const cursorValues = JSON.parse(base64Decode(cursor)); - return queryBuilder.addCursorCondition(cursorValues, isAfter); - } catch (e) { - throw new Error('Invalid cursor, please enter a cursor from a previous request, or null.'); - } - } - }, - }; - }); - - return extend( - args, - { - first: { - description: build.wrapDescription('Only read the first `n` values of the set.', 'arg'), - type: GraphQLInt, - }, - ...(isPgFieldConnection - ? { - last: { - description: build.wrapDescription('Only read the last `n` values of the set.', 'arg'), - type: GraphQLInt, - }, - } - : null), - offset: { - description: build.wrapDescription( - isPgFieldConnection - ? 'Skip the first `n` values from our `after` cursor, an alternative to cursor based pagination. May not be used with `last`.' - : 'Skip the first `n` values.', - 'arg' - ), - type: GraphQLInt, - }, - ...(isPgFieldConnection - ? { - before: { - description: build.wrapDescription('Read all values in the set before (above) this cursor.', 'arg'), - type: Cursor, - }, - after: { - description: build.wrapDescription('Read all values in the set after (below) this cursor.', 'arg'), - type: Cursor, - }, - } - : null), - }, - isPgFieldConnection - ? `Adding connection pagination args to field '${fieldName}' of '${Self.name}'` - : `Adding simple collection args to field '${fieldName}' of '${Self.name}'` - ); - }, - ['PgConnectionArgFirstLastBeforeAfter'] - ); -}; diff --git a/packages/query/src/graphql/plugins/PgOrderByAggregatesPlugin.ts b/packages/query/src/graphql/plugins/PgOrderByAggregatesPlugin.ts deleted file mode 100644 index 60549aa4..00000000 --- a/packages/query/src/graphql/plugins/PgOrderByAggregatesPlugin.ts +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -/* WARNING - * This is a fork of https://github.com/graphile/pg-aggregates/blob/c8dd0f951663d5dacde21da26f3b94b62dc296c5/src/OrderByAggregatesPlugin.ts - * The only modification is to filter out `_id` and `_block_height` attributes to fix a naming conflict - */ - -import {AggregateSpec} from '@graphile/pg-aggregates/dist/interfaces'; -import type {Plugin} from 'graphile-build'; -import type {SQL, QueryBuilder, PgClass, PgEntity} from 'graphile-build-pg'; - -type OrderBySpecIdentity = string | SQL | ((options: {queryBuilder: QueryBuilder}) => SQL); - -type OrderSpec = [OrderBySpecIdentity, boolean] | [OrderBySpecIdentity, boolean, boolean]; -export interface OrderSpecs { - [orderByEnumValue: string]: { - value: { - alias?: string; - specs: Array; - unique: boolean; - }; - }; -} - -const OrderByAggregatesPlugin: Plugin = (builder) => { - builder.hook('GraphQLEnumType:values', (values, build, context) => { - const { - extend, - inflection, - pgIntrospectionResultsByKind: introspectionResultsByKind, - pgOmit: omit, - pgSql: sql, - } = build; - const pgAggregateSpecs: AggregateSpec[] = build.pgAggregateSpecs; - const { - scope: {isPgRowSortEnum}, - } = context; - - const pgIntrospection: PgEntity | undefined = context.scope.pgIntrospection; - - if (!isPgRowSortEnum || !pgIntrospection || pgIntrospection.kind !== 'class') { - return values; - } - - const foreignTable: PgClass = pgIntrospection; - - const foreignKeyConstraints = foreignTable.foreignConstraints.filter((con) => con.type === 'f'); - - const newValues = foreignKeyConstraints.reduce((memo, constraint) => { - if (omit(constraint, 'read')) { - return memo; - } - const table: PgClass | undefined = introspectionResultsByKind.classById[constraint.classId]; - if (!table) { - throw new Error(`Could not find the table that referenced us (constraint: ${constraint.name})`); - } - const keys = constraint.keyAttributes; - const foreignKeys = constraint.foreignKeyAttributes; - if (!keys.every((_) => _) || !foreignKeys.every((_) => _)) { - throw new Error('Could not find key columns!'); - } - if (keys.some((key) => omit(key, 'read'))) { - return memo; - } - if (foreignKeys.some((key) => omit(key, 'read'))) { - return memo; - } - const isUnique = !!table.constraints.find( - (c) => - (c.type === 'p' || c.type === 'u') && - c.keyAttributeNums.length === keys.length && - c.keyAttributeNums.every((n, i) => keys[i].num === n) - ); - if (isUnique) { - // No point aggregating over a relation that's unique - return memo; - } - - const tableAlias = sql.identifier(Symbol(`${foreignTable.namespaceName}.${foreignTable.name}`)); - - // Add count - memo = build.extend( - memo, - orderByAscDesc( - inflection.orderByCountOfManyRelationByKeys(keys, table, foreignTable, constraint), - ({queryBuilder}) => { - const foreignTableAlias = queryBuilder.getTableAlias(); - const conditions: SQL[] = []; - keys.forEach((key, i) => { - conditions.push( - sql.fragment`${tableAlias}.${sql.identifier(key.name)} = ${foreignTableAlias}.${sql.identifier( - foreignKeys[i].name - )}` - ); - }); - return sql.fragment`(select count(*) from ${sql.identifier( - table.namespaceName, - table.name - )} ${tableAlias} where (${sql.join(conditions, ' AND ')}))`; - }, - false - ), - `Adding orderBy count to '${foreignTable.namespaceName}.${foreignTable.name}' using constraint '${constraint.name}'` - ); - - // Filter out attributes relating to historical. This was causing conflicts with `id` and `_id` - const attributes = table.attributes.filter((attr) => attr.name !== '_id' && attr.name !== '_block_height'); - - // Add other aggregates - pgAggregateSpecs.forEach((spec) => { - attributes.forEach((attr) => { - memo = build.extend( - memo, - orderByAscDesc( - inflection.orderByColumnAggregateOfManyRelationByKeys(keys, table, foreignTable, constraint, spec, attr), - ({queryBuilder}) => { - const foreignTableAlias = queryBuilder.getTableAlias(); - const conditions: SQL[] = []; - keys.forEach((key, i) => { - conditions.push( - sql.fragment`${tableAlias}.${sql.identifier(key.name)} = ${foreignTableAlias}.${sql.identifier( - foreignKeys[i].name - )}` - ); - }); - return sql.fragment`(select ${spec.sqlAggregateWrap( - sql.fragment`${tableAlias}.${sql.identifier(attr.name)}` - )} from ${sql.identifier(table.namespaceName, table.name)} ${tableAlias} where (${sql.join( - conditions, - ' AND ' - )}))`; - }, - false - ), - `Adding orderBy ${spec.id} of '${attr.name}' to '${foreignTable.namespaceName}.${foreignTable.name}' using constraint '${constraint.name}'` - ); - }); - }); - - return memo; - }, {} as OrderSpecs); - - return extend(values, newValues, `Adding aggregate orders to '${foreignTable.namespaceName}.${foreignTable.name}'`); - }); -}; - -export function orderByAscDesc(baseName: string, columnOrSqlFragment: OrderBySpecIdentity, unique = false): OrderSpecs { - return { - [`${baseName}_ASC`]: { - value: { - alias: `${baseName}_ASC`, - specs: [[columnOrSqlFragment, true]], - unique, - }, - }, - [`${baseName}_DESC`]: { - value: { - alias: `${baseName}_DESC`, - specs: [[columnOrSqlFragment, false]], - unique, - }, - }, - }; -} - -export default OrderByAggregatesPlugin; diff --git a/packages/query/src/graphql/plugins/PgRowByVirtualIdPlugin.ts b/packages/query/src/graphql/plugins/PgRowByVirtualIdPlugin.ts deleted file mode 100644 index 9655699d..00000000 --- a/packages/query/src/graphql/plugins/PgRowByVirtualIdPlugin.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Plugin} from 'graphile-build'; - -// Copied from graphile-build-pg/node8plus/plugins/PgRowByUniqueConstraint.ts -// Modified to overwrite hidden column _id primary key with id column -export const PgRowByVirtualIdPlugin: Plugin = (builder) => { - builder.hook('GraphQLObjectType:fields', (fields, build, context) => { - const { - extend, - gql2pg, - graphql: {GraphQLNonNull}, - inflection, - parseResolveInfo, - pgGetGqlInputTypeByTypeIdAndModifier, - pgGetGqlTypeByTypeIdAndModifier, - pgIntrospectionResultsByKind: introspectionResultsByKind, - pgOmit: omit, - pgPrepareAndRun, - pgQueryFromResolveData: queryFromResolveData, - pgSql: sql, - } = build; - const { - fieldWithHooks, - scope: {isRootQuery}, - } = context; - - if (!isRootQuery) { - return fields; - } - - return extend( - fields, - introspectionResultsByKind.class.reduce((memo, table) => { - if (!table.namespace) return memo; - if (omit(table, 'read')) return memo; - - const TableType = pgGetGqlTypeByTypeIdAndModifier(table.type.id, null); - const sqlFullTableName = sql.identifier(table.namespace.name, table.name); - if (TableType) { - const uniqueConstraints = table.constraints.filter((con) => con.type === 'u' || con.type === 'p'); - uniqueConstraints.forEach((constraint) => { - if (omit(constraint, 'read')) { - return; - } - const keys = constraint.keyAttributes; - // Only for _id primary key - if (keys.length !== 1 || keys[0].name !== '_id') { - return; - } - const fieldName = inflection.rowByUniqueKeys(keys, table, constraint); - // Find id column - const idColumn = table.attributes.find(({name}) => name === 'id'); - if (!idColumn) { - return; - } - // Overwrite with id column - const keysIncludingMeta = [ - { - ...idColumn, - sqlIdentifier: sql.identifier(idColumn.name), - columnName: inflection.column(idColumn), - }, - ]; - const queryFromResolveDataOptions = { - useAsterisk: false, - }; - const queryFromResolveDataCallback = (queryBuilder, args) => { - const sqlTableAlias = queryBuilder.getTableAlias(); - keysIncludingMeta.forEach(({columnName, sqlIdentifier, type, typeModifier}) => { - queryBuilder.where( - sql.fragment`${sqlTableAlias}.${sqlIdentifier} = ${gql2pg(args[columnName], type, typeModifier)}` - ); - }); - }; - - memo[fieldName] = fieldWithHooks( - fieldName, - ({getDataFromParsedResolveInfoFragment}) => { - return { - type: TableType, - args: keysIncludingMeta.reduce((memo, {columnName, name, typeId, typeModifier}) => { - const InputType = pgGetGqlInputTypeByTypeIdAndModifier(typeId, typeModifier); - if (!InputType) { - throw new Error(`Could not find input type for key '${name}' on type '${TableType.name}'`); - } - memo[columnName] = { - type: new GraphQLNonNull(InputType), - }; - return memo; - }, {}), - async resolve(parent, args, resolveContext, resolveInfo) { - const {pgClient} = resolveContext; - const parsedResolveInfoFragment = parseResolveInfo(resolveInfo); - parsedResolveInfoFragment.args = args; // Allow overriding via makeWrapResolversPlugin - const resolveData = getDataFromParsedResolveInfoFragment(parsedResolveInfoFragment, TableType); - const query = queryFromResolveData( - sqlFullTableName, - undefined, - resolveData, - queryFromResolveDataOptions, - (queryBuilder) => queryFromResolveDataCallback(queryBuilder, args), - resolveContext, - resolveInfo.rootValue - ); - const {text, values} = sql.compile(query); - const { - rows: [row], - } = await pgPrepareAndRun(pgClient, text, values); - return row; - }, - }; - }, - { - isPgRowByUniqueConstraintField: true, - pgFieldIntrospection: constraint, - } - ); - }); - } - return memo; - }, {}) - ); - }); -}; diff --git a/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts b/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts deleted file mode 100644 index f9533b78..00000000 --- a/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {PgIntrospectionResultsByKind} from 'graphile-build-pg'; -import {makeExtendSchemaPlugin, gql, embed} from 'graphile-utils'; - -const filter = (event, args) => { - if (args.mutation && !args.mutation.includes(event.mutation_type)) { - return false; - } - if (args.id && !args.id.includes(event.id)) { - return false; - } - return true; -}; - -export const PgSubscriptionPlugin = makeExtendSchemaPlugin((build) => { - const {inflection, pgIntrospectionResultsByKind} = build; - - const typeDefs = [ - gql` - enum MutationType { - INSERT - UPDATE - DELETE - } - - type SubscriptionPayload { - id: ID! - mutation_type: MutationType! - _entity: JSON - } - `, - ]; - - // Generate subscription fields for all database tables - (pgIntrospectionResultsByKind as PgIntrospectionResultsByKind).class.forEach((table) => { - if (!table.namespace || table.name === '_metadata') return; - - const field = inflection.allRows(table); - const topic = `${table.namespace.name}.${table.name}`; - typeDefs.push( - gql` - extend type Subscription { - ${field}(id: [ID!], mutation: [MutationType!]): SubscriptionPayload - @pgSubscription( - topic: ${embed(topic)} - filter: ${embed(filter)} - ) - }` - ); - }); - - return {typeDefs}; -}); diff --git a/packages/query/src/graphql/plugins/QueryComplexityPlugin.ts b/packages/query/src/graphql/plugins/QueryComplexityPlugin.ts deleted file mode 100644 index 153ee78f..00000000 --- a/packages/query/src/graphql/plugins/QueryComplexityPlugin.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import type {ApolloServerPlugin} from 'apollo-server-plugin-base'; -import {separateOperations, GraphQLSchema} from 'graphql'; -import {getComplexity, simpleEstimator} from 'graphql-query-complexity'; - -export function queryComplexityPlugin(options: {schema: GraphQLSchema; maxComplexity?: number}): ApolloServerPlugin { - return { - requestDidStart: () => { - let complexity: number; - return { - didResolveOperation({document, request}) { - complexity = getComplexity({ - schema: options.schema, - query: request.operationName ? separateOperations(document)[request.operationName] : document, - variables: request.variables, - estimators: [simpleEstimator({defaultComplexity: 1})], - }); - - if (options.maxComplexity !== undefined && complexity > options.maxComplexity) { - throw new Error( - `Sorry, too complicated query! Current ${complexity} is over ${options.maxComplexity} that is the max allowed complexity.` - ); - } - }, - willSendResponse({response}) { - response.http.headers.append('query-complexity', complexity); - if (options.maxComplexity !== undefined) { - response.http.headers.append('max-query-complexity', options.maxComplexity); - } - }, - }; - }, - } as unknown as ApolloServerPlugin; -} diff --git a/packages/query/src/graphql/plugins/index.ts b/packages/query/src/graphql/plugins/index.ts deleted file mode 100644 index 39a3834e..00000000 --- a/packages/query/src/graphql/plugins/index.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -/* eslint-disable */ -import { - SwallowErrorsPlugin, - StandardTypesPlugin, - NodePlugin, - QueryPlugin, - MutationPlugin, - SubscriptionPlugin, - ClientMutationIdDescriptionPlugin, - MutationPayloadQueryPlugin, - AddQueriesToSubscriptionsPlugin, - TrimEmptyDescriptionsPlugin, -} from 'graphile-build/node8plus/plugins'; -import PgBasicsPlugin from 'graphile-build-pg/node8plus/plugins/PgBasicsPlugin'; -import PgIntrospectionPlugin from 'graphile-build-pg/node8plus/plugins/PgIntrospectionPlugin'; -import PgTypesPlugin from 'graphile-build-pg/node8plus/plugins/PgTypesPlugin'; -import PgTablesPlugin from 'graphile-build-pg/node8plus/plugins/PgTablesPlugin'; -import PgConnectionArgOrderBy from 'graphile-build-pg/node8plus/plugins/PgConnectionArgOrderBy'; -import PgConnectionArgOrderByDefaultValue from 'graphile-build-pg/node8plus/plugins/PgConnectionArgOrderByDefaultValue'; -import PgConditionComputedColumnPlugin from 'graphile-build-pg/node8plus/plugins/PgConditionComputedColumnPlugin'; -import PgAllRows from 'graphile-build-pg/node8plus/plugins/PgAllRows'; -import PgColumnsPlugin from 'graphile-build-pg/node8plus/plugins/PgColumnsPlugin'; -import PgColumnDeprecationPlugin from 'graphile-build-pg/node8plus/plugins/PgColumnDeprecationPlugin'; -import PgForwardRelationPlugin from 'graphile-build-pg/node8plus/plugins/PgForwardRelationPlugin'; -import PgRowByUniqueConstraint from 'graphile-build-pg/node8plus/plugins/PgRowByUniqueConstraint'; -import PgComputedColumnsPlugin from 'graphile-build-pg/node8plus/plugins/PgComputedColumnsPlugin'; -import PgQueryProceduresPlugin from 'graphile-build-pg/node8plus/plugins/PgQueryProceduresPlugin'; -import PgOrderAllColumnsPlugin from 'graphile-build-pg/node8plus/plugins/PgOrderAllColumnsPlugin'; -import PgOrderComputedColumnsPlugin from 'graphile-build-pg/node8plus/plugins/PgOrderComputedColumnsPlugin'; -import PgOrderByPrimaryKeyPlugin from 'graphile-build-pg/node8plus/plugins/PgOrderByPrimaryKeyPlugin'; -import PgRowNode from 'graphile-build-pg/node8plus/plugins/PgRowNode'; -import PgNodeAliasPostGraphile from 'graphile-build-pg/node8plus/plugins/PgNodeAliasPostGraphile'; -import PgRecordReturnTypesPlugin from 'graphile-build-pg/node8plus/plugins/PgRecordReturnTypesPlugin'; -import PgRecordFunctionConnectionPlugin from 'graphile-build-pg/node8plus/plugins/PgRecordFunctionConnectionPlugin'; -import PgScalarFunctionConnectionPlugin from 'graphile-build-pg/node8plus/plugins/PgScalarFunctionConnectionPlugin'; -import PageInfoStartEndCursor from 'graphile-build-pg/node8plus/plugins/PageInfoStartEndCursor'; -import PgConnectionTotalCount from 'graphile-build-pg/node8plus/plugins/PgConnectionTotalCount'; - -import PgSimplifyInflectorPlugin from '@graphile-contrib/pg-simplify-inflector'; -import PgManyToManyPlugin from '@graphile-contrib/pg-many-to-many'; -import ConnectionFilterPlugin from 'postgraphile-plugin-connection-filter'; - -// custom plugins -import PgConnectionArgFirstLastBeforeAfter from './PgConnectionArgFirstLastBeforeAfter'; -import PgBackwardRelationPlugin from './PgBackwardRelationPlugin'; -import {GetMetadataPlugin} from './GetMetadataPlugin'; -import {smartTagsPlugin} from './smartTagsPlugin'; -import {makeAddInflectorsPlugin} from 'graphile-utils'; -import PgAggregationPlugin from './PgAggregationPlugin'; -import {PgBlockHeightPlugin} from './PgBlockHeightPlugin'; -import {PgRowByVirtualIdPlugin} from './PgRowByVirtualIdPlugin'; - -/* eslint-enable */ - -export const defaultPlugins = [ - SwallowErrorsPlugin, - StandardTypesPlugin, - NodePlugin, - QueryPlugin, - MutationPlugin, - SubscriptionPlugin, - ClientMutationIdDescriptionPlugin, - MutationPayloadQueryPlugin, - AddQueriesToSubscriptionsPlugin, - TrimEmptyDescriptionsPlugin, -]; - -export const pgDefaultPlugins = [ - PgBasicsPlugin, - PgIntrospectionPlugin, - PgTypesPlugin, - // PgJWTPlugin, - PgTablesPlugin, - PgConnectionArgFirstLastBeforeAfter, - PgConnectionArgOrderBy, - PgConnectionArgOrderByDefaultValue, - PgConditionComputedColumnPlugin, - PgAllRows, - PgColumnsPlugin, - PgColumnDeprecationPlugin, - PgForwardRelationPlugin, - PgBackwardRelationPlugin, - PgRowByUniqueConstraint, - PgComputedColumnsPlugin, - PgQueryProceduresPlugin, - PgOrderAllColumnsPlugin, - PgOrderComputedColumnsPlugin, - PgOrderByPrimaryKeyPlugin, - PgRowNode, - PgNodeAliasPostGraphile, - PgRecordReturnTypesPlugin, - PgRecordFunctionConnectionPlugin, - PgScalarFunctionConnectionPlugin, // For PostGraphile compatibility - PageInfoStartEndCursor, // For PostGraphile compatibility - PgConnectionTotalCount, -]; - -const plugins = [ - ...defaultPlugins, - ...pgDefaultPlugins, - PgSimplifyInflectorPlugin, - PgManyToManyPlugin, - ConnectionFilterPlugin, - smartTagsPlugin, - GetMetadataPlugin, - PgAggregationPlugin, - PgBlockHeightPlugin, - PgRowByVirtualIdPlugin, - makeAddInflectorsPlugin((inflectors) => { - const {constantCase: oldConstantCase} = inflectors; - const enumValues = new Set(); - return { - enumName: (v: string) => { - enumValues.add(v); - return v; - }, - constantCase: (v: string) => { - // We don't want to change the names of all enum values to CONSTANT CASE - // because they could be specified in non CONSTANT CASE in their schema.graphql - if (enumValues.has(v)) { - return v; - } else { - return oldConstantCase(v); - } - }, - }; - }, true), -]; - -export {plugins}; diff --git a/packages/query/src/graphql/plugins/smartTagsPlugin.ts b/packages/query/src/graphql/plugins/smartTagsPlugin.ts deleted file mode 100644 index 9f38ca98..00000000 --- a/packages/query/src/graphql/plugins/smartTagsPlugin.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {PgEntity, PgEntityKind} from 'graphile-build-pg'; -import {makePgSmartTagsPlugin} from 'graphile-utils'; - -export const smartTagsPlugin = makePgSmartTagsPlugin([ - { - //Rule 1, omit `_metadata` from node - kind: PgEntityKind.CLASS, - match: ({name}: PgEntity) => /^_metadata$/.test(name), - tags: { - omit: true, - }, - }, - // Omit _block_range column - { - kind: PgEntityKind.ATTRIBUTE, - match: ({name}) => /^_block_range$/.test(name), - tags: { - omit: true, - }, - }, - // Omit _id column - { - kind: PgEntityKind.ATTRIBUTE, - match: ({name}) => /^_id$/.test(name), - tags: { - omit: true, - }, - }, -]); diff --git a/packages/query/src/graphql/project.service.ts b/packages/query/src/graphql/project.service.ts deleted file mode 100644 index 631f5dc4..00000000 --- a/packages/query/src/graphql/project.service.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Injectable} from '@nestjs/common'; -import {Pool} from 'pg'; -import {Config} from '../configure'; - -@Injectable() -export class ProjectService { - constructor(private readonly pool: Pool, private readonly config: Config) {} - - async getProjectSchema(name: string): Promise { - // After subqueries table has been deprecated, project may not be present in subqueries table - const result = await this.pool - .query<{schema_name: string}, any[]>(`SELECT schema_name FROM information_schema.schemata`) - .then((obj) => obj.rows.map((x) => x.schema_name)) - .catch((e) => { - throw new Error(`Unable to fetch all database schemas: ${e}`); - }); - if (result.includes(name)) { - return name; - } else { - // fallback to subqueries table - const {rows} = await this.pool.query( - `SELECT * - FROM public.subqueries - WHERE name = $1`, - [name] - ); - if (rows.length === 0) { - throw new Error(`unknown project name ${this.config.get('name')}`); - } - return rows[0].db_schema; - } - } -} diff --git a/packages/query/src/main.ts b/packages/query/src/main.ts deleted file mode 100644 index 778c7101..00000000 --- a/packages/query/src/main.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {NestFactory} from '@nestjs/core'; -import {findAvailablePort} from '@subql/common'; -import {AppModule} from './app.module'; -import {getLogger, NestLogger} from './utils/logger'; -import {getYargsOption} from './yargs'; - -const DEFAULT_PORT = 3000; -const {argv} = getYargsOption(); - -void (async () => { - const app = await NestFactory.create(AppModule, { - logger: new NestLogger(), - }); - - const validate = (x: any) => { - const p = parseInt(x); - return isNaN(p) ? null : p; - }; - - const port = validate(process.env.PORT) ?? validate(argv.port) ?? (await findAvailablePort(DEFAULT_PORT)); - if (!port) { - getLogger('subql-query').error( - `Unable to find available port (tried ports in range (${DEFAULT_PORT}..${ - DEFAULT_PORT + 10 - })). Try setting a free port manually by setting the PORT environment variable or by setting the --port flag` - ); - process.exit(1); - } - - if (argv.playground) { - getLogger('subql-query').info(`Started playground at http://localhost:${port}`); - } - - await app.listen(port); -})(); diff --git a/packages/query/src/utils/asyncInterval.ts b/packages/query/src/utils/asyncInterval.ts deleted file mode 100644 index 4afcd027..00000000 --- a/packages/query/src/utils/asyncInterval.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -//improve util method from : https://dev.to/jsmccrumb/asynchronous-setinterval-4j69 - -const asyncIntervals = []; - -const runAsyncInterval = async (cb, interval, intervalIndex) => { - await cb(); - if (asyncIntervals[intervalIndex].run) { - // eslint-disable-next-line @typescript-eslint/no-misused-promises - asyncIntervals[intervalIndex].id = setTimeout(() => runAsyncInterval(cb, interval, intervalIndex), interval); - } -}; - -export const setAsyncInterval = (cb, interval) => { - if (cb && typeof cb === 'function') { - const intervalIndex = asyncIntervals.length; - asyncIntervals.push({run: true, id: 0}); - runAsyncInterval(cb, interval, intervalIndex); - return intervalIndex; - } else { - throw new Error('Callback must be a function'); - } -}; - -const clearAsyncInterval = (intervalIndex) => { - if (asyncIntervals[intervalIndex].run) { - clearTimeout(asyncIntervals[intervalIndex].id); - asyncIntervals[intervalIndex].run = false; - } -}; diff --git a/packages/query/src/utils/logger.ts b/packages/query/src/utils/logger.ts deleted file mode 100644 index fc65c81b..00000000 --- a/packages/query/src/utils/logger.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {LoggerService} from '@nestjs/common'; -import {Logger} from '@subql/utils'; -import Pino from 'pino'; -import {argv} from '../yargs'; - -const outputFmt = argv('output-fmt') as 'json' | 'colored'; -const logLevel = argv('log-level') as string | undefined; -const logPath = argv('log-path') as string | undefined; -const logRotate = argv('log-rotate') as boolean | undefined; - -const logger = new Logger({level: logLevel, filepath: logPath, rotate: logRotate, outputFormat: outputFmt}); - -export function getLogger(category: string): Pino.Logger { - return logger.getLogger(category); -} - -export class NestLogger implements LoggerService { - private logger = logger.getLogger('nestjs'); - - error(message: any, trace?: string): void { - if (trace) { - this.logger.error({trace}, message); - } else { - this.logger.error(message); - } - } - - log(message: any): any { - this.logger.info(message); - } - - warn(message: any): any { - this.logger.warn(message); - } -} - -export const PinoConfig = { - logger: getLogger('express'), - serializers: { - req(req) { - const body = req.raw.body; - if ('operationName' in body && body.query) { - // Logging IntrospectionQuery payload clutters logs and isn't useful - if (body.operationName === 'IntrospectionQuery') { - req.introspection = true; - } else { - req.payload = body.query; - } - } - return req; - }, - }, - autoLogging: { - ignorePaths: ['/.well-known/apollo/server-health'], - }, -}; diff --git a/packages/query/src/yargs.ts b/packages/query/src/yargs.ts deleted file mode 100644 index 987ac507..00000000 --- a/packages/query/src/yargs.ts +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {argv as yargv} from 'yargs'; -import {hideBin} from 'yargs/helpers'; -import yargs from 'yargs/yargs'; - -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export function getYargsOption() { - return yargs(hideBin(process.argv)).options({ - name: { - demandOption: true, - alias: 'n', - describe: 'Project name', - type: 'string', - }, - playground: { - demandOption: false, - describe: 'Enable graphql playground', - type: 'boolean', - }, - 'output-fmt': { - demandOption: false, - describe: 'Print log as json or plain text', - type: 'string', - default: 'colored', - choices: ['json', 'colored'], - }, - 'log-level': { - demandOption: false, - describe: 'Specify log level to print.', - type: 'string', - default: 'info', - choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'], - }, - 'log-path': { - demandOption: false, - describe: 'Path to create log file e.g ./src/name.log', - type: 'string', - }, - 'log-rotate': { - demandOption: false, - describe: 'Rotate log files in directory specified by log-path', - type: 'boolean', - default: false, - }, - indexer: { - demandOption: false, - describe: 'Url that allows query to access indexer metadata', - type: 'string', - }, - unsafe: { - demandOption: false, - describe: 'Disable limits on query depth and allowable number returned query records', - type: 'boolean', - }, - subscription: { - demandOption: false, - describe: 'Enable subscription service', - type: 'boolean', - default: false, - }, - port: { - alias: 'p', - demandOption: false, - describe: 'The port the service will bind to', - type: 'number', - }, - 'query-complexity': { - demandOption: false, - describe: 'Level of query complexity', - type: 'number', - }, - 'max-connection': { - demandOption: false, - describe: 'Max connection to pg pool', - type: 'number', - }, - 'query-timeout': { - demandOption: false, - describe: 'Query timeout in milliseconds', - type: 'number', - }, - 'query-explain': { - demandOption: false, - describe: 'Explain query in SQL statement', - type: 'boolean', - }, - aggregate: { - demandOption: false, - default: true, - describe: 'Enable aggregate feature', - type: 'boolean', - }, - }); -} - -export function argv(arg: string): unknown { - return getYargsOption().argv[arg]; -} diff --git a/packages/query/tsconfig.build.json b/packages/query/tsconfig.build.json deleted file mode 100644 index 64f86c6b..00000000 --- a/packages/query/tsconfig.build.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig.json", - "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] -} diff --git a/packages/query/tsconfig.json b/packages/query/tsconfig.json deleted file mode 100644 index 9c7d8d6e..00000000 --- a/packages/query/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "es2017", - "sourceMap": true, - "tsBuildInfoFile": "dist/.tsbuildinfo", - "rootDir": "src", - "outDir": "./dist", - "lib": ["dom"] - }, - "references": [{"path": "../common"}, {"path": "../types"}, {"path": "../utils"}], - "include": ["src/**/*"] -} diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 80fd2092..26a08781 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -9,134 +9,3 @@ All logs must start with the format: [x.y.z] - yyyy-mm-dd ## [Unreleased] -## [1.5.0] - 2022-09-13 -### Changed -- Change types to support wasm processor and update polkadot API to v9. (#1280) - -## [1.4.0] - 2022-08-26 - -### Changed -- Updated store.getByField to have limit and offset options. `getByField(entity: string, field: string, value: any, options?: {offset?: number; limit?: number}): Promise;`. (#1259) - -## [1.3.0] - 2022-08-17 -### Added -- `bulkUpdate` and `bulkGet` to the injected store. This can be used to optimise handlers and speed up indexing. (#1246) - -## [1.2.1] - 2022-08-04 -### Fixed -- Export `EventTypeRecord`. (#1225) - -## [1.2.0] - 2022-07-27 -### Changed -- Update `SubstrateBlockFilter` with new `modulo` filter. (#1196) -- Make `SubstrateExtrinsic` and `SubstrateEvent` types generic. This allows specifying the data/args type rather than being provided with `Codec[]` or `AnyTuple`. (#1194) - -## [1.1.0] - 2022-05-31 -### Changed -- Update name for substrate types (#1012) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.15.0] - 2022-05-02 -### Changed -- Update polkadot 8.2.1 (#910) - -## [0.14.0] - 2022-02-09 -### Added -- inject `createDynamicDatasource` in global (#773) - -## [0.13.0] - 2022-01-13 -### Changed -- Update Polkadot/api to 7.3.1 (#745) - -## [0.12.0] - 2021-12-16 -### Added -- Add `bulkCreate` in `Store` interface (#699) - -## [0.11.0] - 2021-11-27 -### Changed -- Update patch api type (#638) - -## [0.10.1] - 2021-11-19 -### Changed -- Update patch api type (#638) - -## [0.10.0] - 2021-11-03 -### Changed -- Update interface under project for Moonbeam custom datasource processor (#579) -### Added -- Add interface `FunctionPropertyNames` improve types of entity creation (#573) - -## [0.9.0] - 2021-10-26 -### Changed -- Update Polkadot/api to v6 (#548) -- Move project manifest types to @subql/types because it is now also required by subquery project. (#512) - -## [0.8.5] - 2021-10-12 -### Changed -- Update Polkadot/api to 6.3.1 (#505) - -## [0.8.4] - 2021-09-16 -### Changed -- Update Polkadot/api to 5.9.1 (#476) - -## [0.8.3] - 2021-09-01 -### Changed -- Update Polkadot/api to 5.7.1 (#460) - -## [0.8.2] - 2021-08-20 -### Changed -- Update Polkadot/api to 5.5.2 (#439) - -## [0.8.1] - 2021-08-16 -### Changed -- Update Polkadot/api to 5.5.1 (#433) - -## [0.8.0] - 2021-06-25 -### Changed -- Update dependencies (#358) - -## [0.7.0] - 2021-04-20 -### Fixed -- inject logger module in global(#248) - -### Added -- Expose events in SubstrateBlock (#256) -- Injecting logger to sandbox's global (#259) -- Store support querying by indexed field (#271) - -## [0.6.1] - 2021-03-11 - -## [0.6.0] - 2021-01-27 -### Fixed -- fix crash for events not own by extrinsic (#120) - -## [0.5.0] - 2021-01-25 -### Added -- patch and inject api in sandbox context (#103) -- support specVersion filter and success filter (#106) - -### Changed -- bump @polkadot/api to v3.6.3 (#109) - -## [0.3.0] - 2021-01-06 -### Added -- support callHandler and eventHandler (#47) - -## [0.2.0] - 2020-12-22 -### Added -- support block handler - -[Unreleased]: https://github.com/subquery/subql/compare/types/0.14.0...HEAD -[0.14.0]: https://github.com/subquery/subql/compare/types/0.13.0...types/0.14.0 -[0.13.0]: https://github.com/subquery/subql/compare/types/0.12.0...types/0.13.0 -[0.12.0]: https://github.com/subquery/subql/compare/types/0.11.0...types/0.12.0 -[0.11.0]: https://github.com/subquery/subql/compare/types/0.10.0...types/0.11.0 -[0.10.1]: https://github.com/subquery/subql/compare/types/0.10.0...types/0.10.1 -[0.10.0]: https://github.com/subquery/subql/compare/types/0.9.0...types/0.10.0 -[0.7.0]: https://github.com/subquery/subql/compare/v0.6.1...v0.7.0 -[0.6.1]: https://github.com/subquery/subql/compare/v0.6.0...v0.6.1 -[0.6.0]: https://github.com/OnFinality-io/subql/compare/v0.5.0...v0.6.0 -[0.5.0]: https://github.com/OnFinality-io/subql/compare/v0.3.0...v0.5.0 -[0.3.0]: https://github.com/OnFinality-io/subql/compare/v0.2.0...v0.3.0 diff --git a/packages/types/package.json b/packages/types/package.json index 55b5e927..76670a07 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { - "name": "@subql/types", - "version": "1.5.0", + "name": "@subql/types-ethereum", + "version": "0.0.0", "description": "", "homepage": "https://github.com/subquery/subql", "repository": "github:subquery/subql", @@ -21,5 +21,9 @@ "devDependencies": { "@polkadot/api": "^9", "@types/app-module-path": "^2.2.0" - } + }, + "dependencies": { + "@ethersproject/abstract-provider": "^5.6.1" + }, + "stableVersion": "0.4.0" } diff --git a/packages/node-core/src/configure/index.ts b/packages/types/src/ethereum/index.ts similarity index 77% rename from packages/node-core/src/configure/index.ts rename to packages/types/src/ethereum/index.ts index e12382d9..671bcad6 100644 --- a/packages/node-core/src/configure/index.ts +++ b/packages/types/src/ethereum/index.ts @@ -1,4 +1,4 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './NodeConfig'; +export * from './interfaces'; diff --git a/packages/types/src/ethereum/interfaces.ts b/packages/types/src/ethereum/interfaces.ts new file mode 100644 index 00000000..3e8857f8 --- /dev/null +++ b/packages/types/src/ethereum/interfaces.ts @@ -0,0 +1,113 @@ +// Copyright 2020-2022 OnFinality Limited authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import {BlockWrapper} from '../interfaces'; + +export interface EthereumBlockFilter { + modulo?: number; +} + +export interface EthereumTransactionFilter { + from?: string; + to?: string; + function?: string; +} + +export interface EthereumLogFilter { + topics?: Array; + address?: string; +} + +export interface EthereumResult extends ReadonlyArray { + readonly [key: string]: any; +} +export type EthereumBlock = { + blockExtraData: string; + difficulty: bigint; + extDataGasUsed: string; + extDataHash: string; + gasLimit: bigint; + gasUsed: bigint; + hash: string; + logs: EthereumLog[]; + logsBloom: string; + miner: string; + mixHash: string; + nonce: string; + number: number; + parentHash: string; + receiptsRoot: string; + sha3Uncles: string; + size: bigint; + stateRoot: string; + timestamp: bigint; + totalDifficulty: bigint; + transactions: EthereumTransaction[]; + transactionsRoot: string; + uncles: string[]; + baseFeePerGas?: bigint; + blockGasCost?: bigint; +}; + +export type EthereumTransaction = { + blockHash: string; + blockNumber: number; + from: string; + gas: bigint; + gasPrice: bigint; + hash: string; + input: string; + nonce: bigint; + to: string; + transactionIndex: bigint; + value: bigint; + type: string; + v: bigint; + r: string; + s: string; + receipt: EthereumReceipt; + accessList?: string[]; + chainId?: string; + maxFeePerGas?: bigint; + maxPriorityFeePerGas?: bigint; + args?: T; +}; + +export type EthereumReceipt = { + blockHash: string; + blockNumber: number; + contractAddress: string; + cumulativeGasUsed: bigint; + effectiveGasPrice: bigint; + from: string; + gasUsed: bigint; + logs: EthereumLog[]; + logsBloom: string; + status: boolean; + to: string; + transactionHash: string; + transactionIndex: number; + type: string; +}; + +export type EthereumLog = { + address: string; + topics: string[]; + data: string; + blockHash: string; + blockNumber: number; + transactionHash: string; + transactionIndex: number; + logIndex: number; + removed: boolean; + args?: T; + block: EthereumBlock; +}; + +export type EthereumBlockWrapper = BlockWrapper< + EthereumBlock, + EthereumTransaction, + EthereumLog, + EthereumTransactionFilter, + EthereumLogFilter +>; diff --git a/packages/types/src/global.ts b/packages/types/src/global.ts index 94f7cc42..415a3e6a 100644 --- a/packages/types/src/global.ts +++ b/packages/types/src/global.ts @@ -1,15 +1,12 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -import {ApiPromise} from '@polkadot/api'; -import {ApiDecoration} from '@polkadot/api/types'; +import {Provider} from '@ethersproject/abstract-provider'; import Pino from 'pino'; import {Store, DynamicDatasourceCreator} from './interfaces'; -type ApiAt = ApiDecoration<'promise'> & {rpc: ApiPromise['rpc']}; - declare global { - const api: ApiAt; + const api: Provider; const logger: Pino.Logger; const store: Store; const createDynamicDatasource: DynamicDatasourceCreator; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index d0b173a6..04c03d57 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -3,3 +3,4 @@ export * from './interfaces'; export * from './project'; +export * from './ethereum'; diff --git a/packages/types/src/interfaces.ts b/packages/types/src/interfaces.ts index 801fc111..0d72799f 100644 --- a/packages/types/src/interfaces.ts +++ b/packages/types/src/interfaces.ts @@ -1,55 +1,63 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -import {AnyTuple, Codec} from '@polkadot/types-codec/types'; -import {GenericExtrinsic} from '@polkadot/types/extrinsic'; -import {EventRecord, SignedBlock} from '@polkadot/types/interfaces'; -import {IEvent} from '@polkadot/types/types'; +// import {ApiPromise} from '@polkadot/api'; +// import {ApiDecoration} from '@polkadot/api/types'; +import {Block} from '@ethersproject/abstract-provider'; +import { + EthereumBlock, + EthereumBlockWrapper, + EthereumLog, + EthereumLogFilter, + EthereumTransaction, + EthereumTransactionFilter, +} from './ethereum'; export interface Entity { id: string; } +// export type ApiAt = ApiDecoration<'promise'> & {rpc: ApiPromise['rpc']}; + export type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]; export interface Store { get(entity: string, id: string): Promise; - getByField(entity: string, field: string, value: any, options?: {offset?: number; limit?: number}): Promise; - getOneByField(entity: string, field: string, value: any): Promise; + getByField(entity: string, field: string, value): Promise; + getOneByField(entity: string, field: string, value): Promise; set(entity: string, id: string, data: Entity): Promise; bulkCreate(entity: string, data: Entity[]): Promise; - //if fields in provided, only specify fields will be updated - bulkUpdate(entity: string, data: Entity[], fields?: string[]): Promise; remove(entity: string, id: string): Promise; } -export interface SubstrateBlock extends SignedBlock { - // parent block's spec version, can be used to decide the correct metadata that should be used for this block. - specVersion: number; - timestamp: Date; - events: EventRecord[]; -} - -export interface SubstrateExtrinsic { - // index in the block - idx: number; - extrinsic: GenericExtrinsic; - block: SubstrateBlock; - events: TypedEventRecord[]; - success: boolean; +export interface BlockWrapper< + B extends EthereumBlock = EthereumBlock, + C extends EthereumTransaction = EthereumTransaction, + E extends EthereumLog = EthereumLog, + CF extends EthereumTransactionFilter = EthereumTransactionFilter, + EF extends EthereumLogFilter = EthereumLogFilter +> { + block: B; + blockHeight: number; + specVersion?: number; + hash: string; + calls?: (filters?: CF | CF[], ds?: any) => C[]; + transactions?: C[]; + events?: (filters?: EF | EF[], ds?: any) => E[]; + logs?: E[]; } -export interface SubstrateEvent extends TypedEventRecord { - // index in the block - idx: number; - extrinsic?: SubstrateExtrinsic; - block: SubstrateBlock; +export interface ApiWrapper { + init: () => Promise; + getGenesisHash: () => string; + getRuntimeChain: () => string; + getSpecName: () => string; + getFinalizedBlockHeight: () => Promise; + getLastHeight: () => Promise; + fetchBlocks: (bufferBlocks: number[]) => Promise; + freezeApi: (processor: any, blockContent?: BlockWrapper) => void; } export type DynamicDatasourceCreator = (name: string, args: Record) => Promise; - -export type TypedEventRecord = Omit & { - event: IEvent; -}; diff --git a/packages/types/src/project.ts b/packages/types/src/project.ts index 08b2e7ee..4b1aa200 100644 --- a/packages/types/src/project.ts +++ b/packages/types/src/project.ts @@ -1,30 +1,37 @@ // Copyright 2020-2022 OnFinality Limited authors & contributors // SPDX-License-Identifier: Apache-2.0 -import {ApiPromise} from '@polkadot/api'; -import {AnyTuple, RegistryTypes} from '@polkadot/types/types'; -import {SubstrateBlock, SubstrateEvent, SubstrateExtrinsic} from './interfaces'; - -export enum SubstrateDatasourceKind { - Runtime = 'substrate/Runtime', -} - -export enum SubstrateHandlerKind { - Block = 'substrate/BlockHandler', - Call = 'substrate/CallHandler', - Event = 'substrate/EventHandler', -} - -export type RuntimeHandlerInputMap = { - [SubstrateHandlerKind.Block]: SubstrateBlock; - [SubstrateHandlerKind.Event]: SubstrateEvent; - [SubstrateHandlerKind.Call]: SubstrateExtrinsic; +import {RegistryTypes} from '@polkadot/types/types'; +import { + EthereumBlock, + EthereumBlockFilter, + EthereumLog, + EthereumLogFilter, + EthereumTransaction, + EthereumTransactionFilter, +} from './ethereum'; +import {ApiWrapper} from './interfaces'; + +export enum EthereumDatasourceKind { + Runtime = 'ethereum/Runtime', +} + +export enum EthereumHandlerKind { + Block = 'ethereum/BlockHandler', + Call = 'ethereum/TransactionHandler', + Event = 'ethereum/LogHandler', +} + +export type EthereumRuntimeHandlerInputMap = { + [EthereumHandlerKind.Block]: EthereumBlock; + [EthereumHandlerKind.Call]: EthereumTransaction; + [EthereumHandlerKind.Event]: EthereumLog; }; -type RuntimeFilterMap = { - [SubstrateHandlerKind.Block]: SubstrateNetworkFilter; - [SubstrateHandlerKind.Event]: SubstrateEventFilter; - [SubstrateHandlerKind.Call]: SubstrateCallFilter; +type EthereumRuntimeFilterMap = { + [EthereumHandlerKind.Block]: EthereumBlockFilter; + [EthereumHandlerKind.Event]: EthereumLogFilter; + [EthereumHandlerKind.Call]: EthereumTransactionFilter; }; export interface ProjectManifest { @@ -39,66 +46,63 @@ export interface ProjectManifest { customTypes?: RegistryTypes; }; - dataSources: SubstrateDatasource[]; + dataSources: SubqlDatasource[]; } -// [startSpecVersion?, endSpecVersion?] closed range -export type SpecVersionRange = [number, number]; - -interface SubstrateBaseHandlerFilter { - specVersion?: SpecVersionRange; -} - -export interface SubstrateBlockFilter extends SubstrateBaseHandlerFilter { - modulo?: number; +export interface SubqlBlockHandler { + handler: string; + kind: EthereumHandlerKind.Block; + filter?: EthereumBlockFilter; } -export interface SubstrateEventFilter extends SubstrateBaseHandlerFilter { - module?: string; - method?: string; +export interface SubqlCallHandler { + handler: string; + kind: EthereumHandlerKind.Call; + filter?: EthereumTransactionFilter; } -export interface SubstrateCallFilter extends SubstrateEventFilter { - success?: boolean; +export interface SubqlEventHandler { + handler: string; + kind: EthereumHandlerKind.Event; + filter?: EthereumLogFilter; } -export type SubstrateBlockHandler = SubstrateCustomHandler; -export type SubstrateCallHandler = SubstrateCustomHandler; -export type SubstrateEventHandler = SubstrateCustomHandler; - -export interface SubstrateCustomHandler> { +export interface SubqlCustomHandler> { handler: string; kind: K; filter?: F; } -export type SubstrateRuntimeHandler = SubstrateBlockHandler | SubstrateCallHandler | SubstrateEventHandler; -export type SubstrateHandler = SubstrateRuntimeHandler | SubstrateCustomHandler; -export type SubstrateRuntimeHandlerFilter = SubstrateBlockFilter | SubstrateCallFilter | SubstrateEventFilter; +export type SubqlRuntimeHandler = SubqlBlockHandler | SubqlCallHandler | SubqlEventHandler; + +export type SubqlHandler = SubqlRuntimeHandler | SubqlCustomHandler; -export interface SubstrateMapping extends FileReference { +export type SubqlHandlerFilter = EthereumBlockFilter | EthereumTransactionFilter | EthereumLogFilter; + +export interface SubqlMapping { + file: string; handlers: T[]; } -interface ISubstrateDatasource { +interface ISubqlDatasource { name?: string; kind: string; - filter?: F; startBlock?: number; mapping: M; } -export interface SubstrateRuntimeDatasource< - M extends SubstrateMapping = SubstrateMapping -> extends ISubstrateDatasource { - kind: SubstrateDatasourceKind.Runtime; +export interface SubqlRuntimeDatasource = SubqlMapping> + extends ISubqlDatasource { + kind: EthereumDatasourceKind.Runtime; + options?: any; + assets?: Map; } -export interface SubstrateNetworkFilter { +export interface SubqlNetworkFilter { specName?: string; } -export type SubstrateDatasource = SubstrateRuntimeDatasource | SubstrateCustomDatasource; // | SubstrateBuiltinDataSource; +export type SubqlDatasource = SubqlRuntimeDatasource | SubqlCustomDatasource; // | SubqlBuiltinDataSource; export interface FileReference { file: string; @@ -108,120 +112,112 @@ export type CustomDataSourceAsset = FileReference; export type Processor = FileReference & {options?: O}; -export interface SubstrateCustomDatasource< +export interface SubqlCustomDatasource< K extends string = string, - T extends SubstrateNetworkFilter = SubstrateNetworkFilter, - M extends SubstrateMapping = SubstrateMapping, + M extends SubqlMapping = SubqlMapping, O = any -> extends ISubstrateDatasource { +> extends ISubqlDatasource { kind: K; assets: Map; processor: Processor; } -//export type SubstrateBuiltinDataSource = ISubstrateDatasource; +//export type SubqlBuiltinDataSource = ISubqlDatasource; export interface HandlerInputTransformer_0_0_0< - T extends SubstrateHandlerKind, + T extends EthereumHandlerKind, E, - IT extends AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource + DS extends SubqlCustomDatasource = SubqlCustomDatasource > { - (input: RuntimeHandlerInputMap[T], ds: DS, api: ApiPromise, assets?: Record): Promise; // | SubstrateBuiltinDataSource + (input: EthereumRuntimeHandlerInputMap[T], ds: DS, api: ApiWrapper, assets?: Record): Promise; // | SubstrateBuiltinDataSource } export interface HandlerInputTransformer_1_0_0< - T extends SubstrateHandlerKind, + T extends EthereumHandlerKind, F, E, - IT extends AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource + DS extends SubqlCustomDatasource = SubqlCustomDatasource > { (params: { - input: RuntimeHandlerInputMap[T]; + input: EthereumRuntimeHandlerInputMap[T]; ds: DS; filter?: F; - api: ApiPromise; + api: ApiWrapper; assets?: Record; }): Promise; // | SubstrateBuiltinDataSource } -type SecondLayerHandlerProcessorArray< +export interface DictionaryQueryCondition { + field: string; + value: string; +} + +export interface DictionaryQueryEntry { + entity: string; + conditions: DictionaryQueryCondition[]; +} + +export type SecondLayerHandlerProcessorArray< K extends string, - F extends SubstrateNetworkFilter, + F, T, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource + DS extends SubqlCustomDatasource = SubqlCustomDatasource > = - | SecondLayerHandlerProcessor - | SecondLayerHandlerProcessor - | SecondLayerHandlerProcessor; + | SecondLayerHandlerProcessor + | SecondLayerHandlerProcessor + | SecondLayerHandlerProcessor; -export interface SubstrateDatasourceProcessor< +export interface SubqlDatasourceProcessor< K extends string, - F extends SubstrateNetworkFilter, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource, - P extends Record> = Record< + F, + DS extends SubqlCustomDatasource = SubqlCustomDatasource, + P extends Record> = Record< string, - SecondLayerHandlerProcessorArray + SecondLayerHandlerProcessorArray > > { kind: K; validate(ds: DS, assets: Record): void; - dsFilterProcessor(ds: DS, api: ApiPromise): boolean; + dsFilterProcessor(ds: DS, api: ApiWrapper): boolean; handlerProcessors: P; } -export interface DictionaryQueryCondition { - field: string; - value: string; -} - -export interface DictionaryQueryEntry { - entity: string; - conditions: DictionaryQueryCondition[]; -} - interface SecondLayerHandlerProcessorBase< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource + DS extends SubqlCustomDatasource = SubqlCustomDatasource > { baseHandlerKind: K; - baseFilter: RuntimeFilterMap[K] | RuntimeFilterMap[K][]; + baseFilter: EthereumRuntimeFilterMap[K] | EthereumRuntimeFilterMap[K][]; filterValidator: (filter?: F) => void; dictionaryQuery?: (filter: F, ds: DS) => DictionaryQueryEntry | undefined; } -// only allow one custom handler for each baseHandler kind export interface SecondLayerHandlerProcessor_0_0_0< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, E, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource + DS extends SubqlCustomDatasource = SubqlCustomDatasource > extends SecondLayerHandlerProcessorBase { specVersion: undefined; - transformer: HandlerInputTransformer_0_0_0; - filterProcessor: (filter: F | undefined, input: RuntimeHandlerInputMap[K], ds: DS) => boolean; + transformer: HandlerInputTransformer_0_0_0; + filterProcessor: (filter: F | undefined, input: EthereumRuntimeHandlerInputMap[K], ds: DS) => boolean; } export interface SecondLayerHandlerProcessor_1_0_0< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, E, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource + DS extends SubqlCustomDatasource = SubqlCustomDatasource > extends SecondLayerHandlerProcessorBase { specVersion: '1.0.0'; - transformer: HandlerInputTransformer_1_0_0; - filterProcessor: (params: {filter: F | undefined; input: RuntimeHandlerInputMap[K]; ds: DS}) => boolean; + transformer: HandlerInputTransformer_1_0_0; + filterProcessor: (params: {filter: F | undefined; input: EthereumRuntimeHandlerInputMap[K]; ds: DS}) => boolean; } export type SecondLayerHandlerProcessor< - K extends SubstrateHandlerKind, + K extends EthereumHandlerKind, F, E, - IT extends AnyTuple = AnyTuple, - DS extends SubstrateCustomDatasource = SubstrateCustomDatasource -> = SecondLayerHandlerProcessor_0_0_0 | SecondLayerHandlerProcessor_1_0_0; + DS extends SubqlCustomDatasource = SubqlCustomDatasource +> = SecondLayerHandlerProcessor_0_0_0 | SecondLayerHandlerProcessor_1_0_0; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index b9875beb..c5e7a6a7 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "strictNullChecks": true, - "noImplicitAny": true, "tsBuildInfoFile": "dist/.tsbuildinfo", "rootDir": "src", "outDir": "dist" diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md deleted file mode 100644 index 80756cbc..00000000 --- a/packages/utils/CHANGELOG.md +++ /dev/null @@ -1,27 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -All logs must start with the format: [x.y.z] - yyyy-mm-dd - -## [Unreleased] - -## [1.1.0] - 2022-08-11 -### Changed -- Update `@polkadot/util` to v10 (#1230) - -## [1.0.1] - 2022-07-05 -### Fixed -- Tidy up dependency, move `ipfs-http-client` to common packages (#1160) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.1.0] - 2022-05-06 -### Changed -- Update polkadot/api to 9 - - - diff --git a/packages/utils/README.md b/packages/utils/README.md deleted file mode 100644 index 1169f252..00000000 --- a/packages/utils/README.md +++ /dev/null @@ -1 +0,0 @@ -# manifest-spec diff --git a/packages/utils/package.json b/packages/utils/package.json deleted file mode 100644 index 16569849..00000000 --- a/packages/utils/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@subql/utils", - "version": "1.1.0", - "description": "", - "packageManager": "yarn@3.1.1", - "scripts": { - "build": "tsc -b" - }, - "homepage": "https://github.com/subquery/subql", - "repository": "github:subquery/subql", - "author": "SubQuery Pty. Limited", - "main": "dist/index.js", - "license": "Apache-2.0", - "dependencies": { - "@polkadot/util": "^10", - "ansi-styles": "^6.1.0", - "axios": "^0.27.1", - "chalk": "^4.1.2", - "detect-port": "^1.3.0", - "flatted": "^3.2.5", - "graphql": "^15.8.0", - "graphql-tag": "^2.12.6", - "pino": "^6.13.3", - "rotating-file-stream": "^3.0.2", - "semver": "^7.3.7", - "sequelize": "^6.15.0", - "tar": "^6.1.11" - }, - "devDependencies": { - "@types/semver": "^7" - } -} diff --git a/packages/utils/src/graphql/builder.spec.ts b/packages/utils/src/graphql/builder.spec.ts deleted file mode 100644 index d716fda0..00000000 --- a/packages/utils/src/graphql/builder.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {validate} from 'graphql/validation'; -import {buildQuery, GqlNode, GqlVar} from './builder'; - -describe('build gql', () => { - it('gql 1', () => { - const vars: GqlVar[] = [ - { - name: 'e_1_value', - gqlType: 'String!', - value: 'balances', - }, - ]; - const nodes: GqlNode[] = [ - { - entity: 'specVersions', - args: { - filter: { - blockHeight: {greaterThanOrEqualTo: '"1000"', lessThan: '"100000"'}, - }, - }, - project: [ - { - entity: 'nodes', - project: ['id', 'blockHeight'], - }, - ], - }, - { - entity: 'events', - args: { - filter: { - blockHeight: {greaterThanOrEqualTo: '"1000"', lessThan: '"100000"'}, - or: [ - { - and: [{module: {equalTo: '$e_1_value'}}, {event: {equalTo: '"Transfer"'}}], - }, - ], - }, - orderBy: 'BLOCK_HEIGHT_ASC', - first: '100', - }, - project: [ - { - entity: 'nodes', - project: ['blockHeight'], - }, - ], - }, - ]; - const {query, variables} = buildQuery(vars, nodes); - expect(variables.e_1_value).toBe('balances'); - expect(query).toMatch(/query\(\$e_1_value:String!\)/); - }); -}); diff --git a/packages/utils/src/graphql/builder.ts b/packages/utils/src/graphql/builder.ts deleted file mode 100644 index efed2092..00000000 --- a/packages/utils/src/graphql/builder.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export interface GqlVar { - name: string; - gqlType: string; - value: unknown; -} - -export interface GqlNode { - // type?: "interface" | "union"; - entity: string; - project?: Array; - args?: Record; -} - -export interface GqlQuery { - query: string; - variables: Record; -} - -function buildArgs(args: Record): string { - return Object.keys(args) - .map((argKey) => { - const argValue = args[argKey]; - if (typeof argValue === 'string') { - return `${argKey}:${argValue}`; - } else if (argValue instanceof Array) { - return `${argKey}:[${argValue - .map((nested) => { - if (typeof nested === 'string') { - return nested; - } else if (nested instanceof Array) { - throw new Error('not supported'); - } else if (typeof nested === 'object') { - return `{${buildArgs(nested)}}`; - } - throw new Error('not supported'); - }) - .join(',')}]`; - } else if (typeof argValue === 'object') { - return `${argKey}:{${buildArgs(argValue as Record)}}`; - } else { - throw new Error('graphql args not supported'); - } - }) - .join(','); -} - -const bindProjections = (node: GqlNode): string => { - return `${node.entity} ${node.args ? `(${buildArgs(node.args)})` : ``}${ - node.project - ? `{${node.project - .map((el: GqlNode | string) => { - if (typeof el === 'string') { - return `${el} `; - } - return `${bindProjections(el)} `; - }) - .join('')}} ` - : `` - }`; -}; - -const toVarDefs = (vars: GqlVar[]): string => { - return vars && vars.length ? `(${vars.map((item) => `$${item.name}:${item.gqlType}`)})` : ``; -}; - -const toVariables = (vars: GqlVar[]) => - vars.reduce((acc, v) => { - if (acc[v.name]) { - throw new Error(`Graphql variables conflicts $${v.name}`); - } - acc[v.name] = v.value; - return acc; - }, {} as Record); - -export function buildQuery(vars: GqlVar[], nodes: GqlNode[]): GqlQuery { - return { - query: `query${toVarDefs(vars)}{${nodes.map((node) => bindProjections(node)).join(' ')}}`, - variables: toVariables(vars), - }; -} diff --git a/packages/utils/src/graphql/constant.ts b/packages/utils/src/graphql/constant.ts deleted file mode 100644 index 781ed07f..00000000 --- a/packages/utils/src/graphql/constant.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export enum DirectiveName { - DerivedFrom = 'derivedFrom', - Entity = 'entity', - JsonField = 'jsonField', -} diff --git a/packages/utils/src/graphql/entities.ts b/packages/utils/src/graphql/entities.ts deleted file mode 100644 index b513d374..00000000 --- a/packages/utils/src/graphql/entities.ts +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import assert from 'assert'; -import { - assertListType, - getDirectiveValues, - getNullableType, - GraphQLEnumType, - GraphQLField, - GraphQLNamedType, - GraphQLObjectType, - GraphQLOutputType, - GraphQLSchema, - isEnumType, - isInterfaceType, - isListType, - isNonNullType, - isObjectType, - isUnionType, -} from 'graphql'; -import {getTypeByScalarName} from '../types'; -import {DirectiveName} from './constant'; -import {buildSchemaFromFile} from './schema'; -import { - FieldScalar, - GraphQLEntityField, - GraphQLJsonFieldType, - GraphQLJsonObjectType, - GraphQLModelsRelationsEnums, - GraphQLModelsType, - GraphQLRelationsType, - IndexType, -} from './types'; - -export function getAllJsonObjects(_schema: GraphQLSchema | string): GraphQLObjectType[] { - return Object.values(getSchema(_schema).getTypeMap()) - .filter((node) => node.astNode?.directives?.find(({name: {value}}) => value === DirectiveName.JsonField)) - .map((node) => node) - .filter(isObjectType); -} - -export function getAllEnums(_schema: GraphQLSchema | string): GraphQLEnumType[] { - return getEnumsFromSchema(getSchema(_schema)); -} - -// eslint-disable-next-line complexity -export function getAllEntitiesRelations(_schema: GraphQLSchema | string): GraphQLModelsRelationsEnums { - const schema = getSchema(_schema); - const entities = Object.values(schema.getTypeMap()) - .filter((node) => node.astNode?.directives?.find(({name: {value}}) => value === DirectiveName.Entity)) - .filter(isObjectType); - - const jsonObjects = getAllJsonObjects(schema); - - const entityNameSet = entities.map((entity) => entity.name); - - const enums = new Map( - getEnumsFromSchema(schema).map((node) => [ - node.name, - {name: node.name, description: node.description, values: node.getValues().map((v) => v.value)}, - ]) - ); - - const modelRelations = {models: [], relations: [], enums: [...enums.values()]} as GraphQLModelsRelationsEnums; - const derivedFrom = schema.getDirective('derivedFrom'); - const indexDirective = schema.getDirective('index'); - for (const entity of entities) { - const newModel: GraphQLModelsType = { - name: entity.name, - description: entity.description, - fields: [], - indexes: [], - }; - - for (const field of Object.values(entity.getFields())) { - const typeString = extractType(field.type); - const derivedFromDirectValues = getDirectiveValues(derivedFrom, field.astNode); - const indexDirectiveVal = getDirectiveValues(indexDirective, field.astNode); - //If is a basic scalar type - const typeClass = getTypeByScalarName(typeString); - if (typeClass?.fieldScalar) { - newModel.fields.push(packEntityField(typeString, field, false)); - } - // If is an enum - else if (enums.has(typeString)) { - newModel.fields.push({ - type: typeString, - description: field.description, - isEnum: true, - isArray: isListType(isNonNullType(field.type) ? getNullableType(field.type) : field.type), - nullable: !isNonNullType(field.type), - name: field.name, - }); - } - // If is a foreign key - else if (entityNameSet.includes(typeString) && !derivedFromDirectValues) { - newModel.fields.push(packEntityField(typeString, field, true)); - modelRelations.relations.push({ - from: entity.name, - type: 'belongsTo', - to: typeString, - foreignKey: `${field.name}Id`, - } as GraphQLRelationsType); - newModel.indexes.push({ - unique: false, - fields: [`${field.name}Id`], - using: IndexType.HASH, - }); - } - // If is derivedFrom - else if (entityNameSet.includes(typeString) && derivedFromDirectValues) { - modelRelations.relations.push({ - from: entity.name, - type: isListType(isNonNullType(field.type) ? getNullableType(field.type) : field.type) ? 'hasMany' : 'hasOne', - to: typeString, - foreignKey: `${derivedFromDirectValues.field}Id`, - fieldName: field.name, - } as GraphQLRelationsType); - } - // If is jsonField - else if (jsonObjects.map((json) => json.name).includes(typeString)) { - const jsonObject = setJsonObjectType( - jsonObjects.find((object) => object.name === typeString), - jsonObjects - ); - newModel.fields.push(packJSONField(typeString, field, jsonObject)); - newModel.indexes.push({ - unique: false, - fields: [field.name], - using: IndexType.GIN, - }); - } else { - throw new Error(`${typeString} is not an valid type`); - } - // handle indexes - if (indexDirectiveVal) { - if (typeString !== 'ID' && typeClass) { - newModel.indexes.push({ - unique: indexDirectiveVal.unique, - fields: [field.name], - }); - } else if (typeString !== 'ID' && entityNameSet.includes(typeString)) { - if (indexDirectiveVal.unique) { - const fkIndex = newModel.indexes.find( - (idx) => idx.fields.length === 1 && idx.fields[0] === `${field.name}Id` - ); - if (fkIndex) { - fkIndex.unique = true; - } - } - } else { - throw new Error(`index can not be added on field ${field.name}`); - } - } - } - modelRelations.models.push(newModel); - } - validateRelations(modelRelations); - return modelRelations; -} - -function packEntityField( - typeString: FieldScalar | string, - field: GraphQLField, - isForeignKey: boolean -): GraphQLEntityField { - return { - name: isForeignKey ? `${field.name}Id` : field.name, - type: isForeignKey ? FieldScalar.String : typeString, - description: field.description, - isArray: isListType(isNonNullType(field.type) ? getNullableType(field.type) : field.type), - nullable: !isNonNullType(field.type), - isEnum: false, - }; -} - -function packJSONField( - typeString: string, - field: GraphQLField, - jsonObject: GraphQLJsonObjectType -): GraphQLEntityField { - return { - name: field.name, - type: 'Json', - description: field.description, - jsonInterface: jsonObject, - isArray: isListType(isNonNullType(field.type) ? getNullableType(field.type) : field.type), - nullable: !isNonNullType(field.type), - isEnum: false, - }; -} - -export function setJsonObjectType( - jsonObject: GraphQLObjectType, - jsonObjects: GraphQLObjectType[] -): GraphQLJsonObjectType { - const graphQLJsonObject: GraphQLJsonObjectType = { - name: jsonObject.name, - fields: [], - }; - for (const field of Object.values(jsonObject.getFields())) { - //check if field is also json - const typeString = extractType(field.type); - const isJsonType = jsonObjects.map((json) => json.name).includes(typeString); - graphQLJsonObject.fields.push({ - name: field.name, - type: isJsonType ? 'Json' : extractType(field.type), - jsonInterface: isJsonType - ? setJsonObjectType( - jsonObjects.find((object) => object.name === typeString), - jsonObjects - ) - : undefined, - nullable: !isNonNullType(field.type), - isArray: isListType(isNonNullType(field.type) ? getNullableType(field.type) : field.type), - } as GraphQLJsonFieldType); - } - return graphQLJsonObject; -} - -function getSchema(_schema: GraphQLSchema | string): GraphQLSchema { - return typeof _schema === 'string' ? buildSchemaFromFile(_schema) : _schema; -} - -function getEnumsFromSchema(schema: GraphQLSchema): GraphQLEnumType[] { - return Object.values(schema.getTypeMap()) - .filter((r) => r.astNode !== undefined) - .filter(isEnumType); -} - -//Get the type, ready to be convert to string -function extractType(type: GraphQLOutputType): string { - if (isUnionType(type)) { - throw new Error(`Not support Union type`); - } - if (isInterfaceType(type)) { - throw new Error(`Not support Interface type`); - } - const offNullType = isNonNullType(type) ? getNullableType(type) : type; - const offListType = isListType(offNullType) ? assertListType(offNullType).ofType : type; - return isNonNullType(offListType) - ? (getNullableType(offListType) as unknown as GraphQLNamedType).name - : offListType.name; -} - -function validateRelations(modelRelations: GraphQLModelsRelationsEnums): void { - for (const r of modelRelations.relations.filter((model) => model.type === 'hasMany' || model.type === 'hasOne')) { - assert( - modelRelations.models.find( - (model) => model.name === r.to && model.fields.find((field) => field.name === r.foreignKey) - ), - `Please check entity ${r.from} with field ${r.fieldName} has correct relation with entity ${r.to}` - ); - } -} diff --git a/packages/utils/src/graphql/graphql.spec.ts b/packages/utils/src/graphql/graphql.spec.ts deleted file mode 100644 index 9d45f536..00000000 --- a/packages/utils/src/graphql/graphql.spec.ts +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import gql from 'graphql-tag'; -import {getAllEntitiesRelations} from './entities'; -import {buildSchemaFromDocumentNode} from './schema'; - -describe('utils that handle schema.graphql', () => { - it('support @entity annotation in the schema', () => { - const graphqlSchema = gql` - type KittyBirthInfo @entity { - id: ID! - birthBlockHeight: BigInt! - owner: String! - birthAt: Date! - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - expect(schema).toBeTruthy(); - expect(Object.keys(schema.getTypeMap())).toContain('KittyBirthInfo'); - }); - it('can extract entities from the schema', () => { - const graphqlSchema = gql` - type KittyBirthInfo @entity { - id: ID! - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - const entities = getAllEntitiesRelations(schema); - expect(entities.models).toMatchObject([{name: 'KittyBirthInfo'}]); - expect(entities.models[0].fields).toEqual([ - {isArray: false, name: 'id', nullable: false, type: 'ID', isEnum: false}, - ]); - }); - - it('throw error for unsupported types', () => { - const graphqlSchema = gql` - type Test @entity { - id: ID! - price: Double - } - `; - expect(() => buildSchemaFromDocumentNode(graphqlSchema)).toThrow(); - }); - - it('support Bytes and Float types', () => { - const graphqlSchema = gql` - type Test @entity { - id: ID! - hash: Bytes - rate: Float - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - const entities = getAllEntitiesRelations(schema); - expect(entities.models[0].fields[1].type).toBe('Bytes'); - expect(entities.models[0].fields[2].type).toBe('Float'); - }); - - it('throw error for union/enum/interface type', () => { - const graphqlSchema = gql` - type Test @entity { - id: ID! - unionKind: unionResult - enumKind: enumResult - who: Character - } - interface Character { - id: ID! - name: String! - } - union unionResult = Human | Droid | Starship - type Human @entity { - id: ID! - } - type Droid @entity { - id: ID! - } - type Starship @entity { - id: ID! - } - enum enumResult { - NEWHOPE - EMPIRE - JEDI - } - `; - expect(() => { - const schema = buildSchemaFromDocumentNode(graphqlSchema); - getAllEntitiesRelations(schema); - }).toThrow(/Not support/); - }); - - it('can extract nested models and relations from the schema', () => { - const graphqlSchema = gql` - type Account @entity { - id: ID! - identity: Identity! @derivedFrom(field: "account") - transfers: [Transfer] @derivedFrom(field: "from") - } - type Transfer @entity { - id: ID! - from: Account! - } - type Identity @entity { - id: ID! - account: Account! - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - const entities = getAllEntitiesRelations(schema); - expect(entities.models).toMatchObject([ - { - name: 'Account', - fields: [{name: 'id', type: 'ID', isArray: false, nullable: false}], - }, - { - name: 'Transfer', - fields: [ - {name: 'id', type: 'ID', isArray: false, nullable: false}, - {name: 'fromId', type: 'String', isArray: false, nullable: false}, - ], - }, - { - name: 'Identity', - fields: [ - {name: 'id', type: 'ID', isArray: false, nullable: false}, - { - name: 'accountId', - type: 'String', - isArray: false, - nullable: false, - }, - ], - }, - ]); - - expect(entities.relations).toMatchObject([ - { - from: 'Account', - type: 'hasOne', - to: 'Identity', - foreignKey: 'accountId', - fieldName: 'identity', - }, - { - from: 'Account', - type: 'hasMany', - to: 'Transfer', - foreignKey: 'fromId', - fieldName: 'transfers', - }, - { - from: 'Transfer', - type: 'belongsTo', - to: 'Account', - foreignKey: 'fromId', - }, - { - from: 'Identity', - type: 'belongsTo', - to: 'Account', - foreignKey: 'accountId', - }, - ]); - }); - - it('throw error if derivedFrom field with missing field name in corresponding entity', () => { - const graphqlSchema = gql` - type Account @entity { - id: ID! - transfers: [Transfer] @derivedFrom(field: "from") - } - type Transfer @entity { - id: ID! - #from: Account! # If this is missing - to: Account! - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - expect(() => getAllEntitiesRelations(schema)).toThrow( - 'Please check entity Account with field transfers has correct relation with entity Transfer' - ); - }); - - it('can extract indexed fields from the schema', () => { - const graphqlSchema = gql` - type TestEntity @entity { - id: ID! - column1: String @index - column2: BigInt @index(unique: true) - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - const entities = getAllEntitiesRelations(schema); - expect(entities.models?.[0].indexes).toHaveLength(2); - expect(entities.models?.[0].indexes[0].fields).toEqual(['column1']); - expect(entities.models?.[0].indexes[0].unique).toBeUndefined(); - expect(entities.models?.[0].indexes[1].fields).toEqual(['column2']); - expect(entities.models?.[0].indexes[1].unique).toBe(true); - }); - - it('throw if add index on pk', () => { - const graphqlSchema = gql` - type TestEntity @entity { - id: ID! @index - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - expect(() => getAllEntitiesRelations(schema)).toThrow(/^index can not be added on field id/); - }); - - it('can extract indexed fields from foreign field', () => { - const graphqlSchema = gql` - type Fruit @entity { - id: ID! - apple: Apple - banana: [Banana] @index(unique: true) - } - type Fruit2 @entity { - id: ID! - apple: Apple @index - } - type Apple @entity { - id: ID! - } - type Banana @entity { - id: ID! - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - const entities = getAllEntitiesRelations(schema); - expect(entities.models?.[0].indexes[0].fields).toEqual(['appleId']); - expect(entities.models?.[0].indexes[0].using).toEqual('hash'); - expect(entities.models?.[0].indexes[0].unique).toBe(false); - expect(entities.models?.[0].indexes[1].unique).toBe(true); - expect(entities.models?.[1].indexes[0].fields).toEqual(['appleId']); - expect(entities.models?.[1].indexes[0].unique).toBe(false); - }); - - it('can read jsonfield', () => { - const graphqlSchema = gql` - type MyJson @jsonField { - data: String! - data2: [String] - data3: MyJson2 - } - type MyJson2 @jsonField { - data4: String! - } - type Account @entity { - field6: [MyJson]! - } - `; - const schema = buildSchemaFromDocumentNode(graphqlSchema); - const accountModel = getAllEntitiesRelations(schema).models.find((model) => model.name === 'Account'); - expect(accountModel.fields[0].type).toBe('Json'); - expect(accountModel.fields[0].jsonInterface.name).toBe('MyJson'); - expect(accountModel.fields[0].isArray).toBeTruthy(); - expect(accountModel.fields[0].jsonInterface.fields[0].nullable).toBeFalsy(); - expect(accountModel.fields[0].jsonInterface.fields[1].isArray).toBeTruthy(); - // allow json in json - expect(accountModel.fields[0].jsonInterface.fields[2].type).toBe('Json'); - expect(accountModel.fields[0].jsonInterface.fields[2].jsonInterface.name).toBe('MyJson2'); - }); -}); diff --git a/packages/utils/src/graphql/index.ts b/packages/utils/src/graphql/index.ts deleted file mode 100644 index 7b4d8990..00000000 --- a/packages/utils/src/graphql/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './entities'; -export * from './schema'; -export * from './types'; -export * from './builder'; diff --git a/packages/utils/src/graphql/schema.ts b/packages/utils/src/graphql/schema.ts deleted file mode 100644 index 6e25bb2a..00000000 --- a/packages/utils/src/graphql/schema.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import {buildASTSchema, DocumentNode, extendSchema, GraphQLSchema, parse, Source} from 'graphql'; -import {directives} from './schema/directives'; -import {scalas} from './schema/scalas'; - -function loadBaseSchema(): GraphQLSchema { - const schema = buildASTSchema(scalas); - return extendSchema(schema, directives); -} - -export function buildSchemaFromFile(path: string): GraphQLSchema { - return buildSchemaFromString(fs.readFileSync(path).toString()); -} - -export function buildSchemaFromString(raw: string): GraphQLSchema { - const src = new Source(raw); - const doc = parse(src); - return buildSchemaFromDocumentNode(doc); -} - -export function buildSchemaFromDocumentNode(doc: DocumentNode): GraphQLSchema { - return extendSchema(loadBaseSchema(), doc); -} diff --git a/packages/utils/src/graphql/schema/directives.ts b/packages/utils/src/graphql/schema/directives.ts deleted file mode 100644 index 9dad4545..00000000 --- a/packages/utils/src/graphql/schema/directives.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import gql from 'graphql-tag'; - -export const directives = gql` - directive @derivedFrom(field: String!) on FIELD_DEFINITION - directive @entity on OBJECT - directive @jsonField on OBJECT - directive @index(unique: Boolean) on FIELD_DEFINITION -`; diff --git a/packages/utils/src/graphql/schema/scalas.ts b/packages/utils/src/graphql/schema/scalas.ts deleted file mode 100644 index 51e6f455..00000000 --- a/packages/utils/src/graphql/schema/scalas.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import gql from 'graphql-tag'; - -export const scalas = gql` - scalar BigInt - scalar BigDecimal - scalar Date - scalar Bytes - scalar Float -`; diff --git a/packages/utils/src/graphql/types.ts b/packages/utils/src/graphql/types.ts deleted file mode 100644 index 4117c466..00000000 --- a/packages/utils/src/graphql/types.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export interface GraphQLJsonObjectType { - name: string; - fields: GraphQLJsonFieldType[]; -} - -export interface GraphQLJsonFieldType { - name: string; - type: Exclude | 'Json'; - jsonInterface?: GraphQLJsonObjectType; - nullable: boolean; - isArray: boolean; -} - -export interface GraphQLModelsRelationsEnums { - models: GraphQLModelsType[]; - - relations: GraphQLRelationsType[]; - - enums: GraphQLEnumsType[]; -} - -export interface GraphQLEnumsType { - name: string; - - values: string[]; - - description?: string; -} - -export interface GraphQLModelsType { - name: string; - - fields: GraphQLEntityField[]; - - indexes: GraphQLEntityIndex[]; - - description?: string; -} - -export interface GraphQLEntityField { - name: string; - - type: string; - - jsonInterface?: GraphQLJsonObjectType; - - isArray: boolean; - - nullable: boolean; - - isEnum: boolean; - - description?: string; -} - -export enum IndexType { - BTREE = 'btree', - HASH = 'hash', - GIST = 'gist', - SPGIST = 'spgist', - GIN = 'gin', - BRIN = 'brin', -} - -export interface GraphQLEntityIndex { - fields: string[]; - - unique?: boolean; - - using?: IndexType; -} - -export interface GraphQLRelationsType { - from: string; - - type: 'hasOne' | 'hasMany' | 'belongsTo'; - - to: string; - - foreignKey: string; - - fieldName?: string; -} - -export enum FieldScalar { - ID = 'ID', - Int = 'Int', - BigInt = 'BigInt', - String = 'String', - Date = 'Date', - Boolean = 'Boolean', - Bytes = 'Bytes', - Float = 'Float', -} diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts deleted file mode 100644 index aae093dd..00000000 --- a/packages/utils/src/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './graphql'; -export {levelFilter, Logger, LoggerOption} from './logger'; -export * from './query'; -export * from './types'; diff --git a/packages/utils/src/logger/colors.spec.ts b/packages/utils/src/logger/colors.spec.ts deleted file mode 100644 index e76b7a41..00000000 --- a/packages/utils/src/logger/colors.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {colorizeLevel} from './colors'; - -describe('LoggerColorLevel', () => { - it('returns default for an unsupported level number', () => { - const level = colorizeLevel(5); - expect(level).toBe('\x1b[37mUSERLVL\x1b[39m'); - }); - - it('returns the correct level for a level number', () => { - const level = colorizeLevel(60); - expect(level).toBe('\x1b[41mFATAL\x1b[49m'); - }); -}); diff --git a/packages/utils/src/logger/colors.ts b/packages/utils/src/logger/colors.ts deleted file mode 100644 index 394fb57b..00000000 --- a/packages/utils/src/logger/colors.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import chalk from 'chalk'; -import {LEVELS} from './constants'; - -export const ctx = new chalk.Instance({level: 3}); -const colored: Record = { - default: ctx.white, - 60: ctx.bgRed, - 50: ctx.red, - 40: ctx.yellow, - 30: ctx.green, - 20: ctx.blue, - 10: ctx.grey, - message: ctx.cyan, -}; - -function isColouredValue(level: number | string): level is keyof typeof LEVELS { - return Number.isInteger(+level) && level in colored; -} - -export function colorizeLevel(level: number): string { - if (isColouredValue(level) && Object.prototype.hasOwnProperty.call(LEVELS, level)) { - return colored[level](LEVELS[level]); - } - return colored.default(LEVELS.default); -} diff --git a/packages/utils/src/logger/constants.ts b/packages/utils/src/logger/constants.ts deleted file mode 100644 index 7eaefb8f..00000000 --- a/packages/utils/src/logger/constants.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export const LEVELS = { - default: 'USERLVL', - 60: 'FATAL', - 50: 'ERROR', - 40: 'WARN', - 30: 'INFO', - 20: 'DEBUG', - 10: 'TRACE', -}; - -export const LEVELS_MAP = { - trace: 10, - debug: 20, - info: 30, - warn: 40, - error: 50, - fatal: 60, - silent: 999, -}; diff --git a/packages/utils/src/logger/index.ts b/packages/utils/src/logger/index.ts deleted file mode 100644 index c02ed8dd..00000000 --- a/packages/utils/src/logger/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './logger'; -export * from './util'; diff --git a/packages/utils/src/logger/logger.ts b/packages/utils/src/logger/logger.ts deleted file mode 100644 index 85667d16..00000000 --- a/packages/utils/src/logger/logger.ts +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import fs from 'fs'; -import path from 'path'; -import {stringify} from 'flatted'; -import Pino, {LevelWithSilent} from 'pino'; -import {createStream} from 'rotating-file-stream'; -import {colorizeLevel, ctx} from './colors'; -export interface LoggerOption { - level?: string; - filepath?: string; - rotate?: boolean; - nestedKey?: string; - outputFormat?: 'json' | 'colored'; -} - -export class Logger { - private pino: Pino.Logger; - private childLoggers: {[category: string]: Pino.Logger} = {}; - - constructor({filepath, level: logLevel = 'info', nestedKey, outputFormat, rotate}: LoggerOption) { - const options = { - messageKey: 'message', - timestamp: () => `,"timestamp":"${new Date().toISOString()}"`, - nestedKey, - level: logLevel, - formatters: { - level(label, number) { - return {level: label}; - }, - }, - serializers: - outputFormat === 'json' - ? { - payload: (value) => { - if (value instanceof Error) { - return { - type: 'error', - name: value.name, - message: value.message, - stack: value.stack, - }; - } else { - return stringify(value); - } - }, - } - : {}, - prettyPrint: outputFormat !== 'json', - prettifier: function (options: unknown) { - // `this` is bound to the pino instance - // Deal with whatever options are supplied. - return function prettifier(inputData: string | object) { - let logObject; - if (typeof inputData === 'string') { - logObject = JSON.parse(inputData); - } else if (isObject(inputData)) { - logObject = inputData; - } - if (!logObject) return inputData; - // implement prettification - const {category, level, message, payload, time} = logObject; - let error = ''; - if (payload instanceof Error) { - if (['debug', 'trace'].includes(logLevel)) { - error = `\n${payload.stack}`; - } else { - error = `${payload.name}: ${payload.message}`; - } - } - return `${time} <${ctx.magentaBright(category)}> ${colorizeLevel(level)} ${message} ${error}\n`; - }; - - function isObject(input: unknown): boolean { - return Object.prototype.toString.apply(input) === '[object Object]'; - } - }, - } as Pino.LoggerOptions; - - if (filepath) { - const baseName = path.basename(filepath); - const dirName = path.dirname(path.resolve(filepath)); - - const rotateOptions = { - interval: '1d', - maxFiles: 7, - maxSize: '1G', - }; - - if (rotate) { - this.pino = Pino(options, createStream(baseName, {path: dirName, ...rotateOptions})); - } else { - this.pino = Pino(options, createStream(baseName, {path: dirName})); - } - } else { - this.pino = Pino(options); - } - } - - getLogger(category: string): Pino.Logger { - if (!this.childLoggers[category]) { - this.childLoggers[category] = this.pino.child({category}); - } - return this.childLoggers[category]; - } - - setLevel(level: LevelWithSilent): void { - this.pino.level = level; - } -} diff --git a/packages/utils/src/logger/util.ts b/packages/utils/src/logger/util.ts deleted file mode 100644 index 8dd7fc12..00000000 --- a/packages/utils/src/logger/util.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {LevelWithSilent} from 'pino'; -import {LEVELS_MAP} from './constants'; - -export function levelFilter(test: LevelWithSilent, target: LevelWithSilent): boolean { - return LEVELS_MAP[test?.toLowerCase()] >= LEVELS_MAP[target.toLowerCase()]; -} diff --git a/packages/utils/src/query/index.ts b/packages/utils/src/query/index.ts deleted file mode 100644 index 289b9622..00000000 --- a/packages/utils/src/query/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './types'; diff --git a/packages/utils/src/query/types.ts b/packages/utils/src/query/types.ts deleted file mode 100644 index 076ceddd..00000000 --- a/packages/utils/src/query/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export type TableEstimate = { - table: string; - estimate: number; -}; - -export type MetaData = { - lastProcessedHeight: number; - lastProcessedTimestamp: number; - targetHeight: number; - chain: string; - specName: string; - genesisHash: string; - indexerHealthy: boolean; - indexerNodeVersion: string; - queryNodeVersion: string; - rowCountEstimate: [TableEstimate]; -}; - -export type TerraMetaData = { - lastProcessedHeight: number; - lastProcessedTimestamp: number; - targetHeight: number; - chain: string; // Was a bug in the dictionary, should have been chainId - indexerHealthy: boolean; - indexerNodeVersion: string; - queryNodeVersion: string; -}; diff --git a/packages/utils/src/types/TypeClass.ts b/packages/utils/src/types/TypeClass.ts deleted file mode 100644 index a19c7325..00000000 --- a/packages/utils/src/types/TypeClass.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import assert from 'assert'; -import {DataTypes} from 'sequelize'; -type ValueOf = T[keyof T]; -export type SequelizeTypes = string | ValueOf; - -export class TypeClass { - constructor( - public name: string, - private _hashCode: (data: unknown) => Uint8Array, - private _tsType?: string, - private _fieldScalar?: string, - private _sequelizeType?: SequelizeTypes - ) {} - get tsType(): string | undefined { - return this._tsType; - } - get fieldScalar(): string | undefined { - return this._fieldScalar; - } - get sequelizeType(): SequelizeTypes { - assert(this._sequelizeType !== undefined, `Type ${this.name} associated sequelize type is not supported`); - return this._sequelizeType; - } - hashCode(data: any): Uint8Array { - if (this._hashCode === undefined) { - return Buffer.from(JSON.stringify(data)); - } - return this._hashCode(data); - } -} diff --git a/packages/utils/src/types/generalTypes.spec.ts b/packages/utils/src/types/generalTypes.spec.ts deleted file mode 100644 index d356cefe..00000000 --- a/packages/utils/src/types/generalTypes.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {getTypeByScalarName} from '../types'; - -describe('general types', () => { - it('can get json type', () => { - const typeClass = getTypeByScalarName('Json'); - expect(typeClass.name).toBe('Json'); - }); - - it('get sequelize date type', () => { - const typeClass = getTypeByScalarName('Date'); - expect(typeClass.sequelizeType).toBe('timestamp'); - }); -}); diff --git a/packages/utils/src/types/generalTypes.ts b/packages/utils/src/types/generalTypes.ts deleted file mode 100644 index abda6b04..00000000 --- a/packages/utils/src/types/generalTypes.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import * as supportedTypes from './supported'; -import {TypeClass} from './TypeClass'; - -export function getTypeByScalarName(type: string): TypeClass | undefined { - return Object.values(supportedTypes).find(({name}) => name === type) as TypeClass; -} diff --git a/packages/utils/src/types/index.ts b/packages/utils/src/types/index.ts deleted file mode 100644 index f096a16d..00000000 --- a/packages/utils/src/types/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './generalTypes'; - -export * from './TypeClass'; diff --git a/packages/utils/src/types/supported/BigInt.ts b/packages/utils/src/types/supported/BigInt.ts deleted file mode 100644 index 4148906f..00000000 --- a/packages/utils/src/types/supported/BigInt.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import BN from 'bn.js'; -import {TypeClass} from '../TypeClass'; - -export const BigInt = new TypeClass( - 'BigInt', - (data: bigint | string): Uint8Array => { - return new BN(data.toString()).toBuffer(); - }, - 'bigint', - 'BigInt', - 'numeric' -); diff --git a/packages/utils/src/types/supported/Boolean.ts b/packages/utils/src/types/supported/Boolean.ts deleted file mode 100644 index b65a2bb8..00000000 --- a/packages/utils/src/types/supported/Boolean.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {numberToU8a} from '@polkadot/util'; -import {TypeClass} from '../TypeClass'; - -export const Boolean = new TypeClass( - 'Boolean', - (data: boolean): Uint8Array => { - return numberToU8a(data ? 1 : 0); - }, - 'boolean', - 'Boolean', - 'boolean' -); diff --git a/packages/utils/src/types/supported/Bytes.ts b/packages/utils/src/types/supported/Bytes.ts deleted file mode 100644 index aa91adf4..00000000 --- a/packages/utils/src/types/supported/Bytes.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {isHex, hexToU8a} from '@polkadot/util'; -import {DataTypes} from 'sequelize'; -import {TypeClass} from '../TypeClass'; - -export const Bytes = new TypeClass( - 'Bytes', - (data: string | Uint8Array): Uint8Array => { - if (data instanceof Uint8Array) return data; - if (isHex(data)) { - return hexToU8a(data); - } - throw new Error(`can not hash ${data}`); - }, - 'string', - 'Bytes', - DataTypes.BLOB -); diff --git a/packages/utils/src/types/supported/Date.ts b/packages/utils/src/types/supported/Date.ts deleted file mode 100644 index 4101a29a..00000000 --- a/packages/utils/src/types/supported/Date.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import assert from 'assert'; -import {numberToU8a} from '@polkadot/util'; -import {TypeClass} from '../TypeClass'; - -export const DateObj = new TypeClass( - 'Date', - (data: Date): Uint8Array => { - assert(data instanceof Date, `can not hash ${data}, expect instance of Date`); - return numberToU8a(data.getTime()); - }, - 'Date', - 'Date', - 'timestamp' -); diff --git a/packages/utils/src/types/supported/Float.ts b/packages/utils/src/types/supported/Float.ts deleted file mode 100644 index 8b909ee3..00000000 --- a/packages/utils/src/types/supported/Float.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {DataTypes} from 'sequelize'; -import {TypeClass} from '../TypeClass'; - -export const Float = new TypeClass( - 'Float', - (data: number): Uint8Array => { - //TODO, check if this is proper way to handle float - return Buffer.from(data.toString()); - }, - 'number', - 'Float', - DataTypes.FLOAT -); diff --git a/packages/utils/src/types/supported/ID.ts b/packages/utils/src/types/supported/ID.ts deleted file mode 100644 index 46d38c71..00000000 --- a/packages/utils/src/types/supported/ID.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {TypeClass} from '../TypeClass'; - -export const ID = new TypeClass( - 'ID', - (data: any): Uint8Array => { - return Buffer.from(data); - }, - 'string', - 'ID', - 'text' -); diff --git a/packages/utils/src/types/supported/Int.ts b/packages/utils/src/types/supported/Int.ts deleted file mode 100644 index 4f5328a1..00000000 --- a/packages/utils/src/types/supported/Int.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {numberToU8a} from '@polkadot/util'; -import {TypeClass} from '../TypeClass'; - -export const Int = new TypeClass( - 'Int', - (data: number): Uint8Array => { - return numberToU8a(data); - }, - 'number', - 'Int', - 'integer' -); diff --git a/packages/utils/src/types/supported/Json.ts b/packages/utils/src/types/supported/Json.ts deleted file mode 100644 index 2ab04850..00000000 --- a/packages/utils/src/types/supported/Json.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {DataTypes} from 'sequelize'; -import {TypeClass} from '../TypeClass'; - -export const Json = new TypeClass( - 'Json', - (data: unknown): Uint8Array => { - return Buffer.from(JSON.stringify(data)); - }, - undefined, - undefined, - DataTypes.JSONB -); diff --git a/packages/utils/src/types/supported/String.ts b/packages/utils/src/types/supported/String.ts deleted file mode 100644 index 32aa404b..00000000 --- a/packages/utils/src/types/supported/String.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {TypeClass} from '../TypeClass'; - -export const String = new TypeClass( - 'String', - (data: string): Uint8Array => { - return Buffer.from(data); - }, - 'string', - 'String', - 'text' -); diff --git a/packages/utils/src/types/supported/index.ts b/packages/utils/src/types/supported/index.ts deleted file mode 100644 index c614404b..00000000 --- a/packages/utils/src/types/supported/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './BigInt'; -export * from './Boolean'; -export * from './Bytes'; -export * from './Date'; -export * from './Float'; -export * from './ID'; -export * from './Int'; -export * from './String'; -export * from './Json'; diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json deleted file mode 100644 index 35bc0ba3..00000000 --- a/packages/utils/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "es2017", - "sourceMap": true, - "tsBuildInfoFile": "dist/.tsbuildinfo", - "rootDir": "src", - "outDir": "./dist", - "noImplicitAny": true, - "noImplicitThis": true - }, - "references": [{"path": "../types"}], - "include": ["src/**/*"] -} diff --git a/packages/validator/CHANGELOG.md b/packages/validator/CHANGELOG.md deleted file mode 100644 index 11902b84..00000000 --- a/packages/validator/CHANGELOG.md +++ /dev/null @@ -1,106 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -All logs must start with the format: [x.y.z] - yyyy-mm-dd - -## [Unreleased] - -## [1.5.0] - 2022.08-26 -### Changed -- Use `@subql/node-core` package. (#1222) - -## [1.4.1] - 2022-08-11 -### Fixed -- Bump version for missing update `subql-common` in previous release. - -## [1.4.0] - 2022-08-04 -### Added -- Support for Algorand projects (#1228) - -## [1.3.0] - 2022-07-27 -### Changed -- Update dependencies with `@subql/common` - -## [1.2.2] - 2022-07-12 -### Fixed -- Fix test (#1174) - -## [1.2.1] - 2022-07-05 -### Fixed -- Tidy up dependency, move `ipfs-http-client` to common packages (#1160) - -## [1.2.0] - 2022-06-22 -### Changed -- move out terra pacakges (#1112) -### Added -- validate deployment, validate multi network (#1115) - -## [1.1.0] - 2022-05-31 -### Changed -- Update import types name (#1012) - -## [1.0.0] - 2022-05-11 -- Major release - -## [0.6.0] - 2022-04-06 -### Added -- Add validation to support manifest 1.0.0, add rules for runner (#845) - -## [0.5.0] - 2022-04-04 -### Added -- Add terra project validation (#781) - -## [0.4.5] - 2022-02-24 -### Changed -- Bump with subql/common release, as `reader` has been updated. - -## [0.4.4] - 2022-02-15 -### Fixed -- Fix chainTypes validation when load from yaml or json (#804) - -## [0.4.3] - 2022-02-09 -### Changed -- Move readers from validator to common (#551) -- Include dynamic datasource in manifest v0.2.1 to custom-ds-validation (#773) - -## [0.4.2] - 2022-01-13 -### Changed -- Version bump with subql/common - - -## [0.4.1] - 2021-12-16 -### Fixed -- Fix chain types checking when load from js (#720) - -## [0.4.0] - 2021-11-19 -### Added -- Added ipfs-reader and update reader (#486) -- Add validator that runs custom ds processor validation (#596) -### Changed -- Bump deps (#584) -- Move `isCustomDs` to Common (#610) -### Fixed -- Fix validating custom DS if location param is provided (#639) - -## [0.3.0] - 2021-10-12 -### Added -- Add validation for manifest v0.2.0 (#495) -- Add manifest valitation (#477) - -## [0.2.0] - 2021-06-25 -### Changed -- Update dependencies (#358) - -## [0.1.0] - 2021-03-11 -### Added -- init release: support validation of subquery project - -[Unreleased]: https://github.com/subquery/subql/compare/v0.4.3...HEAD -[0.4.3]: https://github.com/subquery/subql/compare/query/0.4.2...query/0.4.3 -[0.4.2]: https://github.com/subquery/subql/compare/query/0.4.1...query/0.4.2 -[0.4.1]: https://github.com/subquery/subql/compare/query/0.4.0...query/0.4.1 -[0.4.0]: https://github.com/subquery/subql/compare/query/0.3.0...query/0.4.0 diff --git a/packages/validator/LICENSE b/packages/validator/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/packages/validator/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/validator/README.md b/packages/validator/README.md deleted file mode 100644 index 34f2b33f..00000000 --- a/packages/validator/README.md +++ /dev/null @@ -1 +0,0 @@ -# @subql/validator diff --git a/packages/validator/fixtures/package.json b/packages/validator/fixtures/package.json deleted file mode 100644 index 6a44e68e..00000000 --- a/packages/validator/fixtures/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "subquery-starter", - "version": "0.0.3", - "description": "This project can be use as a starting point for developing your SubQuery project", - "main": "dist/index.js", - "scripts": { - "build": "tsc -b", - "prepack": "rm -rf dist && npm build", - "test": "jest", - "codegen": "./node_modules/.bin/subql codegen" - }, - "homepage": "https://github.com/subquery/subql-starter", - "repository": "github:subquery/subql-starter", - "files": [ - "dist", - "schema.graphql", - "project.yaml" - ], - "author": "Ian He & Jay Ji", - "license": "Apache-2.0", - "devDependencies": { - "@subql/types": "^0.6.0", - "typescript": "^4.1.3", - "@subql/cli": "^0.7.3" - } -} diff --git a/packages/validator/fixtures/project.yaml b/packages/validator/fixtures/project.yaml deleted file mode 100644 index 23332df7..00000000 --- a/packages/validator/fixtures/project.yaml +++ /dev/null @@ -1,24 +0,0 @@ -specVersion: "0.0.1" -description: "" -repository: "https://github.com/subquery/subql-starter" - -schema: "./schema.graphql" - -network: - endpoint: "wss://polkadot.api.onfinality.io/public-ws" - -dataSources: - - name: main - kind: substrate/Runtime - startBlock: 1 - mapping: - handlers: - - handler: handleBlock - kind: substrate/BlockHandler - - handler: handleEvent - kind: substrate/EventHandler - filter: #Filter is optional - module: balances - method: Deposit - - handler: handleCall - kind: substrate/CallHandler diff --git a/packages/validator/package.json b/packages/validator/package.json deleted file mode 100644 index 31b2fc4b..00000000 --- a/packages/validator/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@subql/validator", - "version": "1.5.0", - "description": "to validate subquery project", - "homepage": "https://github.com/subquery/subql", - "repository": "github:subquery/subql", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "rm -rf dist && tsc -b" - }, - "author": "ZheX", - "main": "dist/index.js", - "license": "Apache-2.0", - "files": [ - "src/global.d.ts", - "/dist" - ], - "dependencies": { - "@subql/common": "workspace:*", - "@subql/common-avalanche": "latest", - "@subql/common-cosmos": "^0.0.6", - "@subql/common-substrate": "workspace:*", - "@subql/common-terra": "latest", - "axios": "^0.24.0", - "js-yaml": "^4.1.0", - "package-json-type": "^1.0.3" - }, - "devDependencies": { - "@types/js-yaml": "^4.0.5" - } -} diff --git a/packages/validator/src/context.ts b/packages/validator/src/context.ts deleted file mode 100644 index 99f77caf..00000000 --- a/packages/validator/src/context.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Reader} from '@subql/common'; -import {AlgorandProjectManifestVersioned} from '@subql/common-algorand'; -import {SubstrateProjectManifestVersioned as AvalancheProjectManifestVersioned} from '@subql/common-avalanche'; -import {CosmosProjectManifestVersioned} from '@subql/common-cosmos'; -import {SubstrateProjectManifestVersioned} from '@subql/common-substrate'; -import {TerraProjectManifestVersioned} from '@subql/common-terra'; -import {IPackageJson} from 'package-json-type'; - -export interface ContextData { - projectPath: string; - pkg: IPackageJson; - schema?: - | SubstrateProjectManifestVersioned - | TerraProjectManifestVersioned - | CosmosProjectManifestVersioned - | AvalancheProjectManifestVersioned - | AlgorandProjectManifestVersioned; -} - -export interface Context { - data: ContextData; - logger: Console; - reader: Reader; -} diff --git a/packages/validator/src/index.ts b/packages/validator/src/index.ts deleted file mode 100644 index f7057c13..00000000 --- a/packages/validator/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './validator'; -export * from './rules'; diff --git a/packages/validator/src/rules/index.ts b/packages/validator/src/rules/index.ts deleted file mode 100644 index c31c2b1f..00000000 --- a/packages/validator/src/rules/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export * from './rule'; -export * from './require-build-script'; -export * from './require-codegen-script'; -export * from './require-cli-dep'; -export * from './require-valid-manifest'; -export * from './require-valid-runner'; diff --git a/packages/validator/src/rules/require-build-script.ts b/packages/validator/src/rules/require-build-script.ts deleted file mode 100644 index a048a474..00000000 --- a/packages/validator/src/rules/require-build-script.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export class RequireBuildScript implements Rule { - type = RuleType.PackageJSON; - name = 'require-build-script'; - description = 'A `build` script in `package.json` is required to compile this SubQuery project'; - - validate(ctx: Context): boolean { - return 'build' in ctx.data.pkg.scripts; - } -} diff --git a/packages/validator/src/rules/require-cli-dep.ts b/packages/validator/src/rules/require-cli-dep.ts deleted file mode 100644 index 934ba86d..00000000 --- a/packages/validator/src/rules/require-cli-dep.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export class RequireCliDep implements Rule { - type = RuleType.PackageJSON; - name = 'require-cli-dep'; - description = '`@subql/cli` must be defined as a dependency in `package.json`'; - - validate(ctx: Context): boolean { - const pkgName = '@subql/cli'; - return ( - Object.keys(ctx.data.pkg.devDependencies ?? {}).includes(pkgName) || - Object.keys(ctx.data.pkg.dependencies ?? {}).includes(pkgName) - ); - } -} diff --git a/packages/validator/src/rules/require-codegen-script.ts b/packages/validator/src/rules/require-codegen-script.ts deleted file mode 100644 index 38dd4417..00000000 --- a/packages/validator/src/rules/require-codegen-script.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export class RequireCodegenScript implements Rule { - type = RuleType.PackageJSON; - name = 'require-codegen-script'; - description = 'A `codegen` script in `package.json` is required to compile this SubQuery project'; - - validate(ctx: Context): boolean { - return 'codegen' in ctx.data.pkg.scripts; - } -} diff --git a/packages/validator/src/rules/require-custom-ds-validation.ts b/packages/validator/src/rules/require-custom-ds-validation.ts deleted file mode 100644 index be8c9de6..00000000 --- a/packages/validator/src/rules/require-custom-ds-validation.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {isCustomDs, SubstrateProjectManifestVersioned} from '@subql/common-substrate'; -import {SubstrateDatasourceProcessor, SubstrateNetworkFilter} from '@subql/types'; -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export class RequireCustomDsValidation implements Rule { - type = RuleType.Schema; - name = 'require-custom-ds-validation'; - description = 'custom datasources mast pass processor validation'; - - validate(ctx: Context): boolean { - const schema = ctx.data.schema; - - if ( - (schema as SubstrateProjectManifestVersioned).isV0_2_0 || - (schema as SubstrateProjectManifestVersioned).isV0_2_1 - ) { - for (const customDs of (schema as SubstrateProjectManifestVersioned).dataSources.filter(isCustomDs)) { - const processor: SubstrateDatasourceProcessor = require(path.resolve( - ctx.data.projectPath, - customDs.processor.file - )).default; - - if (customDs.kind !== processor.kind) { - ctx.logger.log(`ds kind (${customDs.kind}) doesnt match processor (${processor.kind})`); - return false; - } - - for (const handler of customDs.mapping.handlers) { - if (!(handler.kind in processor.handlerProcessors)) { - ctx.logger.log(`ds kind ${handler.kind} not one of ${Object.keys(processor.handlerProcessors).join(', ')}`); - return false; - } - } - - try { - customDs.mapping.handlers.map((handler) => - processor.handlerProcessors[handler.kind].filterValidator(handler.filter) - ); - } catch (e) { - ctx.logger.log(`Invalid filter for DS: ${e.message}`); - return false; - } - } - } - - return true; - } -} diff --git a/packages/validator/src/rules/require-valid-chaintypes.ts b/packages/validator/src/rules/require-valid-chaintypes.ts deleted file mode 100644 index e698aa91..00000000 --- a/packages/validator/src/rules/require-valid-chaintypes.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import path from 'path'; -import {parseChainTypes, SubstrateProjectManifestVersioned} from '@subql/common-substrate'; -import yaml from 'js-yaml'; -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export default class RequireValidChainTypes implements Rule { - type = RuleType.Schema; - name = 'require-valid-chaintypes'; - description = 'Specified chain types file must match the polkadot RegistryTypes'; - - async validateSubstrate(schema: SubstrateProjectManifestVersioned, ctx: Context): Promise { - if (schema.isV0_0_1) return true; - - if (schema.isV0_2_0 || schema.isV0_2_1 || schema.isV0_3_0 || schema.isV1_0_0) { - const schemaV0_2_0 = schema.asV0_2_0; - - // No chain types to validate - if (!schemaV0_2_0.network.chaintypes?.file) return true; - - //TODO, skip validate if chaintype is js format for now - const {ext} = path.parse(schemaV0_2_0.network.chaintypes.file); - if (ext === '.js' || ext === '.cjs') return true; - - try { - const rawChainTypes = yaml.load(await ctx.reader.getFile(schemaV0_2_0.network.chaintypes.file)); - parseChainTypes(rawChainTypes); - return true; - } catch (e) { - return false; - } - } - } - - async validate(ctx: Context): Promise { - if (ctx.data.schema instanceof SubstrateProjectManifestVersioned) { - return this.validateSubstrate(ctx.data.schema as SubstrateProjectManifestVersioned, ctx); - } else { - return true; - } - } -} diff --git a/packages/validator/src/rules/require-valid-manifest.ts b/packages/validator/src/rules/require-valid-manifest.ts deleted file mode 100644 index 97214e42..00000000 --- a/packages/validator/src/rules/require-valid-manifest.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export class RequireValidManifest implements Rule { - type = RuleType.Schema; - name = 'require-valid-manifest'; - description = '`project.yaml` must match the schema'; - - validate(ctx: Context): boolean { - const schema = ctx.data.schema; - - try { - schema.validate(); - return true; - } catch (e) { - ctx.logger.error(e.message); - return false; - } - } -} diff --git a/packages/validator/src/rules/require-valid-runner.ts b/packages/validator/src/rules/require-valid-runner.ts deleted file mode 100644 index a7f20fc0..00000000 --- a/packages/validator/src/rules/require-valid-runner.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Context} from '../context'; -import {Rule, RuleType} from './rule'; - -export class RequireValidRunner implements Rule { - type = RuleType.Schema; - name = 'require-valid-runner'; - description = '`runner` must match the `datasource`'; - - validate(ctx: Context): boolean { - const schema = ctx.data.schema; - if (schema.isV1_0_0) { - try { - schema.toDeployment(); - } catch (e) { - return false; - } - } - return true; - } -} diff --git a/packages/validator/src/rules/rule.ts b/packages/validator/src/rules/rule.ts deleted file mode 100644 index f4143e52..00000000 --- a/packages/validator/src/rules/rule.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {Context} from '../context'; -import {RequireBuildScript} from './require-build-script'; -import {RequireCliDep} from './require-cli-dep'; -import {RequireCodegenScript} from './require-codegen-script'; -import {RequireCustomDsValidation} from './require-custom-ds-validation'; -import RequireValidChainTypes from './require-valid-chaintypes'; -import {RequireValidManifest} from './require-valid-manifest'; -import {RequireValidRunner} from './require-valid-runner'; - -export enum RuleType { - PackageJSON = 'packageJSON', - Schema = 'schema', -} - -export interface Rule { - type: RuleType; - name: string; - description: string; - - validate(ctx: Context): boolean | Promise; -} - -export const deploymentRules: Rule[] = [ - new RequireValidManifest(), - new RequireValidChainTypes(), - new RequireCustomDsValidation(), - new RequireValidRunner(), -]; - -export const commonRules: Rule[] = [ - new RequireBuildScript(), - new RequireCodegenScript(), - new RequireCliDep(), - ...deploymentRules, -]; diff --git a/packages/validator/src/validator.spec.ts b/packages/validator/src/validator.spec.ts deleted file mode 100644 index eb6b11c4..00000000 --- a/packages/validator/src/validator.spec.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {IPFS_NODE_ENDPOINT, NETWORK_FAMILY} from '@subql/common'; -import {commonRules, deploymentRules} from './rules'; -import {Validator} from './validator'; - -describe('Validate project below manifest spec 1.0.0', () => { - let v: Validator; - const url = 'https://github.com/subquery/tutorials-block-timestamp'; - - beforeAll(async () => { - v = await Validator.create(url, null, NETWORK_FAMILY.substrate); - v.addRule(...commonRules); - }); - - it('should throw error if manifest is below 1.0.0 and network is not provided', async () => { - const v1 = await Validator.create(url); - v1.addRule(...commonRules); - await expect(v1.getValidateReports()).rejects.toThrow(/Can not identify project network under spec version 1.0.0/); - }); - - it('should validate get reports', async () => { - const result = await v.getValidateReports(); - expect(result.filter((r) => r.valid).length).toBe(result.length); - }); - - it('should return validate result', async () => { - const result = await v.validate(); - expect(result).toBeTruthy(); - }); -}); - -describe('Validate project with manifest spec 1.0.0, auto identify network', () => { - it('should validate IPFS deployment', async () => { - const cid = 'ipfs://QmVX1aaJRL9f5Vgjr8VJ9MWAcFHzAya9omnQ534JYCigCQ'; - const v = await Validator.create(cid, {ipfs: IPFS_NODE_ENDPOINT}); - v.addRule(...deploymentRules); - const result = await v.getValidateReports(); - expect(result.filter((r) => r.valid).length).toBe(result.length); - }); - - it('should validate get reports', async () => { - const url = 'https://github.com/subquery/tutorials-frontier-evm-starter'; - const v = await Validator.create(url); - v.addRule(...commonRules); - const result = await v.getValidateReports(); - expect(result.filter((r) => r.valid).length).toBe(result.length); - }); -}); diff --git a/packages/validator/src/validator.ts b/packages/validator/src/validator.ts deleted file mode 100644 index 7f5d7425..00000000 --- a/packages/validator/src/validator.ts +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2020-2022 OnFinality Limited authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import {getProjectNetwork, NETWORK_FAMILY, Reader, ReaderFactory, ReaderOptions} from '@subql/common'; -import {parseAlgorandProjectManifest} from '@subql/common-algorand'; -import {parseSubstrateProjectManifest as parseAvalancheProjectManifest} from '@subql/common-avalanche'; -import {parseCosmosProjectManifest} from '@subql/common-cosmos'; -import {parseSubstrateProjectManifest} from '@subql/common-substrate'; -import {parseTerraProjectManifest} from '@subql/common-terra'; - -import {Context} from './context'; -import {Rule, RuleType} from './rules'; - -export interface Report { - name: string; - skipped: boolean; - description: string; - valid: boolean; -} - -export class Validator { - private readonly rules: Rule[] = []; - - static async create(location: string, opts?: ReaderOptions, networkFamily?: NETWORK_FAMILY): Promise { - return new Validator(await ReaderFactory.create(location, opts), location, networkFamily); - } - constructor( - private readonly reader: Reader, - private readonly location: string, - private readonly networkFamily?: NETWORK_FAMILY - ) {} - - addRule(...rules: Rule[]): void { - this.rules.push(...rules); - } - - async getValidateReports(): Promise { - const reports: Report[] = []; - const [pkg, rawSchema] = await Promise.all([this.reader.getPkg(), this.reader.getProjectSchema()]); - - if (!rawSchema) { - throw new Error('Not a valid SubQuery project, project.yaml is missing'); - } - - reports.push({ - name: 'project-yaml-file', - description: 'A valid `project.yaml` file must exist in the root directory of the project', - valid: !!rawSchema, - skipped: false, - }); - - let schema; - - const networkFamily = this.networkFamily ?? getProjectNetwork(rawSchema); - switch (networkFamily) { - case NETWORK_FAMILY.substrate: - schema = parseSubstrateProjectManifest(rawSchema); - if (schema.isV0_0_1) { - reports.push({ - name: 'package-json-file', - description: 'A valid `package.json` file must exist in the root directory of the project', - valid: !!pkg, - skipped: false, - }); - } - break; - case NETWORK_FAMILY.terra: - schema = parseTerraProjectManifest(rawSchema); - break; - case NETWORK_FAMILY.avalanche: - schema = parseAvalancheProjectManifest(rawSchema); - break; - case NETWORK_FAMILY.cosmos: - schema = parseCosmosProjectManifest(rawSchema); - break; - case NETWORK_FAMILY.algorand: - schema = parseAlgorandProjectManifest(rawSchema); - break; - default: - console.error(`Load project failed, please check the manifest file.`); - break; - } - - const ctx: Context = { - data: { - projectPath: this.location, - pkg, - schema, - }, - logger: console, - reader: this.reader, - }; - - for (const r of this.rules) { - const report = { - name: r.name, - description: r.description, - valid: false, - skipped: false, - }; - if ((!pkg && r.type === RuleType.PackageJSON) || (!schema && r.type === RuleType.Schema)) { - report.skipped = true; - } else { - report.valid = await r.validate(ctx); - } - reports.push(report); - } - return reports; - } - - async validate(): Promise { - const reports = await this.getValidateReports(); - return !reports.some((r) => !r.valid); - } -} diff --git a/packages/validator/tsconfig.json b/packages/validator/tsconfig.json deleted file mode 100644 index 0e24dd00..00000000 --- a/packages/validator/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "tsBuildInfoFile": "dist/.tsbuildinfo", - "rootDir": "src", - "outDir": "dist", - "noImplicitAny": true - }, - "include": ["src/**/*"], - "references": [{"path": "../common"}, {"path": "../common-substrate"}] -} diff --git a/tsconfig.json b/tsconfig.json index 9896c777..734bf6be 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,30 +18,17 @@ "inlineSources": true, "composite": true, "paths": { - "@subql/utils": ["packages/utils/src"], - "@subql/utils/*": ["packages/utils/src/*"], - "@subql/common": ["packages/common/src"], - "@subql/common/*": ["packages/common/src/*"], - "@subql/common-substrate": ["packages/common-substrate/src"], - "@subql/common-substrate/*": ["packages/common-substrate/src/*"], - "@subql/node-core": ["packages/node-core/src"], - "@subql/node-core/*": ["packages/node-core/src/*"], - "@subql/types": ["packages/types/src"], - "@subql/types/*": ["packages/types/src/*"], - "@subql/validator": ["packages/validator/src"], - "@subql/validator/*": ["packages/validator/src/*"] + "@subql/common-ethereum": ["packages/common-ethereum/src"], + "@subql/common-ethereum/*": ["packages/common-ethereum/src/*"], + "@subql/types-ethereum": ["packages/types/src"], + "@subql/types-ethereum/*": ["packages/types/src/*"], }, "skipLibCheck": true }, "references": [ - {"path": "packages/cli"}, - {"path": "packages/common"}, - {"path": "packages/common-substrate"}, + {"path": "packages/common-ethereum"}, {"path": "packages/node"}, - {"path": "packages/node-core"}, {"path": "packages/types"}, - {"path": "packages/utils"}, - {"path": "packages/validator"} ], "include": ["packages/**/*"], "exclude": ["**/node_modules/**"], diff --git a/yarn.lock b/yarn.lock index 3fe3f1cc..1317440e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,20 +6,21 @@ __metadata: cacheKey: 8 "@actions/core@npm:^1.6.0": - version: 1.8.0 - resolution: "@actions/core@npm:1.8.0" + version: 1.9.1 + resolution: "@actions/core@npm:1.9.1" dependencies: - "@actions/http-client": ^1.0.11 - checksum: 0634770fce3fdf56fd76338731921fde67dcea54cba7e5be2398d62445ada2ee8afca6694da1c6f72d9b4d257cbf3ed0dacbd58753adac712e06249f57156cf3 + "@actions/http-client": ^2.0.1 + uuid: ^8.3.2 + checksum: 8f9823bed2e172fcabb65a63e136f98bbd0614bf37b5012caff4d3216471de19956e6bc0ed2767c52bccc3d02a7450a3b902a83f56bfa255477858c6341d1e2e languageName: node linkType: hard -"@actions/http-client@npm:^1.0.11": - version: 1.0.11 - resolution: "@actions/http-client@npm:1.0.11" +"@actions/http-client@npm:^2.0.1": + version: 2.0.1 + resolution: "@actions/http-client@npm:2.0.1" dependencies: - tunnel: 0.0.6 - checksum: 2c72834ec36a121ae95d2cb61fd28234eae2ab265a2aefe857a9eeb788ea77b284ad727ecd3c67fefd1920d5f2800b6c1ba6916b39d44f81f293b4b0020d367c + tunnel: ^0.0.6 + checksum: 799ec3df91e28a9da91ce6592e94f8b8923ccf6cc21a2f72c7429be5af5273f1625335411adc2a1bb222d56c852d5767214dfa6fa32a6da7e81dba8290e08f17 languageName: node linkType: hard @@ -33,25 +34,6 @@ __metadata: languageName: node linkType: hard -"@angular-devkit/core@npm:13.3.2": - version: 13.3.2 - resolution: "@angular-devkit/core@npm:13.3.2" - dependencies: - ajv: 8.9.0 - ajv-formats: 2.1.1 - fast-json-stable-stringify: 2.1.0 - magic-string: 0.25.7 - rxjs: 6.6.7 - source-map: 0.7.3 - peerDependencies: - chokidar: ^3.5.2 - peerDependenciesMeta: - chokidar: - optional: true - checksum: 2db925c9daddeda481a3bc95bad2d3d6624bfe0f3102e4af2d278c064e965cfa382bd72aee6e502d50c5f74a41ff46707a4d6e203cf8772a83997991e2c22ade - languageName: node - linkType: hard - "@angular-devkit/core@npm:13.3.5": version: 13.3.5 resolution: "@angular-devkit/core@npm:13.3.5" @@ -71,35 +53,6 @@ __metadata: languageName: node linkType: hard -"@angular-devkit/schematics-cli@npm:13.3.2": - version: 13.3.2 - resolution: "@angular-devkit/schematics-cli@npm:13.3.2" - dependencies: - "@angular-devkit/core": 13.3.2 - "@angular-devkit/schematics": 13.3.2 - ansi-colors: 4.1.1 - inquirer: 8.2.0 - minimist: 1.2.6 - symbol-observable: 4.0.0 - bin: - schematics: bin/schematics.js - checksum: e7eb8db41677db63bf52a93b8103ba1b5bb5d6598dd3452860d87c60b4907d7a2097f17b1f84648a208c2250329500287bd2c746ff757a051409b6cf1cb90482 - languageName: node - linkType: hard - -"@angular-devkit/schematics@npm:13.3.2": - version: 13.3.2 - resolution: "@angular-devkit/schematics@npm:13.3.2" - dependencies: - "@angular-devkit/core": 13.3.2 - jsonc-parser: 3.0.0 - magic-string: 0.25.7 - ora: 5.4.1 - rxjs: 6.6.7 - checksum: 796a2f613a39e30fea1c83a8c2eb422064702d795fdd7749d57d7a72a5c40c9d569209c4cf7ad199ef61ccbb2df8f082d352b931104886a883d85071b553c448 - languageName: node - linkType: hard - "@angular-devkit/schematics@npm:13.3.5": version: 13.3.5 resolution: "@angular-devkit/schematics@npm:13.3.5" @@ -142,603 +95,547 @@ __metadata: languageName: node linkType: hard -"@apollo/protobufjs@npm:1.2.2": - version: 1.2.2 - resolution: "@apollo/protobufjs@npm:1.2.2" - dependencies: - "@protobufjs/aspromise": ^1.1.2 - "@protobufjs/base64": ^1.1.2 - "@protobufjs/codegen": ^2.0.4 - "@protobufjs/eventemitter": ^1.1.0 - "@protobufjs/fetch": ^1.1.0 - "@protobufjs/float": ^1.0.2 - "@protobufjs/inquire": ^1.1.0 - "@protobufjs/path": ^1.1.2 - "@protobufjs/pool": ^1.1.0 - "@protobufjs/utf8": ^1.1.0 - "@types/long": ^4.0.0 - "@types/node": ^10.1.0 - long: ^4.0.0 - bin: - apollo-pbjs: bin/pbjs - apollo-pbts: bin/pbts - checksum: 3f3ec1f428cbcc53760daa6f1076c9043a5aa270b2c9a2ca9f97610eabd3ee1aea08dd36fac658bab83eb6607bc62340bbc6c13ba6bba3c6776df71d68b55929 - languageName: node - linkType: hard - -"@apollo/utils.logger@npm:^1.0.0": - version: 1.0.0 - resolution: "@apollo/utils.logger@npm:1.0.0" - checksum: 9be2b269d6d1cf2235c7b49a5edbb36c87589facf79516521df66d0c782709b7301a1365693b6e15d77f482d231bbb0fea4c2ae42faac7068cc4e014ce338c68 - languageName: node - linkType: hard - -"@apollographql/apollo-tools@npm:^0.5.3": - version: 0.5.4 - resolution: "@apollographql/apollo-tools@npm:0.5.4" - peerDependencies: - graphql: ^14.2.1 || ^15.0.0 || ^16.0.0 - checksum: 673eaaf371504939b58c2717334e237639d3c277ec9b1b9cc7a53a1ad24ded456a6e49bbf2ecf26a64f4b92b04c12cd48f6e22066c6041ae30f2ba4720fb01b6 - languageName: node - linkType: hard - -"@apollographql/graphql-playground-html@npm:1.6.29": - version: 1.6.29 - resolution: "@apollographql/graphql-playground-html@npm:1.6.29" - dependencies: - xss: ^1.0.8 - checksum: 32984ae225de572f3fe286409553884e4d252a35019abfd5bd6ef40f52173ba810fd0a4d23915e727425cd993fd178115e6a2557315789085e235114228dfe4a - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/code-frame@npm:7.16.7" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/code-frame@npm:7.18.6" dependencies: - "@babel/highlight": ^7.16.7 - checksum: db2f7faa31bc2c9cf63197b481b30ea57147a5fc1a6fab60e5d6c02cdfbf6de8e17b5121f99917b3dabb5eeb572da078312e70697415940383efc140d4e0808b + "@babel/highlight": ^7.18.6 + checksum: 195e2be3172d7684bf95cff69ae3b7a15a9841ea9d27d3c843662d50cdd7d6470fd9c8e64be84d031117e4a4083486effba39f9aef6bbb2c89f7f21bcfba33ba languageName: node linkType: hard -"@babel/compat-data@npm:^7.13.11, @babel/compat-data@npm:^7.17.0, @babel/compat-data@npm:^7.17.10": - version: 7.17.10 - resolution: "@babel/compat-data@npm:7.17.10" - checksum: e85051087cd4690de5061909a2dd2d7f8b6434a3c2e30be6c119758db2027ae1845bcd75a81127423dd568b706ac6994a1a3d7d701069a23bf5cfe900728290b +"@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.18.8, @babel/compat-data@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/compat-data@npm:7.19.0" + checksum: f90d25a3779578c230ad0632e12ffd5ee1033614dee2786f7f1567823a78923da7185638eedd7166f31e4771a3398ae6a28ab8e680b96cc25bafb38a3b66ff11 languageName: node linkType: hard -"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.16, @babel/core@npm:^7.12.3, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": - version: 7.17.10 - resolution: "@babel/core@npm:7.17.10" +"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": + version: 7.19.0 + resolution: "@babel/core@npm:7.19.0" dependencies: "@ampproject/remapping": ^2.1.0 - "@babel/code-frame": ^7.16.7 - "@babel/generator": ^7.17.10 - "@babel/helper-compilation-targets": ^7.17.10 - "@babel/helper-module-transforms": ^7.17.7 - "@babel/helpers": ^7.17.9 - "@babel/parser": ^7.17.10 - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.17.10 - "@babel/types": ^7.17.10 + "@babel/code-frame": ^7.18.6 + "@babel/generator": ^7.19.0 + "@babel/helper-compilation-targets": ^7.19.0 + "@babel/helper-module-transforms": ^7.19.0 + "@babel/helpers": ^7.19.0 + "@babel/parser": ^7.19.0 + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.19.0 + "@babel/types": ^7.19.0 convert-source-map: ^1.7.0 debug: ^4.1.0 gensync: ^1.0.0-beta.2 json5: ^2.2.1 semver: ^6.3.0 - checksum: 2545fb24b4090c1e9ead0daad4713ae6fe779df0843e6e286509146f4dd09958bd067d80995f2cc09fdb01fd0dc936f42cdd6f70b3d058de48e124cd9a3cc93e - languageName: node - linkType: hard - -"@babel/eslint-parser@npm:^7.12.16": - version: 7.17.0 - resolution: "@babel/eslint-parser@npm:7.17.0" - dependencies: - eslint-scope: ^5.1.1 - eslint-visitor-keys: ^2.1.0 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ">=7.11.0" - eslint: ^7.5.0 || ^8.0.0 - checksum: 1cedd9998dd89f779bbc5496531e3ef1b43d6f4fb7209ed5088938292b81287302cb47c0923ce074e84e83aa41b236b09bfecacdf20770f4cbfade2de9519c10 + checksum: 0d5b52b552e215802d2fd7b266611c390d90b28dece09db8a142666c32928c5d404eb72a95630b4cb726c4d80a53fcdc2d6464cd7ad28bb26087475f1b2205e2 languageName: node linkType: hard -"@babel/generator@npm:^7.17.10, @babel/generator@npm:^7.7.2": - version: 7.17.10 - resolution: "@babel/generator@npm:7.17.10" +"@babel/generator@npm:^7.19.0, @babel/generator@npm:^7.7.2": + version: 7.19.0 + resolution: "@babel/generator@npm:7.19.0" dependencies: - "@babel/types": ^7.17.10 - "@jridgewell/gen-mapping": ^0.1.0 + "@babel/types": ^7.19.0 + "@jridgewell/gen-mapping": ^0.3.2 jsesc: ^2.5.1 - checksum: 9ec596a6ffec7bec239133a4ba79d4f834e6c894019accb1c70a7a5affbec9d0912d3baef200edd9d48e553d4ef72abcbffbc73cfb7d75f327c24186e887f79c + checksum: aa3d5785cf8f8e81672dcc61aef351188efeadb20d9f66d79113d82cbcf3bbbdeb829989fa14582108572ddbc4e4027bdceb06ccaf5ec40fa93c2dda8fbcd4aa languageName: node linkType: hard -"@babel/helper-annotate-as-pure@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-annotate-as-pure@npm:7.16.7" +"@babel/helper-annotate-as-pure@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-annotate-as-pure@npm:7.18.6" dependencies: - "@babel/types": ^7.16.7 - checksum: d235be963fed5d48a8a4cfabc41c3f03fad6a947810dbcab9cebed7f819811457e10d99b4b2e942ad71baa7ee8e3cd3f5f38a4e4685639ddfddb7528d9a07179 + "@babel/types": ^7.18.6 + checksum: 88ccd15ced475ef2243fdd3b2916a29ea54c5db3cd0cfabf9d1d29ff6e63b7f7cd1c27264137d7a40ac2e978b9b9a542c332e78f40eb72abe737a7400788fc1b languageName: node linkType: hard -"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.16.7" +"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.18.6": + version: 7.18.9 + resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.18.9" dependencies: - "@babel/helper-explode-assignable-expression": ^7.16.7 - "@babel/types": ^7.16.7 - checksum: 1784f19a57ecfafca8e5c2e0f3eac53451cb13a857cbe0ca0cd9670922228d099ef8c3dd8cd318e2d7bce316fdb2ece3e527c30f3ecd83706e37ab6beb0c60eb + "@babel/helper-explode-assignable-expression": ^7.18.6 + "@babel/types": ^7.18.9 + checksum: b4bc214cb56329daff6cc18a7f7a26aeafb55a1242e5362f3d47fe3808421f8c7cd91fff95d6b9b7ccb67e14e5a67d944e49dbe026942bfcbfda19b1c72a8e72 languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.16.7, @babel/helper-compilation-targets@npm:^7.17.10": - version: 7.17.10 - resolution: "@babel/helper-compilation-targets@npm:7.17.10" +"@babel/helper-compilation-targets@npm:^7.17.7, @babel/helper-compilation-targets@npm:^7.18.9, @babel/helper-compilation-targets@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/helper-compilation-targets@npm:7.19.0" dependencies: - "@babel/compat-data": ^7.17.10 - "@babel/helper-validator-option": ^7.16.7 + "@babel/compat-data": ^7.19.0 + "@babel/helper-validator-option": ^7.18.6 browserslist: ^4.20.2 semver: ^6.3.0 peerDependencies: "@babel/core": ^7.0.0 - checksum: 5f547c7ebd372e90fa72c2aaea867e7193166e9f469dec5acde4f0e18a78b80bdca8e02a0f641f3e998be984fb5b802c729a9034faaee8b1a9ef6670cb76f120 + checksum: 5f1be9811d53a5e43eb4b9b402517dec79bfa3a55e9fbc131a106914a78b435bc08a4b35591e424665c36c2c1eceb864ec2ca2c2f3dcf240a1551a28530428f9 languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.16.10, @babel/helper-create-class-features-plugin@npm:^7.16.7, @babel/helper-create-class-features-plugin@npm:^7.17.6": - version: 7.17.9 - resolution: "@babel/helper-create-class-features-plugin@npm:7.17.9" +"@babel/helper-create-class-features-plugin@npm:^7.18.6": + version: 7.19.0 + resolution: "@babel/helper-create-class-features-plugin@npm:7.19.0" dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - "@babel/helper-environment-visitor": ^7.16.7 - "@babel/helper-function-name": ^7.17.9 - "@babel/helper-member-expression-to-functions": ^7.17.7 - "@babel/helper-optimise-call-expression": ^7.16.7 - "@babel/helper-replace-supers": ^7.16.7 - "@babel/helper-split-export-declaration": ^7.16.7 + "@babel/helper-annotate-as-pure": ^7.18.6 + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-function-name": ^7.19.0 + "@babel/helper-member-expression-to-functions": ^7.18.9 + "@babel/helper-optimise-call-expression": ^7.18.6 + "@babel/helper-replace-supers": ^7.18.9 + "@babel/helper-split-export-declaration": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0 - checksum: db7be8852096084883dbbd096f925976695e5b34919a888fded9fd359d75d9994960e459f4eeb51ff6700109f83be6c1359e57809deb3fe36fc589b2a208b6d7 + checksum: f0c6fb77b6f113d70f308e7093f60dd465b697818badf5df0519d8dd12b6bfb1f4ad300b923207ce9f9c1c940ef58bff12ac4270c0863eadf9e303b7dd6d01b6 languageName: node linkType: hard -"@babel/helper-create-regexp-features-plugin@npm:^7.16.7, @babel/helper-create-regexp-features-plugin@npm:^7.17.0": - version: 7.17.0 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.17.0" +"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/helper-create-regexp-features-plugin@npm:7.19.0" dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - regexpu-core: ^5.0.1 + "@babel/helper-annotate-as-pure": ^7.18.6 + regexpu-core: ^5.1.0 peerDependencies: "@babel/core": ^7.0.0 - checksum: eb66d9241544c705e9ce96d2d122b595ef52d926e6e031653e09af8a01050bd9d7e7fee168bf33a863342774d7d6a8cc7e8e9e5a45b955e9c01121c7a2d51708 + checksum: 811cc90afe9fc25a74ed37fc0c1361a4a91b0b940235dd3958e3f03b366d40a903b40fc93b51bcb93be774aba573219f8f215664bea1d1301f58797ca6854f3f languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.3.1": - version: 0.3.1 - resolution: "@babel/helper-define-polyfill-provider@npm:0.3.1" +"@babel/helper-define-polyfill-provider@npm:^0.3.2, @babel/helper-define-polyfill-provider@npm:^0.3.3": + version: 0.3.3 + resolution: "@babel/helper-define-polyfill-provider@npm:0.3.3" dependencies: - "@babel/helper-compilation-targets": ^7.13.0 - "@babel/helper-module-imports": ^7.12.13 - "@babel/helper-plugin-utils": ^7.13.0 - "@babel/traverse": ^7.13.0 + "@babel/helper-compilation-targets": ^7.17.7 + "@babel/helper-plugin-utils": ^7.16.7 debug: ^4.1.1 lodash.debounce: ^4.0.8 resolve: ^1.14.2 semver: ^6.1.2 peerDependencies: "@babel/core": ^7.4.0-0 - checksum: e3e93cb22febfc0449a210cdafb278e5e1a038af2ca2b02f5dee71c7a49e8ba26e469d631ee11a4243885961a62bb2e5b0a4deb3ec1d7918a33c953d05c3e584 + checksum: 8e3fe75513302e34f6d92bd67b53890e8545e6c5bca8fe757b9979f09d68d7e259f6daea90dc9e01e332c4f8781bda31c5fe551c82a277f9bc0bec007aed497c languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-environment-visitor@npm:7.16.7" - dependencies: - "@babel/types": ^7.16.7 - checksum: c03a10105d9ebd1fe632a77356b2e6e2f3c44edba9a93b0dc3591b6a66bd7a2e323dd9502f9ce96fc6401234abff1907aa877b6674f7826b61c953f7c8204bbe +"@babel/helper-environment-visitor@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/helper-environment-visitor@npm:7.18.9" + checksum: b25101f6162ddca2d12da73942c08ad203d7668e06663df685634a8fde54a98bc015f6f62938e8554457a592a024108d45b8f3e651fd6dcdb877275b73cc4420 languageName: node linkType: hard -"@babel/helper-explode-assignable-expression@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-explode-assignable-expression@npm:7.16.7" +"@babel/helper-explode-assignable-expression@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-explode-assignable-expression@npm:7.18.6" dependencies: - "@babel/types": ^7.16.7 - checksum: ea2135ba36da6a2be059ebc8f10fbbb291eb0e312da54c55c6f50f9cbd8601e2406ec497c5e985f7c07a97f31b3bef9b2be8df53f1d53b974043eaf74fe54bbc + "@babel/types": ^7.18.6 + checksum: 225cfcc3376a8799023d15dc95000609e9d4e7547b29528c7f7111a0e05493ffb12c15d70d379a0bb32d42752f340233c4115bded6d299bc0c3ab7a12be3d30f languageName: node linkType: hard -"@babel/helper-function-name@npm:^7.16.7, @babel/helper-function-name@npm:^7.17.9": - version: 7.17.9 - resolution: "@babel/helper-function-name@npm:7.17.9" +"@babel/helper-function-name@npm:^7.18.9, @babel/helper-function-name@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/helper-function-name@npm:7.19.0" dependencies: - "@babel/template": ^7.16.7 - "@babel/types": ^7.17.0 - checksum: a59b2e5af56d8f43b9b0019939a43774754beb7cb01a211809ca8031c71890999d07739e955343135ec566c4d8ff725435f1f60fb0af3bb546837c1f9f84f496 + "@babel/template": ^7.18.10 + "@babel/types": ^7.19.0 + checksum: eac1f5db428ba546270c2b8d750c24eb528b8fcfe50c81de2e0bdebf0e20f24bec688d4331533b782e4a907fad435244621ca2193cfcf80a86731299840e0f6e languageName: node linkType: hard -"@babel/helper-hoist-variables@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-hoist-variables@npm:7.16.7" +"@babel/helper-hoist-variables@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-hoist-variables@npm:7.18.6" dependencies: - "@babel/types": ^7.16.7 - checksum: 6ae1641f4a751cd9045346e3f61c3d9ec1312fd779ab6d6fecfe2a96e59a481ad5d7e40d2a840894c13b3fd6114345b157f9e3062fc5f1580f284636e722de60 + "@babel/types": ^7.18.6 + checksum: fd9c35bb435fda802bf9ff7b6f2df06308a21277c6dec2120a35b09f9de68f68a33972e2c15505c1a1a04b36ec64c9ace97d4a9e26d6097b76b4396b7c5fa20f languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.16.7, @babel/helper-member-expression-to-functions@npm:^7.17.7": - version: 7.17.7 - resolution: "@babel/helper-member-expression-to-functions@npm:7.17.7" +"@babel/helper-member-expression-to-functions@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/helper-member-expression-to-functions@npm:7.18.9" dependencies: - "@babel/types": ^7.17.0 - checksum: 70f361bab627396c714c3938e94a569cb0da522179328477cdbc4318e4003c2666387ad4931d6bd5de103338c667c9e4bbe3e917fc8c527b3f3eb6175b888b7d + "@babel/types": ^7.18.9 + checksum: fcf8184e3b55051c4286b2cbedf0eccc781d0f3c9b5cbaba582eca19bf0e8d87806cdb7efc8554fcb969ceaf2b187d5ea748d40022d06ec7739fbb18c1b19a7a languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.12.13, @babel/helper-module-imports@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-module-imports@npm:7.16.7" +"@babel/helper-module-imports@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-module-imports@npm:7.18.6" dependencies: - "@babel/types": ^7.16.7 - checksum: ddd2c4a600a2e9a4fee192ab92bf35a627c5461dbab4af31b903d9ba4d6b6e59e0ff3499fde4e2e9a0eebe24906f00b636f8b4d9bd72ff24d50e6618215c3212 + "@babel/types": ^7.18.6 + checksum: f393f8a3b3304b1b7a288a38c10989de754f01d29caf62ce7c4e5835daf0a27b81f3ac687d9d2780d39685aae7b55267324b512150e7b2be967b0c493b6a1def languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.16.7, @babel/helper-module-transforms@npm:^7.17.7": - version: 7.17.7 - resolution: "@babel/helper-module-transforms@npm:7.17.7" +"@babel/helper-module-transforms@npm:^7.18.6, @babel/helper-module-transforms@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/helper-module-transforms@npm:7.19.0" dependencies: - "@babel/helper-environment-visitor": ^7.16.7 - "@babel/helper-module-imports": ^7.16.7 - "@babel/helper-simple-access": ^7.17.7 - "@babel/helper-split-export-declaration": ^7.16.7 - "@babel/helper-validator-identifier": ^7.16.7 - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.17.3 - "@babel/types": ^7.17.0 - checksum: 0b8f023aa7ff82dc4864349d54c4557865ad8ba54d78f6d78a86b05ca40f65c2d60acb4a54c5c309e7a4356beb9a89b876e54af4b3c4801ad25f62ec3721f0ae + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-module-imports": ^7.18.6 + "@babel/helper-simple-access": ^7.18.6 + "@babel/helper-split-export-declaration": ^7.18.6 + "@babel/helper-validator-identifier": ^7.18.6 + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.19.0 + "@babel/types": ^7.19.0 + checksum: 4483276c66f56cf3b5b063634092ad9438c2593725de5c143ba277dda82f1501e6d73b311c1b28036f181dbe36eaeff29f24726cde37a599d4e735af294e5359 languageName: node linkType: hard -"@babel/helper-optimise-call-expression@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-optimise-call-expression@npm:7.16.7" +"@babel/helper-optimise-call-expression@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-optimise-call-expression@npm:7.18.6" dependencies: - "@babel/types": ^7.16.7 - checksum: 925feb877d5a30a71db56e2be498b3abbd513831311c0188850896c4c1ada865eea795dce5251a1539b0f883ef82493f057f84286dd01abccc4736acfafe15ea + "@babel/types": ^7.18.6 + checksum: e518fe8418571405e21644cfb39cf694f30b6c47b10b006609a92469ae8b8775cbff56f0b19732343e2ea910641091c5a2dc73b56ceba04e116a33b0f8bd2fbd languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.13.0, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": - version: 7.16.7 - resolution: "@babel/helper-plugin-utils@npm:7.16.7" - checksum: d08dd86554a186c2538547cd537552e4029f704994a9201d41d82015c10ed7f58f9036e8d1527c3760f042409163269d308b0b3706589039c5f1884619c6d4ce +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.18.9, @babel/helper-plugin-utils@npm:^7.19.0, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": + version: 7.19.0 + resolution: "@babel/helper-plugin-utils@npm:7.19.0" + checksum: eedc996c633c8c207921c26ec2989eae0976336ecd9b9f1ac526498f52b5d136f7cd03c32b6fdf8d46a426f907c142de28592f383c42e5fba1e904cbffa05345 languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.16.8": - version: 7.16.8 - resolution: "@babel/helper-remap-async-to-generator@npm:7.16.8" +"@babel/helper-remap-async-to-generator@npm:^7.18.6, @babel/helper-remap-async-to-generator@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/helper-remap-async-to-generator@npm:7.18.9" dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - "@babel/helper-wrap-function": ^7.16.8 - "@babel/types": ^7.16.8 - checksum: 29282ee36872130085ca111539725abbf20210c2a1d674bee77f338a57c093c3154108d03a275f602e471f583bd2c7ae10d05534f87cbc22b95524fe2b569488 + "@babel/helper-annotate-as-pure": ^7.18.6 + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-wrap-function": ^7.18.9 + "@babel/types": ^7.18.9 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 4be6076192308671b046245899b703ba090dbe7ad03e0bea897bb2944ae5b88e5e85853c9d1f83f643474b54c578d8ac0800b80341a86e8538264a725fbbefec languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-replace-supers@npm:7.16.7" +"@babel/helper-replace-supers@npm:^7.18.6, @babel/helper-replace-supers@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/helper-replace-supers@npm:7.18.9" dependencies: - "@babel/helper-environment-visitor": ^7.16.7 - "@babel/helper-member-expression-to-functions": ^7.16.7 - "@babel/helper-optimise-call-expression": ^7.16.7 - "@babel/traverse": ^7.16.7 - "@babel/types": ^7.16.7 - checksum: e5c0b6eb3dad8410a6255f93b580dde9b3c1564646c6ef751de59d5b2a65b5caa80cc9e568155f04bbae895ad0f54305c2e833dbd971a4f641f970c90b3d892b + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-member-expression-to-functions": ^7.18.9 + "@babel/helper-optimise-call-expression": ^7.18.6 + "@babel/traverse": ^7.18.9 + "@babel/types": ^7.18.9 + checksum: 2de8b29cc4bfa4e241da2de16abd5571709f6eb394206dc16e3a7816976d1691635dd4bc930881e9d798f44b48a5f1849dc7f51a62946f3e8270452be1ec5352 languageName: node linkType: hard -"@babel/helper-simple-access@npm:^7.17.7": - version: 7.17.7 - resolution: "@babel/helper-simple-access@npm:7.17.7" +"@babel/helper-simple-access@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-simple-access@npm:7.18.6" dependencies: - "@babel/types": ^7.17.0 - checksum: 58a9bfd054720024f6ff47fbb113c96061dc2bd31a5e5285756bd3c2e83918c6926900e00150d0fb175d899494fe7d69bf2a8b278c32ef6f6bea8d032e6a3831 + "@babel/types": ^7.18.6 + checksum: 37cd36eef199e0517845763c1e6ff6ea5e7876d6d707a6f59c9267c547a50aa0e84260ba9285d49acfaf2cfa0a74a772d92967f32ac1024c961517d40b6c16a5 languageName: node linkType: hard -"@babel/helper-skip-transparent-expression-wrappers@npm:^7.16.0": - version: 7.16.0 - resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.16.0" +"@babel/helper-skip-transparent-expression-wrappers@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.18.9" dependencies: - "@babel/types": ^7.16.0 - checksum: b9ed2896eb253e6a85f472b0d4098ed80403758ad1a4e34b02b11e8276e3083297526758b1a3e6886e292987266f10622d7dbced3508cc22b296a74903b41cfb + "@babel/types": ^7.18.9 + checksum: 6e93ccd10248293082606a4b3e30eed32c6f796d378f6b662796c88f462f348aa368aadeb48eb410cfcc8250db93b2d6627c2e55662530f08fc25397e588d68a languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-split-export-declaration@npm:7.16.7" +"@babel/helper-split-export-declaration@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-split-export-declaration@npm:7.18.6" dependencies: - "@babel/types": ^7.16.7 - checksum: e10aaf135465c55114627951b79115f24bc7af72ecbb58d541d66daf1edaee5dde7cae3ec8c3639afaf74526c03ae3ce723444e3b5b3dc77140c456cd84bcaa1 + "@babel/types": ^7.18.6 + checksum: c6d3dede53878f6be1d869e03e9ffbbb36f4897c7cc1527dc96c56d127d834ffe4520a6f7e467f5b6f3c2843ea0e81a7819d66ae02f707f6ac057f3d57943a2b + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.18.10": + version: 7.18.10 + resolution: "@babel/helper-string-parser@npm:7.18.10" + checksum: d554a4393365b624916b5c00a4cc21c990c6617e7f3fe30be7d9731f107f12c33229a7a3db9d829bfa110d2eb9f04790745d421640e3bd245bb412dc0ea123c1 languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.14.9, @babel/helper-validator-identifier@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-validator-identifier@npm:7.16.7" - checksum: dbb3db9d184343152520a209b5684f5e0ed416109cde82b428ca9c759c29b10c7450657785a8b5c5256aa74acc6da491c1f0cf6b784939f7931ef82982051b69 +"@babel/helper-validator-identifier@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-validator-identifier@npm:7.18.6" + checksum: e295254d616bbe26e48c196a198476ab4d42a73b90478c9842536cf910ead887f5af6b5c4df544d3052a25ccb3614866fa808dc1e3a5a4291acd444e243c0648 languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-validator-option@npm:7.16.7" - checksum: c5ccc451911883cc9f12125d47be69434f28094475c1b9d2ada7c3452e6ac98a1ee8ddd364ca9e3f9855fcdee96cdeafa32543ebd9d17fee7a1062c202e80570 +"@babel/helper-validator-option@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-validator-option@npm:7.18.6" + checksum: f9cc6eb7cc5d759c5abf006402180f8d5e4251e9198197428a97e05d65eb2f8ae5a0ce73b1dfd2d35af41d0eb780627a64edf98a4e71f064eeeacef8de58f2cf languageName: node linkType: hard -"@babel/helper-wrap-function@npm:^7.16.8": - version: 7.16.8 - resolution: "@babel/helper-wrap-function@npm:7.16.8" +"@babel/helper-wrap-function@npm:^7.18.9": + version: 7.19.0 + resolution: "@babel/helper-wrap-function@npm:7.19.0" dependencies: - "@babel/helper-function-name": ^7.16.7 - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.16.8 - "@babel/types": ^7.16.8 - checksum: d8aae4bacaf138d47dca1421ba82b41eac954cbb0ad17ab1c782825c6f2afe20076fbed926ab265967758336de5112d193a363128cd1c6967c66e0151174f797 + "@babel/helper-function-name": ^7.19.0 + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.19.0 + "@babel/types": ^7.19.0 + checksum: 2453a6b134f12cc779179188c4358a66252c29b634a8195c0cf626e17f9806c3c4c40e159cd8056c2ec82b69b9056a088014fa43d6ccc1aca67da8d9605da8fd languageName: node linkType: hard -"@babel/helpers@npm:^7.17.9": - version: 7.17.9 - resolution: "@babel/helpers@npm:7.17.9" +"@babel/helpers@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/helpers@npm:7.19.0" dependencies: - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.17.9 - "@babel/types": ^7.17.0 - checksum: 3c6db861e4c82fff2de3efb4ad12e32658c50c29920597cd0979390659b202e5849acd9542e0e2453167a52ccc30156ee4455d64d0e330f020d991d7551566f8 + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.19.0 + "@babel/types": ^7.19.0 + checksum: e50e78e0dbb0435075fa3f85021a6bcae529589800bca0292721afd7f7c874bea54508d6dc57eca16e5b8224f8142c6b0e32e3b0140029dc09865da747da4623 languageName: node linkType: hard -"@babel/highlight@npm:^7.16.7": - version: 7.17.9 - resolution: "@babel/highlight@npm:7.17.9" +"@babel/highlight@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/highlight@npm:7.18.6" dependencies: - "@babel/helper-validator-identifier": ^7.16.7 + "@babel/helper-validator-identifier": ^7.18.6 chalk: ^2.0.0 js-tokens: ^4.0.0 - checksum: 7bdf10228f2e4d18f48f114411ed584380d356e7c168d7582c14abd8df9909b2fc09e0a7cd334f47c3eb0bc17e639e0c8d9688c6afd5d09a2bdbf0ac193b11fd + checksum: 92d8ee61549de5ff5120e945e774728e5ccd57fd3b2ed6eace020ec744823d4a98e242be1453d21764a30a14769ecd62170fba28539b211799bbaf232bbb2789 languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.7, @babel/parser@npm:^7.17.10": - version: 7.17.10 - resolution: "@babel/parser@npm:7.17.10" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/parser@npm:7.19.0" bin: parser: ./bin/babel-parser.js - checksum: a9493d9fb8625e0904a178703866c8ee4d3a6003f0954b08df9f772b54dae109c69376812b74732e0c3e1a7f1d5b30915577a1db12e5e16b0abee083539df574 + checksum: af86d829bfeb60e0dcf54a43489c2514674b6c8d9bb24cf112706772125752fcd517877ad30501d533fa85f70a439d02eebeec3be9c2e95499853367184e0da7 languageName: node linkType: hard -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.16.7" +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0 - checksum: bbb0f82a4cf297bdbb9110eea570addd4b883fd1b61535558d849822b087aa340fe4e9c31f8a39b087595c8310b58d0f5548d6be0b72c410abefb23a5734b7bc + checksum: 845bd280c55a6a91d232cfa54eaf9708ec71e594676fe705794f494bb8b711d833b752b59d1a5c154695225880c23dbc9cab0e53af16fd57807976cd3ff41b8d languageName: node linkType: hard -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.16.7" +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-skip-transparent-expression-wrappers": ^7.16.0 - "@babel/plugin-proposal-optional-chaining": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 + "@babel/helper-skip-transparent-expression-wrappers": ^7.18.9 + "@babel/plugin-proposal-optional-chaining": ^7.18.9 peerDependencies: "@babel/core": ^7.13.0 - checksum: 81b372651a7d886a06596b02df7fb65ea90265a8bd60c9f0d5c1777590a598e6cccbdc3239033ee0719abf904813e69577eeb0ed5960b40e07978df023b17a6a + checksum: 93abb5cb179a13db171bfc2cdf79489598f43c50cc174f97a2b7bb1d44d24ade7109665a20cf4e317ad6c1c730f036f06478f7c7e789b4240be1abdb60d6452f languageName: node linkType: hard -"@babel/plugin-proposal-async-generator-functions@npm:^7.16.8": - version: 7.16.8 - resolution: "@babel/plugin-proposal-async-generator-functions@npm:7.16.8" +"@babel/plugin-proposal-async-generator-functions@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/plugin-proposal-async-generator-functions@npm:7.19.0" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-remap-async-to-generator": ^7.16.8 + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-plugin-utils": ^7.19.0 + "@babel/helper-remap-async-to-generator": ^7.18.9 "@babel/plugin-syntax-async-generators": ^7.8.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: abd2c2c67de262720d37c5509dafe2ce64d6cee2dc9a8e863bbba1796b77387214442f37618373c6a4521ca624bfc7dcdbeb1376300d16f2a474405ee0ca2e69 + checksum: f1876286d608650928f60ac6091b9a6e7839e005941be483df47693b98c90649202aa1793f28f6e9b4ce69bf0773552144fa40f38751f56dc5d02051a8ee0461 languageName: node linkType: hard -"@babel/plugin-proposal-class-properties@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-class-properties@npm:7.16.7" +"@babel/plugin-proposal-class-properties@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-class-properties@npm:7.18.6" dependencies: - "@babel/helper-create-class-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-class-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 3977e841e17b45b47be749b9a5b67b9e8b25ff0840f9fdad3f00cbcb35db4f5ff15f074939fe19b01207a29688c432cc2c682351959350834d62920b7881f803 + checksum: 49a78a2773ec0db56e915d9797e44fd079ab8a9b2e1716e0df07c92532f2c65d76aeda9543883916b8e0ff13606afeffa67c5b93d05b607bc87653ad18a91422 languageName: node linkType: hard -"@babel/plugin-proposal-class-static-block@npm:^7.17.6": - version: 7.17.6 - resolution: "@babel/plugin-proposal-class-static-block@npm:7.17.6" +"@babel/plugin-proposal-class-static-block@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-class-static-block@npm:7.18.6" dependencies: - "@babel/helper-create-class-features-plugin": ^7.17.6 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-class-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-class-static-block": ^7.14.5 peerDependencies: "@babel/core": ^7.12.0 - checksum: 0ef00d73b4a7667059f71614669fb5ec989a0a6d5fe58118310c892507f2556a6f3ae66f0c547cd06e50bdf3ff528ef486e611079d41ef321300c967d2c26e1d + checksum: b8d7ae99ed5ad784f39e7820e3ac03841f91d6ed60ab4a98c61d6112253da36013e12807bae4ffed0ef3cb318e47debac112ed614e03b403fb8b075b09a828ee languageName: node linkType: hard -"@babel/plugin-proposal-dynamic-import@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-dynamic-import@npm:7.16.7" +"@babel/plugin-proposal-dynamic-import@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-dynamic-import@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-dynamic-import": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 5992012484fb8bda1451369350e475091954ed414dd9ef8654a3c4daa2db0205d4f29c94f5d3dedfbc5a434996375c8304586904337d6af938ac0f27a0033e23 + checksum: 96b1c8a8ad8171d39e9ab106be33bde37ae09b22fb2c449afee9a5edf3c537933d79d963dcdc2694d10677cb96da739cdf1b53454e6a5deab9801f28a818bb2f languageName: node linkType: hard -"@babel/plugin-proposal-export-namespace-from@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-export-namespace-from@npm:7.16.7" +"@babel/plugin-proposal-export-namespace-from@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-proposal-export-namespace-from@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 "@babel/plugin-syntax-export-namespace-from": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 5016079a5305c1c130fea587b42cdce501574739cfefa5b63469dbc1f32d436df0ff42fabf04089fe8b6a00f4ea7563869e944744b457e186c677995983cb166 + checksum: 84ff22bacc5d30918a849bfb7e0e90ae4c5b8d8b65f2ac881803d1cf9068dffbe53bd657b0e4bc4c20b4db301b1c85f1e74183cf29a0dd31e964bd4e97c363ef languageName: node linkType: hard -"@babel/plugin-proposal-json-strings@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-json-strings@npm:7.16.7" +"@babel/plugin-proposal-json-strings@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-json-strings@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-json-strings": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: ea6487918f8d88322ac2a4e5273be6163b0d84a34330c31cee346e23525299de3b4f753bc987951300a79f55b8f4b1971b24d04c0cdfcb7ceb4d636975c215e8 + checksum: 25ba0e6b9d6115174f51f7c6787e96214c90dd4026e266976b248a2ed417fe50fddae72843ffb3cbe324014a18632ce5648dfac77f089da858022b49fd608cb3 languageName: node linkType: hard -"@babel/plugin-proposal-logical-assignment-operators@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-logical-assignment-operators@npm:7.16.7" +"@babel/plugin-proposal-logical-assignment-operators@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-proposal-logical-assignment-operators@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: c4cf18e10f900d40eaa471c4adce4805e67bd845f997a4b9d5653eced4e653187b9950843b2bf7eab6c0c3e753aba222b1d38888e3e14e013f87295c5b014f19 + checksum: dd87fa4a48c6408c5e85dbd6405a65cc8fe909e3090030df46df90df64cdf3e74007381a58ed87608778ee597eff7395d215274009bb3f5d8964b2db5557754f languageName: node linkType: hard -"@babel/plugin-proposal-nullish-coalescing-operator@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-nullish-coalescing-operator@npm:7.16.7" +"@babel/plugin-proposal-nullish-coalescing-operator@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-nullish-coalescing-operator@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: bfafc2701697b5c763dbbb65dd97b56979bfb0922e35be27733699a837aeff22316313ddfdd0fb45129efa3f86617219b77110d05338bc4dca4385d8ce83dd19 + checksum: 949c9ddcdecdaec766ee610ef98f965f928ccc0361dd87cf9f88cf4896a6ccd62fce063d4494778e50da99dea63d270a1be574a62d6ab81cbe9d85884bf55a7d languageName: node linkType: hard -"@babel/plugin-proposal-numeric-separator@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-numeric-separator@npm:7.16.7" +"@babel/plugin-proposal-numeric-separator@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-numeric-separator@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-numeric-separator": ^7.10.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 8e2fb0b32845908c67f80bc637a0968e28a66727d7ffb22b9c801dc355d88e865dc24aec586b00c922c23833ae5d26301b443b53609ea73d8344733cd48a1eca + checksum: f370ea584c55bf4040e1f78c80b4eeb1ce2e6aaa74f87d1a48266493c33931d0b6222d8cee3a082383d6bb648ab8d6b7147a06f974d3296ef3bc39c7851683ec languageName: node linkType: hard -"@babel/plugin-proposal-object-rest-spread@npm:^7.17.3": - version: 7.17.3 - resolution: "@babel/plugin-proposal-object-rest-spread@npm:7.17.3" +"@babel/plugin-proposal-object-rest-spread@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-proposal-object-rest-spread@npm:7.18.9" dependencies: - "@babel/compat-data": ^7.17.0 - "@babel/helper-compilation-targets": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/compat-data": ^7.18.8 + "@babel/helper-compilation-targets": ^7.18.9 + "@babel/helper-plugin-utils": ^7.18.9 "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-transform-parameters": ^7.16.7 + "@babel/plugin-transform-parameters": ^7.18.8 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 02810f158db4aaf6883131621b5d2c7d901ea3c034df2c2b78663f8b26813795d78a346c37e56770a720c54773732fd1d7fe40947dbf11d1d8de0e9a38e856d3 + checksum: 66b9bae741d46edf1c96776d26dfe5d335981e57164ec2450583e3d20dfaa08a5137ffebb897e443913207789f9816bfec4ae845f38762c0196a60949eaffdba languageName: node linkType: hard -"@babel/plugin-proposal-optional-catch-binding@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-optional-catch-binding@npm:7.16.7" +"@babel/plugin-proposal-optional-catch-binding@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-optional-catch-binding@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4a422bb19a23cf80a245c60bea7adbe5dac8ff3bc1a62f05d7155e1eb68d401b13339c94dfd1f3d272972feeb45746f30d52ca0f8d5c63edf6891340878403df + checksum: 7b5b39fb5d8d6d14faad6cb68ece5eeb2fd550fb66b5af7d7582402f974f5bc3684641f7c192a5a57e0f59acfae4aada6786be1eba030881ddc590666eff4d1e languageName: node linkType: hard -"@babel/plugin-proposal-optional-chaining@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-optional-chaining@npm:7.16.7" +"@babel/plugin-proposal-optional-chaining@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-proposal-optional-chaining@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-skip-transparent-expression-wrappers": ^7.16.0 + "@babel/helper-plugin-utils": ^7.18.9 + "@babel/helper-skip-transparent-expression-wrappers": ^7.18.9 "@babel/plugin-syntax-optional-chaining": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: e4a6c1ac7e6817b92a673ea52ab0b7dc1fb39d29fb0820cd414e10ae2cd132bd186b4238dcca881a29fc38fe9d38ed24fc111ba22ca20086481682d343f4f130 + checksum: f2db40e26172f07c50b635cb61e1f36165de3ba868fcf608d967642f0d044b7c6beb0e7ecf17cbd421144b99e1eae7ad6031ded92925343bb0ed1d08707b514f languageName: node linkType: hard -"@babel/plugin-proposal-private-methods@npm:^7.16.11": - version: 7.16.11 - resolution: "@babel/plugin-proposal-private-methods@npm:7.16.11" +"@babel/plugin-proposal-private-methods@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-private-methods@npm:7.18.6" dependencies: - "@babel/helper-create-class-features-plugin": ^7.16.10 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-class-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b333e5aa91c265bb394a57b5f4ae1a34fc8ee73a8d75506b12df258d8b5342107cbd9261f95e606bd3264a5b023db77f1f95be30c2e526683916c57f793f7943 + checksum: 22d8502ee96bca99ad2c8393e8493e2b8d4507576dd054490fd8201a36824373440106f5b098b6d821b026c7e72b0424ff4aeca69ed5f42e48f029d3a156d5ad languageName: node linkType: hard -"@babel/plugin-proposal-private-property-in-object@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.16.7" +"@babel/plugin-proposal-private-property-in-object@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.18.6" dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - "@babel/helper-create-class-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-annotate-as-pure": ^7.18.6 + "@babel/helper-create-class-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 "@babel/plugin-syntax-private-property-in-object": ^7.14.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 666d668f51d8c01aaf0dd87b27a83fc0392884d2c8e9d8e17b3b7011c0d348865dee94b44dc2d7070726e58e3b579728dc2588aaa8140d563f7390743ee90f0a + checksum: c8e56a972930730345f39f2384916fd8e711b3f4b4eae2ca9740e99958980118120d5cc9b6ac150f0965a5a35f825910e2c3013d90be3e9993ab6111df444569 languageName: node linkType: hard -"@babel/plugin-proposal-unicode-property-regex@npm:^7.16.7, @babel/plugin-proposal-unicode-property-regex@npm:^7.4.4": - version: 7.16.7 - resolution: "@babel/plugin-proposal-unicode-property-regex@npm:7.16.7" +"@babel/plugin-proposal-unicode-property-regex@npm:^7.18.6, @babel/plugin-proposal-unicode-property-regex@npm:^7.4.4": + version: 7.18.6 + resolution: "@babel/plugin-proposal-unicode-property-regex@npm:7.18.6" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-regexp-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2b8a33713d456183f0b7d011011e7bd932c08cc06216399a7b2015ab39284b511993dc10a89bbb15d1d728e6a2ef42ca08c3202619aa148cbd48052422ea3995 + checksum: a8575ecb7ff24bf6c6e94808d5c84bb5a0c6dd7892b54f09f4646711ba0ee1e1668032b3c43e3e1dfec2c5716c302e851ac756c1645e15882d73df6ad21ae951 languageName: node linkType: hard @@ -808,6 +705,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-import-assertions@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-syntax-import-assertions@npm:7.18.6" + dependencies: + "@babel/helper-plugin-utils": ^7.18.6 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 54918a05375325ba0c60bc81abfb261e6f118bed2de94e4c17dca9a2006fc25e13b1a8b5504b9a881238ea394fd2f098f60b2eb3a392585d6348874565445e7b + languageName: node + linkType: hard + "@babel/plugin-syntax-import-meta@npm:^7.8.3": version: 7.10.4 resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4" @@ -919,424 +827,428 @@ __metadata: linkType: hard "@babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.17.10 - resolution: "@babel/plugin-syntax-typescript@npm:7.17.10" + version: 7.18.6 + resolution: "@babel/plugin-syntax-typescript@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 43e908acf4a1e267f7bd86dc2fcb015b1fbcc364da43b125289d6a91bd32eeed41e5d9870051f7a3e4e2da9eeff7655f7988b6f27beac06bcb60c054aa5bac6d + checksum: 2cde73725ec51118ebf410bf02d78781c03fa4d3185993fcc9d253b97443381b621c44810084c5dd68b92eb8bdfae0e5b163e91b32bebbb33852383d1815c05d languageName: node linkType: hard -"@babel/plugin-transform-arrow-functions@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-arrow-functions@npm:7.16.7" +"@babel/plugin-transform-arrow-functions@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-arrow-functions@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2a6aa982c6fc80f4de7ccd973507ce5464fab129987cb6661136a7b9b6a020c2b329b912cbc46a68d39b5a18451ba833dcc8d1ca8d615597fec98624ac2add54 + checksum: 900f5c695755062b91eec74da6f9092f40b8fada099058b92576f1e23c55e9813ec437051893a9b3c05cefe39e8ac06303d4a91b384e1c03dd8dc1581ea11602 languageName: node linkType: hard -"@babel/plugin-transform-async-to-generator@npm:^7.16.8": - version: 7.16.8 - resolution: "@babel/plugin-transform-async-to-generator@npm:7.16.8" +"@babel/plugin-transform-async-to-generator@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-async-to-generator@npm:7.18.6" dependencies: - "@babel/helper-module-imports": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-remap-async-to-generator": ^7.16.8 + "@babel/helper-module-imports": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 + "@babel/helper-remap-async-to-generator": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 3a2e781800e3dea1f526324ed259d1f9064c5ea3c9909c0c22b445d4c648ad489c579f358ae20ada11f7725ba67e0ddeb1e0241efadc734771e87dabd4c6820a + checksum: c2cca47468cf1aeefdc7ec35d670e195c86cee4de28a1970648c46a88ce6bd1806ef0bab27251b9e7fb791bb28a64dcd543770efd899f28ee5f7854e64e873d3 languageName: node linkType: hard -"@babel/plugin-transform-block-scoped-functions@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.16.7" +"@babel/plugin-transform-block-scoped-functions@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 591e9f75437bb32ebf9506d28d5c9659c66c0e8e0c19b12924d808d898e68309050aadb783ccd70bb4956555067326ecfa17a402bc77eb3ece3c6863d40b9016 + checksum: 0a0df61f94601e3666bf39f2cc26f5f7b22a94450fb93081edbed967bd752ce3f81d1227fefd3799f5ee2722171b5e28db61379234d1bb85b6ec689589f99d7e languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-block-scoping@npm:7.16.7" +"@babel/plugin-transform-block-scoping@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-block-scoping@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f93b5441af573fc274655f1707aeb4f67a43e926b58f56d89cc35a27877ae0bf198648603cbc19f442579489138f93c3838905895f109aa356996dbc3ed97a68 + checksum: f8064ea431eb7aa349dc5b6be87a650f912b48cd65afde917e8644f6f840d7f9d2ce4795f2aa3955aa5b23a73d4ad38abd03386ae109b4b8702b746c6d35bda3 languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-classes@npm:7.16.7" +"@babel/plugin-transform-classes@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/plugin-transform-classes@npm:7.19.0" dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - "@babel/helper-environment-visitor": ^7.16.7 - "@babel/helper-function-name": ^7.16.7 - "@babel/helper-optimise-call-expression": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-replace-supers": ^7.16.7 - "@babel/helper-split-export-declaration": ^7.16.7 + "@babel/helper-annotate-as-pure": ^7.18.6 + "@babel/helper-compilation-targets": ^7.19.0 + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-function-name": ^7.19.0 + "@babel/helper-optimise-call-expression": ^7.18.6 + "@babel/helper-plugin-utils": ^7.19.0 + "@babel/helper-replace-supers": ^7.18.9 + "@babel/helper-split-export-declaration": ^7.18.6 globals: ^11.1.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 791526a1bf3c4659b94d619536e3181d3ad54887d50539066628c6e695789a3bb264dc1fbc8540169d62a222f623df54defb490c1811ae63bad1e3557d6b3bb0 + checksum: 5500953031fc3eae73f717c7b59ef406158a4a710d566a0f78a4944240bcf98f817f07cf1d6af0e749e21f0dfee29c36412b75d57b0a753c3ad823b70c596b79 languageName: node linkType: hard -"@babel/plugin-transform-computed-properties@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-computed-properties@npm:7.16.7" +"@babel/plugin-transform-computed-properties@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-computed-properties@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 28b17f7cfe643f45920b76dc040cab40d4e54eccf5074fba2658c484feacda9b4885b3854ffaf26292189783fdecc97211519c61831b6708fcbf739cfbcbf31c + checksum: a6bfbea207827d77592628973c0e8cc3319db636506bdc6e81e21582de2e767890e6975b382d0511e9ec3773b9f43691185df90832883bbf9251f688d27fbc1d languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.17.7": - version: 7.17.7 - resolution: "@babel/plugin-transform-destructuring@npm:7.17.7" +"@babel/plugin-transform-destructuring@npm:^7.18.13": + version: 7.18.13 + resolution: "@babel/plugin-transform-destructuring@npm:7.18.13" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 767ecf6640fea9a06a4859f0c34daa30ac7d146a96476caa1f77081d5b6e43699f45e14acd52682078f2b7c230ff0814312b41f61b21ca2b5f9c5a2cc93c2b58 + checksum: 83e44ec93a4cfbf69376db8836d00ec803820081bf0f8b6cea73a9b3cd320b8285768d5b385744af4a27edda4b6502245c52d3ed026ea61356faf57bfe78effb languageName: node linkType: hard -"@babel/plugin-transform-dotall-regex@npm:^7.16.7, @babel/plugin-transform-dotall-regex@npm:^7.4.4": - version: 7.16.7 - resolution: "@babel/plugin-transform-dotall-regex@npm:7.16.7" +"@babel/plugin-transform-dotall-regex@npm:^7.18.6, @babel/plugin-transform-dotall-regex@npm:^7.4.4": + version: 7.18.6 + resolution: "@babel/plugin-transform-dotall-regex@npm:7.18.6" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-regexp-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 554570dddfd5bfd87ab307be520f69a3d4ed2d2db677c165971b400d4c96656d0c165b318e69f1735612dcd12e04c0ee257697dc26800e8a572ca73bc05fa0f4 + checksum: cbe5d7063eb8f8cca24cd4827bc97f5641166509e58781a5f8aa47fb3d2d786ce4506a30fca2e01f61f18792783a5cb5d96bf5434c3dd1ad0de8c9cc625a53da languageName: node linkType: hard -"@babel/plugin-transform-duplicate-keys@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-duplicate-keys@npm:7.16.7" +"@babel/plugin-transform-duplicate-keys@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-duplicate-keys@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b96f6e9f7b33a91ad0eb6b793e4da58b7a0108b58269109f391d57078d26e043b3872c95429b491894ae6400e72e44d9b744c9b112b8433c99e6969b767e30ed + checksum: 220bf4a9fec5c4d4a7b1de38810350260e8ea08481bf78332a464a21256a95f0df8cd56025f346238f09b04f8e86d4158fafc9f4af57abaef31637e3b58bd4fe languageName: node linkType: hard -"@babel/plugin-transform-exponentiation-operator@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.16.7" +"@babel/plugin-transform-exponentiation-operator@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.18.6" dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-builder-binary-assignment-operator-visitor": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 8082c79268f5b1552292bd3abbfed838a1131747e62000146e70670707b518602e907bbe3aef0fda824a2eebe995a9d897bd2336a039c5391743df01608673b0 + checksum: 7f70222f6829c82a36005508d34ddbe6fd0974ae190683a8670dd6ff08669aaf51fef2209d7403f9bd543cb2d12b18458016c99a6ed0332ccedb3ea127b01229 languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-for-of@npm:7.16.7" +"@babel/plugin-transform-for-of@npm:^7.18.8": + version: 7.18.8 + resolution: "@babel/plugin-transform-for-of@npm:7.18.8" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 35c9264ee4bef814818123d70afe8b2f0a85753a0a9dc7b73f93a71cadc5d7de852f1a3e300a7c69a491705805704611de1e2ccceb5686f7828d6bca2e5a7306 + checksum: ca64c623cf0c7a80ab6f07ebd3e6e4ade95e2ae806696f70b43eafe6394fa8ce21f2b1ffdd15df2067f7363d2ecfe26472a97c6c774403d2163fa05f50c98f17 languageName: node linkType: hard -"@babel/plugin-transform-function-name@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-function-name@npm:7.16.7" +"@babel/plugin-transform-function-name@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-function-name@npm:7.18.9" dependencies: - "@babel/helper-compilation-targets": ^7.16.7 - "@babel/helper-function-name": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-compilation-targets": ^7.18.9 + "@babel/helper-function-name": ^7.18.9 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4d97d0b84461cdd5d5aa2d010cdaf30f1f83a92a0dedd3686cbc7e90dc1249a70246f5bac0c1f3cd3f1dbfb03f7aac437776525a0c90cafd459776ea4fcc6bde + checksum: 62dd9c6cdc9714704efe15545e782ee52d74dc73916bf954b4d3bee088fb0ec9e3c8f52e751252433656c09f744b27b757fc06ed99bcde28e8a21600a1d8e597 languageName: node linkType: hard -"@babel/plugin-transform-literals@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-literals@npm:7.16.7" +"@babel/plugin-transform-literals@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-literals@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: a9565d999fc7a72a391ef843cf66028c38ca858537c7014d9ea8ea587a59e5f952d9754bdcca6ca0446e84653e297d417d4faedccb9e4221af1aa30f25d918e0 + checksum: 3458dd2f1a47ac51d9d607aa18f3d321cbfa8560a985199185bed5a906bb0c61ba85575d386460bac9aed43fdd98940041fae5a67dff286f6f967707cff489f8 languageName: node linkType: hard -"@babel/plugin-transform-member-expression-literals@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-member-expression-literals@npm:7.16.7" +"@babel/plugin-transform-member-expression-literals@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-member-expression-literals@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: fdf5b22abab2b770e69348ce7f99796c3e0e1e7ce266afdbe995924284704930fa989323bdbda7070db8adb45a72f39eaa1dbebf18b67fc44035ec00c6ae3300 + checksum: 35a3d04f6693bc6b298c05453d85ee6e41cc806538acb6928427e0e97ae06059f97d2f07d21495fcf5f70d3c13a242e2ecbd09d5c1fcb1b1a73ff528dcb0b695 languageName: node linkType: hard -"@babel/plugin-transform-modules-amd@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-modules-amd@npm:7.16.7" +"@babel/plugin-transform-modules-amd@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-modules-amd@npm:7.18.6" dependencies: - "@babel/helper-module-transforms": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-module-transforms": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 babel-plugin-dynamic-import-node: ^2.3.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 9ac251ee96183b10cf9b4ec8f9e8d52e14ec186a56103f6c07d0c69e99faa60391f6bac67da733412975e487bd36adb403e2fc99bae6b785bf1413e9d928bc71 + checksum: f60c4c4e0eaec41e42c003cbab44305da7a8e05b2c9bdfc2b3fe0f9e1d7441c959ff5248aa03e350abe530e354028cbf3aa20bf07067b11510997dad8dd39be0 languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.17.9": - version: 7.17.9 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.17.9" +"@babel/plugin-transform-modules-commonjs@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.18.6" dependencies: - "@babel/helper-module-transforms": ^7.17.7 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-simple-access": ^7.17.7 + "@babel/helper-module-transforms": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 + "@babel/helper-simple-access": ^7.18.6 babel-plugin-dynamic-import-node: ^2.3.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 23f248a28b43978c7ee187a91392510f665db32f2cc869007da4922e5a83da47f27ecd5da37c8f66fe6b89e4b324f1a978a4493ae59edf2b3129387d844fde1b + checksum: 7e356e3df8a6a8542cced7491ec5b1cc1093a88d216a59e63a5d2b9fe9d193cbea864f680a41429e41a4f9ecec930aa5b0b8f57e2b17b3b4d27923bb12ba5d14 languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.17.8": - version: 7.17.8 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.17.8" +"@babel/plugin-transform-modules-systemjs@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.19.0" dependencies: - "@babel/helper-hoist-variables": ^7.16.7 - "@babel/helper-module-transforms": ^7.17.7 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-validator-identifier": ^7.16.7 + "@babel/helper-hoist-variables": ^7.18.6 + "@babel/helper-module-transforms": ^7.19.0 + "@babel/helper-plugin-utils": ^7.19.0 + "@babel/helper-validator-identifier": ^7.18.6 babel-plugin-dynamic-import-node: ^2.3.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 058c0e7987aab64c4019bc9eab3f80c5dd05bec737e230e5c60e9222dfb3d01b2dfa3aa1db6cbb75a4095c40af3bba2e3a60170b1570a158d3e781376569ce49 + checksum: a0742deee4a076d6fc303d036c1ea2bea9b7d91af390483fe91fc415f9cb43925bb5dd930fdcb8fcdc9d4c7a22774a3cec521c67f1422a9b473debcb85ee57f9 languageName: node linkType: hard -"@babel/plugin-transform-modules-umd@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-modules-umd@npm:7.16.7" +"@babel/plugin-transform-modules-umd@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-modules-umd@npm:7.18.6" dependencies: - "@babel/helper-module-transforms": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-module-transforms": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d1433f8b0e0b3c9f892aa530f08fe3ba653a5e51fe1ed6034ac7d45d4d6f22c3ba99186b72e41ad9ce5d8dcf964104c3da2419f15fcdcf5ba05c5fda3ea2cefc + checksum: c3b6796c6f4579f1ba5ab0cdcc73910c1e9c8e1e773c507c8bb4da33072b3ae5df73c6d68f9126dab6e99c24ea8571e1563f8710d7c421fac1cde1e434c20153 languageName: node linkType: hard -"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.17.10": - version: 7.17.10 - resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.17.10" +"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.19.0" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.17.0 + "@babel/helper-create-regexp-features-plugin": ^7.19.0 + "@babel/helper-plugin-utils": ^7.19.0 peerDependencies: "@babel/core": ^7.0.0 - checksum: a2be5f9f23d4dd49106e1c84a1cb625a56d6c7e5cb466602151f9e05aa0a70f68b52206f034447d37e6790914ea953ebf2ab705f377ee7ef00e14453ba3c3d6a + checksum: 60f7b2c537fa3e8392f19b1f1026ba68844c5dc7942867e7a96a636d8a52d4766629b898e59aa690d3806bf02a7fa52e12d1f7c1ca2ef4fa2b53f3fe0a835117 languageName: node linkType: hard -"@babel/plugin-transform-new-target@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-new-target@npm:7.16.7" +"@babel/plugin-transform-new-target@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-new-target@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 7410c3e68abc835f87a98d40269e65fb1a05c131decbb6721a80ed49a01bd0c53abb6b8f7f52d5055815509022790e1accca32e975c02f2231ac3cf13d8af768 + checksum: bd780e14f46af55d0ae8503b3cb81ca86dcc73ed782f177e74f498fff934754f9e9911df1f8f3bd123777eed7c1c1af4d66abab87c8daae5403e7719a6b845d1 languageName: node linkType: hard -"@babel/plugin-transform-object-super@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-object-super@npm:7.16.7" +"@babel/plugin-transform-object-super@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-object-super@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-replace-supers": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 + "@babel/helper-replace-supers": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 46e3c879f4a93e904f2ecf83233d40c48c832bdbd82a67cab1f432db9aa51702e40d9e51e5800613e12299974f90f4ed3869e1273dbca8642984266320c5f341 + checksum: 0fcb04e15deea96ae047c21cb403607d49f06b23b4589055993365ebd7a7d7541334f06bf9642e90075e66efce6ebaf1eb0ef066fbbab802d21d714f1aac3aef languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-parameters@npm:7.16.7" +"@babel/plugin-transform-parameters@npm:^7.18.8": + version: 7.18.8 + resolution: "@babel/plugin-transform-parameters@npm:7.18.8" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4d6904376db82d0b35f0a6cce08f630daf8608d94e903d6c7aff5bd742b251651bd1f88cdf9f16cad98aba5fc7c61da8635199364865fad6367d5ae37cf56cc1 + checksum: 2b5863300da60face8a250d91da16294333bd5626e9721b13a3ba2078bd2a5a190e32c6e7a1323d5f547f579aeb2804ff49a62a55fcad2b1d099e55a55b788ea languageName: node linkType: hard -"@babel/plugin-transform-property-literals@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-property-literals@npm:7.16.7" +"@babel/plugin-transform-property-literals@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-property-literals@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b5674458991a9b0e8738989d70faa88c7f98ed3df923c119f1225069eed72fe5e0ce947b1adc91e378f5822fbdeb7a672f496fd1c75c4babcc88169e3a7c3229 + checksum: 1c16e64de554703f4b547541de2edda6c01346dd3031d4d29e881aa7733785cd26d53611a4ccf5353f4d3e69097bb0111c0a93ace9e683edd94fea28c4484144 languageName: node linkType: hard -"@babel/plugin-transform-regenerator@npm:^7.17.9": - version: 7.17.9 - resolution: "@babel/plugin-transform-regenerator@npm:7.17.9" +"@babel/plugin-transform-regenerator@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-regenerator@npm:7.18.6" dependencies: + "@babel/helper-plugin-utils": ^7.18.6 regenerator-transform: ^0.15.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: bf92f7228397615f12fa62d1decbe854ee9065d44e55036f99bf312783d51b082981bab38ba61de9858f7e20513484a043bfa958c0ce4a0d4d1710710df029a9 + checksum: 60bd482cb0343c714f85c3e19a13b3b5fa05ee336c079974091c0b35e263307f4e661f4555dff90707a87d5efe19b1d51835db44455405444ac1813e268ad750 languageName: node linkType: hard -"@babel/plugin-transform-reserved-words@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-reserved-words@npm:7.16.7" +"@babel/plugin-transform-reserved-words@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-reserved-words@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 00218a646e99a97c1f10b77c41c178ca1b91d0e6cf18dd4ca3c59b8a5ad721db04ef508f49be4cd0dcca7742490dbb145307b706a2dbea1917d5e5f7ba2f31b7 + checksum: 0738cdc30abdae07c8ec4b233b30c31f68b3ff0eaa40eddb45ae607c066127f5fa99ddad3c0177d8e2832e3a7d3ad115775c62b431ebd6189c40a951b867a80c languageName: node linkType: hard -"@babel/plugin-transform-shorthand-properties@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-shorthand-properties@npm:7.16.7" +"@babel/plugin-transform-shorthand-properties@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-shorthand-properties@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: ca381ecf8f48696512172deca40af46b1f64e3497186fdc2c9009286d8f06b468c4d61cdc392dc8b0c165298117dda67be9e2ff0e99d7691b0503f1240d4c62b + checksum: b8e4e8acc2700d1e0d7d5dbfd4fdfb935651913de6be36e6afb7e739d8f9ca539a5150075a0f9b79c88be25ddf45abb912fe7abf525f0b80f5b9d9860de685d7 languageName: node linkType: hard -"@babel/plugin-transform-spread@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-spread@npm:7.16.7" +"@babel/plugin-transform-spread@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/plugin-transform-spread@npm:7.19.0" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-skip-transparent-expression-wrappers": ^7.16.0 + "@babel/helper-plugin-utils": ^7.19.0 + "@babel/helper-skip-transparent-expression-wrappers": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 6e961af1a70586bb72dd85e8296cee857c5dadd73225fccd0fe261c0d98652a82d69c65f3e9dc31ce019a12e9677262678479b96bd2d9140ddf6514618362828 + checksum: e73a4deb095999185e70b524d0ff4e35df50fcda58299e700a6149a15bbc1a9b369ef1cef384e15a54b3c3ce316cc0f054dbf249dcd0d1ca59f4281dd4df9718 languageName: node linkType: hard -"@babel/plugin-transform-sticky-regex@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-sticky-regex@npm:7.16.7" +"@babel/plugin-transform-sticky-regex@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-sticky-regex@npm:7.18.6" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d59e20121ff0a483e29364eff8bb42cd8a0b7a3158141eea5b6f219227e5b873ea70f317f65037c0f557887a692ac993b72f99641a37ea6ec0ae8000bfab1343 + checksum: 68ea18884ae9723443ffa975eb736c8c0d751265859cd3955691253f7fee37d7a0f7efea96c8a062876af49a257a18ea0ed5fea0d95a7b3611ce40f7ee23aee3 languageName: node linkType: hard -"@babel/plugin-transform-template-literals@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-template-literals@npm:7.16.7" +"@babel/plugin-transform-template-literals@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-template-literals@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b55a519dd8b957247ebad3cab21918af5adca4f6e6c87819501cfe3d4d4bccda25bc296c7dfc8a30909b4ad905902aeb9d55ad955cb9f5cbc74b42dab32baa18 + checksum: 3d2fcd79b7c345917f69b92a85bdc3ddd68ce2c87dc70c7d61a8373546ccd1f5cb8adc8540b49dfba08e1b82bb7b3bbe23a19efdb2b9c994db2db42906ca9fb2 languageName: node linkType: hard -"@babel/plugin-transform-typeof-symbol@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-typeof-symbol@npm:7.16.7" +"@babel/plugin-transform-typeof-symbol@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/plugin-transform-typeof-symbol@npm:7.18.9" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 739a8c439dacbd9af62cfbfa0a7cbc3f220849e5fc774e5ef708a09186689a724c41a1d11323e7d36588d24f5481c8b702c86ff7be8da2e2fed69bed0175f625 + checksum: e754e0d8b8a028c52e10c148088606e3f7a9942c57bd648fc0438e5b4868db73c386a5ed47ab6d6f0594aae29ee5ffc2ffc0f7ebee7fae560a066d6dea811cd4 languageName: node linkType: hard -"@babel/plugin-transform-unicode-escapes@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.16.7" +"@babel/plugin-transform-unicode-escapes@npm:^7.18.10": + version: 7.18.10 + resolution: "@babel/plugin-transform-unicode-escapes@npm:7.18.10" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-plugin-utils": ^7.18.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d10c3b5baa697ca2d9ecce2fd7705014d7e1ddd86ed684ccec378f7ad4d609ab970b5546d6cdbe242089ecfc7a79009d248cf4f8ee87d629485acfb20c0d9160 + checksum: f5baca55cb3c11bc08ec589f5f522d85c1ab509b4d11492437e45027d64ae0b22f0907bd1381e8d7f2a436384bb1f9ad89d19277314242c5c2671a0f91d0f9cd languageName: node linkType: hard -"@babel/plugin-transform-unicode-regex@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-unicode-regex@npm:7.16.7" +"@babel/plugin-transform-unicode-regex@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-transform-unicode-regex@npm:7.18.6" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-regexp-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: ef7721cfb11b269809555b1c392732566c49f6ced58e0e990c0e81e58a934bbab3072dcbe92d3a20d60e3e41036ecf987bcc63a7cde90711a350ad774667e5e6 + checksum: d9e18d57536a2d317fb0b7c04f8f55347f3cfacb75e636b4c6fa2080ab13a3542771b5120e726b598b815891fc606d1472ac02b749c69fd527b03847f22dc25e languageName: node linkType: hard "@babel/preset-env@npm:^7.16.11": - version: 7.17.10 - resolution: "@babel/preset-env@npm:7.17.10" - dependencies: - "@babel/compat-data": ^7.17.10 - "@babel/helper-compilation-targets": ^7.17.10 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-validator-option": ^7.16.7 - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.16.7 - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.16.7 - "@babel/plugin-proposal-async-generator-functions": ^7.16.8 - "@babel/plugin-proposal-class-properties": ^7.16.7 - "@babel/plugin-proposal-class-static-block": ^7.17.6 - "@babel/plugin-proposal-dynamic-import": ^7.16.7 - "@babel/plugin-proposal-export-namespace-from": ^7.16.7 - "@babel/plugin-proposal-json-strings": ^7.16.7 - "@babel/plugin-proposal-logical-assignment-operators": ^7.16.7 - "@babel/plugin-proposal-nullish-coalescing-operator": ^7.16.7 - "@babel/plugin-proposal-numeric-separator": ^7.16.7 - "@babel/plugin-proposal-object-rest-spread": ^7.17.3 - "@babel/plugin-proposal-optional-catch-binding": ^7.16.7 - "@babel/plugin-proposal-optional-chaining": ^7.16.7 - "@babel/plugin-proposal-private-methods": ^7.16.11 - "@babel/plugin-proposal-private-property-in-object": ^7.16.7 - "@babel/plugin-proposal-unicode-property-regex": ^7.16.7 + version: 7.19.0 + resolution: "@babel/preset-env@npm:7.19.0" + dependencies: + "@babel/compat-data": ^7.19.0 + "@babel/helper-compilation-targets": ^7.19.0 + "@babel/helper-plugin-utils": ^7.19.0 + "@babel/helper-validator-option": ^7.18.6 + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.18.6 + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.18.9 + "@babel/plugin-proposal-async-generator-functions": ^7.19.0 + "@babel/plugin-proposal-class-properties": ^7.18.6 + "@babel/plugin-proposal-class-static-block": ^7.18.6 + "@babel/plugin-proposal-dynamic-import": ^7.18.6 + "@babel/plugin-proposal-export-namespace-from": ^7.18.9 + "@babel/plugin-proposal-json-strings": ^7.18.6 + "@babel/plugin-proposal-logical-assignment-operators": ^7.18.9 + "@babel/plugin-proposal-nullish-coalescing-operator": ^7.18.6 + "@babel/plugin-proposal-numeric-separator": ^7.18.6 + "@babel/plugin-proposal-object-rest-spread": ^7.18.9 + "@babel/plugin-proposal-optional-catch-binding": ^7.18.6 + "@babel/plugin-proposal-optional-chaining": ^7.18.9 + "@babel/plugin-proposal-private-methods": ^7.18.6 + "@babel/plugin-proposal-private-property-in-object": ^7.18.6 + "@babel/plugin-proposal-unicode-property-regex": ^7.18.6 "@babel/plugin-syntax-async-generators": ^7.8.4 "@babel/plugin-syntax-class-properties": ^7.12.13 "@babel/plugin-syntax-class-static-block": ^7.14.5 "@babel/plugin-syntax-dynamic-import": ^7.8.3 "@babel/plugin-syntax-export-namespace-from": ^7.8.3 + "@babel/plugin-syntax-import-assertions": ^7.18.6 "@babel/plugin-syntax-json-strings": ^7.8.3 "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 @@ -1346,48 +1258,48 @@ __metadata: "@babel/plugin-syntax-optional-chaining": ^7.8.3 "@babel/plugin-syntax-private-property-in-object": ^7.14.5 "@babel/plugin-syntax-top-level-await": ^7.14.5 - "@babel/plugin-transform-arrow-functions": ^7.16.7 - "@babel/plugin-transform-async-to-generator": ^7.16.8 - "@babel/plugin-transform-block-scoped-functions": ^7.16.7 - "@babel/plugin-transform-block-scoping": ^7.16.7 - "@babel/plugin-transform-classes": ^7.16.7 - "@babel/plugin-transform-computed-properties": ^7.16.7 - "@babel/plugin-transform-destructuring": ^7.17.7 - "@babel/plugin-transform-dotall-regex": ^7.16.7 - "@babel/plugin-transform-duplicate-keys": ^7.16.7 - "@babel/plugin-transform-exponentiation-operator": ^7.16.7 - "@babel/plugin-transform-for-of": ^7.16.7 - "@babel/plugin-transform-function-name": ^7.16.7 - "@babel/plugin-transform-literals": ^7.16.7 - "@babel/plugin-transform-member-expression-literals": ^7.16.7 - "@babel/plugin-transform-modules-amd": ^7.16.7 - "@babel/plugin-transform-modules-commonjs": ^7.17.9 - "@babel/plugin-transform-modules-systemjs": ^7.17.8 - "@babel/plugin-transform-modules-umd": ^7.16.7 - "@babel/plugin-transform-named-capturing-groups-regex": ^7.17.10 - "@babel/plugin-transform-new-target": ^7.16.7 - "@babel/plugin-transform-object-super": ^7.16.7 - "@babel/plugin-transform-parameters": ^7.16.7 - "@babel/plugin-transform-property-literals": ^7.16.7 - "@babel/plugin-transform-regenerator": ^7.17.9 - "@babel/plugin-transform-reserved-words": ^7.16.7 - "@babel/plugin-transform-shorthand-properties": ^7.16.7 - "@babel/plugin-transform-spread": ^7.16.7 - "@babel/plugin-transform-sticky-regex": ^7.16.7 - "@babel/plugin-transform-template-literals": ^7.16.7 - "@babel/plugin-transform-typeof-symbol": ^7.16.7 - "@babel/plugin-transform-unicode-escapes": ^7.16.7 - "@babel/plugin-transform-unicode-regex": ^7.16.7 + "@babel/plugin-transform-arrow-functions": ^7.18.6 + "@babel/plugin-transform-async-to-generator": ^7.18.6 + "@babel/plugin-transform-block-scoped-functions": ^7.18.6 + "@babel/plugin-transform-block-scoping": ^7.18.9 + "@babel/plugin-transform-classes": ^7.19.0 + "@babel/plugin-transform-computed-properties": ^7.18.9 + "@babel/plugin-transform-destructuring": ^7.18.13 + "@babel/plugin-transform-dotall-regex": ^7.18.6 + "@babel/plugin-transform-duplicate-keys": ^7.18.9 + "@babel/plugin-transform-exponentiation-operator": ^7.18.6 + "@babel/plugin-transform-for-of": ^7.18.8 + "@babel/plugin-transform-function-name": ^7.18.9 + "@babel/plugin-transform-literals": ^7.18.9 + "@babel/plugin-transform-member-expression-literals": ^7.18.6 + "@babel/plugin-transform-modules-amd": ^7.18.6 + "@babel/plugin-transform-modules-commonjs": ^7.18.6 + "@babel/plugin-transform-modules-systemjs": ^7.19.0 + "@babel/plugin-transform-modules-umd": ^7.18.6 + "@babel/plugin-transform-named-capturing-groups-regex": ^7.19.0 + "@babel/plugin-transform-new-target": ^7.18.6 + "@babel/plugin-transform-object-super": ^7.18.6 + "@babel/plugin-transform-parameters": ^7.18.8 + "@babel/plugin-transform-property-literals": ^7.18.6 + "@babel/plugin-transform-regenerator": ^7.18.6 + "@babel/plugin-transform-reserved-words": ^7.18.6 + "@babel/plugin-transform-shorthand-properties": ^7.18.6 + "@babel/plugin-transform-spread": ^7.19.0 + "@babel/plugin-transform-sticky-regex": ^7.18.6 + "@babel/plugin-transform-template-literals": ^7.18.9 + "@babel/plugin-transform-typeof-symbol": ^7.18.9 + "@babel/plugin-transform-unicode-escapes": ^7.18.10 + "@babel/plugin-transform-unicode-regex": ^7.18.6 "@babel/preset-modules": ^0.1.5 - "@babel/types": ^7.17.10 - babel-plugin-polyfill-corejs2: ^0.3.0 - babel-plugin-polyfill-corejs3: ^0.5.0 - babel-plugin-polyfill-regenerator: ^0.3.0 + "@babel/types": ^7.19.0 + babel-plugin-polyfill-corejs2: ^0.3.2 + babel-plugin-polyfill-corejs3: ^0.5.3 + babel-plugin-polyfill-regenerator: ^0.4.0 core-js-compat: ^3.22.1 semver: ^6.3.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d81a11a0866e9a90eaa799211a609f3f3838eebcaaa717c63438cbb9c90e99ed336822717614bf974b90438e1f5c6157c9b43a0bfceece5b2c9188d67cbbae92 + checksum: ae1866b9a6c9749d52618f39aab8c369e0d6dc88e327341fae932411a0d51db2ec51b882cebc62ff3d49443261a6940e3fc03762ff3925d165884e7990eb612c languageName: node linkType: hard @@ -1406,60 +1318,52 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/runtime@npm:7.18.9" - dependencies: - regenerator-runtime: ^0.13.4 - checksum: 36dd736baba7164e82b3cc9d43e081f0cb2d05ff867ad39cac515d99546cee75b7f782018b02a3dcf5f2ef3d27f319faa68965fdfec49d4912c60c6002353a2e - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.8.4": - version: 7.17.9 - resolution: "@babel/runtime@npm:7.17.9" +"@babel/runtime@npm:^7.18.9, @babel/runtime@npm:^7.8.4": + version: 7.19.0 + resolution: "@babel/runtime@npm:7.19.0" dependencies: regenerator-runtime: ^0.13.4 - checksum: 4d56bdb82890f386d5a57c40ef985a0ed7f0a78f789377a2d0c3e8826819e0f7f16ba0fe906d9b2241c5f7ca56630ef0653f5bb99f03771f7b87ff8af4bf5fe3 + checksum: fa69c351bb05e1db3ceb9a02fdcf620c234180af68cdda02152d3561015f6d55277265d3109815992f96d910f3db709458cae4f8df1c3def66f32e0867d82294 languageName: node linkType: hard -"@babel/template@npm:^7.16.7, @babel/template@npm:^7.3.3": - version: 7.16.7 - resolution: "@babel/template@npm:7.16.7" +"@babel/template@npm:^7.18.10, @babel/template@npm:^7.3.3": + version: 7.18.10 + resolution: "@babel/template@npm:7.18.10" dependencies: - "@babel/code-frame": ^7.16.7 - "@babel/parser": ^7.16.7 - "@babel/types": ^7.16.7 - checksum: 10cd112e89276e00f8b11b55a51c8b2f1262c318283a980f4d6cdb0286dc05734b9aaeeb9f3ad3311900b09bc913e02343fcaa9d4a4f413964aaab04eb84ac4a + "@babel/code-frame": ^7.18.6 + "@babel/parser": ^7.18.10 + "@babel/types": ^7.18.10 + checksum: 93a6aa094af5f355a72bd55f67fa1828a046c70e46f01b1606e6118fa1802b6df535ca06be83cc5a5e834022be95c7b714f0a268b5f20af984465a71e28f1473 languageName: node linkType: hard -"@babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.16.7, @babel/traverse@npm:^7.16.8, @babel/traverse@npm:^7.17.10, @babel/traverse@npm:^7.17.3, @babel/traverse@npm:^7.17.9, @babel/traverse@npm:^7.7.2": - version: 7.17.10 - resolution: "@babel/traverse@npm:7.17.10" +"@babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.19.0, @babel/traverse@npm:^7.7.2": + version: 7.19.0 + resolution: "@babel/traverse@npm:7.19.0" dependencies: - "@babel/code-frame": ^7.16.7 - "@babel/generator": ^7.17.10 - "@babel/helper-environment-visitor": ^7.16.7 - "@babel/helper-function-name": ^7.17.9 - "@babel/helper-hoist-variables": ^7.16.7 - "@babel/helper-split-export-declaration": ^7.16.7 - "@babel/parser": ^7.17.10 - "@babel/types": ^7.17.10 + "@babel/code-frame": ^7.18.6 + "@babel/generator": ^7.19.0 + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-function-name": ^7.19.0 + "@babel/helper-hoist-variables": ^7.18.6 + "@babel/helper-split-export-declaration": ^7.18.6 + "@babel/parser": ^7.19.0 + "@babel/types": ^7.19.0 debug: ^4.1.0 globals: ^11.1.0 - checksum: 44ec0a59aa274b59464d52b1796eb6e54c67ae0f946de0d608068e28b1ab7065bdf53c0169d9102854cb00aa01944c83e722f08aeab96d9cc6bf56f8aede70fd + checksum: dcbd1316c9f4bf3cefee45b6f5194590563aa5d123500a60d3c8d714bef279205014c8e599ebafc469967199a7622e1444cd0235c16d4243da437e3f1281771e languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.16.0, @babel/types@npm:^7.16.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.17.10, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": - version: 7.17.10 - resolution: "@babel/types@npm:7.17.10" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.10, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.19.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": + version: 7.19.0 + resolution: "@babel/types@npm:7.19.0" dependencies: - "@babel/helper-validator-identifier": ^7.16.7 + "@babel/helper-string-parser": ^7.18.10 + "@babel/helper-validator-identifier": ^7.18.6 to-fast-properties: ^2.0.0 - checksum: 40cfc3f43a3ab7374df8ee6844793f804c65e7bea0fd1b090886b425106ba26e16e8fa698ae4b2caf2746083fe3e62f03f12997a5982e0d131700f17cbdcfca1 + checksum: 9b346715a68aeede70ba9c685a144b0b26c53bcd595d448e24c8fa8df4d5956a5712e56ebadb7c85dcc32f218ee42788e37b93d50d3295c992072224cb3ef3fe languageName: node linkType: hard @@ -1470,254 +1374,549 @@ __metadata: languageName: node linkType: hard -"@cspotcode/source-map-consumer@npm:0.8.0": - version: 0.8.0 - resolution: "@cspotcode/source-map-consumer@npm:0.8.0" - checksum: c0c16ca3d2f58898f1bd74c4f41a189dbcc202e642e60e489cbcc2e52419c4e89bdead02c886a12fb13ea37798ede9e562b2321df997ebc210ae9bd881561b4e - languageName: node - linkType: hard - -"@cspotcode/source-map-support@npm:0.7.0": - version: 0.7.0 - resolution: "@cspotcode/source-map-support@npm:0.7.0" +"@cspotcode/source-map-support@npm:^0.8.0": + version: 0.8.1 + resolution: "@cspotcode/source-map-support@npm:0.8.1" dependencies: - "@cspotcode/source-map-consumer": 0.8.0 - checksum: 9faddda7757cd778b5fd6812137b2cc265810043680d6399acc20441668fafcdc874053be9dccd0d9110087287bfad27eb3bf342f72bceca9aa9059f5d0c4be8 + "@jridgewell/trace-mapping": 0.3.9 + checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa languageName: node linkType: hard -"@eslint/eslintrc@npm:^1.2.3": - version: 1.2.3 - resolution: "@eslint/eslintrc@npm:1.2.3" +"@eslint/eslintrc@npm:^1.3.2": + version: 1.3.2 + resolution: "@eslint/eslintrc@npm:1.3.2" dependencies: ajv: ^6.12.4 debug: ^4.3.2 - espree: ^9.3.2 - globals: ^13.9.0 + espree: ^9.4.0 + globals: ^13.15.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: 48e7b7ac05cd514eee2ebb1d487600f0dd637ac21f63605e353cff6a08c7223275fe4f571d15ee9deae4e78c53edc73369ffcbed15fba4dfc1806179dbf4dc85 + checksum: 2074dca47d7e1c5c6323ff353f690f4b25d3ab53fe7d27337e2592d37a894cf60ca0e85ca66b50ff2db0bc7e630cc1e9c7347d65bb185b61416565584c38999c languageName: node linkType: hard -"@gar/promisify@npm:^1.0.1, @gar/promisify@npm:^1.1.3": - version: 1.1.3 - resolution: "@gar/promisify@npm:1.1.3" - checksum: 4059f790e2d07bf3c3ff3e0fec0daa8144fe35c1f6e0111c9921bd32106adaa97a4ab096ad7dab1e28ee6a9060083c4d1a4ada42a7f5f3f7a96b8812e2b757c1 +"@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/abi@npm:5.7.0" + dependencies: + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/hash": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: bc6962bb6cb854e4d2a4d65b2c49c716477675b131b1363312234bdbb7e19badb7d9ce66f4ca2a70ae2ea84f7123dbc4e300a1bfe5d58864a7eafabc1466627e languageName: node linkType: hard -"@graphile-contrib/pg-many-to-many@npm:^1.0.1": - version: 1.0.1 - resolution: "@graphile-contrib/pg-many-to-many@npm:1.0.1" - checksum: 99b7d5ebadd5525727dff279caf7261ff000e8bf37c42eafe5491e44101aebef60ed29e3111319219e01cb7b0a61e6ded843843b1e9d4e4745926f9b5dfe4a17 +"@ethersproject/abstract-provider@npm:5.7.0, @ethersproject/abstract-provider@npm:^5.6.1, @ethersproject/abstract-provider@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/abstract-provider@npm:5.7.0" + dependencies: + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/networks": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@ethersproject/web": ^5.7.0 + checksum: 74cf4696245cf03bb7cc5b6cbf7b4b89dd9a79a1c4688126d214153a938126d4972d42c93182198653ce1de35f2a2cad68be40337d4774b3698a39b28f0228a8 languageName: node linkType: hard -"@graphile-contrib/pg-simplify-inflector@npm:^6.1.0": - version: 6.1.0 - resolution: "@graphile-contrib/pg-simplify-inflector@npm:6.1.0" - checksum: cd9ca7d2769f60b77ad83368b128a6c6fd6e596442b5094a8a8473a7ad92df1496c4c278106858daafe65489f7428dfd816c23b36c6de73092af0e05c8287822 +"@ethersproject/abstract-signer@npm:5.7.0, @ethersproject/abstract-signer@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/abstract-signer@npm:5.7.0" + dependencies: + "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + checksum: a823dac9cfb761e009851050ebebd5b229d1b1cc4a75b125c2da130ff37e8218208f7f9d1386f77407705b889b23d4a230ad67185f8872f083143e0073cbfbe3 languageName: node linkType: hard -"@graphile/lru@npm:4.11.0": - version: 4.11.0 - resolution: "@graphile/lru@npm:4.11.0" +"@ethersproject/address@npm:5.7.0, @ethersproject/address@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/address@npm:5.7.0" dependencies: - tslib: ^2.0.1 - checksum: c92fdbcdf3d8cd75666f2d62c8afddf7cbf9b30ce3a9cee76f56553e6993aa4fe003d69b3eb2795c95fb8203670dd9dd98fc57bc3f51bf58b6bb5a6735f9213e + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/rlp": ^5.7.0 + checksum: 64ea5ebea9cc0e845c413e6cb1e54e157dd9fc0dffb98e239d3a3efc8177f2ff798cd4e3206cf3660ee8faeb7bef1a47dc0ebef0d7b132c32e61e550c7d4c843 languageName: node linkType: hard -"@graphile/pg-aggregates@npm:^0.1.0": - version: 0.1.0 - resolution: "@graphile/pg-aggregates@npm:0.1.0" +"@ethersproject/base64@npm:5.7.0, @ethersproject/base64@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/base64@npm:5.7.0" dependencies: - "@types/debug": ^4.1.5 - "@types/graphql": ^14.5.0 - debug: ^4.3.1 - graphile-utils: ^4.12.0-alpha.0 - peerDependencies: - graphile-build: ^4.12.0-alpha.0 - graphile-build-pg: ^4.12.0-alpha.0 - graphql: ">0.6.0 <16" - checksum: a8b5de2efb510913b503ae89a29255175c464d829d51a9ea63e02da2300f0e47f2e4493f02ebc7b9d026f450d1bc0555dc49563783a78e035c6f6eef512e4ced + "@ethersproject/bytes": ^5.7.0 + checksum: 7dd5d734d623582f08f665434f53685041a3d3b334a0e96c0c8afa8bbcaab934d50e5b6b980e826a8fde8d353e0b18f11e61faf17468177274b8e7c69cd9742b languageName: node linkType: hard -"@graphile/pg-pubsub@npm:^4.12.2": - version: 4.12.2 - resolution: "@graphile/pg-pubsub@npm:4.12.2" +"@ethersproject/basex@npm:5.7.0, @ethersproject/basex@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/basex@npm:5.7.0" dependencies: - "@types/debug": ^4.1.4 - "@types/pg": ">=6 <9" - debug: ^4.1.1 - graphql-subscriptions: ^1.1.0 - tslib: ^2.0.1 - peerDependencies: - graphile-build: 4.x - graphql: ">=0.6 <16" - postgraphile: ^4.4.0-beta.10 - checksum: 6341f2e5f017c7a3b5df7512cfdf4c4b9f94eebc658eab765b7652f166df53da9d7ca73a421c3a6bd2ef18828d743ddb6d69460b6fef962aebdcac6926a773b0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + checksum: 326087b7e1f3787b5fe6cd1cf2b4b5abfafbc355a45e88e22e5e9d6c845b613ffc5301d629b28d5c4d5e2bfe9ec424e6782c804956dff79be05f0098cb5817de languageName: node linkType: hard -"@graphql-tools/merge@npm:8.2.11": - version: 8.2.11 - resolution: "@graphql-tools/merge@npm:8.2.11" +"@ethersproject/bignumber@npm:5.7.0, @ethersproject/bignumber@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/bignumber@npm:5.7.0" dependencies: - "@graphql-tools/utils": 8.6.10 - tslib: ~2.4.0 - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: cfc77d6d8bb426a1deb0b7763d58d183827a7f1727d0778c829f0824f2b36192543ef7190a5a5620f9e6e8f5627082688ac243884fcb6c570f664a4016435a16 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + bn.js: ^5.2.1 + checksum: 8c9a134b76f3feb4ec26a5a27379efb4e156b8fb2de0678a67788a91c7f4e30abe9d948638458e4b20f2e42380da0adacc7c9389d05fce070692edc6ae9b4904 languageName: node linkType: hard -"@graphql-tools/mock@npm:^8.1.2": - version: 8.6.9 - resolution: "@graphql-tools/mock@npm:8.6.9" +"@ethersproject/bytes@npm:5.7.0, @ethersproject/bytes@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/bytes@npm:5.7.0" dependencies: - "@graphql-tools/schema": 8.3.11 - "@graphql-tools/utils": 8.6.10 - fast-json-stable-stringify: ^2.1.0 - tslib: ~2.4.0 - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: d7312aaa81a3d56504b5880f6a1448e8f4eef833e9b49d73847d88133e6271668cbc1961950c022121cbbb35792d0d1071026e92b7d55adbbf2629ac9badd976 + "@ethersproject/logger": ^5.7.0 + checksum: 66ad365ceaab5da1b23b72225c71dce472cf37737af5118181fa8ab7447d696bea15ca22e3a0e8836fdd8cfac161afe321a7c67d0dde96f9f645ddd759676621 languageName: node linkType: hard -"@graphql-tools/schema@npm:8.3.11, @graphql-tools/schema@npm:^8.0.0": - version: 8.3.11 - resolution: "@graphql-tools/schema@npm:8.3.11" +"@ethersproject/constants@npm:5.7.0, @ethersproject/constants@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/constants@npm:5.7.0" dependencies: - "@graphql-tools/merge": 8.2.11 - "@graphql-tools/utils": 8.6.10 - tslib: ~2.4.0 - value-or-promise: 1.0.11 - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: b57e673bacdc25d93bae2bc4378709daeeae9738f51d96194ebe88eabb993dd1c14d85ca3828fcddf8a3937fdddfdcb8f41ff6eced504ebb306350aba2668bed + "@ethersproject/bignumber": ^5.7.0 + checksum: 6d4b1355747cce837b3e76ec3bde70e4732736f23b04f196f706ebfa5d4d9c2be50904a390d4d40ce77803b98d03d16a9b6898418e04ba63491933ce08c4ba8a languageName: node linkType: hard -"@graphql-tools/utils@npm:8.6.10": - version: 8.6.10 - resolution: "@graphql-tools/utils@npm:8.6.10" +"@ethersproject/contracts@npm:5.7.0": + version: 5.7.0 + resolution: "@ethersproject/contracts@npm:5.7.0" dependencies: - tslib: ~2.4.0 - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: fd020ef2efe98436e86335af37b9d703b2ca937179ce5d4988853c233824bd69ae01b3e2414586edd132501c042c0c582f63f6e3853ad91a59194483c248f416 + "@ethersproject/abi": ^5.7.0 + "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + checksum: 6ccf1121cba01b31e02f8c507cb971ab6bfed85706484a9ec09878ef1594a62215f43c4fdef8f4a4875b99c4a800bc95e3be69b1803f8ce479e07634b5a740c0 languageName: node linkType: hard -"@graphql-typed-document-node/core@npm:^3.0.0": - version: 3.1.1 - resolution: "@graphql-typed-document-node/core@npm:3.1.1" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 87ff4cee308f1075f4472b80f9f9409667979940f8f701e87f0aa35ce5cf104d94b41258ea8192d05a0893475cd0f086a3929a07663b4fe8d0e805a277f07ed5 +"@ethersproject/hash@npm:5.7.0, @ethersproject/hash@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/hash@npm:5.7.0" + dependencies: + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/base64": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: 6e9fa8d14eb08171cd32f17f98cc108ec2aeca74a427655f0d689c550fee0b22a83b3b400fad7fb3f41cf14d4111f87f170aa7905bcbcd1173a55f21b06262ef languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.9.2": - version: 0.9.5 - resolution: "@humanwhocodes/config-array@npm:0.9.5" +"@ethersproject/hdnode@npm:5.7.0, @ethersproject/hdnode@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/hdnode@npm:5.7.0" dependencies: - "@humanwhocodes/object-schema": ^1.2.1 - debug: ^4.1.1 - minimatch: ^3.0.4 - checksum: 8ba6281bc0590f6c6eadeefc14244b5a3e3f5903445aadd1a32099ed80e753037674026ce1b3c945ab93561bea5eb29e3c5bff67060e230c295595ba517a3492 + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/basex": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/pbkdf2": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/sha2": ^5.7.0 + "@ethersproject/signing-key": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@ethersproject/wordlists": ^5.7.0 + checksum: bfe5ca2d89a42de73655f853170ef4766b933c5f481cddad709b3aca18823275b096e572f92d1602a052f80b426edde44ad6b9d028799775a7dad4a5bbed2133 languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^1.2.1": - version: 1.2.1 - resolution: "@humanwhocodes/object-schema@npm:1.2.1" - checksum: a824a1ec31591231e4bad5787641f59e9633827d0a2eaae131a288d33c9ef0290bd16fda8da6f7c0fcb014147865d12118df10db57f27f41e20da92369fcb3f1 +"@ethersproject/json-wallets@npm:5.7.0, @ethersproject/json-wallets@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/json-wallets@npm:5.7.0" + dependencies: + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/hdnode": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/pbkdf2": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/random": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + checksum: f583458d22db62efaaf94d38dd243482776a45bf90f9f3882fbad5aa0b8fd288b41eb7c1ff8ec0b99c9b751088e43d6173530db64dd33c59f9d8daa8d7ad5aa2 languageName: node linkType: hard -"@ipld/dag-cbor@npm:^6.0.5": - version: 6.0.15 - resolution: "@ipld/dag-cbor@npm:6.0.15" +"@ethersproject/keccak256@npm:5.7.0, @ethersproject/keccak256@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/keccak256@npm:5.7.0" dependencies: - cborg: ^1.5.4 - multiformats: ^9.5.4 - checksum: c4ac8d7d271b9dd093c43495b1f24c3cdb7f10487aac529c2010c53a3320439ac9b17f53f02177e022735a1aae3d921f359c7020f765b72f94799ec3ff8e7207 + "@ethersproject/bytes": ^5.7.0 + js-sha3: 0.8.0 + checksum: ff70950d82203aab29ccda2553422cbac2e7a0c15c986bd20a69b13606ed8bb6e4fdd7b67b8d3b27d4f841e8222cbaccd33ed34be29f866fec7308f96ed244c6 languageName: node linkType: hard -"@ipld/dag-pb@npm:^2.1.3": - version: 2.1.16 - resolution: "@ipld/dag-pb@npm:2.1.16" +"@ethersproject/logger@npm:5.7.0, @ethersproject/logger@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/logger@npm:5.7.0" + checksum: 075ab2f605f1fd0813f2e39c3308f77b44a67732b36e712d9bc085f22a84aac4da4f71b39bee50fe78da3e1c812673fadc41180c9970fe5e486e91ea17befe0d + languageName: node + linkType: hard + +"@ethersproject/networks@npm:5.7.1, @ethersproject/networks@npm:^5.7.0": + version: 5.7.1 + resolution: "@ethersproject/networks@npm:5.7.1" dependencies: - multiformats: ^9.5.4 - checksum: dda996d5f459e7b7a91a72abbe65bac65b9ee7f684aa985fdf3ef3100f13461c42363131e25d8d91b1e43a465c5da2a51e80eb40cb1d13ebc673813220ae1a4e + "@ethersproject/logger": ^5.7.0 + checksum: 0339f312304c17d9a0adce550edb825d4d2c8c9468c1634c44172c67a9ed256f594da62c4cda5c3837a0f28b7fabc03aca9b492f68ff1fdad337ee861b27bd5d languageName: node linkType: hard -"@isaacs/string-locale-compare@npm:^1.1.0": - version: 1.1.0 - resolution: "@isaacs/string-locale-compare@npm:1.1.0" - checksum: 7287da5d11497b82c542d3c2abe534808015be4f4883e71c26853277b5456f6bbe4108535db847a29f385ad6dc9318ffb0f55ee79bb5f39993233d7dccf8751d +"@ethersproject/pbkdf2@npm:5.7.0, @ethersproject/pbkdf2@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/pbkdf2@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/sha2": ^5.7.0 + checksum: b895adb9e35a8a127e794f7aadc31a2424ef355a70e51cde10d457e3e888bb8102373199a540cf61f2d6b9a32e47358f9c65b47d559f42bf8e596b5fd67901e9 languageName: node linkType: hard -"@istanbuljs/load-nyc-config@npm:^1.0.0": - version: 1.1.0 - resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" +"@ethersproject/properties@npm:5.7.0, @ethersproject/properties@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/properties@npm:5.7.0" dependencies: - camelcase: ^5.3.1 - find-up: ^4.1.0 - get-package-type: ^0.1.0 - js-yaml: ^3.13.1 - resolve-from: ^5.0.0 - checksum: d578da5e2e804d5c93228450a1380e1a3c691de4953acc162f387b717258512a3e07b83510a936d9fab03eac90817473917e24f5d16297af3867f59328d58568 + "@ethersproject/logger": ^5.7.0 + checksum: 6ab0ccf0c3aadc9221e0cdc5306ce6cd0df7f89f77d77bccdd1277182c9ead0202cd7521329ba3acde130820bf8af299e17cf567d0d497c736ee918207bbf59f languageName: node linkType: hard -"@istanbuljs/schema@npm:^0.1.2": - version: 0.1.3 - resolution: "@istanbuljs/schema@npm:0.1.3" - checksum: 5282759d961d61350f33d9118d16bcaed914ebf8061a52f4fa474b2cb08720c9c81d165e13b82f2e5a8a212cc5af482f0c6fc1ac27b9e067e5394c9a6ed186c9 +"@ethersproject/providers@npm:5.7.1": + version: 5.7.1 + resolution: "@ethersproject/providers@npm:5.7.1" + dependencies: + "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/base64": ^5.7.0 + "@ethersproject/basex": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/hash": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/networks": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/random": ^5.7.0 + "@ethersproject/rlp": ^5.7.0 + "@ethersproject/sha2": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@ethersproject/web": ^5.7.0 + bech32: 1.1.4 + ws: 7.4.6 + checksum: 673745e967e7215b46b7d3024f5ee02be975d6cf66b605f87a0e5beaa349d6d30c987165f98eceddaf7996f64a1ec414f0715f25fc3458aead6eea4c4820c399 languageName: node linkType: hard -"@jest/console@npm:^27.5.1": - version: 27.5.1 - resolution: "@jest/console@npm:27.5.1" +"@ethersproject/random@npm:5.7.0, @ethersproject/random@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/random@npm:5.7.0" dependencies: - "@jest/types": ^27.5.1 - "@types/node": "*" - chalk: ^4.0.0 - jest-message-util: ^27.5.1 - jest-util: ^27.5.1 - slash: ^3.0.0 - checksum: 7cb20f06a34b09734c0342685ec53aa4c401fe3757c13a9c58fce76b971a322eb884f6de1068ef96f746e5398e067371b89515a07c268d4440a867c87748a706 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + checksum: 017829c91cff6c76470852855108115b0b52c611b6be817ed1948d56ba42d6677803ec2012aa5ae298a7660024156a64c11fcf544e235e239ab3f89f0fff7345 languageName: node linkType: hard -"@jest/core@npm:^27.5.1": - version: 27.5.1 - resolution: "@jest/core@npm:27.5.1" +"@ethersproject/rlp@npm:5.7.0, @ethersproject/rlp@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/rlp@npm:5.7.0" dependencies: - "@jest/console": ^27.5.1 - "@jest/reporters": ^27.5.1 - "@jest/test-result": ^27.5.1 - "@jest/transform": ^27.5.1 - "@jest/types": ^27.5.1 - "@types/node": "*" - ansi-escapes: ^4.2.1 - chalk: ^4.0.0 - emittery: ^0.8.1 - exit: ^0.1.2 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + checksum: bce165b0f7e68e4d091c9d3cf47b247cac33252df77a095ca4281d32d5eeaaa3695d9bc06b2b057c5015353a68df89f13a4a54a72e888e4beeabbe56b15dda6e + languageName: node + linkType: hard + +"@ethersproject/sha2@npm:5.7.0, @ethersproject/sha2@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/sha2@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + hash.js: 1.1.7 + checksum: 09321057c022effbff4cc2d9b9558228690b5dd916329d75c4b1ffe32ba3d24b480a367a7cc92d0f0c0b1c896814d03351ae4630e2f1f7160be2bcfbde435dbc + languageName: node + linkType: hard + +"@ethersproject/signing-key@npm:5.7.0, @ethersproject/signing-key@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/signing-key@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + bn.js: ^5.2.1 + elliptic: 6.5.4 + hash.js: 1.1.7 + checksum: 8f8de09b0aac709683bbb49339bc0a4cd2f95598f3546436c65d6f3c3a847ffa98e06d35e9ed2b17d8030bd2f02db9b7bd2e11c5cf8a71aad4537487ab4cf03a + languageName: node + linkType: hard + +"@ethersproject/solidity@npm:5.7.0": + version: 5.7.0 + resolution: "@ethersproject/solidity@npm:5.7.0" + dependencies: + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/sha2": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: 9a02f37f801c96068c3e7721f83719d060175bc4e80439fe060e92bd7acfcb6ac1330c7e71c49f4c2535ca1308f2acdcb01e00133129aac00581724c2d6293f3 + languageName: node + linkType: hard + +"@ethersproject/strings@npm:5.7.0, @ethersproject/strings@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/strings@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + checksum: 5ff78693ae3fdf3cf23e1f6dc047a61e44c8197d2408c42719fef8cb7b7b3613a4eec88ac0ed1f9f5558c74fe0de7ae3195a29ca91a239c74b9f444d8e8b50df + languageName: node + linkType: hard + +"@ethersproject/transactions@npm:5.7.0, @ethersproject/transactions@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/transactions@npm:5.7.0" + dependencies: + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/rlp": ^5.7.0 + "@ethersproject/signing-key": ^5.7.0 + checksum: a31b71996d2b283f68486241bff0d3ea3f1ba0e8f1322a8fffc239ccc4f4a7eb2ea9994b8fd2f093283fd75f87bae68171e01b6265261f821369aca319884a79 + languageName: node + linkType: hard + +"@ethersproject/units@npm:5.7.0": + version: 5.7.0 + resolution: "@ethersproject/units@npm:5.7.0" + dependencies: + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + checksum: 304714f848cd32e57df31bf545f7ad35c2a72adae957198b28cbc62166daa929322a07bff6e9c9ac4577ab6aa0de0546b065ed1b2d20b19e25748b7d475cb0fc + languageName: node + linkType: hard + +"@ethersproject/wallet@npm:5.7.0": + version: 5.7.0 + resolution: "@ethersproject/wallet@npm:5.7.0" + dependencies: + "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/hash": ^5.7.0 + "@ethersproject/hdnode": ^5.7.0 + "@ethersproject/json-wallets": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/random": ^5.7.0 + "@ethersproject/signing-key": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@ethersproject/wordlists": ^5.7.0 + checksum: a4009bf7331eddab38e3015b5e9101ef92de7f705b00a6196b997db0e5635b6d83561674d46c90c6f77b87c0500fe4a6b0183ba13749efc22db59c99deb82fbd + languageName: node + linkType: hard + +"@ethersproject/web@npm:5.7.1, @ethersproject/web@npm:^5.7.0": + version: 5.7.1 + resolution: "@ethersproject/web@npm:5.7.1" + dependencies: + "@ethersproject/base64": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: 7028c47103f82fd2e2c197ce0eecfacaa9180ffeec7de7845b1f4f9b19d84081b7a48227aaddde05a4aaa526af574a9a0ce01cc0fc75e3e371f84b38b5b16b2b + languageName: node + linkType: hard + +"@ethersproject/wordlists@npm:5.7.0, @ethersproject/wordlists@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/wordlists@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/hash": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: 30eb6eb0731f9ef5faa44bf9c0c6e950bcaaef61e4d2d9ce0ae6d341f4e2d6d1f4ab4f8880bfce03b7aac4b862fb740e1421170cfbf8e2aafc359277d49e6e97 + languageName: node + linkType: hard + +"@gar/promisify@npm:^1.1.3": + version: 1.1.3 + resolution: "@gar/promisify@npm:1.1.3" + checksum: 4059f790e2d07bf3c3ff3e0fec0daa8144fe35c1f6e0111c9921bd32106adaa97a4ab096ad7dab1e28ee6a9060083c4d1a4ada42a7f5f3f7a96b8812e2b757c1 + languageName: node + linkType: hard + +"@graphql-typed-document-node/core@npm:^3.0.0": + version: 3.1.1 + resolution: "@graphql-typed-document-node/core@npm:3.1.1" + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + checksum: 87ff4cee308f1075f4472b80f9f9409667979940f8f701e87f0aa35ce5cf104d94b41258ea8192d05a0893475cd0f086a3929a07663b4fe8d0e805a277f07ed5 + languageName: node + linkType: hard + +"@humanwhocodes/config-array@npm:^0.10.4": + version: 0.10.4 + resolution: "@humanwhocodes/config-array@npm:0.10.4" + dependencies: + "@humanwhocodes/object-schema": ^1.2.1 + debug: ^4.1.1 + minimatch: ^3.0.4 + checksum: d480e5d57e6d787565b6cff78e27c3d1b380692d4ffb0ada7d7f5957a56c9032f034da05a3e443065dbd0671ebf4d859036ced34e96b325bbc1badbae3c05300 + languageName: node + linkType: hard + +"@humanwhocodes/gitignore-to-minimatch@npm:^1.0.2": + version: 1.0.2 + resolution: "@humanwhocodes/gitignore-to-minimatch@npm:1.0.2" + checksum: aba5c40c9e3770ed73a558b0bfb53323842abfc2ce58c91d7e8b1073995598e6374456d38767be24ab6176915f0a8d8b23eaae5c85e2b488c0dccca6d795e2ad + languageName: node + linkType: hard + +"@humanwhocodes/module-importer@npm:^1.0.1": + version: 1.0.1 + resolution: "@humanwhocodes/module-importer@npm:1.0.1" + checksum: 0fd22007db8034a2cdf2c764b140d37d9020bbfce8a49d3ec5c05290e77d4b0263b1b972b752df8c89e5eaa94073408f2b7d977aed131faf6cf396ebb5d7fb61 + languageName: node + linkType: hard + +"@humanwhocodes/object-schema@npm:^1.2.1": + version: 1.2.1 + resolution: "@humanwhocodes/object-schema@npm:1.2.1" + checksum: a824a1ec31591231e4bad5787641f59e9633827d0a2eaae131a288d33c9ef0290bd16fda8da6f7c0fcb014147865d12118df10db57f27f41e20da92369fcb3f1 + languageName: node + linkType: hard + +"@ipld/dag-cbor@npm:^6.0.5": + version: 6.0.15 + resolution: "@ipld/dag-cbor@npm:6.0.15" + dependencies: + cborg: ^1.5.4 + multiformats: ^9.5.4 + checksum: c4ac8d7d271b9dd093c43495b1f24c3cdb7f10487aac529c2010c53a3320439ac9b17f53f02177e022735a1aae3d921f359c7020f765b72f94799ec3ff8e7207 + languageName: node + linkType: hard + +"@ipld/dag-pb@npm:^2.1.3": + version: 2.1.18 + resolution: "@ipld/dag-pb@npm:2.1.18" + dependencies: + multiformats: ^9.5.4 + checksum: 46b9a7dabf6e87698fc268f88d94b710ba3988e26ab7918bcdf10c4356e15eb32393b6ab56eaf0d8936b369cb77456e491495f1025f78b099f1bd26cc5ccda06 + languageName: node + linkType: hard + +"@istanbuljs/load-nyc-config@npm:^1.0.0": + version: 1.1.0 + resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" + dependencies: + camelcase: ^5.3.1 + find-up: ^4.1.0 + get-package-type: ^0.1.0 + js-yaml: ^3.13.1 + resolve-from: ^5.0.0 + checksum: d578da5e2e804d5c93228450a1380e1a3c691de4953acc162f387b717258512a3e07b83510a936d9fab03eac90817473917e24f5d16297af3867f59328d58568 + languageName: node + linkType: hard + +"@istanbuljs/schema@npm:^0.1.2": + version: 0.1.3 + resolution: "@istanbuljs/schema@npm:0.1.3" + checksum: 5282759d961d61350f33d9118d16bcaed914ebf8061a52f4fa474b2cb08720c9c81d165e13b82f2e5a8a212cc5af482f0c6fc1ac27b9e067e5394c9a6ed186c9 + languageName: node + linkType: hard + +"@jest/console@npm:^27.5.1": + version: 27.5.1 + resolution: "@jest/console@npm:27.5.1" + dependencies: + "@jest/types": ^27.5.1 + "@types/node": "*" + chalk: ^4.0.0 + jest-message-util: ^27.5.1 + jest-util: ^27.5.1 + slash: ^3.0.0 + checksum: 7cb20f06a34b09734c0342685ec53aa4c401fe3757c13a9c58fce76b971a322eb884f6de1068ef96f746e5398e067371b89515a07c268d4440a867c87748a706 + languageName: node + linkType: hard + +"@jest/core@npm:^27.5.1": + version: 27.5.1 + resolution: "@jest/core@npm:27.5.1" + dependencies: + "@jest/console": ^27.5.1 + "@jest/reporters": ^27.5.1 + "@jest/test-result": ^27.5.1 + "@jest/transform": ^27.5.1 + "@jest/types": ^27.5.1 + "@types/node": "*" + ansi-escapes: ^4.2.1 + chalk: ^4.0.0 + emittery: ^0.8.1 + exit: ^0.1.2 graceful-fs: ^4.2.9 jest-changed-files: ^27.5.1 jest-config: ^27.5.1 @@ -1891,13 +2090,6 @@ __metadata: languageName: node linkType: hard -"@josephg/resolvable@npm:^1.0.0": - version: 1.0.1 - resolution: "@josephg/resolvable@npm:1.0.1" - checksum: 64eb763b5138bdae4fb59c0c0e89ed261b690917ae6bd777b533257668f151b8868698fb73dfd7665746ad07c7c917fe89ccfdf2404048d39f373f57f1a14e34 - languageName: node - linkType: hard - "@jridgewell/gen-mapping@npm:^0.1.0": version: 0.1.1 resolution: "@jridgewell/gen-mapping@npm:0.1.1" @@ -1908,92 +2100,65 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.2": + version: 0.3.2 + resolution: "@jridgewell/gen-mapping@npm:0.3.2" + dependencies: + "@jridgewell/set-array": ^1.0.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 1832707a1c476afebe4d0fbbd4b9434fdb51a4c3e009ab1e9938648e21b7a97049fa6009393bdf05cab7504108413441df26d8a3c12193996e65493a4efb6882 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.0.3": - version: 3.0.7 - resolution: "@jridgewell/resolve-uri@npm:3.0.7" - checksum: 94f454f4cef8f0acaad85745fd3ca6cd0d62ef731cf9f952ecb89b8b2ce5e20998cd52be31311cedc5fa5b28b1708a15f3ad9df0fe1447ee4f42959b036c4b5b + version: 3.1.0 + resolution: "@jridgewell/resolve-uri@npm:3.1.0" + checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 languageName: node linkType: hard -"@jridgewell/set-array@npm:^1.0.0": - version: 1.1.1 - resolution: "@jridgewell/set-array@npm:1.1.1" - checksum: cc5d91e0381c347e3edee4ca90b3c292df9e6e55f29acbe0dd97de8651b4730e9ab761406fd572effa79972a0edc55647b627f8c72315e276d959508853d9bf2 +"@jridgewell/set-array@npm:^1.0.0, @jridgewell/set-array@npm:^1.0.1": + version: 1.1.2 + resolution: "@jridgewell/set-array@npm:1.1.2" + checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e languageName: node linkType: hard "@jridgewell/sourcemap-codec@npm:^1.4.10": - version: 1.4.13 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.13" - checksum: f14449096f60a5f921262322fef65ce0bbbfb778080b3b20212080bcefdeba621c43a58c27065bd536ecb4cc767b18eb9c45f15b6b98a4970139572b60603a1c + version: 1.4.14 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" + checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.10 - resolution: "@jridgewell/trace-mapping@npm:0.3.10" +"@jridgewell/trace-mapping@npm:0.3.9": + version: 0.3.9 + resolution: "@jridgewell/trace-mapping@npm:0.3.9" dependencies: "@jridgewell/resolve-uri": ^3.0.3 "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: 1e5f7ff99f6fe8b671aab61b5a943d00f689728380e2d20df1e8a7418b421d4f941679ab327282d9ad5b2d71c0eedf2928ad2b974d0bd046e57c6fd66e891144 + checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef languageName: node linkType: hard -"@kwsites/file-exists@npm:^1.1.1": - version: 1.1.1 - resolution: "@kwsites/file-exists@npm:1.1.1" +"@jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.15 + resolution: "@jridgewell/trace-mapping@npm:0.3.15" dependencies: - debug: ^4.1.1 - checksum: 4ff945de7293285133aeae759caddc71e73c4a44a12fac710fdd4f574cce2671a3f89d8165fdb03d383cfc97f3f96f677d8de3c95133da3d0e12a123a23109fe - languageName: node - linkType: hard - -"@kwsites/promise-deferred@npm:^1.1.1": - version: 1.1.1 - resolution: "@kwsites/promise-deferred@npm:1.1.1" - checksum: 07455477a0123d9a38afb503739eeff2c5424afa8d3dbdcc7f9502f13604488a4b1d9742fc7288832a52a6422cf1e1c0a1d51f69a39052f14d27c9a0420b6629 - languageName: node - linkType: hard - -"@nestjs/cli@npm:^8.1.4": - version: 8.2.5 - resolution: "@nestjs/cli@npm:8.2.5" - dependencies: - "@angular-devkit/core": 13.3.2 - "@angular-devkit/schematics": 13.3.2 - "@angular-devkit/schematics-cli": 13.3.2 - "@nestjs/schematics": ^8.0.3 - chalk: 3.0.0 - chokidar: 3.5.3 - cli-table3: 0.6.1 - commander: 4.1.1 - fork-ts-checker-webpack-plugin: 7.2.3 - inquirer: 7.3.3 - node-emoji: 1.11.0 - ora: 5.4.1 - os-name: 4.0.1 - rimraf: 3.0.2 - shelljs: 0.8.5 - source-map-support: 0.5.21 - tree-kill: 1.2.2 - tsconfig-paths: 3.14.1 - tsconfig-paths-webpack-plugin: 3.5.2 - typescript: 4.6.2 - webpack: 5.71.0 - webpack-node-externals: 3.0.0 - bin: - nest: bin/nest.js - checksum: 80787185451cb5f206b14536d4d8ce107a5ef6074865eb44c8b9ab35f56ed0a6140403aaebbe4b348445323cdbb1a07376fde796f1dff373abf351cc005eb630 + "@jridgewell/resolve-uri": ^3.0.3 + "@jridgewell/sourcemap-codec": ^1.4.10 + checksum: 38917e9c2b014d469a9f51c016ed506acbe44dd16ec2f6f99b553ebf3764d22abadbf992f2367b6d2b3511f3eae8ed3a8963f6c1030093fda23efd35ecab2bae languageName: node linkType: hard "@nestjs/common@npm:^8.2.6": - version: 8.4.4 - resolution: "@nestjs/common@npm:8.4.4" + version: 8.4.7 + resolution: "@nestjs/common@npm:8.4.7" dependencies: - axios: 0.26.1 + axios: 0.27.2 iterare: 1.2.1 - tslib: 2.3.1 + tslib: 2.4.0 uuid: 8.3.2 peerDependencies: cache-manager: "*" @@ -2008,7 +2173,7 @@ __metadata: optional: true class-validator: optional: true - checksum: bd0326a7a52b4ca819ca8790cec1e649ba0067d2eee54a32aabe890729f5d7dd6ecbf834cf68aa6727974a693981a4a6c119574dd12560914041380010632174 + checksum: b3fa20618d4e60f9f5089215c800f2deb5d08b9f88443102b066036d7bacf17ff5926ad5ff0ef7ace42feb8e0ca561dc7e75fd05dbd028f5e675d5e7062eb685 languageName: node linkType: hard @@ -2042,31 +2207,31 @@ __metadata: linkType: hard "@nestjs/event-emitter@npm:^1.3.0": - version: 1.3.0 - resolution: "@nestjs/event-emitter@npm:1.3.0" + version: 1.3.1 + resolution: "@nestjs/event-emitter@npm:1.3.1" dependencies: eventemitter2: 6.4.6 peerDependencies: "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 "@nestjs/core": ^7.0.0 || ^8.0.0 || ^9.0.0 reflect-metadata: ^0.1.12 - checksum: 7cc37d45740d1870ee8620a76e85a79683161a2aed02d4715c643caab09ac54c95ccd4b7f20fe5662d736b6e12c3791a83b54e7845ea7e983708cad587fda8da + checksum: fd4b8f2ec6ff8f2aa5dce41d5bc4492ab22af908e42eff3b21978c929514ce816649ca1f077255171a8a586db731d0268b171a2e909f64dda7d6f2598b75a6fe languageName: node linkType: hard "@nestjs/platform-express@npm:^8.2.6": - version: 8.4.4 - resolution: "@nestjs/platform-express@npm:8.4.4" + version: 8.4.7 + resolution: "@nestjs/platform-express@npm:8.4.7" dependencies: body-parser: 1.20.0 cors: 2.8.5 - express: 4.17.3 - multer: 1.4.4 - tslib: 2.3.1 + express: 4.18.1 + multer: 1.4.4-lts.1 + tslib: 2.4.0 peerDependencies: "@nestjs/common": ^8.0.0 "@nestjs/core": ^8.0.0 - checksum: 69616a33f5bf731ecec74e11b05d240b1c2ac52fca5c40e7120bac2dadb60e7c2942c885147914822e9507235326ea0ee8b185cbc55a3be7a61df0900ad9d202 + checksum: 41d3e35adfb2d3f54c9d4a7ce94525fac0be3119caa0bba8b5607c8345cef964a6893891c541d2f4e7a677cc4f91045bc3cb23e4bf29df9ba84a76e70eefd3e6 languageName: node linkType: hard @@ -2084,7 +2249,7 @@ __metadata: languageName: node linkType: hard -"@nestjs/schematics@npm:^8.0.3, @nestjs/schematics@npm:^8.0.5": +"@nestjs/schematics@npm:^8.0.5": version: 8.0.11 resolution: "@nestjs/schematics@npm:8.0.11" dependencies: @@ -2100,11 +2265,10 @@ __metadata: linkType: hard "@nestjs/testing@npm:^8.2.6": - version: 8.4.4 - resolution: "@nestjs/testing@npm:8.4.4" + version: 8.4.7 + resolution: "@nestjs/testing@npm:8.4.7" dependencies: - optional: 0.1.4 - tslib: 2.3.1 + tslib: 2.4.0 peerDependencies: "@nestjs/common": ^8.0.0 "@nestjs/core": ^8.0.0 @@ -2115,7 +2279,7 @@ __metadata: optional: true "@nestjs/platform-express": optional: true - checksum: e896199b4801009f39204baaa371b7ba77ce5737847b65a281a9bf7a006ba3a7ca09e107081d7f1e131ce0c42462e245408b70b9da2de5ac000a39060c616d4d + checksum: 5514f2638ad1dcdabe3c13fa35f8d73dbae5924c051a9747f19c2bbb5491998a3261e6a43562af8a4f67af4fe4a5b6b97406712e3aa28da5d5e3ace0fbab7112 languageName: node linkType: hard @@ -2160,579 +2324,88 @@ __metadata: languageName: node linkType: hard -"@npmcli/arborist@npm:^4.0.4": - version: 4.3.1 - resolution: "@npmcli/arborist@npm:4.3.1" - dependencies: - "@isaacs/string-locale-compare": ^1.1.0 - "@npmcli/installed-package-contents": ^1.0.7 - "@npmcli/map-workspaces": ^2.0.0 - "@npmcli/metavuln-calculator": ^2.0.0 - "@npmcli/move-file": ^1.1.0 - "@npmcli/name-from-folder": ^1.0.1 - "@npmcli/node-gyp": ^1.0.3 - "@npmcli/package-json": ^1.0.1 - "@npmcli/run-script": ^2.0.0 - bin-links: ^3.0.0 - cacache: ^15.0.3 - common-ancestor-path: ^1.0.1 - json-parse-even-better-errors: ^2.3.1 - json-stringify-nice: ^1.1.4 - mkdirp: ^1.0.4 - mkdirp-infer-owner: ^2.0.0 - npm-install-checks: ^4.0.0 - npm-package-arg: ^8.1.5 - npm-pick-manifest: ^6.1.0 - npm-registry-fetch: ^12.0.1 - pacote: ^12.0.2 - parse-conflict-json: ^2.0.1 - proc-log: ^1.0.0 - promise-all-reject-late: ^1.0.0 - promise-call-limit: ^1.0.1 - read-package-json-fast: ^2.0.2 - readdir-scoped-modules: ^1.1.0 - rimraf: ^3.0.2 - semver: ^7.3.5 - ssri: ^8.0.1 - treeverse: ^1.0.4 - walk-up-path: ^1.0.0 - bin: - arborist: bin/index.js - checksum: 51470ebb9a47c414822d1c05eda7dfef672848ddacf5734cc0575cc1a9f92cca32f17aac209d9e520424620a9ff4685db103f8b16953e2ef1823dfa2871b50e7 - languageName: node - linkType: hard - -"@npmcli/fs@npm:^1.0.0": - version: 1.1.1 - resolution: "@npmcli/fs@npm:1.1.1" - dependencies: - "@gar/promisify": ^1.0.1 - semver: ^7.3.5 - checksum: f5ad92f157ed222e4e31c352333d0901df02c7c04311e42a81d8eb555d4ec4276ea9c635011757de20cc476755af33e91622838de573b17e52e2e7703f0a9965 - languageName: node - linkType: hard - "@npmcli/fs@npm:^2.1.0": - version: 2.1.0 - resolution: "@npmcli/fs@npm:2.1.0" + version: 2.1.2 + resolution: "@npmcli/fs@npm:2.1.2" dependencies: "@gar/promisify": ^1.1.3 semver: ^7.3.5 - checksum: 6ec6d678af6da49f9dac50cd882d7f661934dd278972ffbaacde40d9eaa2871292d634000a0cca9510f6fc29855fbd4af433e1adbff90a524ec3eaf140f1219b + checksum: 405074965e72d4c9d728931b64d2d38e6ea12066d4fad651ac253d175e413c06fe4350970c783db0d749181da8fe49c42d3880bd1cbc12cd68e3a7964d820225 languageName: node linkType: hard -"@npmcli/git@npm:^2.1.0": - version: 2.1.0 - resolution: "@npmcli/git@npm:2.1.0" +"@npmcli/move-file@npm:^2.0.0": + version: 2.0.1 + resolution: "@npmcli/move-file@npm:2.0.1" dependencies: - "@npmcli/promise-spawn": ^1.3.2 - lru-cache: ^6.0.0 mkdirp: ^1.0.4 - npm-pick-manifest: ^6.1.1 - promise-inflight: ^1.0.1 - promise-retry: ^2.0.1 - semver: ^7.3.5 - which: ^2.0.2 - checksum: 1f89752df7b836f378b8828423c6ae344fe59399915b9460acded19686e2d0626246251a3cd4cc411ed21c1be6fe7f0c2195c17f392e88748581262ee806dc33 + rimraf: ^3.0.2 + checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 languageName: node linkType: hard -"@npmcli/installed-package-contents@npm:^1.0.6, @npmcli/installed-package-contents@npm:^1.0.7": - version: 1.0.7 - resolution: "@npmcli/installed-package-contents@npm:1.0.7" +"@nuxtjs/opencollective@npm:0.3.2": + version: 0.3.2 + resolution: "@nuxtjs/opencollective@npm:0.3.2" dependencies: - npm-bundled: ^1.1.1 - npm-normalize-package-bin: ^1.0.1 + chalk: ^4.1.0 + consola: ^2.15.0 + node-fetch: ^2.6.1 bin: - installed-package-contents: index.js - checksum: a4a29b99d439827ce2e7817c1f61b56be160e640696e31dc513a2c8a37c792f75cdb6258ec15a1e22904f20df0a8a3019dd3766de5e6619f259834cf64233538 + opencollective: bin/opencollective.js + checksum: fd3737c12edf55b5c2279674664c3ed5e756410ea82e9cd324c3f0e032ed5ccd8df1959ec69ea97f2f1c9c33c884aae3d7a7108a73ea0faa90d74ea47cf364d4 languageName: node linkType: hard -"@npmcli/map-workspaces@npm:^2.0.0": - version: 2.0.3 - resolution: "@npmcli/map-workspaces@npm:2.0.3" +"@octokit/endpoint@npm:^6.0.1": + version: 6.0.12 + resolution: "@octokit/endpoint@npm:6.0.12" dependencies: - "@npmcli/name-from-folder": ^1.0.1 - glob: ^8.0.1 - minimatch: ^5.0.1 - read-package-json-fast: ^2.0.3 - checksum: c9878a22168d3f2d8df9e339ed0799628db3ea8502bd623b5bbe7b0dfcac065b3310e4093df94667a4a28ef2c54c02ce6956467a8aaa2e150305f2fe1cd64f9d + "@octokit/types": ^6.0.3 + is-plain-object: ^5.0.0 + universal-user-agent: ^6.0.0 + checksum: b48b29940af11c4b9bca41cf56809754bb8385d4e3a6122671799d27f0238ba575b3fde86d2d30a84f4dbbc14430940de821e56ecc6a9a92d47fc2b29a31479d languageName: node linkType: hard -"@npmcli/metavuln-calculator@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/metavuln-calculator@npm:2.0.0" - dependencies: - cacache: ^15.0.5 - json-parse-even-better-errors: ^2.3.1 - pacote: ^12.0.0 - semver: ^7.3.2 - checksum: bf88115e7c52a5fcf9d3f06d47eeb18acb6077327ee035661b6e4c26102b5e963aa3461679a50fb54427ff4526284a8fdebc743689dd7d71d8ee3814e8f341ee +"@octokit/openapi-types@npm:^12.11.0": + version: 12.11.0 + resolution: "@octokit/openapi-types@npm:12.11.0" + checksum: 8a7d4bd6288cc4085cabe0ca9af2b87c875c303af932cb138aa1b2290eb69d32407759ac23707bb02776466e671244a902e9857896903443a69aff4b6b2b0e3b languageName: node linkType: hard -"@npmcli/move-file@npm:^1.0.1, @npmcli/move-file@npm:^1.1.0": - version: 1.1.2 - resolution: "@npmcli/move-file@npm:1.1.2" +"@octokit/request-error@npm:^2.1.0": + version: 2.1.0 + resolution: "@octokit/request-error@npm:2.1.0" dependencies: - mkdirp: ^1.0.4 - rimraf: ^3.0.2 - checksum: c96381d4a37448ea280951e46233f7e541058cf57a57d4094dd4bdcaae43fa5872b5f2eb6bfb004591a68e29c5877abe3cdc210cb3588cbf20ab2877f31a7de7 + "@octokit/types": ^6.0.3 + deprecation: ^2.0.0 + once: ^1.4.0 + checksum: baec2b5700498be01b4d958f9472cb776b3f3b0ea52924323a07e7a88572e24cac2cdf7eb04a0614031ba346043558b47bea2d346e98f0e8385b4261f138ef18 languageName: node linkType: hard -"@npmcli/move-file@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/move-file@npm:2.0.0" +"@octokit/request@npm:^5.6.3": + version: 5.6.3 + resolution: "@octokit/request@npm:5.6.3" dependencies: - mkdirp: ^1.0.4 - rimraf: ^3.0.2 - checksum: 1388777b507b0c592d53f41b9d182e1a8de7763bc625fc07999b8edbc22325f074e5b3ec90af79c89d6987fdb2325bc66d59f483258543c14a43661621f841b0 - languageName: node - linkType: hard - -"@npmcli/name-from-folder@npm:^1.0.1": - version: 1.0.1 - resolution: "@npmcli/name-from-folder@npm:1.0.1" - checksum: 67339f4096e32b712d2df0250cc95c087569f09e657d7f81a1760fa2cc5123e29c3c3e1524388832310ba2d96ec4679985b643b44627f6a51f4a00c3b0075de9 + "@octokit/endpoint": ^6.0.1 + "@octokit/request-error": ^2.1.0 + "@octokit/types": ^6.16.1 + is-plain-object: ^5.0.0 + node-fetch: ^2.6.7 + universal-user-agent: ^6.0.0 + checksum: c0b4542eb4baaf880d673c758d3e0b5c4a625a4ae30abf40df5548b35f1ff540edaac74625192b1aff42a79ac661e774da4ab7d5505f1cb4ef81239b1e8510c5 languageName: node linkType: hard -"@npmcli/node-gyp@npm:^1.0.2, @npmcli/node-gyp@npm:^1.0.3": - version: 1.0.3 - resolution: "@npmcli/node-gyp@npm:1.0.3" - checksum: 496d5eef2e90e34bb07e96adbcbbce3dba5370ae87e8c46ff5b28570848f35470c8e008b8f69e50863632783e0a9190e6f55b2e4b049c537142821153942d26a - languageName: node - linkType: hard - -"@npmcli/package-json@npm:^1.0.1": - version: 1.0.1 - resolution: "@npmcli/package-json@npm:1.0.1" - dependencies: - json-parse-even-better-errors: ^2.3.1 - checksum: 08b66c8ddb1d6b678975a83006d2fe5070b3013bcb68ea9d54c0142538a614596ddfd1143183fbb8f82c5cecf477d98f3c4e473ef34df3bbf3814e97e37e18d3 - languageName: node - linkType: hard - -"@npmcli/promise-spawn@npm:^1.2.0, @npmcli/promise-spawn@npm:^1.3.2": - version: 1.3.2 - resolution: "@npmcli/promise-spawn@npm:1.3.2" - dependencies: - infer-owner: ^1.0.4 - checksum: 543b7c1e26230499b4100b10d45efa35b1077e8f25595050f34930ca3310abe9524f7387279fe4330139e0f28a0207595245503439276fd4b686cca2b6503080 - languageName: node - linkType: hard - -"@npmcli/run-script@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/run-script@npm:2.0.0" - dependencies: - "@npmcli/node-gyp": ^1.0.2 - "@npmcli/promise-spawn": ^1.3.2 - node-gyp: ^8.2.0 - read-package-json-fast: ^2.0.1 - checksum: c016ea9411e434d84e9bb9c30814c2868eee3ff32625f3e1af4671c3abfe0768739ffb2dba5520da926ae44315fc5f507b744f0626a80bc9461f2f19760e5fa0 - languageName: node - linkType: hard - -"@nuxtjs/opencollective@npm:0.3.2": - version: 0.3.2 - resolution: "@nuxtjs/opencollective@npm:0.3.2" - dependencies: - chalk: ^4.1.0 - consola: ^2.15.0 - node-fetch: ^2.6.1 - bin: - opencollective: bin/opencollective.js - checksum: fd3737c12edf55b5c2279674664c3ed5e756410ea82e9cd324c3f0e032ed5ccd8df1959ec69ea97f2f1c9c33c884aae3d7a7108a73ea0faa90d74ea47cf364d4 - languageName: node - linkType: hard - -"@oclif/color@npm:^1.0.0": - version: 1.0.1 - resolution: "@oclif/color@npm:1.0.1" - dependencies: - ansi-styles: ^4.2.1 - chalk: ^4.1.0 - strip-ansi: ^6.0.1 - supports-color: ^8.1.1 - tslib: ^2 - checksum: 7901e928b45ce8483e1cb5ceabf5a597d20933097cb20276a9fefbcd54ae642f595c6b1fef398fdd14fa70dadf0936ec38caf81b0d2346475f9523ff99136a49 - languageName: node - linkType: hard - -"@oclif/command@npm:^1.8.14, @oclif/command@npm:^1.8.15, @oclif/command@npm:^1.8.16": - version: 1.8.16 - resolution: "@oclif/command@npm:1.8.16" - dependencies: - "@oclif/config": ^1.18.2 - "@oclif/errors": ^1.3.5 - "@oclif/help": ^1.0.1 - "@oclif/parser": ^3.8.6 - debug: ^4.1.1 - semver: ^7.3.2 - peerDependencies: - "@oclif/config": ^1 - checksum: c7cac8e1f9a7e5d9d88a316becc6f7f3bc72fce1a2d583d39b0b08cd98c13f0fe71e256f90ac586d7bd21054c8e76c0fef0b823bb7d108977d777e10c2678e7d - languageName: node - linkType: hard - -"@oclif/config@npm:1.18.2": - version: 1.18.2 - resolution: "@oclif/config@npm:1.18.2" - dependencies: - "@oclif/errors": ^1.3.3 - "@oclif/parser": ^3.8.0 - debug: ^4.1.1 - globby: ^11.0.1 - is-wsl: ^2.1.1 - tslib: ^2.0.0 - checksum: edb82ae885bb5a7a244d99707f837f8f0c7a3286a9f19e6cda2af599a06c189c21221082acde9927dadf951d060bdc05bee9ea5f9e8223c12688956b94c3b1e0 - languageName: node - linkType: hard - -"@oclif/config@npm:^1.18.2, @oclif/config@npm:^1.18.3": - version: 1.18.3 - resolution: "@oclif/config@npm:1.18.3" - dependencies: - "@oclif/errors": ^1.3.5 - "@oclif/parser": ^3.8.0 - debug: ^4.1.1 - globby: ^11.0.1 - is-wsl: ^2.1.1 - tslib: ^2.3.1 - checksum: 96b4cde1ec68e82414c456687af2643c500f595b40ff0b0da3dd4aed93de096c07c01887e6d8e93701859956cad491502143b6ab35df86faacddc6a0272c3133 - languageName: node - linkType: hard - -"@oclif/core@npm:^1.0.8, @oclif/core@npm:^1.1.1, @oclif/core@npm:^1.2.1, @oclif/core@npm:^1.3.3, @oclif/core@npm:^1.3.6, @oclif/core@npm:^1.6.4": - version: 1.8.0 - resolution: "@oclif/core@npm:1.8.0" - dependencies: - "@oclif/linewrap": ^1.0.0 - "@oclif/screen": ^3.0.2 - ansi-escapes: ^4.3.2 - ansi-styles: ^4.3.0 - cardinal: ^2.1.1 - chalk: ^4.1.2 - clean-stack: ^3.0.1 - cli-progress: ^3.10.0 - debug: ^4.3.4 - ejs: ^3.1.6 - fs-extra: ^9.1.0 - get-package-type: ^0.1.0 - globby: ^11.1.0 - hyperlinker: ^1.0.0 - indent-string: ^4.0.0 - is-wsl: ^2.2.0 - js-yaml: ^3.14.1 - lodash: ^4.17.21 - natural-orderby: ^2.0.3 - object-treeify: ^1.1.33 - password-prompt: ^1.1.2 - semver: ^7.3.5 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - supports-color: ^8.1.1 - supports-hyperlinks: ^2.2.0 - tslib: ^2.3.1 - widest-line: ^3.1.0 - wrap-ansi: ^7.0.0 - checksum: e84b5eae4a3d2717cec60c5b675b184fc5da4e987974d1a9e9ded0e8961a9d8bb4f91ec48dc6c75e86909c4c825f581d764fba424c50153340b72786f084984c - languageName: node - linkType: hard - -"@oclif/dev-cli@npm:^1.26.10": - version: 1.26.10 - resolution: "@oclif/dev-cli@npm:1.26.10" - dependencies: - "@oclif/command": ^1.8.15 - "@oclif/config": ^1.18.2 - "@oclif/errors": ^1.3.5 - "@oclif/plugin-help": 3.2.18 - cli-ux: 5.6.7 - debug: ^4.1.1 - find-yarn-workspace-root: ^2.0.0 - fs-extra: ^8.1 - github-slugger: ^1.2.1 - lodash: ^4.17.11 - normalize-package-data: ^3.0.0 - qqjs: ^0.3.10 - tslib: ^2.0.3 - bin: - oclif-dev: bin/run - checksum: 9f708ae66e424c4b3789088767c5277f1cdbe508fde973bfbe44f9be23824c1e629ef78c2cfc2485d2c2a1200b50dbc3f04ba0a33dadc4b7726e29fe497ef761 - languageName: node - linkType: hard - -"@oclif/errors@npm:1.3.5, @oclif/errors@npm:^1.3.3, @oclif/errors@npm:^1.3.5": - version: 1.3.5 - resolution: "@oclif/errors@npm:1.3.5" - dependencies: - clean-stack: ^3.0.0 - fs-extra: ^8.1 - indent-string: ^4.0.0 - strip-ansi: ^6.0.0 - wrap-ansi: ^7.0.0 - checksum: abce216ff1321ac4924fe405c50e9b2a93cfb51ad229d7e6ced8ee1c4bd01a85ee270b4433a12c73da9394dd8e9f6ec73443f8582da7ac46379b7e4991c3fa50 - languageName: node - linkType: hard - -"@oclif/help@npm:^1.0.0, @oclif/help@npm:^1.0.1": - version: 1.0.1 - resolution: "@oclif/help@npm:1.0.1" - dependencies: - "@oclif/config": 1.18.2 - "@oclif/errors": 1.3.5 - chalk: ^4.1.2 - indent-string: ^4.0.0 - lodash: ^4.17.21 - string-width: ^4.2.0 - strip-ansi: ^6.0.0 - widest-line: ^3.1.0 - wrap-ansi: ^6.2.0 - checksum: 26cdde82ca98f34bc57f7c7513b151f5fc2a6332f37b2f1186fe6d946011b7a4cc11e91053c569ebd28ad2b2ea90fd4a0851a21167e7780041a0caf369a8b277 - languageName: node - linkType: hard - -"@oclif/linewrap@npm:^1.0.0": - version: 1.0.0 - resolution: "@oclif/linewrap@npm:1.0.0" - checksum: a072016a58b5e1331bbc21303ad5100fcda846ac4b181e344aec88bb24c5da09c416651e51313ffcc846a83514b74b8b987dd965982900f3edbb42b4e87cc246 - languageName: node - linkType: hard - -"@oclif/parser@npm:^3.8.0, @oclif/parser@npm:^3.8.6": - version: 3.8.7 - resolution: "@oclif/parser@npm:3.8.7" - dependencies: - "@oclif/errors": ^1.3.5 - "@oclif/linewrap": ^1.0.0 - chalk: ^4.1.0 - tslib: ^2.3.1 - checksum: 3e355e0d459ee53d848451a43df4568eb96fed8c14ba3ab336fd011c3c7d4daba3ed4d9f5fa6288fb5b3c59ace745a3ec2776fca8450abecb67ab19db379c366 - languageName: node - linkType: hard - -"@oclif/plugin-help@npm:3.2.18": - version: 3.2.18 - resolution: "@oclif/plugin-help@npm:3.2.18" - dependencies: - "@oclif/command": ^1.8.14 - "@oclif/config": 1.18.2 - "@oclif/errors": 1.3.5 - "@oclif/help": ^1.0.0 - chalk: ^4.1.2 - indent-string: ^4.0.0 - lodash: ^4.17.21 - string-width: ^4.2.0 - strip-ansi: ^6.0.0 - widest-line: ^3.1.0 - wrap-ansi: ^6.2.0 - checksum: b0146e57d8dec1f0e1a4c1605f7b25ab77c3dc75afe7051db021b843d896dbfb409a544c71d34bd199dd6addba77fe3e3ee213e43dbf9272daf909bb8f3e5154 - languageName: node - linkType: hard - -"@oclif/plugin-help@npm:^3.2.3": - version: 3.3.1 - resolution: "@oclif/plugin-help@npm:3.3.1" - dependencies: - "@oclif/command": ^1.8.15 - "@oclif/config": 1.18.2 - "@oclif/errors": 1.3.5 - "@oclif/help": ^1.0.1 - chalk: ^4.1.2 - indent-string: ^4.0.0 - lodash: ^4.17.21 - string-width: ^4.2.0 - strip-ansi: ^6.0.0 - widest-line: ^3.1.0 - wrap-ansi: ^6.2.0 - checksum: 07c67a9ed32ea05a6407823325fac7379fdea2cd0b688ef927d6265f695c1e3707d13de6a706e2af5b1949ea4beb5720d11feb87e1f4323bfe5948846766d9e2 - languageName: node - linkType: hard - -"@oclif/plugin-help@npm:^5.1.11": - version: 5.1.12 - resolution: "@oclif/plugin-help@npm:5.1.12" - dependencies: - "@oclif/core": ^1.3.6 - checksum: 5964a6bdd3784088eac4cbbd361dc4393250d6ac7eb91d4f1df133f0ad4ffe97fb08646fdf4da5719a96fbeb646a72793a2e528bc4a296901f5ef9c1b17246a4 - languageName: node - linkType: hard - -"@oclif/plugin-not-found@npm:^2.3.1": - version: 2.3.1 - resolution: "@oclif/plugin-not-found@npm:2.3.1" - dependencies: - "@oclif/color": ^1.0.0 - "@oclif/core": ^1.2.1 - fast-levenshtein: ^3.0.0 - lodash: ^4.17.21 - checksum: b6aeddb7335f2963b5835f0a7f9c0fe0952e112a0360373974059d927cbb21cb9f3c3cb0dcf36268d8db5e524877268c7bc3def51a4f907fe7fdc5471fb42819 - languageName: node - linkType: hard - -"@oclif/plugin-warn-if-update-available@npm:^2.0.4": - version: 2.0.4 - resolution: "@oclif/plugin-warn-if-update-available@npm:2.0.4" - dependencies: - "@oclif/core": ^1.0.8 - chalk: ^4.1.0 - debug: ^4.1.0 - fs-extra: ^9.0.1 - http-call: ^5.2.2 - lodash: ^4.17.21 - semver: ^7.3.2 - checksum: 9a127aaaa3e37a390f17070f9c96fbee5c9b0c5ad0c1a01da84f28717ed80048ea909d4fe691b4021ee98af861d5ae34412e2b35180cbed36765eb0a078e5fdb - languageName: node - linkType: hard - -"@oclif/screen@npm:^1.0.4, @oclif/screen@npm:^1.0.4 ": - version: 1.0.4 - resolution: "@oclif/screen@npm:1.0.4" - checksum: 13e64efb1a6b4cf89989dd3e96cc78751193257694f9f104d3d41f7f8d12e217297d3c2983ed972d84d43ff3b50ceff50529996ee6bc6764f01ed90aa39a83cb - languageName: node - linkType: hard - -"@oclif/screen@npm:^3.0.2": - version: 3.0.2 - resolution: "@oclif/screen@npm:3.0.2" - checksum: 962678c65f1cf5b06864295a212020e3ddda36ab37190ca317e938943325a5acdbf3cb2761c371612daf1565e397fa5ff7bd0563887d746ccfde7c4ab312f005 - languageName: node - linkType: hard - -"@octokit/auth-token@npm:^2.4.4": - version: 2.5.0 - resolution: "@octokit/auth-token@npm:2.5.0" - dependencies: - "@octokit/types": ^6.0.3 - checksum: 45949296c09abcd6beb4c3f69d45b0c1f265f9581d2a9683cf4d1800c4cf8259c2f58d58e44c16c20bffb85a0282a176c0d51f4af300e428b863f27b910e6297 - languageName: node - linkType: hard - -"@octokit/core@npm:^3.5.1": - version: 3.6.0 - resolution: "@octokit/core@npm:3.6.0" - dependencies: - "@octokit/auth-token": ^2.4.4 - "@octokit/graphql": ^4.5.8 - "@octokit/request": ^5.6.3 - "@octokit/request-error": ^2.0.5 - "@octokit/types": ^6.0.3 - before-after-hook: ^2.2.0 - universal-user-agent: ^6.0.0 - checksum: f81160129037bd8555d47db60cd5381637b7e3602ad70735a7bdf8f3d250c7b7114a666bb12ef7a8746a326a5d72ed30a1b8f8a5a170007f7285c8e217bef1f0 - languageName: node - linkType: hard - -"@octokit/endpoint@npm:^6.0.1": - version: 6.0.12 - resolution: "@octokit/endpoint@npm:6.0.12" - dependencies: - "@octokit/types": ^6.0.3 - is-plain-object: ^5.0.0 - universal-user-agent: ^6.0.0 - checksum: b48b29940af11c4b9bca41cf56809754bb8385d4e3a6122671799d27f0238ba575b3fde86d2d30a84f4dbbc14430940de821e56ecc6a9a92d47fc2b29a31479d - languageName: node - linkType: hard - -"@octokit/graphql@npm:^4.5.8": - version: 4.8.0 - resolution: "@octokit/graphql@npm:4.8.0" - dependencies: - "@octokit/request": ^5.6.0 - "@octokit/types": ^6.0.3 - universal-user-agent: ^6.0.0 - checksum: f68afe53f63900d4a16a0a733f2f500df2695b731f8ed32edb728d50edead7f5011437f71d069c2d2f6d656227703d0c832a3c8af58ecf82bd5dcc051f2d2d74 - languageName: node - linkType: hard - -"@octokit/openapi-types@npm:^11.2.0": - version: 11.2.0 - resolution: "@octokit/openapi-types@npm:11.2.0" - checksum: eb373ea496bc96bf0233505a0916eb38cb193d1829cab935e1cf1fd21839c402a1d835d3c0326290c756c0ed980a64d0ae73ad3c5d5decde9000f0828aa7ff52 - languageName: node - linkType: hard - -"@octokit/plugin-paginate-rest@npm:^2.16.8": - version: 2.17.0 - resolution: "@octokit/plugin-paginate-rest@npm:2.17.0" - dependencies: - "@octokit/types": ^6.34.0 - peerDependencies: - "@octokit/core": ">=2" - checksum: c8753cda6f7ede79d0e9df43a54e56020aa1c9c6887684e0e0d45cb6ee0dcabf460c3e4b8a18edabef711bb269fd826616e99e78dc29fb30d47c210c562603a0 - languageName: node - linkType: hard - -"@octokit/plugin-request-log@npm:^1.0.4": - version: 1.0.4 - resolution: "@octokit/plugin-request-log@npm:1.0.4" - peerDependencies: - "@octokit/core": ">=3" - checksum: 2086db00056aee0f8ebd79797b5b57149ae1014e757ea08985b71eec8c3d85dbb54533f4fd34b6b9ecaa760904ae6a7536be27d71e50a3782ab47809094bfc0c - languageName: node - linkType: hard - -"@octokit/plugin-rest-endpoint-methods@npm:^5.12.0": - version: 5.13.0 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:5.13.0" - dependencies: - "@octokit/types": ^6.34.0 - deprecation: ^2.3.1 - peerDependencies: - "@octokit/core": ">=3" - checksum: f331457e4317130adb456b27df2a99609fb54a4dc2da6f87009e567c7325680c901abf18ad08483535bab4ec1c892e4236f4135a2804603aebb12c0698c678c8 - languageName: node - linkType: hard - -"@octokit/request-error@npm:^2.0.5, @octokit/request-error@npm:^2.1.0": - version: 2.1.0 - resolution: "@octokit/request-error@npm:2.1.0" - dependencies: - "@octokit/types": ^6.0.3 - deprecation: ^2.0.0 - once: ^1.4.0 - checksum: baec2b5700498be01b4d958f9472cb776b3f3b0ea52924323a07e7a88572e24cac2cdf7eb04a0614031ba346043558b47bea2d346e98f0e8385b4261f138ef18 - languageName: node - linkType: hard - -"@octokit/request@npm:^5.6.0, @octokit/request@npm:^5.6.3": - version: 5.6.3 - resolution: "@octokit/request@npm:5.6.3" - dependencies: - "@octokit/endpoint": ^6.0.1 - "@octokit/request-error": ^2.1.0 - "@octokit/types": ^6.16.1 - is-plain-object: ^5.0.0 - node-fetch: ^2.6.7 - universal-user-agent: ^6.0.0 - checksum: c0b4542eb4baaf880d673c758d3e0b5c4a625a4ae30abf40df5548b35f1ff540edaac74625192b1aff42a79ac661e774da4ab7d5505f1cb4ef81239b1e8510c5 - languageName: node - linkType: hard - -"@octokit/rest@npm:^18.0.6": - version: 18.12.0 - resolution: "@octokit/rest@npm:18.12.0" - dependencies: - "@octokit/core": ^3.5.1 - "@octokit/plugin-paginate-rest": ^2.16.8 - "@octokit/plugin-request-log": ^1.0.4 - "@octokit/plugin-rest-endpoint-methods": ^5.12.0 - checksum: c18bd6676a60b66819b016b0f969fcd04d8dfa04d01b7af9af9a7410ff028c621c995185e29454c23c47906da506c1e01620711259989a964ebbfd9106f5b715 - languageName: node - linkType: hard - -"@octokit/types@npm:^6.0.3, @octokit/types@npm:^6.16.1, @octokit/types@npm:^6.34.0": - version: 6.34.0 - resolution: "@octokit/types@npm:6.34.0" - dependencies: - "@octokit/openapi-types": ^11.2.0 - checksum: f122b9aee8f6baddd515e34a0913e73b21d4bc82d6ee59d77a8aaf01b4a02c10867dd013003d087a83dc96db23511893669015af6d30c27cece185e21cf1df89 +"@octokit/types@npm:^6.0.3, @octokit/types@npm:^6.16.1": + version: 6.41.0 + resolution: "@octokit/types@npm:6.41.0" + dependencies: + "@octokit/openapi-types": ^12.11.0 + checksum: fd6f75e0b19b90d1a3d244d2b0c323ed8f2f05e474a281f60a321986683548ef2e0ec2b3a946aa9405d6092e055344455f69f58957c60f58368c8bdda5b7d2ab languageName: node linkType: hard @@ -3221,13 +2894,6 @@ __metadata: languageName: node linkType: hard -"@sindresorhus/is@npm:^0.14.0": - version: 0.14.0 - resolution: "@sindresorhus/is@npm:0.14.0" - checksum: 971e0441dd44ba3909b467219a5e242da0fc584048db5324cfb8048148fa8dcc9d44d71e3948972c4f6121d24e5da402ef191420d1266a95f713bb6d6e59c98a - languageName: node - linkType: hard - "@sinonjs/commons@npm:^1.7.0": version: 1.8.3 resolution: "@sinonjs/commons@npm:1.8.3" @@ -3246,75 +2912,16 @@ __metadata: languageName: node linkType: hard -"@subql/cli@workspace:packages/cli": +"@subql/common-ethereum@workspace:*, @subql/common-ethereum@workspace:packages/common-ethereum": version: 0.0.0-use.local - resolution: "@subql/cli@workspace:packages/cli" - dependencies: - "@oclif/command": ^1.8.16 - "@oclif/config": ^1.18.3 - "@oclif/core": ^1.3.3 - "@oclif/dev-cli": ^1.26.10 - "@oclif/plugin-help": ^3.2.3 - "@subql/common": "workspace:*" - "@subql/common-algorand": latest - "@subql/common-avalanche": latest - "@subql/common-cosmos": latest - "@subql/common-substrate": "workspace:*" - "@subql/common-terra": ^0.6.0 - "@subql/utils": "workspace:*" - "@subql/validator": "workspace:*" - "@types/ejs": ^3.1.0 - "@types/inquirer": ^8.2.0 - "@types/node": ^14.18.10 - "@types/rimraf": ^3.0.2 - "@types/websocket": ^1 - algosdk: ^1.19.0 - cli-ux: ^6.0.9 - ejs: ^3.1.6 - eslint: ^8.8.0 - eslint-config-oclif: ^4.0.0 - eslint-config-oclif-typescript: ^1.0.2 - fuzzy: ^0.1.3 - globby: ^11 - inquirer: ^8.2.0 - inquirer-autocomplete-prompt: ^1.4.0 - node-fetch: 2.6.7 - oclif: ^2.4.4 - rimraf: ^3.0.2 - simple-git: ^3.12.0 - ts-loader: ^9.2.6 - tslib: ^2.3.1 - webpack: ^5.68.0 - webpack-merge: ^5.8.0 - websocket: ^1.0.34 - yaml-loader: ^0.6.0 - bin: - subql: ./bin/run - languageName: unknown - linkType: soft - -"@subql/common-algorand@npm:latest": - version: 1.0.0 - resolution: "@subql/common-algorand@npm:1.0.0" - dependencies: - "@subql/common": latest - "@subql/types-algorand": 1.2.1 - class-transformer: 0.4.0 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 - semver: ^7.3.7 - checksum: c60bbe97468e63bb3dfa56214b15de85e205a4e4dcfae9306e936fc3e9e3072f1fa580c6ecb840d5270f3621e78f31a6621048ba79167f205c32908d6cf6e1d8 - languageName: node - linkType: hard - -"@subql/common-avalanche@npm:latest": - version: 0.0.2-0 - resolution: "@subql/common-avalanche@npm:0.0.2-0" + resolution: "@subql/common-ethereum@workspace:packages/common-ethereum" dependencies: "@polkadot/util": ^8 - "@subql/common": 0.22.0 - "@subql/types-avalanche": 0.0.2-0 + "@subql/common": latest + "@subql/types-ethereum": "workspace:*" + "@types/bn.js": 4.11.6 + "@types/js-yaml": ^4.0.4 + "@types/pino": ^6.3.12 bn.js: 4.11.6 class-transformer: 0.4.0 class-validator: ^0.13.2 @@ -3326,106 +2933,13 @@ __metadata: reflect-metadata: ^0.1.13 sequelize: ^6.6.2 vm2: ^3.9.9 - checksum: 99493bdfb2b06af583f382584c06e583b6874740a683971d45cdd58ceff86fc0ef068659b26ac64c0205767d8ce65035aab6d588a496fdf915a3dc92c9c6646f - languageName: node - linkType: hard - -"@subql/common-cosmos@npm:^0.0.6": - version: 0.0.6 - resolution: "@subql/common-cosmos@npm:0.0.6" - dependencies: - "@subql/common": latest - "@subql/types-cosmos": 0.0.6 - class-transformer: 0.4.0 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 - checksum: 93d113560cad2202d08a51ef9e3d8e8d3dac349cb63e6ccb9744ff5ae3b728d985cec422226119219be4622e02cad1597010b0d0d5179519bc76bf1d26f4c028 - languageName: node - linkType: hard - -"@subql/common-cosmos@npm:latest": - version: 0.0.5 - resolution: "@subql/common-cosmos@npm:0.0.5" - dependencies: - "@subql/common": latest - "@subql/types-cosmos": 0.0.5 - class-transformer: 0.4.0 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 - checksum: ad0b8e64345594b991b42c9d6ae97668a4d7ac9f28ff14919c5c5b440c2b8b791d94d40a49504d8e8d5a7ca309d82c2ce8b2ecf349b8a58962bf52db341b566a - languageName: node - linkType: hard - -"@subql/common-substrate@workspace:*, @subql/common-substrate@workspace:packages/common-substrate": - version: 0.0.0-use.local - resolution: "@subql/common-substrate@workspace:packages/common-substrate" - dependencies: - "@subql/common": "workspace:*" - "@subql/types": "workspace:*" - "@types/bn.js": 4.11.6 - "@types/js-yaml": ^4.0.4 - "@types/pino": ^6.3.12 - class-transformer: 0.4.0 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 languageName: unknown linkType: soft -"@subql/common-terra@npm:^0.6.0, @subql/common-terra@npm:latest": - version: 0.6.0 - resolution: "@subql/common-terra@npm:0.6.0" - dependencies: - "@subql/types-terra": 0.4.0 - class-transformer: 0.4.0 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 - checksum: 90e45b4dcac1f624d18395a3db928a7a7a86dd199d0a8f7594862ab62256dc39170b1488b0490a46139f25563178beb103eee2c8450c342bf49d7553399d5729 - languageName: node - linkType: hard - -"@subql/common@npm:0.22.0": - version: 0.22.0 - resolution: "@subql/common@npm:0.22.0" - dependencies: - axios: ^0.27.2 - class-transformer: 0.5.1 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 - semver: ^7.3.5 - checksum: 58259f15f19cae5f3a2aab3de8d8a6eba54c681960e32c9e83bfe7dcede185734ddd28e71518939fad35df83c9ef18b426ac7b224331b9468918ad401926f698 - languageName: node - linkType: hard - -"@subql/common@npm:latest": - version: 1.1.0 - resolution: "@subql/common@npm:1.1.0" - dependencies: - axios: ^0.27.2 - class-transformer: 0.5.1 - class-validator: ^0.13.2 - js-yaml: ^4.1.0 - reflect-metadata: ^0.1.13 - semver: ^7.3.5 - checksum: f54b39f90c8dcbc65a04f602fa42fcb945f3ac0a6000b20d4614160fc31ce4d4f0da260df2755cb96c94ca9cc7f9c0090570770216da8fddfa285c8ed3bdf7ef - languageName: node - linkType: hard - -"@subql/common@workspace:*, @subql/common@workspace:packages/common": - version: 0.0.0-use.local - resolution: "@subql/common@workspace:packages/common" +"@subql/common@npm:1.4.0, @subql/common@npm:latest": + version: 1.4.0 + resolution: "@subql/common@npm:1.4.0" dependencies: - "@types/bn.js": 4.11.6 - "@types/detect-port": ^1 - "@types/fs-extra": ^9.0.13 - "@types/js-yaml": ^4.0.5 - "@types/pino": ^6.3.12 - "@types/semver": ^7.3.9 - "@types/tar": ^6.1.1 axios: ^0.27.2 class-transformer: 0.5.1 class-validator: ^0.13.2 @@ -3434,32 +2948,34 @@ __metadata: js-yaml: ^4.1.0 reflect-metadata: ^0.1.13 semver: ^7.3.5 - languageName: unknown - linkType: soft + checksum: b53a929c70586c26433488a2360f2df8da740f2121068f4def73934c0b28298a30676376b4f32f15df3515c5c71e812ce2ae0a36a0e12149580262868b856fdc + languageName: node + linkType: hard -"@subql/node-core@workspace:*, @subql/node-core@workspace:packages/node-core": - version: 0.0.0-use.local - resolution: "@subql/node-core@workspace:packages/node-core" +"@subql/node-core@npm:^0.1.1, @subql/node-core@npm:latest": + version: 0.1.1 + resolution: "@subql/node-core@npm:0.1.1" dependencies: "@nestjs/common": ^8.2.6 "@nestjs/event-emitter": ^1.3.0 "@nestjs/schedule": ^1.0.2 "@polkadot/api": 9.1.1 - "@subql/common": "workspace:*" - "@subql/types": "workspace:*" - "@subql/utils": "workspace:*" + "@subql/common": 1.4.0 + "@subql/types": 1.4.0 + "@subql/utils": 1.1.0 "@subql/x-merkle-mountain-range": ^2.0.0-0.1.2 "@willsoto/nestjs-prometheus": ^4.4.0 lodash: ^4.17.21 prom-client: ^14.0.1 sequelize: 6.19.0 yargs: ^16.2.0 - languageName: unknown - linkType: soft + checksum: 4f06f5ff10c1fb4a9628ce244a5400dd2fc6471f9b799000777938e9ecd2eb4cc414895d2d529692d5f152551a364d6a4ad73b74f76b0d5501216d6cb2250e99 + languageName: node + linkType: hard -"@subql/node@workspace:packages/node": +"@subql/node-ethereum@workspace:packages/node": version: 0.0.0-use.local - resolution: "@subql/node@workspace:packages/node" + resolution: "@subql/node-ethereum@workspace:packages/node" dependencies: "@apollo/client": 3.5.8 "@nestjs/common": ^8.2.6 @@ -3469,13 +2985,13 @@ __metadata: "@nestjs/schedule": ^1.0.2 "@nestjs/schematics": ^8.0.5 "@nestjs/testing": ^8.2.6 - "@polkadot/api": 9.2.4 - "@subql/common": "workspace:*" - "@subql/common-substrate": "workspace:*" - "@subql/node-core": "workspace:*" - "@subql/types": "workspace:*" - "@subql/utils": "workspace:*" - "@subql/x-merkle-mountain-range": 2.0.0-0.1.2 + "@subql/common": latest + "@subql/common-ethereum": "workspace:*" + "@subql/node-core": latest + "@subql/types-ethereum": "workspace:*" + "@subql/utils": latest + "@subql/x-merkle-mountain-range": 2.0.0-0.1.1 + "@subql/x-vm2": ^3.9.3-0.1.0 "@types/app-module-path": ^2.2.0 "@types/express": ^4.17.13 "@types/jest": ^27.4.0 @@ -3485,11 +3001,12 @@ __metadata: "@types/tar": ^6.1.1 "@types/yargs": ^16.0.4 "@willsoto/nestjs-prometheus": ^4.4.0 + algosdk: ^1.13.1 app-module-path: ^2.2.0 dayjs: ^1.10.7 dotenv: ^15.0.1 + ethers: ^5.6.1 eventemitter2: ^6.4.5 - fetch-h2: 3.0.2 lodash: ^4.17.21 merkle-tools: ^1.4.1 nodemon: ^2.0.15 @@ -3503,125 +3020,38 @@ __metadata: supertest: ^6.2.2 tar: ^6.1.11 typescript: ^4.4.4 - vm2: ^3.9.9 yargs: ^16.2.0 bin: - subql-node: ./bin/run + subql-node-ethereum: ./bin/run languageName: unknown linkType: soft -"@subql/query@workspace:packages/query": +"@subql/types-ethereum@workspace:*, @subql/types-ethereum@workspace:packages/types": version: 0.0.0-use.local - resolution: "@subql/query@workspace:packages/query" + resolution: "@subql/types-ethereum@workspace:packages/types" dependencies: - "@graphile-contrib/pg-many-to-many": ^1.0.1 - "@graphile-contrib/pg-simplify-inflector": ^6.1.0 - "@graphile/pg-aggregates": ^0.1.0 - "@graphile/pg-pubsub": ^4.12.2 - "@nestjs/cli": ^8.1.4 - "@nestjs/common": ^8.2.6 - "@nestjs/core": ^8.2.6 - "@nestjs/platform-express": ^8.2.6 - "@nestjs/schematics": ^8.0.5 - "@nestjs/testing": ^8.2.6 - "@subql/common": "workspace:*" - "@subql/utils": "workspace:*" - "@types/express": ^4.17.13 - "@types/express-pino-logger": ^4.0.3 - "@types/jest": ^27.4.0 - "@types/lodash": ^4.14.178 - "@types/rimraf": ^3.0.2 - "@types/yargs": ^16.0.4 - apollo-server-express: ^3.6.2 - express-pino-logger: ^6.0.0 - graphile-build: ^4.12.2 - graphile-build-pg: ^4.12.2 - graphile-utils: ^4.12.2 - graphql: ^15.8.0 - graphql-query-complexity: ^0.11.0 - lodash: ^4.17.21 - nodemon: ^2.0.15 - pg: ^8.7.1 - postgraphile: ^4.12.9 - postgraphile-core: ^4.12.2 - postgraphile-plugin-connection-filter: ^2.2.2 - reflect-metadata: ^0.1.13 - rimraf: ^3.0.2 - rxjs: ^7.5.2 - subscriptions-transport-ws: ^0.11.0 - typescript: ^4.4.4 - yargs: ^16.2.0 - bin: - subql-query: ./bin/run + "@ethersproject/abstract-provider": ^5.6.1 + "@polkadot/api": ^9 + "@types/app-module-path": ^2.2.0 + peerDependencies: + "@polkadot/api": ^9 languageName: unknown linkType: soft -"@subql/types-algorand@npm:1.2.1": - version: 1.2.1 - resolution: "@subql/types-algorand@npm:1.2.1" - peerDependencies: - algosdk: ^1.19.0 - checksum: be32fe64260d4d13f9a993585612f07c9fa4da8c002e9369c6b18d770cac9feda2ce5a0c5a6771f652515475cf516f9ebc531126417c86b53b6fbc42812831f9 - languageName: node - linkType: hard - -"@subql/types-avalanche@npm:0.0.2-0": - version: 0.0.2-0 - resolution: "@subql/types-avalanche@npm:0.0.2-0" +"@subql/types@npm:1.4.0": + version: 1.4.0 + resolution: "@subql/types@npm:1.4.0" peerDependencies: "@polkadot/api": ^8 - checksum: 3144caabcea3049a302e515ce966e32be5cc7f68dd313418424c1d825c324d66e271d881c8efff14b6106d71d1f134e8ca63862163547ae43956a893ed228538 - languageName: node - linkType: hard - -"@subql/types-cosmos@npm:0.0.5": - version: 0.0.5 - resolution: "@subql/types-cosmos@npm:0.0.5" - peerDependencies: - "@cosmjs/cosmwasm-stargate": 0.28.7 - "@cosmjs/proto-signing": 0.28.7 - "@cosmjs/stargate": 0.28.7 - checksum: 109137cd0dea1f4e63d6e94614e494d25340319c16a701aa47c60409671c918e6d713cb661812147445fab0e5a9df3cce0ae7d9ecf8feefa169e750d3d69bded + checksum: 4a194eccfc9daba612b425970124eefff476fa07bf02ef32e8f2fcbd9d9b13e490a7f2c970fc809b417214d8596b37ef4e854dd8c830f91b3825d2926c78e255 languageName: node linkType: hard -"@subql/types-cosmos@npm:0.0.6": - version: 0.0.6 - resolution: "@subql/types-cosmos@npm:0.0.6" - peerDependencies: - "@cosmjs/cosmwasm-stargate": 0.28.7 - "@cosmjs/proto-signing": 0.28.7 - "@cosmjs/stargate": 0.28.7 - checksum: 7b86b60e0bccdbb4cd65567049a719a453036a1dc46fecfd13112d71e725e5d72395ed9ad8ce6471cb7d41859387c0f82c0c8d460a6e743c7428382518638471 - languageName: node - linkType: hard - -"@subql/types-terra@npm:0.4.0": - version: 0.4.0 - resolution: "@subql/types-terra@npm:0.4.0" - peerDependencies: - "@terra-money/terra.js": ^3.0.8 - checksum: 2ae60e624d3b57905f9f3f85b2a3538eabda8d87a19371a6e1808837e5cedbc0b5eddeccded84427d5346d1e0846c3d11e32733362bc27c64022dca0a6d73cc6 - languageName: node - linkType: hard - -"@subql/types@workspace:*, @subql/types@workspace:packages/types": - version: 0.0.0-use.local - resolution: "@subql/types@workspace:packages/types" - dependencies: - "@polkadot/api": ^9 - "@types/app-module-path": ^2.2.0 - peerDependencies: - "@polkadot/api": ^9 - languageName: unknown - linkType: soft - -"@subql/utils@workspace:*, @subql/utils@workspace:packages/utils": - version: 0.0.0-use.local - resolution: "@subql/utils@workspace:packages/utils" +"@subql/utils@npm:1.1.0, @subql/utils@npm:^1.1.0, @subql/utils@npm:latest": + version: 1.1.0 + resolution: "@subql/utils@npm:1.1.0" dependencies: "@polkadot/util": ^10 - "@types/semver": ^7 ansi-styles: ^6.1.0 axios: ^0.27.1 chalk: ^4.1.2 @@ -3634,26 +3064,26 @@ __metadata: semver: ^7.3.7 sequelize: ^6.15.0 tar: ^6.1.11 - languageName: unknown - linkType: soft + checksum: 0667298f2cd95cf47783c550e51d9f2495b4666462de8001a7e193b52cc9e6bff02eaf1e83b8781c1d3c956a84b240f3f4d9b7154a0c72ff12f1256817372de6 + languageName: node + linkType: hard -"@subql/validator@workspace:*, @subql/validator@workspace:packages/validator": - version: 0.0.0-use.local - resolution: "@subql/validator@workspace:packages/validator" - dependencies: - "@subql/common": "workspace:*" - "@subql/common-avalanche": latest - "@subql/common-cosmos": ^0.0.6 - "@subql/common-substrate": "workspace:*" - "@subql/common-terra": latest - "@types/js-yaml": ^4.0.5 - axios: ^0.24.0 - js-yaml: ^4.1.0 - package-json-type: ^1.0.3 - languageName: unknown - linkType: soft +"@subql/x-merkle-mountain-range@npm:2.0.0-0.1.1": + version: 2.0.0-0.1.1 + resolution: "@subql/x-merkle-mountain-range@npm:2.0.0-0.1.1" + dependencies: + bignumber.js: ^8.1.1 + buffer: ^5.4.3 + js-sha3: ^0.8.0 + level: ^6.0.0 + rlp: ^2.2.3 + semaphore-async-await: ^1.5.1 + sha.js: ^2.4.11 + checksum: e7286aee9ae657c6952bc7e753253ca80a6f7ce4f12987b4a528b7c8acdedb2e4225484930fb21b2a130a1f11ad95846725de84b18c87ac8cb812b4071cf47c8 + languageName: node + linkType: hard -"@subql/x-merkle-mountain-range@npm:2.0.0-0.1.2, @subql/x-merkle-mountain-range@npm:^2.0.0-0.1.2": +"@subql/x-merkle-mountain-range@npm:^2.0.0-0.1.2": version: 2.0.0-0.1.2 resolution: "@subql/x-merkle-mountain-range@npm:2.0.0-0.1.2" dependencies: @@ -3668,6 +3098,15 @@ __metadata: languageName: node linkType: hard +"@subql/x-vm2@npm:^3.9.3-0.1.0": + version: 3.9.3-0.1.0 + resolution: "@subql/x-vm2@npm:3.9.3-0.1.0" + bin: + vm2: bin/vm2 + checksum: 00dab297b1088714c86ae37a619d670c2899772bd632bf3fb0404158dfcb4f713aabbf5a8efd33536aac1a14dac4cfcbc180495347918eb75a9aa29b4a0a3bd1 + languageName: node + linkType: hard + "@substrate/connect-extension-protocol@npm:^1.0.1": version: 1.0.1 resolution: "@substrate/connect-extension-protocol@npm:1.0.1" @@ -3703,15 +3142,6 @@ __metadata: languageName: node linkType: hard -"@szmarczak/http-timer@npm:^1.1.2": - version: 1.1.2 - resolution: "@szmarczak/http-timer@npm:1.1.2" - dependencies: - defer-to-connect: ^1.0.1 - checksum: 4d9158061c5f397c57b4988cde33a163244e4f02df16364f103971957a32886beb104d6180902cbe8b38cb940e234d9f98a4e486200deca621923f62f50a06fe - languageName: node - linkType: hard - "@tootallnate/once@npm:1": version: 1.1.2 resolution: "@tootallnate/once@npm:1.1.2" @@ -3727,39 +3157,30 @@ __metadata: linkType: hard "@tsconfig/node10@npm:^1.0.7": - version: 1.0.8 - resolution: "@tsconfig/node10@npm:1.0.8" - checksum: b8d5fffbc6b17ef64ef74f7fdbccee02a809a063ade785c3648dae59406bc207f70ea2c4296f92749b33019fa36a5ae716e42e49cc7f1bbf0fd147be0d6b970a + version: 1.0.9 + resolution: "@tsconfig/node10@npm:1.0.9" + checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df languageName: node linkType: hard "@tsconfig/node12@npm:^1.0.7": - version: 1.0.9 - resolution: "@tsconfig/node12@npm:1.0.9" - checksum: a01b2400ab3582b86b589c6d31dcd0c0656f333adecde85d6d7d4086adb059808b82692380bb169546d189bf771ae21d02544a75b57bd6da4a5dd95f8567bec9 + version: 1.0.11 + resolution: "@tsconfig/node12@npm:1.0.11" + checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a languageName: node linkType: hard "@tsconfig/node14@npm:^1.0.0": - version: 1.0.1 - resolution: "@tsconfig/node14@npm:1.0.1" - checksum: 976345e896c0f059867f94f8d0f6ddb8b1844fb62bf36b727de8a9a68f024857e5db97ed51d3325e23e0616a5e48c034ff51a8d595b3fe7e955f3587540489be + version: 1.0.3 + resolution: "@tsconfig/node14@npm:1.0.3" + checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d languageName: node linkType: hard "@tsconfig/node16@npm:^1.0.2": - version: 1.0.2 - resolution: "@tsconfig/node16@npm:1.0.2" - checksum: ca94d3639714672bbfd55f03521d3f56bb6a25479bd425da81faf21f13e1e9d15f40f97377dedbbf477a5841c5b0c8f4cd1b391f33553d750b9202c54c2c07aa - languageName: node - linkType: hard - -"@types/accepts@npm:^1.3.5": - version: 1.3.5 - resolution: "@types/accepts@npm:1.3.5" - dependencies: - "@types/node": "*" - checksum: 590b7580570534a640510c071e09074cf63b5958b237a728f94322567350aea4d239f8a9d897a12b15c856b992ee4d7907e9812bb079886af2c00714e7fb3f60 + version: 1.0.3 + resolution: "@tsconfig/node16@npm:1.0.3" + checksum: 3a8b657dd047495b7ad23437d6afd20297ce90380ff0bdee93fc7d39a900dbd8d9e26e53ff6b465e7967ce2adf0b218782590ce9013285121e6a5928fbd6819f languageName: node linkType: hard @@ -3803,11 +3224,11 @@ __metadata: linkType: hard "@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.4, @types/babel__traverse@npm:^7.0.6": - version: 7.17.1 - resolution: "@types/babel__traverse@npm:7.17.1" + version: 7.18.1 + resolution: "@types/babel__traverse@npm:7.18.1" dependencies: "@babel/types": ^7.3.0 - checksum: 8992d8c1eaaf1c793e9184b930767883446939d2744c40ea4e9591086e79b631189dc519931ed8864f1e016742a189703c217db59b800aca84870b865009d8b4 + checksum: a7158b13e5e4b844565217d04a0a09c1cf04e67de90972318960028effbd5e7400f2567b72c5f790acffdab9b4adce8d68f435a2f0c2b16e2c9c45994ace98f2 languageName: node linkType: hard @@ -3820,7 +3241,7 @@ __metadata: languageName: node linkType: hard -"@types/bn.js@npm:^5.1.1": +"@types/bn.js@npm:^5.1.0, @types/bn.js@npm:^5.1.1": version: 5.1.1 resolution: "@types/bn.js@npm:5.1.1" dependencies: @@ -3829,7 +3250,7 @@ __metadata: languageName: node linkType: hard -"@types/body-parser@npm:*, @types/body-parser@npm:1.19.2": +"@types/body-parser@npm:*": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" dependencies: @@ -3855,14 +3276,7 @@ __metadata: languageName: node linkType: hard -"@types/cors@npm:2.8.12": - version: 2.8.12 - resolution: "@types/cors@npm:2.8.12" - checksum: 8c45f112c7d1d2d831b4b266f2e6ed33a1887a35dcbfe2a18b28370751fababb7cd045e745ef84a523c33a25932678097bf79afaa367c6cb3fa0daa7a6438257 - languageName: node - linkType: hard - -"@types/debug@npm:^4.1.4, @types/debug@npm:^4.1.5, @types/debug@npm:^4.1.7": +"@types/debug@npm:^4.1.7": version: 4.1.7 resolution: "@types/debug@npm:4.1.7" dependencies: @@ -3871,103 +3285,26 @@ __metadata: languageName: node linkType: hard -"@types/detect-port@npm:^1": - version: 1.3.2 - resolution: "@types/detect-port@npm:1.3.2" - checksum: e4678244fbe8801014798b3efb967c886e6fc0fe94fb771a1be9558b35c68910b23bd30984df4a276b927820ce436b244506fb0972116d1b18506ac96bfd1a50 - languageName: node - linkType: hard - -"@types/ejs@npm:^3.1.0": - version: 3.1.0 - resolution: "@types/ejs@npm:3.1.0" - checksum: 2905e401a1cf632ff0001bbb3e647b4f96f1db31ac34ed0b04f2670500d74e60e705526ae87da6e2fe13744ea5b21d521de3c6695d02b21f9121d13402c554da - languageName: node - linkType: hard - -"@types/eslint-scope@npm:^3.7.3": - version: 3.7.3 - resolution: "@types/eslint-scope@npm:3.7.3" - dependencies: - "@types/eslint": "*" - "@types/estree": "*" - checksum: 6772b05e1b92003d1f295e81bc847a61f4fbe8ddab77ffa49e84ed3f9552513bdde677eb53ef167753901282857dd1d604d9f82eddb34a233495932b2dc3dc17 - languageName: node - linkType: hard - -"@types/eslint@npm:*": - version: 8.4.2 - resolution: "@types/eslint@npm:8.4.2" - dependencies: - "@types/estree": "*" - "@types/json-schema": "*" - checksum: e81268cdeb8d64d84af649344df88f064ece0f05db62072657c976b6162ffe16f94b6480a5367d627c629272c2d86d0ee8c24f7095e98f8e743b16f98500673b - languageName: node - linkType: hard - -"@types/estree@npm:*, @types/estree@npm:^0.0.51": - version: 0.0.51 - resolution: "@types/estree@npm:0.0.51" - checksum: e56a3bcf759fd9185e992e7fdb3c6a5f81e8ff120e871641607581fb3728d16c811702a7d40fa5f869b7f7b4437ab6a87eb8d98ffafeee51e85bbe955932a189 - languageName: node - linkType: hard - -"@types/expect@npm:^1.20.4": - version: 1.20.4 - resolution: "@types/expect@npm:1.20.4" - checksum: c09a9abec2c1776dd8948920dc3bad87b1206c843509d3d3002040983b1769b2e3914202a6c20b72e5c3fb5738a1ab87cb7be9d3fe9efabf2a324173b222a224 - languageName: node - linkType: hard - -"@types/express-pino-logger@npm:^4.0.3": - version: 4.0.3 - resolution: "@types/express-pino-logger@npm:4.0.3" - dependencies: - "@types/pino": 6.3 - "@types/pino-http": "*" - checksum: beb68191f1c43d57923a21dfb870c05b0e850ad6942f02ba930c8b1e077041b3482489ca9cf963b306ea7e5e537d947a969cdbb16d51150ab9522beb2e43bfe5 - languageName: node - linkType: hard - -"@types/express-serve-static-core@npm:4.17.28, @types/express-serve-static-core@npm:^4.17.18": - version: 4.17.28 - resolution: "@types/express-serve-static-core@npm:4.17.28" +"@types/express-serve-static-core@npm:^4.17.18": + version: 4.17.31 + resolution: "@types/express-serve-static-core@npm:4.17.31" dependencies: "@types/node": "*" "@types/qs": "*" "@types/range-parser": "*" - checksum: 826489811a5b371c10f02443b4ca894ffc05813bfdf2b60c224f5c18ac9a30a2e518cb9ef9fdfcaa2a1bb17f8bfa4ed1859ccdb252e879c9276271b4ee2df5a9 + checksum: 009bfbe1070837454a1056aa710d0390ee5fb8c05dfe5a1691cc3e2ca88dc256f80e1ca27cb51a978681631d2f6431bfc9ec352ea46dd0c6eb183d0170bde5df languageName: node linkType: hard -"@types/express@npm:4.17.13, @types/express@npm:^4.17.13": - version: 4.17.13 - resolution: "@types/express@npm:4.17.13" +"@types/express@npm:^4.17.13": + version: 4.17.14 + resolution: "@types/express@npm:4.17.14" dependencies: "@types/body-parser": "*" "@types/express-serve-static-core": ^4.17.18 "@types/qs": "*" "@types/serve-static": "*" - checksum: 12a2a0e6c4b993fc0854bec665906788aea0d8ee4392389d7a98a5de1eefdd33c9e1e40a91f3afd274011119c506f7b4126acb97fae62ae20b654974d44cba12 - languageName: node - linkType: hard - -"@types/fs-extra@npm:^9.0.13": - version: 9.0.13 - resolution: "@types/fs-extra@npm:9.0.13" - dependencies: - "@types/node": "*" - checksum: add79e212acd5ac76b97b9045834e03a7996aef60a814185e0459088fd290519a3c1620865d588fa36c4498bf614210d2a703af5cf80aa1dbc125db78f6edac3 - languageName: node - linkType: hard - -"@types/glob@npm:*, @types/glob@npm:^7.1.1": - version: 7.2.0 - resolution: "@types/glob@npm:7.2.0" - dependencies: - "@types/minimatch": "*" - "@types/node": "*" - checksum: 6ae717fedfdfdad25f3d5a568323926c64f52ef35897bcac8aca8e19bc50c0bd84630bbd063e5d52078b2137d8e7d3c26eabebd1a2f03ff350fff8a91e79fc19 + checksum: 15c1af46d02de834e4a225eccaa9d85c0370fdbb3ed4e1bc2d323d24872309961542b993ae236335aeb3e278630224a6ea002078d39e651d78a3b0356b1eaa79 languageName: node linkType: hard @@ -3980,25 +3317,6 @@ __metadata: languageName: node linkType: hard -"@types/graphql@npm:^14.5.0": - version: 14.5.0 - resolution: "@types/graphql@npm:14.5.0" - dependencies: - graphql: "*" - checksum: 8f6e3873a75f1818b6551dae88002d786f764c6c3f5d3b228078ecfc8fb1b116fcec03a1a0dd1f83790505d8e5ecfc4737e152ad7abb6948ff5412f11d7b1b38 - languageName: node - linkType: hard - -"@types/inquirer@npm:^8.2.0": - version: 8.2.1 - resolution: "@types/inquirer@npm:8.2.1" - dependencies: - "@types/through": "*" - rxjs: ^7.2.0 - checksum: 5362d0b1cbec3887c9d5a671a0b19c58cf54066456c8967dd7ee799dfcc242cc8cd8959440c0f2fe7768becaf721b45fd30c222e6b9bcca378f45c68af43bab5 - languageName: node - linkType: hard - "@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": version: 2.0.4 resolution: "@types/istanbul-lib-coverage@npm:2.0.4" @@ -4025,23 +3343,23 @@ __metadata: linkType: hard "@types/jest@npm:^27.4.0": - version: 27.5.0 - resolution: "@types/jest@npm:27.5.0" + version: 27.5.2 + resolution: "@types/jest@npm:27.5.2" dependencies: jest-matcher-utils: ^27.0.0 pretty-format: ^27.0.0 - checksum: ca09ac3a17972e18683c57b681a6866c7a56c67f429810ece00425d948da62f207d271becb5cc759da3630f120596ec3c8e0ceb0eecefbe26daffba168b82879 + checksum: 7e11c6826aa429ad990dc262e4e4b54aa36573287fddf15773e4137f07d11d3105f0dd9f1baff73252160a057df23f5529bb83b1bf83cd3f45f9460a5ca5c22e languageName: node linkType: hard -"@types/js-yaml@npm:^4.0.4, @types/js-yaml@npm:^4.0.5": +"@types/js-yaml@npm:^4.0.4": version: 4.0.5 resolution: "@types/js-yaml@npm:4.0.5" checksum: 7dcac8c50fec31643cc9d6444b5503239a861414cdfaa7ae9a38bc22597c4d850c4b8cec3d82d73b3fbca408348ce223b0408d598b32e094470dfffc6d486b4d languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:^7.0.9": version: 7.0.11 resolution: "@types/json-schema@npm:7.0.11" checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d @@ -4055,68 +3373,34 @@ __metadata: languageName: node linkType: hard -"@types/json5@npm:^0.0.30": - version: 0.0.30 - resolution: "@types/json5@npm:0.0.30" - checksum: 8802648fa736801264fde08da7c08b57be8845bd75ecf50c1eee980245f6d2c10a00f0768d0979c7ec2e4ff7e1417226e527bfb045e7e1a6e6afcaf11706a5f0 - languageName: node - linkType: hard - -"@types/jsonwebtoken@npm:^8.3.2": - version: 8.5.8 - resolution: "@types/jsonwebtoken@npm:8.5.8" - dependencies: - "@types/node": "*" - checksum: 56738a918c543dba30786066959f801212e7fb5cd4ec53cf7b8d227711ed358834feb9e5141f7f88ec7c642bb39757330a5a8917e3b22e0ff9084940d35f0d70 - languageName: node - linkType: hard - -"@types/keyv@npm:^3.1.1": - version: 3.1.4 - resolution: "@types/keyv@npm:3.1.4" - dependencies: - "@types/node": "*" - checksum: e009a2bfb50e90ca9b7c6e8f648f8464067271fd99116f881073fa6fa76dc8d0133181dd65e6614d5fb1220d671d67b0124aef7d97dc02d7e342ab143a47779d - languageName: node - linkType: hard - "@types/lodash@npm:^4.14.178": - version: 4.14.182 - resolution: "@types/lodash@npm:4.14.182" - checksum: 7dd137aa9dbabd632408bd37009d984655164fa1ecc3f2b6eb94afe35bf0a5852cbab6183148d883e9c73a958b7fec9a9bcf7c8e45d41195add6a18c34958209 + version: 4.14.185 + resolution: "@types/lodash@npm:4.14.185" + checksum: f81d13da5ecab110ca9c5c7cc2bedc3c9802a6acf668576aecd1b8f4b134ed81d06c15f1e600fb08f05975098280a0d97d30cddfc2cb39ec1c6b56e971ca53b3 languageName: node linkType: hard -"@types/long@npm:^4.0.0, @types/long@npm:^4.0.1": +"@types/long@npm:^4.0.1": version: 4.0.2 resolution: "@types/long@npm:4.0.2" checksum: d16cde7240d834cf44ba1eaec49e78ae3180e724cd667052b194a372f350d024cba8dd3f37b0864931683dab09ca935d52f0c4c1687178af5ada9fc85b0635f4 languageName: node linkType: hard -"@types/mime@npm:^1": - version: 1.3.2 - resolution: "@types/mime@npm:1.3.2" - checksum: 0493368244cced1a69cb791b485a260a422e6fcc857782e1178d1e6f219f1b161793e9f87f5fae1b219af0f50bee24fcbe733a18b4be8fdd07a38a8fb91146fd +"@types/mime@npm:*": + version: 3.0.1 + resolution: "@types/mime@npm:3.0.1" + checksum: 4040fac73fd0cea2460e29b348c1a6173da747f3a87da0dbce80dd7a9355a3d0e51d6d9a401654f3e5550620e3718b5a899b2ec1debf18424e298a2c605346e7 languageName: node linkType: hard -"@types/minimatch@npm:*, @types/minimatch@npm:^3.0.3, @types/minimatch@npm:^3.0.4": +"@types/minimatch@npm:^3.0.3, @types/minimatch@npm:^3.0.4": version: 3.0.5 resolution: "@types/minimatch@npm:3.0.5" checksum: c41d136f67231c3131cf1d4ca0b06687f4a322918a3a5adddc87ce90ed9dbd175a3610adee36b106ae68c0b92c637c35e02b58c8a56c424f71d30993ea220b92 languageName: node linkType: hard -"@types/minipass@npm:*": - version: 3.1.2 - resolution: "@types/minipass@npm:3.1.2" - dependencies: - "@types/node": "*" - checksum: 0d01e11b5b959625385a482ad29ea16352be42506b459555b0f77fd82235e9c540946cc9c05a73fed1ae30b132914baaa4ccf257ed2cad20bc9773f0a06f4bac - languageName: node - linkType: hard - "@types/ms@npm:*": version: 0.7.31 resolution: "@types/ms@npm:0.7.31" @@ -4135,64 +3419,25 @@ __metadata: linkType: hard "@types/node@npm:*, @types/node@npm:>=13.7.0": - version: 17.0.31 - resolution: "@types/node@npm:17.0.31" - checksum: 704618350f8420d5c47db0f7778398e821b7724369946f5c441a7e6b9343295553936400eb8309f0b07d5e39c240988ab3456b983712ca86265dabc9aee4ad3d - languageName: node - linkType: hard - -"@types/node@npm:^10.1.0": - version: 10.17.60 - resolution: "@types/node@npm:10.17.60" - checksum: 2cdb3a77d071ba8513e5e8306fa64bf50e3c3302390feeaeff1fd325dd25c8441369715dfc8e3701011a72fed5958c7dfa94eb9239a81b3c286caa4d97db6eef + version: 18.7.18 + resolution: "@types/node@npm:18.7.18" + checksum: 8aec61f0f96e2a69ce51f1f40f949ca578bbb4fe05d7c0b8ce3aeeb848e90f755837f17f6ac132ca404d974fe9b2974150ad3b4984fc9dc7c3ceddb10bae0167 languageName: node linkType: hard "@types/node@npm:^14.18.10": - version: 14.18.16 - resolution: "@types/node@npm:14.18.16" - checksum: 1999799309dc8620a2adf9a5d5e48416af87321bae4c950b4aa8018fcef2c3b6c1fcf98c39eae06f6492c03a643a5a44e2bb3750cd2574d9cf7eac33bac50e24 - languageName: node - linkType: hard - -"@types/node@npm:^15.6.1": - version: 15.14.9 - resolution: "@types/node@npm:15.14.9" - checksum: 49f7f0522a3af4b8389aee660e88426490cd54b86356672a1fedb49919a8797c00d090ec2dcc4a5df34edc2099d57fc2203d796c4e7fbd382f2022ccd789eee7 + version: 14.18.29 + resolution: "@types/node@npm:14.18.29" + checksum: 43481c1c066dd01578ff137f437a8a901f8fcd3cdc068c36047c444861ab4aac8a62fb4eb6d03738df02006336c90619bfc7860d4e5b259916956942d2e68e88 languageName: node linkType: hard -"@types/normalize-package-data@npm:^2.4.0": - version: 2.4.1 - resolution: "@types/normalize-package-data@npm:2.4.1" - checksum: e87bccbf11f95035c89a132b52b79ce69a1e3652fe55962363063c9c0dae0fe2477ebc585e03a9652adc6f381d24ba5589cc5e51849df4ced3d3e004a7d40ed5 - languageName: node - linkType: hard - -"@types/parse-json@npm:^4.0.0": - version: 4.0.0 - resolution: "@types/parse-json@npm:4.0.0" - checksum: fd6bce2b674b6efc3db4c7c3d336bd70c90838e8439de639b909ce22f3720d21344f52427f1d9e57b265fcb7f6c018699b99e5e0c208a1a4823014269a6bf35b - languageName: node - linkType: hard - -"@types/pg@npm:>=6 <9": - version: 8.6.5 - resolution: "@types/pg@npm:8.6.5" - dependencies: - "@types/node": "*" - pg-protocol: "*" - pg-types: ^2.2.0 - checksum: 49ef858d95e84a6c1be193d367996581c991cf383d8628449507cc4ce67ef43b75acb18a0f9f49f870594cdec3501ddf4d2ac3fbe0dcdaab35c295c038d47199 - languageName: node - linkType: hard - -"@types/pino-http@npm:*": - version: 5.8.1 - resolution: "@types/pino-http@npm:5.8.1" - dependencies: - "@types/pino": 6.3 - checksum: c01bd5fa927218844337c3ba2c9d6c1c5d9f9da7d45368018a5fd404d5b3dd6489f903c33093a722e52f272b5642e41e660812ed7f50e738f2c5465580f43b27 +"@types/pbkdf2@npm:^3.0.0": + version: 3.1.0 + resolution: "@types/pbkdf2@npm:3.1.0" + dependencies: + "@types/node": "*" + checksum: d15024b1957c21cf3b8887329d9bd8dfde754cf13a09d76ae25f1391cfc62bb8b8d7b760773c5dbaa748172fba8b3e0c3dbe962af6ccbd69b76df12a48dfba40 languageName: node linkType: hard @@ -4228,9 +3473,9 @@ __metadata: linkType: hard "@types/prettier@npm:^2.1.5": - version: 2.6.0 - resolution: "@types/prettier@npm:2.6.0" - checksum: 946f1f82ce6f31664e023a5d65931c31b7d677b454f528f67dce851d72e7fcfe713076f4251b16c3646eecf1545f5f5b909b4962966341ed9ddf5b80113b3674 + version: 2.7.0 + resolution: "@types/prettier@npm:2.7.0" + checksum: bf5d0c7c1270909b39399539ac106d20ddaa85fe92eb1d59922dc99159604b4f8d5e41b0045fb29c8011585cf5bca2350b7441ef3d9816c08bd0e10ebd4b31d4 languageName: node linkType: hard @@ -4248,39 +3493,22 @@ __metadata: languageName: node linkType: hard -"@types/responselike@npm:^1.0.0": - version: 1.0.0 - resolution: "@types/responselike@npm:1.0.0" - dependencies: - "@types/node": "*" - checksum: e99fc7cc6265407987b30deda54c1c24bb1478803faf6037557a774b2f034c5b097ffd65847daa87e82a61a250d919f35c3588654b0fdaa816906650f596d1b0 - languageName: node - linkType: hard - -"@types/rimraf@npm:^3.0.2": - version: 3.0.2 - resolution: "@types/rimraf@npm:3.0.2" +"@types/secp256k1@npm:^4.0.1": + version: 4.0.3 + resolution: "@types/secp256k1@npm:4.0.3" dependencies: - "@types/glob": "*" "@types/node": "*" - checksum: b47fa302f46434cba704d20465861ad250df79467d3d289f9d6490d3aeeb41e8cb32dd80bd1a8fd833d1e185ac719fbf9be12e05ad9ce9be094d8ee8f1405347 - languageName: node - linkType: hard - -"@types/semver@npm:^7, @types/semver@npm:^7.3.9": - version: 7.3.9 - resolution: "@types/semver@npm:7.3.9" - checksum: 60bfcfdfa7f937be2c6f4b37ddb6714fb0f27b05fe4cbdfdd596a97d35ed95d13ee410efdd88e72a66449d0384220bf20055ab7d6b5df10de4990fbd20e5cbe0 + checksum: 1bd10b9afa724084b655dc81b7b315def3d2d0e272014ef16009fa76e17537411c07c0695fdea412bc7b36d2a02687f5fea33522d55b8ef29eda42992f812913 languageName: node linkType: hard "@types/serve-static@npm:*": - version: 1.13.10 - resolution: "@types/serve-static@npm:1.13.10" + version: 1.15.0 + resolution: "@types/serve-static@npm:1.15.0" dependencies: - "@types/mime": ^1 + "@types/mime": "*" "@types/node": "*" - checksum: eaca858739483e3ded254cad7d7a679dc2c8b3f52c8bb0cd845b3b7eb1984bde0371fdcb0a5c83aa12e6daf61b6beb762545021f520f08a1fe882a3fa4ea5554 + checksum: b6ac93d471fb0f53ddcac1f9b67572a09cd62806f7db5855244b28f6f421139626f24799392566e97d1ffc61b12f9de7f30380c39fcae3c8a161fe161d44edf2 languageName: node linkType: hard @@ -4311,49 +3539,23 @@ __metadata: linkType: hard "@types/tar@npm:^6.1.1": - version: 6.1.1 - resolution: "@types/tar@npm:6.1.1" - dependencies: - "@types/minipass": "*" - "@types/node": "*" - checksum: 06cfffc606525fab223f7e7cae74b88347a6c21de39454a9b85a56c61b4cab034e9cefacd6a053c7ac2a07e29bed71ce72bc4ca8bc101f61e2e5248950508b7d - languageName: node - linkType: hard - -"@types/through@npm:*": - version: 0.0.30 - resolution: "@types/through@npm:0.0.30" + version: 6.1.2 + resolution: "@types/tar@npm:6.1.2" dependencies: "@types/node": "*" - checksum: 9578470db0b527c26e246a1220ae9bffc6bf47f20f89c54aac467c083ab1f7e16c00d9a7b4bb6cb4e2dfae465027270827e5908a6236063f6214625e50585d78 - languageName: node - linkType: hard - -"@types/tough-cookie@npm:^4.0.0": - version: 4.0.2 - resolution: "@types/tough-cookie@npm:4.0.2" - checksum: e055556ffdaa39ad85ede0af192c93f93f986f4bd9e9426efdc2948e3e2632db3a4a584d4937dbf6d7620527419bc99e6182d3daf2b08685e710f2eda5291905 + minipass: ^3.3.5 + checksum: 57e625e2db29e3b9c6d8d06774758cf6e4caa2096f4144f7c0fdb2760e1150146d2a86f0eb80b4d2e1ba0ecf07f06303775054c4f4d22bea5d51e8b54cdd0fd8 languageName: node linkType: hard "@types/validator@npm:^13.7.1": - version: 13.7.2 - resolution: "@types/validator@npm:13.7.2" - checksum: e679261dd5392adfeb9b20ba2eaf7d668049ad03b24409a6921bb6a3ee4c3135d46cc536a0eafbbda7f642b196696a6e3e1e615b2d1194330d49b22f1f0acb59 - languageName: node - linkType: hard - -"@types/vinyl@npm:^2.0.4": - version: 2.0.6 - resolution: "@types/vinyl@npm:2.0.6" - dependencies: - "@types/expect": ^1.20.4 - "@types/node": "*" - checksum: 5012fb61e3a29e7deaac7e66b6d8cb73d87d15965c8a38cb69277c2beb851a9a8ec09d4a1b07a3151e143afc2e3a102ca368b9a0e08f2f29de9183c97f9c7d85 + version: 13.7.6 + resolution: "@types/validator@npm:13.7.6" + checksum: f860dd87bc5f90cc33d2802cf2a4da307ddac63c86d86b858a85dd62d457c8fa42fc8756e05b5d24e741376debc13d46ed14bc700006bf7d0cb910118022492b languageName: node linkType: hard -"@types/websocket@npm:^1, @types/websocket@npm:^1.0.5": +"@types/websocket@npm:^1.0.5": version: 1.0.5 resolution: "@types/websocket@npm:1.0.5" dependencies: @@ -4362,15 +3564,6 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:^7.4.0": - version: 7.4.7 - resolution: "@types/ws@npm:7.4.7" - dependencies: - "@types/node": "*" - checksum: b4c9b8ad209620c9b21e78314ce4ff07515c0cadab9af101c1651e7bfb992d7fd933bd8b9c99d110738fd6db523ed15f82f29f50b45510288da72e964dedb1a3 - languageName: node - linkType: hard - "@types/yargs-parser@npm:*": version: 21.0.0 resolution: "@types/yargs-parser@npm:21.0.0" @@ -4387,40 +3580,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^4.31.2": - version: 4.33.0 - resolution: "@typescript-eslint/eslint-plugin@npm:4.33.0" - dependencies: - "@typescript-eslint/experimental-utils": 4.33.0 - "@typescript-eslint/scope-manager": 4.33.0 - debug: ^4.3.1 - functional-red-black-tree: ^1.0.1 - ignore: ^5.1.8 - regexpp: ^3.1.0 - semver: ^7.3.5 - tsutils: ^3.21.0 - peerDependencies: - "@typescript-eslint/parser": ^4.0.0 - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: d74855d0a5ffe0b2f362ec02fcd9301d39a53fb4155b9bd0cb15a0a31d065143129ebf98df9d86af4b6f74de1d423a4c0d8c0095520844068117453afda5bc4f - languageName: node - linkType: hard - "@typescript-eslint/eslint-plugin@npm:^5.10.2": - version: 5.23.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.23.0" + version: 5.37.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.37.0" dependencies: - "@typescript-eslint/scope-manager": 5.23.0 - "@typescript-eslint/type-utils": 5.23.0 - "@typescript-eslint/utils": 5.23.0 - debug: ^4.3.2 + "@typescript-eslint/scope-manager": 5.37.0 + "@typescript-eslint/type-utils": 5.37.0 + "@typescript-eslint/utils": 5.37.0 + debug: ^4.3.4 functional-red-black-tree: ^1.0.1 - ignore: ^5.1.8 + ignore: ^5.2.0 regexpp: ^3.2.0 - semver: ^7.3.5 + semver: ^7.3.7 tsutils: ^3.21.0 peerDependencies: "@typescript-eslint/parser": ^5.0.0 @@ -4428,340 +3599,112 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 19ee37c0be172469968f61d156d6ce36a975ab72ccbb8f702eb4573c94d1cf9247ff32352ed85eda5e7b2eaace567d5c66b32846f042f9711349213496ec37d4 - languageName: node - linkType: hard - -"@typescript-eslint/experimental-utils@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/experimental-utils@npm:4.33.0" - dependencies: - "@types/json-schema": ^7.0.7 - "@typescript-eslint/scope-manager": 4.33.0 - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/typescript-estree": 4.33.0 - eslint-scope: ^5.1.1 - eslint-utils: ^3.0.0 - peerDependencies: - eslint: "*" - checksum: f859800ada0884f92db6856f24efcb1d073ac9883ddc2b1aa9339f392215487895bed8447ebce3741e8141bb32e545244abef62b73193ba9a8a0527c523aabae - languageName: node - linkType: hard - -"@typescript-eslint/parser@npm:^4.31.2": - version: 4.33.0 - resolution: "@typescript-eslint/parser@npm:4.33.0" - dependencies: - "@typescript-eslint/scope-manager": 4.33.0 - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/typescript-estree": 4.33.0 - debug: ^4.3.1 - peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 102457eae1acd516211098fea081c8a2ed728522bbda7f5a557b6ef23d88970514f9a0f6285d53fca134d3d4d7d17822b5d5e12438d5918df4d1f89cc9e67d57 + checksum: 9ef75628fcd6f5425002d0172514ad27e51c6ca438aba65ad445be3c63187de3cb294bcc994bd2859dff4fc0221a22da497b34990e8165dcfd1fec33d7d17fb3 languageName: node linkType: hard "@typescript-eslint/parser@npm:^5.10.2": - version: 5.23.0 - resolution: "@typescript-eslint/parser@npm:5.23.0" + version: 5.37.0 + resolution: "@typescript-eslint/parser@npm:5.37.0" dependencies: - "@typescript-eslint/scope-manager": 5.23.0 - "@typescript-eslint/types": 5.23.0 - "@typescript-eslint/typescript-estree": 5.23.0 - debug: ^4.3.2 + "@typescript-eslint/scope-manager": 5.37.0 + "@typescript-eslint/types": 5.37.0 + "@typescript-eslint/typescript-estree": 5.37.0 + debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: b65a732b0be06ac9e4b13df78c466517e33fd382985c5d85b6d51cfa295cdf3351594cc2f95dda41d57abb6115e3b8df815fbbb7793aa0c4eddbac11077b90a8 - languageName: node - linkType: hard - -"@typescript-eslint/scope-manager@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/scope-manager@npm:4.33.0" - dependencies: - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/visitor-keys": 4.33.0 - checksum: 9a25fb7ba7c725ea7227a24d315b0f6aacbad002e2549a049edf723c1d3615c22f5c301f0d7d615b377f2cdf2f3519d97e79af0c459de6ef8d2aaf0906dff13e + checksum: 33343e27c9602820d43ee12de9797365d97a5cf3f716e750fa44de760f2a2c6800f3bc4fa54931ac70c0e0ede77a92224f8151da7f30fed3bf692a029d6659af languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.23.0": - version: 5.23.0 - resolution: "@typescript-eslint/scope-manager@npm:5.23.0" +"@typescript-eslint/scope-manager@npm:5.37.0": + version: 5.37.0 + resolution: "@typescript-eslint/scope-manager@npm:5.37.0" dependencies: - "@typescript-eslint/types": 5.23.0 - "@typescript-eslint/visitor-keys": 5.23.0 - checksum: cd3dda0b18d6730e34784fc63135fc9fe31673898d3e0868cd765ad78855351f285fe577297193cf179b3ce918c3d44453de85159a925f5c02d12a5626e787d8 + "@typescript-eslint/types": 5.37.0 + "@typescript-eslint/visitor-keys": 5.37.0 + checksum: 1c439e21ffa63ebaadb8c8363e9d668132a835a28203e5b779366bfa56772f332e5dedb50d63dffb836839b9d9c4e66aa9e3ea47b8c59465b18a0cbd063ec7a3 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.23.0": - version: 5.23.0 - resolution: "@typescript-eslint/type-utils@npm:5.23.0" +"@typescript-eslint/type-utils@npm:5.37.0": + version: 5.37.0 + resolution: "@typescript-eslint/type-utils@npm:5.37.0" dependencies: - "@typescript-eslint/utils": 5.23.0 - debug: ^4.3.2 + "@typescript-eslint/typescript-estree": 5.37.0 + "@typescript-eslint/utils": 5.37.0 + debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: eslint: "*" peerDependenciesMeta: typescript: optional: true - checksum: 88bf7c7a08c11f2a02a05fe331750c569bfc2b4759e0dea6ec72ffd1597624a01100965052a5fede1e3f25ea8ef503bd424e03c9805f0a1af223f28b4fd74946 - languageName: node - linkType: hard - -"@typescript-eslint/types@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/types@npm:4.33.0" - checksum: 3baae1ca35872421b4eb60f5d3f3f32dc1d513f2ae0a67dee28c7d159fd7a43ed0d11a8a5a0f0c2d38507ffa036fc7c511cb0f18a5e8ac524b3ebde77390ec53 - languageName: node - linkType: hard - -"@typescript-eslint/types@npm:5.23.0": - version: 5.23.0 - resolution: "@typescript-eslint/types@npm:5.23.0" - checksum: 96ae3e80cfae7b34f2846db692c31fb1804bf9651bce1d29f2eb8ae4c763d22f3283adc02dedeebd7cf70e4d8be54ec7f6ca593e03cdca26c791207e7556c2c1 + checksum: 79dac78eefdbdb3c168da6b303381461af3523e2b45fdeb821eb05e6a5cac797a8850e1dd9e1b6cd1a7c22408acfa2a09854a0f85ff038518c312db8eae9aa4f languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/typescript-estree@npm:4.33.0" - dependencies: - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/visitor-keys": 4.33.0 - debug: ^4.3.1 - globby: ^11.0.3 - is-glob: ^4.0.1 - semver: ^7.3.5 - tsutils: ^3.21.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 2566984390c76bd95f43240057215c068c69769e406e27aba41e9f21fd300074d6772e4983fa58fe61e80eb5550af1548d2e31e80550d92ba1d051bb00fe6f5c +"@typescript-eslint/types@npm:5.37.0": + version: 5.37.0 + resolution: "@typescript-eslint/types@npm:5.37.0" + checksum: 899e59e7775fa95c2d9fcac5cc02cc49d83af5f1ffc706df495046c3b3733f79d5489568b01bfaf8c9ae4636e057056866adc783113036f774580086d0189f21 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.23.0": - version: 5.23.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.23.0" +"@typescript-eslint/typescript-estree@npm:5.37.0": + version: 5.37.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.37.0" dependencies: - "@typescript-eslint/types": 5.23.0 - "@typescript-eslint/visitor-keys": 5.23.0 - debug: ^4.3.2 - globby: ^11.0.4 + "@typescript-eslint/types": 5.37.0 + "@typescript-eslint/visitor-keys": 5.37.0 + debug: ^4.3.4 + globby: ^11.1.0 is-glob: ^4.0.3 - semver: ^7.3.5 + semver: ^7.3.7 tsutils: ^3.21.0 peerDependenciesMeta: typescript: optional: true - checksum: 8d85bb1cd777e93cc7322ae8fea25f9b924def02494cdb8395c1d5d17b5fd3ac9bc969418a1d20a5dc28c2cdd85da20e13527e28b595c06ff6f84cd22a78d73f + checksum: 80365a50fa11ed39bf54d9ef06e264fbbf3bdbcc55b7d7d555ef0be915edae40ec30e98d08b3f6ef048e1874450cbcb1e7d9f429d4f420dacbbde45d3376a7bc languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.23.0": - version: 5.23.0 - resolution: "@typescript-eslint/utils@npm:5.23.0" +"@typescript-eslint/utils@npm:5.37.0": + version: 5.37.0 + resolution: "@typescript-eslint/utils@npm:5.37.0" dependencies: "@types/json-schema": ^7.0.9 - "@typescript-eslint/scope-manager": 5.23.0 - "@typescript-eslint/types": 5.23.0 - "@typescript-eslint/typescript-estree": 5.23.0 + "@typescript-eslint/scope-manager": 5.37.0 + "@typescript-eslint/types": 5.37.0 + "@typescript-eslint/typescript-estree": 5.37.0 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 72207399f29856b601148fe1aff07049021fad8e780ee6e896279d2291806d4608f1c28ddc5c3c5616ce94f25dcbcd26f295669e524fc1c4b4db810569c90f85 - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/visitor-keys@npm:4.33.0" - dependencies: - "@typescript-eslint/types": 4.33.0 - eslint-visitor-keys: ^2.0.0 - checksum: 59953e474ad4610c1aa23b2b1a964445e2c6201521da6367752f37939d854352bbfced5c04ea539274065e012b1337ba3ffa49c2647a240a4e87155378ba9873 - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:5.23.0": - version: 5.23.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.23.0" - dependencies: - "@typescript-eslint/types": 5.23.0 - eslint-visitor-keys: ^3.0.0 - checksum: 322e10d52a985e8a90d3612bb9d09a87dc64fc4cb1248484f1a9a7a98f65d3ef65a465ce868773a4939e35fa3b726ad609dac5a168efd7eaca4b06df33e965e3 - languageName: node - linkType: hard - -"@webassemblyjs/ast@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/ast@npm:1.11.1" - dependencies: - "@webassemblyjs/helper-numbers": 1.11.1 - "@webassemblyjs/helper-wasm-bytecode": 1.11.1 - checksum: 1eee1534adebeece635362f8e834ae03e389281972611408d64be7895fc49f48f98fddbbb5339bf8a72cb101bcb066e8bca3ca1bf1ef47dadf89def0395a8d87 - languageName: node - linkType: hard - -"@webassemblyjs/floating-point-hex-parser@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.1" - checksum: b8efc6fa08e4787b7f8e682182d84dfdf8da9d9c77cae5d293818bc4a55c1f419a87fa265ab85252b3e6c1fd323d799efea68d825d341a7c365c64bc14750e97 - languageName: node - linkType: hard - -"@webassemblyjs/helper-api-error@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/helper-api-error@npm:1.11.1" - checksum: 0792813f0ed4a0e5ee0750e8b5d0c631f08e927f4bdfdd9fe9105dc410c786850b8c61bff7f9f515fdfb149903bec3c976a1310573a4c6866a94d49bc7271959 + checksum: dc6c19ab07b50113f6fa3722518b2f31ce04036ec018855587d4c467108cb4e3c2866e54ed2e18ce61d1e7d0eaab24f94ee39574031b7d8e1c05e4b83ff84ef2 languageName: node linkType: hard -"@webassemblyjs/helper-buffer@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/helper-buffer@npm:1.11.1" - checksum: a337ee44b45590c3a30db5a8b7b68a717526cf967ada9f10253995294dbd70a58b2da2165222e0b9830cd4fc6e4c833bf441a721128d1fe2e9a7ab26b36003ce - languageName: node - linkType: hard - -"@webassemblyjs/helper-numbers@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/helper-numbers@npm:1.11.1" - dependencies: - "@webassemblyjs/floating-point-hex-parser": 1.11.1 - "@webassemblyjs/helper-api-error": 1.11.1 - "@xtuc/long": 4.2.2 - checksum: 44d2905dac2f14d1e9b5765cf1063a0fa3d57295c6d8930f6c59a36462afecc6e763e8a110b97b342a0f13376166c5d41aa928e6ced92e2f06b071fd0db59d3a - languageName: node - linkType: hard - -"@webassemblyjs/helper-wasm-bytecode@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.1" - checksum: eac400113127832c88f5826bcc3ad1c0db9b3dbd4c51a723cfdb16af6bfcbceb608170fdaac0ab7731a7e18b291be7af68a47fcdb41cfe0260c10857e7413d97 - languageName: node - linkType: hard - -"@webassemblyjs/helper-wasm-section@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/helper-wasm-section@npm:1.11.1" - dependencies: - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/helper-buffer": 1.11.1 - "@webassemblyjs/helper-wasm-bytecode": 1.11.1 - "@webassemblyjs/wasm-gen": 1.11.1 - checksum: 617696cfe8ecaf0532763162aaf748eb69096fb27950219bb87686c6b2e66e11cd0614d95d319d0ab1904bc14ebe4e29068b12c3e7c5e020281379741fe4bedf - languageName: node - linkType: hard - -"@webassemblyjs/ieee754@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/ieee754@npm:1.11.1" - dependencies: - "@xtuc/ieee754": ^1.2.0 - checksum: 23a0ac02a50f244471631802798a816524df17e56b1ef929f0c73e3cde70eaf105a24130105c60aff9d64a24ce3b640dad443d6f86e5967f922943a7115022ec - languageName: node - linkType: hard - -"@webassemblyjs/leb128@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/leb128@npm:1.11.1" - dependencies: - "@xtuc/long": 4.2.2 - checksum: 33ccc4ade2f24de07bf31690844d0b1ad224304ee2062b0e464a610b0209c79e0b3009ac190efe0e6bd568b0d1578d7c3047fc1f9d0197c92fc061f56224ff4a - languageName: node - linkType: hard - -"@webassemblyjs/utf8@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/utf8@npm:1.11.1" - checksum: 972c5cfc769d7af79313a6bfb96517253a270a4bf0c33ba486aa43cac43917184fb35e51dfc9e6b5601548cd5931479a42e42c89a13bb591ffabebf30c8a6a0b - languageName: node - linkType: hard - -"@webassemblyjs/wasm-edit@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/wasm-edit@npm:1.11.1" - dependencies: - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/helper-buffer": 1.11.1 - "@webassemblyjs/helper-wasm-bytecode": 1.11.1 - "@webassemblyjs/helper-wasm-section": 1.11.1 - "@webassemblyjs/wasm-gen": 1.11.1 - "@webassemblyjs/wasm-opt": 1.11.1 - "@webassemblyjs/wasm-parser": 1.11.1 - "@webassemblyjs/wast-printer": 1.11.1 - checksum: 6d7d9efaec1227e7ef7585a5d7ff0be5f329f7c1c6b6c0e906b18ed2e9a28792a5635e450aca2d136770d0207225f204eff70a4b8fd879d3ac79e1dcc26dbeb9 - languageName: node - linkType: hard - -"@webassemblyjs/wasm-gen@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/wasm-gen@npm:1.11.1" - dependencies: - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/helper-wasm-bytecode": 1.11.1 - "@webassemblyjs/ieee754": 1.11.1 - "@webassemblyjs/leb128": 1.11.1 - "@webassemblyjs/utf8": 1.11.1 - checksum: 1f6921e640293bf99fb16b21e09acb59b340a79f986c8f979853a0ae9f0b58557534b81e02ea2b4ef11e929d946708533fd0693c7f3712924128fdafd6465f5b - languageName: node - linkType: hard - -"@webassemblyjs/wasm-opt@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/wasm-opt@npm:1.11.1" - dependencies: - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/helper-buffer": 1.11.1 - "@webassemblyjs/wasm-gen": 1.11.1 - "@webassemblyjs/wasm-parser": 1.11.1 - checksum: 21586883a20009e2b20feb67bdc451bbc6942252e038aae4c3a08e6f67b6bae0f5f88f20bfc7bd0452db5000bacaf5ab42b98cf9aa034a6c70e9fc616142e1db - languageName: node - linkType: hard - -"@webassemblyjs/wasm-parser@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/wasm-parser@npm:1.11.1" - dependencies: - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/helper-api-error": 1.11.1 - "@webassemblyjs/helper-wasm-bytecode": 1.11.1 - "@webassemblyjs/ieee754": 1.11.1 - "@webassemblyjs/leb128": 1.11.1 - "@webassemblyjs/utf8": 1.11.1 - checksum: 1521644065c360e7b27fad9f4bb2df1802d134dd62937fa1f601a1975cde56bc31a57b6e26408b9ee0228626ff3ba1131ae6f74ffb7d718415b6528c5a6dbfc2 - languageName: node - linkType: hard - -"@webassemblyjs/wast-printer@npm:1.11.1": - version: 1.11.1 - resolution: "@webassemblyjs/wast-printer@npm:1.11.1" +"@typescript-eslint/visitor-keys@npm:5.37.0": + version: 5.37.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.37.0" dependencies: - "@webassemblyjs/ast": 1.11.1 - "@xtuc/long": 4.2.2 - checksum: f15ae4c2441b979a3b4fce78f3d83472fb22350c6dc3fd34bfe7c3da108e0b2360718734d961bba20e7716cb8578e964b870da55b035e209e50ec9db0378a3f7 + "@typescript-eslint/types": 5.37.0 + eslint-visitor-keys: ^3.3.0 + checksum: d6193550f77413aead0cb267e058df80b80a488c8fb4e39beb5f0a70b971c41682a6391903fbc5f3dd859a872016288c434d631b8efc3ac5a04edbdb7b63b5f6 languageName: node linkType: hard "@willsoto/nestjs-prometheus@npm:^4.4.0": - version: 4.6.0 - resolution: "@willsoto/nestjs-prometheus@npm:4.6.0" + version: 4.7.0 + resolution: "@willsoto/nestjs-prometheus@npm:4.7.0" peerDependencies: - "@nestjs/common": ^7.0.0 || ^8.0.0 + "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 prom-client: ^13.0.0 || ^14.0.0 - checksum: 256fbd7d2db4e2a77b32e7739a6f6b2af7a7514273ad7d47d1ba42bb1bad63e95d2d591d126454395026431120ae3187d1b6a054d8342570d06da5da33758a4d + checksum: 06020f2cb36bf6f98b1f7ca3494103cc77bea227ab766bb66e0294040c6a1399c3ff2a1781b7d163a5590cd9ccf0903fc08fc3bd9d3112d63c7400c4d6d55f23 languageName: node linkType: hard @@ -4775,34 +3718,20 @@ __metadata: linkType: hard "@wry/equality@npm:^0.5.0": - version: 0.5.2 - resolution: "@wry/equality@npm:0.5.2" + version: 0.5.3 + resolution: "@wry/equality@npm:0.5.3" dependencies: tslib: ^2.3.0 - checksum: 19a01043a0583663924ed9f4ea109818b9b4cb540877ca75ea49545689f54c6bfc69e725a8b3b129a2ac15ea368fd40bbb94c22e7a5e4ec370f7c4697e64b8b1 + checksum: 7ea8ded51462911217183b93cc3ffbb4d18dc02a62d4a79e0d9983463739bf54106aaeb25649bf33168120bd044b61d135018bfcf4fefad8099c13eac9238aa6 languageName: node linkType: hard "@wry/trie@npm:^0.3.0": - version: 0.3.1 - resolution: "@wry/trie@npm:0.3.1" + version: 0.3.2 + resolution: "@wry/trie@npm:0.3.2" dependencies: tslib: ^2.3.0 - checksum: c3f6b200aefc64b5cd9976b7ed0dd22852eb826d835c5dccd3d03ef788d258af50ca64e8de654e5f812134afdb9d5890f334c8de2276d0dca1751785694654f9 - languageName: node - linkType: hard - -"@xtuc/ieee754@npm:^1.2.0": - version: 1.2.0 - resolution: "@xtuc/ieee754@npm:1.2.0" - checksum: ac56d4ca6e17790f1b1677f978c0c6808b1900a5b138885d3da21732f62e30e8f0d9120fcf8f6edfff5100ca902b46f8dd7c1e3f903728634523981e80e2885a - languageName: node - linkType: hard - -"@xtuc/long@npm:4.2.2": - version: 4.2.2 - resolution: "@xtuc/long@npm:4.2.2" - checksum: 8ed0d477ce3bc9c6fe2bf6a6a2cc316bb9c4127c5a7827bae947fa8ec34c7092395c5a283cc300c05b5fa01cbbfa1f938f410a7bf75db7c7846fea41949989ec + checksum: 151d06b519e1ff1c3acf6ee6846161b1d7d50bbecd4c48e5cd1b05f9e37c30602aff02e88f20105f6e6c54ae4123f9c4eb7715044d7fd927d4ba4ec3e755cd36 languageName: node linkType: hard @@ -4829,6 +3758,13 @@ __metadata: languageName: node linkType: hard +"abortcontroller-polyfill@npm:^1.7.3": + version: 1.7.3 + resolution: "abortcontroller-polyfill@npm:1.7.3" + checksum: 55739d7f0c9bd6afa2aabb3148778967c4dd4dcff91f6b9259df38da34f9882d3f7730b0954e9767a19cc16a8dd9a58915da4e8a50220300d45af3817d7557b1 + languageName: node + linkType: hard + "abstract-leveldown@npm:^6.2.1": version: 6.3.0 resolution: "abstract-leveldown@npm:6.3.0" @@ -4855,7 +3791,7 @@ __metadata: languageName: node linkType: hard -"accepts@npm:^1.3.5, accepts@npm:~1.3.8": +"accepts@npm:~1.3.8": version: 1.3.8 resolution: "accepts@npm:1.3.8" dependencies: @@ -4875,15 +3811,6 @@ __metadata: languageName: node linkType: hard -"acorn-import-assertions@npm:^1.7.6": - version: 1.8.0 - resolution: "acorn-import-assertions@npm:1.8.0" - peerDependencies: - acorn: ^8 - checksum: 5c4cf7c850102ba7ae0eeae0deb40fb3158c8ca5ff15c0bca43b5c47e307a1de3d8ef761788f881343680ea374631ae9e9615ba8876fee5268dbe068c98bcba6 - languageName: node - linkType: hard - "acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" @@ -4916,19 +3843,26 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.5.0, acorn@npm:^8.7.0, acorn@npm:^8.7.1": - version: 8.7.1 - resolution: "acorn@npm:8.7.1" +"acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.7.0, acorn@npm:^8.8.0": + version: 8.8.0 + resolution: "acorn@npm:8.8.0" bin: acorn: bin/acorn - checksum: aca0aabf98826717920ac2583fdcad0a6fbe4e583fdb6e843af2594e907455aeafe30b1e14f1757cd83ce1776773cf8296ffc3a4acf13f0bd3dfebcf1db6ae80 + checksum: 7270ca82b242eafe5687a11fea6e088c960af712683756abf0791b68855ea9cace3057bd5e998ffcef50c944810c1e0ca1da526d02b32110e13c722aa959afdc languageName: node linkType: hard "address@npm:^1.0.1": - version: 1.2.0 - resolution: "address@npm:1.2.0" - checksum: 2ef3aa9d23bbe0f9f2745a634b16f3a2f2b18c43146c0913c7b26c8be410e20d59b8c3808d0bb7fe94d50fc2448b4b91e65dd9f33deb4aed53c14f0dedc3ddd8 + version: 1.2.1 + resolution: "address@npm:1.2.1" + checksum: e4c0f961464ccad09c3f7ed3a8d12f609354a87dd1ad379e43661e9684446fbf158be3edeef85e1590dfc6c88c0897c5908bc18f232eb86e43993a2ada5820fa + languageName: node + linkType: hard + +"aes-js@npm:3.0.0": + version: 3.0.0 + resolution: "aes-js@npm:3.0.0" + checksum: 251e26d533cd1a915b44896b17d5ed68c24a02484cfdd2e74ec700a309267db96651ea4eb657bf20aac32a3baa61f6e34edf8e2fec2de440a655da9942d334b8 languageName: node linkType: hard @@ -4941,7 +3875,7 @@ __metadata: languageName: node linkType: hard -"agentkeepalive@npm:^4.1.3, agentkeepalive@npm:^4.2.1": +"agentkeepalive@npm:^4.2.1": version: 4.2.1 resolution: "agentkeepalive@npm:4.2.1" dependencies: @@ -4976,15 +3910,6 @@ __metadata: languageName: node linkType: hard -"ajv-keywords@npm:^3.5.2": - version: 3.5.2 - resolution: "ajv-keywords@npm:3.5.2" - peerDependencies: - ajv: ^6.9.1 - checksum: 7dc5e5931677a680589050f79dcbe1fefbb8fea38a955af03724229139175b433c63c68f7ae5f86cf8f65d55eb7c25f75a046723e2e58296707617ca690feae9 - languageName: node - linkType: hard - "ajv@npm:8.9.0": version: 8.9.0 resolution: "ajv@npm:8.9.0" @@ -4997,7 +3922,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.10.0, ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -5028,9 +3953,9 @@ __metadata: languageName: node linkType: hard -"algosdk@npm:^1.19.0": - version: 1.19.0 - resolution: "algosdk@npm:1.19.0" +"algosdk@npm:^1.13.1": + version: 1.20.0 + resolution: "algosdk@npm:1.20.0" dependencies: algo-msgpack-with-bigint: ^2.1.1 buffer: ^6.0.2 @@ -5046,41 +3971,11 @@ __metadata: dependenciesMeta: fsevents: optional: true - checksum: e7503171a587cab6816459cb68b37e2e8a8b9fd253d02843026bc14120f883be593cdfd55ba490ca57cb2399ffaaf68a4704d3e9a7a19dbf97fb094514a5abfe - languageName: node - linkType: hard - -"already@npm:^2.2.1": - version: 2.2.1 - resolution: "already@npm:2.2.1" - checksum: 34f16dd91d8dd48f74b0f5a751872697c745cd815e758d32552166789928690254bdddc964423bdece5b201ae583ddc477f4f97ecc5d6d54ec0edcf1bd3ddb77 - languageName: node - linkType: hard - -"ansi-align@npm:^3.0.0": - version: 3.0.1 - resolution: "ansi-align@npm:3.0.1" - dependencies: - string-width: ^4.1.0 - checksum: 6abfa08f2141d231c257162b15292467081fa49a208593e055c866aa0455b57f3a86b5a678c190c618faa79b4c59e254493099cb700dd9cf2293c6be2c8f5d8d - languageName: node - linkType: hard - -"ansi-colors@npm:4.1.1": - version: 4.1.1 - resolution: "ansi-colors@npm:4.1.1" - checksum: 138d04a51076cb085da0a7e2d000c5c0bb09f6e772ed5c65c53cb118d37f6c5f1637506d7155fb5f330f0abcf6f12fa2e489ac3f8cdab9da393bf1bb4f9a32b0 - languageName: node - linkType: hard - -"ansi-escapes@npm:^3.1.0": - version: 3.2.0 - resolution: "ansi-escapes@npm:3.2.0" - checksum: 0f94695b677ea742f7f1eed961f7fd8d05670f744c6ad1f8f635362f6681dcfbc1575cb05b43abc7bb6d67e25a75fb8c7ea8f2a57330eb2c76b33f18cb2cef0a + checksum: 1a46c7bfa5082b2dcd05ac34da6cc12492e6f7022b59147e2f31885e8ef31ae9f4e3c3a91465194f1dcba9dbca928c2f7338dd59abcaa10a8e5d39e184532cd4 languageName: node linkType: hard -"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.0, ansi-escapes@npm:^4.3.1, ansi-escapes@npm:^4.3.2": +"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.0": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -5089,20 +3984,6 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^2.0.0": - version: 2.1.1 - resolution: "ansi-regex@npm:2.1.1" - checksum: 190abd03e4ff86794f338a31795d262c1dfe8c91f7e01d04f13f646f1dcb16c5800818f886047876f1272f065570ab86b24b99089f8b68a0e11ff19aed4ca8f1 - languageName: node - linkType: hard - -"ansi-regex@npm:^3.0.0": - version: 3.0.1 - resolution: "ansi-regex@npm:3.0.1" - checksum: 09daf180c5f59af9850c7ac1bd7fda85ba596cc8cbeb210826e90755f06c818af86d9fa1e6e8322fab2c3b9e9b03f56c537b42241139f824dd75066a1e7257cc - languageName: node - linkType: hard - "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -5117,14 +3998,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^2.2.1": - version: 2.2.1 - resolution: "ansi-styles@npm:2.2.1" - checksum: ebc0e00381f2a29000d1dac8466a640ce11943cef3bda3cd0020dc042e31e1058ab59bf6169cd794a54c3a7338a61ebc404b7c91e004092dd20e028c432c9c2c - languageName: node - linkType: hard - -"ansi-styles@npm:^3.0.0, ansi-styles@npm:^3.2.1": +"ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" dependencies: @@ -5133,7 +4007,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0, ansi-styles@npm:^4.2.0, ansi-styles@npm:^4.2.1, ansi-styles@npm:^4.3.0": +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" dependencies: @@ -5150,16 +4024,9 @@ __metadata: linkType: hard "ansi-styles@npm:^6.0.0, ansi-styles@npm:^6.1.0": - version: 6.1.0 - resolution: "ansi-styles@npm:6.1.0" - checksum: 7a7f8528c07a9d20c3a92bccd2b6bc3bb4d26e5cb775c02826921477377bd495d615d61f710d56216344b6238d1d11ef2b0348e146c5b128715578bfb3217229 - languageName: node - linkType: hard - -"ansicolors@npm:~0.3.2": - version: 0.3.2 - resolution: "ansicolors@npm:0.3.2" - checksum: e84fae7ebc27ac96d9dbb57f35f078cd6dde1b7046b0f03f73dcefc9fbb1f2e82e3685d083466aded8faf038f9fa9ebb408d215282bcd7aaa301d5ac3c486815 + version: 6.1.1 + resolution: "ansi-styles@npm:6.1.1" + checksum: f2b1ed658ead23caf77effe7b875960cacd70d1ebe47c830e191358b242d688cf52a28d55ef9b19d102f792e8c1dec34bd865db264f1c7f4f63dd3a5fa84677e languageName: node linkType: hard @@ -5183,141 +4050,17 @@ __metadata: languageName: node linkType: hard -"apollo-datasource@npm:^3.3.1": - version: 3.3.1 - resolution: "apollo-datasource@npm:3.3.1" - dependencies: - apollo-server-caching: ^3.3.0 - apollo-server-env: ^4.2.1 - checksum: 5085c731afc45ea19198bad1fb59bfce779f5288802037e7681210b408bd3bc531dbe832236a91c72e084bc3ee5a8742440656a90e46b3f3939295159a2f62e2 +"app-module-path@npm:^2.2.0": + version: 2.2.0 + resolution: "app-module-path@npm:2.2.0" + checksum: b52aa49cfa809efbad41b514222e8ef3f8ee9e147f5eccf79280b45eddcc61f7aeb302b0049474e3f42072dd53a28348c57dd96f36cd461d2e31cc8ab1ef56b5 languageName: node linkType: hard -"apollo-reporting-protobuf@npm:^3.3.1": - version: 3.3.1 - resolution: "apollo-reporting-protobuf@npm:3.3.1" - dependencies: - "@apollo/protobufjs": 1.2.2 - checksum: 1933affb1640d5905e29f8a41becdba1981effd767660748517ea1d4ef30db4c6789b17eba02f11dafd29b46b56d95cd15cbc3eb319d0a90affbdd0f2d168473 - languageName: node - linkType: hard - -"apollo-server-caching@npm:^3.3.0": - version: 3.3.0 - resolution: "apollo-server-caching@npm:3.3.0" - dependencies: - lru-cache: ^6.0.0 - checksum: a5b43025ffb00cb3899fa0584512538747e8afe595ff8a0235caf8469435a03c1edc23fa56893fc77910f032563106872faa7e86a58acf1aed16bf77e9723327 - languageName: node - linkType: hard - -"apollo-server-core@npm:^3.7.0": - version: 3.7.0 - resolution: "apollo-server-core@npm:3.7.0" - dependencies: - "@apollo/utils.logger": ^1.0.0 - "@apollographql/apollo-tools": ^0.5.3 - "@apollographql/graphql-playground-html": 1.6.29 - "@graphql-tools/mock": ^8.1.2 - "@graphql-tools/schema": ^8.0.0 - "@josephg/resolvable": ^1.0.0 - apollo-datasource: ^3.3.1 - apollo-reporting-protobuf: ^3.3.1 - apollo-server-caching: ^3.3.0 - apollo-server-env: ^4.2.1 - apollo-server-errors: ^3.3.1 - apollo-server-plugin-base: ^3.5.3 - apollo-server-types: ^3.5.3 - async-retry: ^1.2.1 - fast-json-stable-stringify: ^2.1.0 - graphql-tag: ^2.11.0 - lodash.sortby: ^4.7.0 - loglevel: ^1.6.8 - lru-cache: ^6.0.0 - sha.js: ^2.4.11 - uuid: ^8.0.0 - whatwg-mimetype: ^3.0.0 - peerDependencies: - graphql: ^15.3.0 || ^16.0.0 - checksum: 94eb354a60a46dfb5afb080ffa92ff32bfa7925191354e08d4724b651c3c8f24db95a75ced784dcdd3169b8655bec35ae32283b196d1c35a2ad85adb3cf74ca9 - languageName: node - linkType: hard - -"apollo-server-env@npm:^4.2.1": - version: 4.2.1 - resolution: "apollo-server-env@npm:4.2.1" - dependencies: - node-fetch: ^2.6.7 - checksum: 039c7eeed82aff072237f9943629ab24b7c62b97535d756a31178f9e7352187951ee654a377d49d775d2ac221fe024914d9989257ca8a7e65c8e5f438c044f18 - languageName: node - linkType: hard - -"apollo-server-errors@npm:^3.3.1": - version: 3.3.1 - resolution: "apollo-server-errors@npm:3.3.1" - peerDependencies: - graphql: ^15.3.0 || ^16.0.0 - checksum: d09b66e7ac3e2cbc60774280d30118ac4d98f945b5cc1013bb81b9970aae49c0717a550e161fe978d69d7039ec053aeba495890f6eebf452532a2c5e94071a80 - languageName: node - linkType: hard - -"apollo-server-express@npm:^3.6.2": - version: 3.7.0 - resolution: "apollo-server-express@npm:3.7.0" - dependencies: - "@types/accepts": ^1.3.5 - "@types/body-parser": 1.19.2 - "@types/cors": 2.8.12 - "@types/express": 4.17.13 - "@types/express-serve-static-core": 4.17.28 - accepts: ^1.3.5 - apollo-server-core: ^3.7.0 - apollo-server-types: ^3.5.3 - body-parser: ^1.19.0 - cors: ^2.8.5 - parseurl: ^1.3.3 - peerDependencies: - express: ^4.17.1 - graphql: ^15.3.0 || ^16.0.0 - checksum: 0e34647726d36faba4464efc9b2b31670229b092ca7dcdeaf10e9d965231ae7c5b979047ab447defa6f223c4cb45c9b1ff8ac1b3545e5a880dcb450aee2d71b2 - languageName: node - linkType: hard - -"apollo-server-plugin-base@npm:^3.5.3": - version: 3.5.3 - resolution: "apollo-server-plugin-base@npm:3.5.3" - dependencies: - apollo-server-types: ^3.5.3 - peerDependencies: - graphql: ^15.3.0 || ^16.0.0 - checksum: c914d21295fb0bd42f7f9df69ebdd5935b531d867ad905cd71abe22f82a46808493311dcc803294cb0418c4c3be5c28670320cf70ff806f5c0c6ca3de0810e8d - languageName: node - linkType: hard - -"apollo-server-types@npm:^3.5.3": - version: 3.5.3 - resolution: "apollo-server-types@npm:3.5.3" - dependencies: - apollo-reporting-protobuf: ^3.3.1 - apollo-server-caching: ^3.3.0 - apollo-server-env: ^4.2.1 - peerDependencies: - graphql: ^15.3.0 || ^16.0.0 - checksum: 5b8ec05b2a80f7acddb5de4d558ef4927425edb171b49293cd61300b72dafbe335d1d10225c52188b135609d51b8f623fe5362817550ce0a6f470515dfeff564 - languageName: node - linkType: hard - -"app-module-path@npm:^2.2.0": - version: 2.2.0 - resolution: "app-module-path@npm:2.2.0" - checksum: b52aa49cfa809efbad41b514222e8ef3f8ee9e147f5eccf79280b45eddcc61f7aeb302b0049474e3f42072dd53a28348c57dd96f36cd461d2e31cc8ab1ef56b5 - languageName: node - linkType: hard - -"append-field@npm:^1.0.0": - version: 1.0.0 - resolution: "append-field@npm:1.0.0" - checksum: 482ba08acc0ecef00fe7da6bf2f8e48359a9905ee1af525f3120c9260c02e91eedf0579b59d898e8d8455b6c199e340bc0a2fd4b9e02adaa29a8a86c722b37f9 +"append-field@npm:^1.0.0": + version: 1.0.0 + resolution: "append-field@npm:1.0.0" + checksum: 482ba08acc0ecef00fe7da6bf2f8e48359a9905ee1af525f3120c9260c02e91eedf0579b59d898e8d8455b6c199e340bc0a2fd4b9e02adaa29a8a86c722b37f9 languageName: node linkType: hard @@ -5328,23 +4071,13 @@ __metadata: languageName: node linkType: hard -"are-we-there-yet@npm:^2.0.0": - version: 2.0.0 - resolution: "are-we-there-yet@npm:2.0.0" - dependencies: - delegates: ^1.0.0 - readable-stream: ^3.6.0 - checksum: 6c80b4fd04ecee6ba6e737e0b72a4b41bdc64b7d279edfc998678567ff583c8df27e27523bc789f2c99be603ffa9eaa612803da1d886962d2086e7ff6fa90c7c - languageName: node - linkType: hard - "are-we-there-yet@npm:^3.0.0": - version: 3.0.0 - resolution: "are-we-there-yet@npm:3.0.0" + version: 3.0.1 + resolution: "are-we-there-yet@npm:3.0.1" dependencies: delegates: ^1.0.0 readable-stream: ^3.6.0 - checksum: 348edfdd931b0b50868b55402c01c3f64df1d4c229ab6f063539a5025fd6c5f5bb8a0cab409bbed8d75d34762d22aa91b7c20b4204eb8177063158d9ba792981 + checksum: 52590c24860fa7173bedeb69a4c05fb573473e860197f618b9a28432ee4379049336727ae3a1f9c4cb083114601c1140cee578376164d0e651217a9843f9fe83 languageName: node linkType: hard @@ -5438,22 +4171,6 @@ __metadata: languageName: node linkType: hard -"async-retry@npm:^1.2.1": - version: 1.3.3 - resolution: "async-retry@npm:1.3.3" - dependencies: - retry: 0.13.1 - checksum: 38a7152ff7265a9321ea214b9c69e8224ab1febbdec98efbbde6e562f17ff68405569b796b1c5271f354aef8783665d29953f051f68c1fc45306e61aec82fdc4 - languageName: node - linkType: hard - -"async@npm:^3.2.3": - version: 3.2.3 - resolution: "async@npm:3.2.3" - checksum: c4bee57ab2249af3dc83ca3ef9acfa8e822c0d5e5aa41bae3eaf7f673648343cd64ecd7d26091ffd357f3f044428b17b5f00098494b6cf8b6b3e9681f0636ca1 - languageName: node - linkType: hard - "asynckit@npm:^0.4.0": version: 0.4.0 resolution: "asynckit@npm:0.4.0" @@ -5461,13 +4178,6 @@ __metadata: languageName: node linkType: hard -"at-least-node@npm:^1.0.0": - version: 1.0.0 - resolution: "at-least-node@npm:1.0.0" - checksum: 463e2f8e43384f1afb54bc68485c436d7622acec08b6fad269b421cb1d29cebb5af751426793d0961ed243146fe4dc983402f6d5a51b720b277818dbf6f2e49e - languageName: node - linkType: hard - "atomic-sleep@npm:^1.0.0": version: 1.0.0 resolution: "atomic-sleep@npm:1.0.0" @@ -5475,42 +4185,7 @@ __metadata: languageName: node linkType: hard -"aws-sdk@npm:^2.1069.0": - version: 2.1131.0 - resolution: "aws-sdk@npm:2.1131.0" - dependencies: - buffer: 4.9.2 - events: 1.1.1 - ieee754: 1.1.13 - jmespath: 0.16.0 - querystring: 0.2.0 - sax: 1.2.1 - url: 0.10.3 - uuid: 3.3.2 - xml2js: 0.4.19 - checksum: 479bc014d767cab9064286f01f63a8643ee0e1959e3235b74407ee7f916a6aae805229444a176361f7dd4d3c5e455e809908cda6333ab9324b9265c158583602 - languageName: node - linkType: hard - -"axios@npm:0.26.1": - version: 0.26.1 - resolution: "axios@npm:0.26.1" - dependencies: - follow-redirects: ^1.14.8 - checksum: d9eb58ff4bc0b36a04783fc9ff760e9245c829a5a1052ee7ca6013410d427036b1d10d04e7380c02f3508c5eaf3485b1ae67bd2adbfec3683704745c8d7a6e1a - languageName: node - linkType: hard - -"axios@npm:^0.24.0": - version: 0.24.0 - resolution: "axios@npm:0.24.0" - dependencies: - follow-redirects: ^1.14.4 - checksum: 468cf496c08a6aadfb7e699bebdac02851e3043d4e7d282350804ea8900e30d368daa6e3cd4ab83b8ddb5a3b1e17a5a21ada13fc9cebd27b74828f47a4236316 - languageName: node - linkType: hard - -"axios@npm:^0.27.1, axios@npm:^0.27.2": +"axios@npm:0.27.2, axios@npm:^0.27.1, axios@npm:^0.27.2": version: 0.27.2 resolution: "axios@npm:0.27.2" dependencies: @@ -5572,39 +4247,39 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.3.0": - version: 0.3.1 - resolution: "babel-plugin-polyfill-corejs2@npm:0.3.1" +"babel-plugin-polyfill-corejs2@npm:^0.3.2": + version: 0.3.3 + resolution: "babel-plugin-polyfill-corejs2@npm:0.3.3" dependencies: - "@babel/compat-data": ^7.13.11 - "@babel/helper-define-polyfill-provider": ^0.3.1 + "@babel/compat-data": ^7.17.7 + "@babel/helper-define-polyfill-provider": ^0.3.3 semver: ^6.1.1 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: ca873f14ccd6d2942013345a956de8165d0913556ec29756a748157140f5312f79eed487674e0ca562285880f05829b3712d72e1e4b412c2ce46bd6a50b4b975 + checksum: 7db3044993f3dddb3cc3d407bc82e640964a3bfe22de05d90e1f8f7a5cb71460011ab136d3c03c6c1ba428359ebf635688cd6205e28d0469bba221985f5c6179 languageName: node linkType: hard -"babel-plugin-polyfill-corejs3@npm:^0.5.0": - version: 0.5.2 - resolution: "babel-plugin-polyfill-corejs3@npm:0.5.2" +"babel-plugin-polyfill-corejs3@npm:^0.5.3": + version: 0.5.3 + resolution: "babel-plugin-polyfill-corejs3@npm:0.5.3" dependencies: - "@babel/helper-define-polyfill-provider": ^0.3.1 + "@babel/helper-define-polyfill-provider": ^0.3.2 core-js-compat: ^3.21.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2f3184c73f80f00ac876a5ebcad945fd8d2ae70e5f85b7ab6cc3bc69bc74025f4f7070de7abbb2a7274c78e130bd34fc13f4c85342da28205930364a1ef0aa21 + checksum: 9c6644a1b0afbe59e402827fdafc6f44994ff92c5b2f258659cbbfd228f7075dea49e95114af10e66d70f36cbde12ff1d81263eb67be749b3ef0e2c18cf3c16d languageName: node linkType: hard -"babel-plugin-polyfill-regenerator@npm:^0.3.0": - version: 0.3.1 - resolution: "babel-plugin-polyfill-regenerator@npm:0.3.1" +"babel-plugin-polyfill-regenerator@npm:^0.4.0": + version: 0.4.1 + resolution: "babel-plugin-polyfill-regenerator@npm:0.4.1" dependencies: - "@babel/helper-define-polyfill-provider": ^0.3.1 + "@babel/helper-define-polyfill-provider": ^0.3.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f1473df7b700d6795ca41301b1e65a0aff15ce6c1463fc0ce2cf0c821114b0330920f59d4cebf52976363ee817ba29ad2758544a4661a724b08191080b9fe1da + checksum: ab0355efbad17d29492503230387679dfb780b63b25408990d2e4cf421012dae61d6199ddc309f4d2409ce4e9d3002d187702700dd8f4f8770ebbba651ed066c languageName: node linkType: hard @@ -5642,13 +4317,6 @@ __metadata: languageName: node linkType: hard -"backo2@npm:^1.0.2": - version: 1.0.2 - resolution: "backo2@npm:1.0.2" - checksum: fda8d0a0f4810068d23715f2f45153146d6ee8f62dd827ce1e0b6cc3c8328e84ad61e11399a83931705cef702fe7cbb457856bf99b9bd10c4ed57b0786252385 - languageName: node - linkType: hard - "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -5656,24 +4324,26 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.0.2, base64-js@npm:^1.3.1": - version: 1.5.1 - resolution: "base64-js@npm:1.5.1" - checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 +"base-x@npm:^3.0.2": + version: 3.0.9 + resolution: "base-x@npm:3.0.9" + dependencies: + safe-buffer: ^5.0.1 + checksum: 957101d6fd09e1903e846fd8f69fd7e5e3e50254383e61ab667c725866bec54e5ece5ba49ce385128ae48f9ec93a26567d1d5ebb91f4d56ef4a9cc0d5a5481e8 languageName: node linkType: hard -"before-after-hook@npm:^2.2.0": - version: 2.2.2 - resolution: "before-after-hook@npm:2.2.2" - checksum: dc2e1ffe389e5afbef2a46790b1b5a50247ed57aba67649cfa9ec2552d248cc9278f222e72fb5a8ff59bbb39d78fbaa97e7234ead0c6b5e8418b67a8644ce207 +"base64-js@npm:^1.3.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 languageName: node linkType: hard -"big.js@npm:^5.2.2": - version: 5.2.2 - resolution: "big.js@npm:5.2.2" - checksum: b89b6e8419b097a8fb4ed2399a1931a68c612bce3cfd5ca8c214b2d017531191070f990598de2fc6f3f993d91c0f08aa82697717f6b3b8732c9731866d233c9e +"bech32@npm:1.1.4": + version: 1.1.4 + resolution: "bech32@npm:1.1.4" + checksum: 0e98db619191548390d6f09ff68b0253ba7ae6a55db93dfdbb070ba234c1fd3308c0606fbcc95fad50437227b10011e2698b89f0181f6e7f845c499bd14d0f4b languageName: node linkType: hard @@ -5685,23 +4355,9 @@ __metadata: linkType: hard "bignumber.js@npm:^9.0.0": - version: 9.0.2 - resolution: "bignumber.js@npm:9.0.2" - checksum: 8637b71d0a99104b20413c47578953970006fec6b4df796b9dcfd9835ea9c402ea0e727eba9a5ca9f9a393c1d88b6168c5bbe0887598b708d4f8b4870ad62e1f - languageName: node - linkType: hard - -"bin-links@npm:^3.0.0": - version: 3.0.1 - resolution: "bin-links@npm:3.0.1" - dependencies: - cmd-shim: ^5.0.0 - mkdirp-infer-owner: ^2.0.0 - npm-normalize-package-bin: ^1.0.0 - read-cmd-shim: ^3.0.0 - rimraf: ^3.0.0 - write-file-atomic: ^4.0.0 - checksum: c608f0746c5851f259f7578ae5157d24fb019b00792d246bade6255136e5fbd41df43219a50d53f844c562afb6e41092a5f2b0be1bd890e08ff023d330327380 + version: 9.1.0 + resolution: "bignumber.js@npm:9.1.0" + checksum: 52ec2bb5a3874d7dc1a1018f28f8f7aff4683515ffd09d6c2d93191343c76567ae0ee32cc45149d53afb2b904bc62ed471a307b35764beea7e9db78e56bef6c6 languageName: node linkType: hard @@ -5712,21 +4368,14 @@ __metadata: languageName: node linkType: hard -"binaryextensions@npm:^4.15.0, binaryextensions@npm:^4.16.0": - version: 4.18.0 - resolution: "binaryextensions@npm:4.18.0" - checksum: 6fe92a9004c5a7c08a8d49ac4087581043a0d195e76c288619c13e9232d0b80543f01da0037bb0f1b02830c174721fcad92bdfe76c84295cc8f308ee3b74d184 - languageName: node - linkType: hard - -"bintrees@npm:1.0.1": - version: 1.0.1 - resolution: "bintrees@npm:1.0.1" - checksum: 71d00ce450ee7ad080a3c86ae5f05fac841bdf95c0d78f3b3bbf8f754c19d7cb732f0f9213a46ed27cbec47eb124ffe2b686bef870718a4b9918c23210b55c73 +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e languageName: node linkType: hard -"bl@npm:^4.0.3, bl@npm:^4.1.0": +"bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" dependencies: @@ -5737,6 +4386,13 @@ __metadata: languageName: node linkType: hard +"blakejs@npm:^1.1.0": + version: 1.2.1 + resolution: "blakejs@npm:1.2.1" + checksum: d699ba116cfa21d0b01d12014a03e484dd76d483133e6dc9eb415aa70a119f08beb3bcefb8c71840106a00b542cba77383f8be60cd1f0d4589cb8afb922eefbe + languageName: node + linkType: hard + "blob-to-it@npm:^1.0.1": version: 1.0.4 resolution: "blob-to-it@npm:1.0.4" @@ -5753,39 +4409,21 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:^5.2.0": - version: 5.2.0 - resolution: "bn.js@npm:5.2.0" - checksum: 6117170393200f68b35a061ecbf55d01dd989302e7b3c798a3012354fa638d124f0b2f79e63f77be5556be80322a09c40339eda6413ba7468524c0b6d4b4cb7a +"bn.js@npm:^4.11.9": + version: 4.12.0 + resolution: "bn.js@npm:4.12.0" + checksum: 39afb4f15f4ea537b55eaf1446c896af28ac948fdcf47171961475724d1bb65118cca49fa6e3d67706e4790955ec0e74de584e45c8f1ef89f46c812bee5b5a12 languageName: node linkType: hard -"bn.js@npm:^5.2.1": +"bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 languageName: node linkType: hard -"body-parser@npm:1.19.2": - version: 1.19.2 - resolution: "body-parser@npm:1.19.2" - dependencies: - bytes: 3.1.2 - content-type: ~1.0.4 - debug: 2.6.9 - depd: ~1.1.2 - http-errors: 1.8.1 - iconv-lite: 0.4.24 - on-finished: ~2.3.0 - qs: 6.9.7 - raw-body: 2.4.3 - type-is: ~1.6.18 - checksum: 7f777ea65670e2622ca4a785b5dcb2a68451b3bb8d4d0f41091d307d56b640dba588a9ae04d85dda2cdd5e42788266a783528d5417e5643720fd611fd52522e7 - languageName: node - linkType: hard - -"body-parser@npm:1.20.0, body-parser@npm:^1.15.2, body-parser@npm:^1.19.0": +"body-parser@npm:1.20.0": version: 1.20.0 resolution: "body-parser@npm:1.20.0" dependencies: @@ -5805,22 +4443,6 @@ __metadata: languageName: node linkType: hard -"boxen@npm:^5.0.0": - version: 5.1.2 - resolution: "boxen@npm:5.1.2" - dependencies: - ansi-align: ^3.0.0 - camelcase: ^6.2.0 - chalk: ^4.1.0 - cli-boxes: ^2.2.1 - string-width: ^4.2.2 - type-fest: ^0.20.2 - widest-line: ^3.1.0 - wrap-ansi: ^7.0.0 - checksum: 82d03e42a72576ff235123f17b7c505372fe05c83f75f61e7d4fa4bcb393897ec95ce766fecb8f26b915f0f7a7227d66e5ec7cef43f5b2bd9d3aeed47ec55877 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -5849,6 +4471,13 @@ __metadata: languageName: node linkType: hard +"brorand@npm:^1.1.0": + version: 1.1.0 + resolution: "brorand@npm:1.1.0" + checksum: 8a05c9f3c4b46572dec6ef71012b1946db6cae8c7bb60ccd4b7dd5a84655db49fe043ecc6272e7ef1f69dc53d6730b9e2a3a03a8310509a3d797a618cbee52be + languageName: node + linkType: hard + "browser-process-hrtime@npm:^1.0.0": version: 1.0.0 resolution: "browser-process-hrtime@npm:1.0.0" @@ -5863,18 +4492,31 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.14.5, browserslist@npm:^4.20.2, browserslist@npm:^4.20.3": - version: 4.20.3 - resolution: "browserslist@npm:4.20.3" +"browserify-aes@npm:^1.2.0": + version: 1.2.0 + resolution: "browserify-aes@npm:1.2.0" dependencies: - caniuse-lite: ^1.0.30001332 - electron-to-chromium: ^1.4.118 - escalade: ^3.1.1 - node-releases: ^2.0.3 - picocolors: ^1.0.0 + buffer-xor: ^1.0.3 + cipher-base: ^1.0.0 + create-hash: ^1.1.0 + evp_bytestokey: ^1.0.3 + inherits: ^2.0.1 + safe-buffer: ^5.0.1 + checksum: 4a17c3eb55a2aa61c934c286f34921933086bf6d67f02d4adb09fcc6f2fc93977b47d9d884c25619144fccd47b3b3a399e1ad8b3ff5a346be47270114bcf7104 + languageName: node + linkType: hard + +"browserslist@npm:^4.20.2, browserslist@npm:^4.21.3": + version: 4.21.3 + resolution: "browserslist@npm:4.21.3" + dependencies: + caniuse-lite: ^1.0.30001370 + electron-to-chromium: ^1.4.202 + node-releases: ^2.0.6 + update-browserslist-db: ^1.0.5 bin: browserslist: cli.js - checksum: 1e4b719ac2ca0fe235218a606e8b8ef16b8809e0973b924158c39fbc435a0b0fe43437ea52dd6ef5ad2efcb83fcb07431244e472270177814217f7c563651f7d + checksum: ff512a7bcca1c530e2854bbdfc7be2791d0fb524097a6340e56e1d5924164c7e4e0a9b070de04cdc4c149d15cb4d4275cb7c626ebbce954278a2823aaad2452a languageName: node linkType: hard @@ -5887,6 +4529,26 @@ __metadata: languageName: node linkType: hard +"bs58@npm:^4.0.0": + version: 4.0.1 + resolution: "bs58@npm:4.0.1" + dependencies: + base-x: ^3.0.2 + checksum: b3c5365bb9e0c561e1a82f1a2d809a1a692059fae016be233a6127ad2f50a6b986467c3a50669ce4c18929dcccb297c5909314dd347a25a68c21b68eb3e95ac2 + languageName: node + linkType: hard + +"bs58check@npm:^2.1.2": + version: 2.1.2 + resolution: "bs58check@npm:2.1.2" + dependencies: + bs58: ^4.0.0 + create-hash: ^1.1.0 + safe-buffer: ^5.1.2 + checksum: 43bdf08a5dd04581b78f040bc4169480e17008da482ffe2a6507327bbc4fc5c28de0501f7faf22901cfe57fbca79cbb202ca529003fedb4cb8dccd265b38e54d + languageName: node + linkType: hard + "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -5896,13 +4558,6 @@ __metadata: languageName: node linkType: hard -"buffer-equal-constant-time@npm:1.0.1": - version: 1.0.1 - resolution: "buffer-equal-constant-time@npm:1.0.1" - checksum: 80bb945f5d782a56f374b292770901065bad21420e34936ecbe949e57724b4a13874f735850dd1cc61f078773c4fb5493a41391e7bda40d1fa388d6bd80daaab - languageName: node - linkType: hard - "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -5917,14 +4572,10 @@ __metadata: languageName: node linkType: hard -"buffer@npm:4.9.2": - version: 4.9.2 - resolution: "buffer@npm:4.9.2" - dependencies: - base64-js: ^1.0.2 - ieee754: ^1.1.4 - isarray: ^1.0.0 - checksum: 8801bc1ba08539f3be70eee307a8b9db3d40f6afbfd3cf623ab7ef41dffff1d0a31de0addbe1e66e0ca5f7193eeb667bfb1ecad3647f8f1b0750de07c13295c3 +"buffer-xor@npm:^1.0.3": + version: 1.0.3 + resolution: "buffer-xor@npm:1.0.3" + checksum: 10c520df29d62fa6e785e2800e586a20fc4f6dfad84bcdbd12e1e8a83856de1cb75c7ebd7abe6d036bbfab738a6cf18a3ae9c8e5a2e2eb3167ca7399ce65373a languageName: node linkType: hard @@ -5958,27 +4609,12 @@ __metadata: languageName: node linkType: hard -"builtin-modules@npm:^3.0.0": - version: 3.2.0 - resolution: "builtin-modules@npm:3.2.0" - checksum: 0265aa1ba78e1a16f4e18668d815cb43fb364e6a6b8aa9189c6f44c7b894a551a43b323c40206959d2d4b2568c1f2805607ad6c88adc306a776ce6904cca6715 - languageName: node - linkType: hard - -"builtins@npm:^1.0.3": - version: 1.0.3 - resolution: "builtins@npm:1.0.3" - checksum: 47ce94f7eee0e644969da1f1a28e5f29bd2e48b25b2bbb61164c345881086e29464ccb1fb88dbc155ea26e8b1f5fc8a923b26c8c1ed0935b67b644d410674513 - languageName: node - linkType: hard - -"busboy@npm:^0.2.11": - version: 0.2.14 - resolution: "busboy@npm:0.2.14" +"busboy@npm:^1.0.0": + version: 1.6.0 + resolution: "busboy@npm:1.6.0" dependencies: - dicer: 0.2.5 - readable-stream: 1.1.x - checksum: 9df9fca6d96dab9edd03f568bde31f215794e6fabd73c75d2b39a4be2e8b73a45121d987dea5db881f3fb499737c261b372106fe72d08b8db92afaed8d751165 + streamsearch: ^1.1.0 + checksum: 32801e2c0164e12106bf236291a00795c3c4e4b709ae02132883fe8478ba2ae23743b11c5735a0aae8afe65ac4b6ca4568b91f0d9fed1fdbc32ede824a73746e languageName: node linkType: hard @@ -5989,35 +4625,9 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^15.0.3, cacache@npm:^15.0.5, cacache@npm:^15.2.0": - version: 15.3.0 - resolution: "cacache@npm:15.3.0" - dependencies: - "@npmcli/fs": ^1.0.0 - "@npmcli/move-file": ^1.0.1 - chownr: ^2.0.0 - fs-minipass: ^2.0.0 - glob: ^7.1.4 - infer-owner: ^1.0.4 - lru-cache: ^6.0.0 - minipass: ^3.1.1 - minipass-collect: ^1.0.2 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.2 - mkdirp: ^1.0.3 - p-map: ^4.0.0 - promise-inflight: ^1.0.1 - rimraf: ^3.0.2 - ssri: ^8.0.1 - tar: ^6.0.2 - unique-filename: ^1.1.1 - checksum: a07327c27a4152c04eb0a831c63c00390d90f94d51bb80624a66f4e14a6b6360bbf02a84421267bd4d00ca73ac9773287d8d7169e8d2eafe378d2ce140579db8 - languageName: node - linkType: hard - -"cacache@npm:^16.0.2": - version: 16.0.7 - resolution: "cacache@npm:16.0.7" +"cacache@npm:^16.1.0": + version: 16.1.3 + resolution: "cacache@npm:16.1.3" dependencies: "@npmcli/fs": ^2.1.0 "@npmcli/move-file": ^2.0.0 @@ -6036,23 +4646,8 @@ __metadata: rimraf: ^3.0.2 ssri: ^9.0.0 tar: ^6.1.11 - unique-filename: ^1.1.1 - checksum: 2155b099b7e0f0369fb1155ca4673532ca7efe2ebdbec63acca8743580b8446b5d4fd7184626b1cb059001af77b981cdc67035c7855544d365d4f048eafca2ca - languageName: node - linkType: hard - -"cacheable-request@npm:^6.0.0": - version: 6.1.0 - resolution: "cacheable-request@npm:6.1.0" - dependencies: - clone-response: ^1.0.2 - get-stream: ^5.1.0 - http-cache-semantics: ^4.0.0 - keyv: ^3.0.0 - lowercase-keys: ^2.0.0 - normalize-url: ^4.1.0 - responselike: ^1.0.2 - checksum: b510b237b18d17e89942e9ee2d2a077cb38db03f12167fd100932dfa8fc963424bfae0bfa1598df4ae16c944a5484e43e03df8f32105b04395ee9495e9e4e9f1 + unique-filename: ^2.0.0 + checksum: d91409e6e57d7d9a3a25e5dcc589c84e75b178ae8ea7de05cbf6b783f77a5fae938f6e8fda6f5257ed70000be27a681e1e44829251bfffe4c10216002f8f14e6 languageName: node linkType: hard @@ -6066,13 +4661,6 @@ __metadata: languageName: node linkType: hard -"callguard@npm:^2.0.0": - version: 2.0.0 - resolution: "callguard@npm:2.0.0" - checksum: 0dccd585ff46f89b64ce2cf212c6bb36d4ba6c681b1b811ed225f15e1fc6a458714dfd93c3e0c54790bb1da307a6223e51a6d1b589bc5a9a8b93d32cb77d756d - languageName: node - linkType: hard - "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -6094,58 +4682,23 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001332": - version: 1.0.30001338 - resolution: "caniuse-lite@npm:1.0.30001338" - checksum: 80ac481b20aac13d6168825762e2ad9b9895d36451088b921400c3cd818185e6d113c2d202e82cf3b88f4d2311b3064507f2e3f9fe9f0935fcaf42d9d4f15570 - languageName: node - linkType: hard - -"cardinal@npm:^2.1.1": - version: 2.1.1 - resolution: "cardinal@npm:2.1.1" - dependencies: - ansicolors: ~0.3.2 - redeyed: ~2.1.0 - bin: - cdl: ./bin/cdl.js - checksum: e8d4ae46439cf8fed481c0efd267711ee91e199aa7821a9143e784ed94a6495accd01a0b36d84d377e8ee2cc9928a6c9c123b03be761c60b805f2c026b8a99ad +"caniuse-lite@npm:^1.0.30001370": + version: 1.0.30001399 + resolution: "caniuse-lite@npm:1.0.30001399" + checksum: dd105b06fbbdc89867780a2f4debc3ecb184cff82f35b34aaac486628fcc9cf6bacf37573a9cc22dedc661178d460fa8401374a933cb9d2f8ee67316d98b2a8f languageName: node linkType: hard "cborg@npm:^1.5.4": - version: 1.9.1 - resolution: "cborg@npm:1.9.1" + version: 1.9.5 + resolution: "cborg@npm:1.9.5" bin: cborg: cli.js - checksum: 856d0bb10dae4ae4528b120b078525427a01490ebbfea0ece18f01502caa834f6924a09e3ea3e09b1d015150c3fa1e6e02358a26f84a4abf1d1c36403bd1a7c9 + checksum: e44a103cc2d2fd0e925e8d2d2049552551c6ae3ed143c52863bd740b39fa4652979f1f898b63190fe61247d08aa4c391f3a19e2dea1d19510e82740599ac8610 languageName: node linkType: hard -"chalk@npm:3.0.0, chalk@npm:^3.0.0": - version: 3.0.0 - resolution: "chalk@npm:3.0.0" - dependencies: - ansi-styles: ^4.1.0 - supports-color: ^7.1.0 - checksum: 8e3ddf3981c4da405ddbd7d9c8d91944ddf6e33d6837756979f7840a29272a69a5189ecae0ff84006750d6d1e92368d413335eab4db5476db6e6703a1d1e0505 - languageName: node - linkType: hard - -"chalk@npm:^1.0.0": - version: 1.1.3 - resolution: "chalk@npm:1.1.3" - dependencies: - ansi-styles: ^2.2.1 - escape-string-regexp: ^1.0.2 - has-ansi: ^2.0.0 - strip-ansi: ^3.0.0 - supports-color: ^2.0.0 - checksum: 9d2ea6b98fc2b7878829eec223abcf404622db6c48396a9b9257f6d0ead2acf18231ae368d6a664a83f272b0679158da12e97b5229f794939e555cc574478acd - languageName: node - linkType: hard - -"chalk@npm:^2.0.0, chalk@npm:^2.4.1, chalk@npm:^2.4.2": +"chalk@npm:^2.0.0": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -6156,7 +4709,17 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": +"chalk@npm:^3.0.0": + version: 3.0.0 + resolution: "chalk@npm:3.0.0" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: 8e3ddf3981c4da405ddbd7d9c8d91944ddf6e33d6837756979f7840a29272a69a5189ecae0ff84006750d6d1e92368d413335eab4db5476db6e6703a1d1e0505 + languageName: node + linkType: hard + +"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -6173,14 +4736,7 @@ __metadata: languageName: node linkType: hard -"chardet@npm:^0.7.0": - version: 0.7.0 - resolution: "chardet@npm:0.7.0" - checksum: 6fd5da1f5d18ff5712c1e0aed41da200d7c51c28f11b36ee3c7b483f3696dabc08927fc6b227735eb8f0e1215c9a8abd8154637f3eff8cada5959df7f58b024d - languageName: node - linkType: hard - -"chokidar@npm:3.5.3, chokidar@npm:^3.5.2, chokidar@npm:^3.5.3": +"chokidar@npm:^3.5.2": version: 3.5.3 resolution: "chokidar@npm:3.5.3" dependencies: @@ -6199,13 +4755,6 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^1.1.1": - version: 1.1.4 - resolution: "chownr@npm:1.1.4" - checksum: 115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d - languageName: node - linkType: hard - "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -6213,24 +4762,20 @@ __metadata: languageName: node linkType: hard -"chrome-trace-event@npm:^1.0.2": - version: 1.0.3 - resolution: "chrome-trace-event@npm:1.0.3" - checksum: cb8b1fc7e881aaef973bd0c4a43cd353c2ad8323fb471a041e64f7c2dd849cde4aad15f8b753331a32dda45c973f032c8a03b8177fc85d60eaa75e91e08bfb97 - languageName: node - linkType: hard - -"ci-info@npm:^2.0.0": - version: 2.0.0 - resolution: "ci-info@npm:2.0.0" - checksum: 3b374666a85ea3ca43fa49aa3a048d21c9b475c96eb13c133505d2324e7ae5efd6a454f41efe46a152269e9b6a00c9edbe63ec7fa1921957165aae16625acd67 +"ci-info@npm:^3.2.0": + version: 3.4.0 + resolution: "ci-info@npm:3.4.0" + checksum: 7f660730170a6ce248e173b670587a0c583e31526d21afcd21f77c811c1aaeb8926999081542d1f30e12cce1df582d4c88709fa45f44c00498b46bdf21d4d21a languageName: node linkType: hard -"ci-info@npm:^3.2.0": - version: 3.3.0 - resolution: "ci-info@npm:3.3.0" - checksum: c3d86fe374938ecda5093b1ba39acb535d8309185ba3f23587747c6a057e63f45419b406d880304dbc0e1d72392c9a33e42fe9a1e299209bc0ded5efaa232b66 +"cipher-base@npm:^1.0.0, cipher-base@npm:^1.0.1, cipher-base@npm:^1.0.3": + version: 1.0.4 + resolution: "cipher-base@npm:1.0.4" + dependencies: + inherits: ^2.0.1 + safe-buffer: ^5.0.1 + checksum: 47d3568dbc17431a339bad1fe7dff83ac0891be8206911ace3d3b818fc695f376df809bea406e759cdea07fff4b454fa25f1013e648851bec790c1d75763032e languageName: node linkType: hard @@ -6265,15 +4810,6 @@ __metadata: languageName: node linkType: hard -"clean-regexp@npm:^1.0.0": - version: 1.0.0 - resolution: "clean-regexp@npm:1.0.0" - dependencies: - escape-string-regexp: ^1.0.5 - checksum: 0b1ce281b07da2463c6882ea2e8409119b6cabbd9f687cdbdcee942c45b2b9049a2084f7b5f228c63ef9f21e722963ae0bfe56a735dbdbdd92512867625a7e40 - languageName: node - linkType: hard - "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -6281,29 +4817,6 @@ __metadata: languageName: node linkType: hard -"clean-stack@npm:^3.0.0, clean-stack@npm:^3.0.1": - version: 3.0.1 - resolution: "clean-stack@npm:3.0.1" - dependencies: - escape-string-regexp: 4.0.0 - checksum: dc18c842d7792dd72d463936b1b0a5b2621f0fc11588ee48b602e1a29b6c010c606d89f3de1f95d15d72de74aea93c0fbac8246593a31d95f8462cac36148e05 - languageName: node - linkType: hard - -"cli-boxes@npm:^1.0.0": - version: 1.0.0 - resolution: "cli-boxes@npm:1.0.0" - checksum: 101cfd6464a418a76523c332665eaf0641522f30ecc2492de48263ada6b0852333b2ed47b2998ddda621e7008471c51f597f813be798db237c33ba45b27e802a - languageName: node - linkType: hard - -"cli-boxes@npm:^2.2.1": - version: 2.2.1 - resolution: "cli-boxes@npm:2.2.1" - checksum: be79f8ec23a558b49e01311b39a1ea01243ecee30539c880cf14bf518a12e223ef40c57ead0cb44f509bffdffc5c129c746cd50d863ab879385370112af4f585 - languageName: node - linkType: hard - "cli-cursor@npm:^3.1.0": version: 3.1.0 resolution: "cli-cursor@npm:3.1.0" @@ -6313,41 +4826,10 @@ __metadata: languageName: node linkType: hard -"cli-progress@npm:^3.10.0, cli-progress@npm:^3.4.0": - version: 3.11.0 - resolution: "cli-progress@npm:3.11.0" - dependencies: - string-width: ^4.2.3 - checksum: aed20534e440d7073b03b5225cc1a3ec06436b5f390b4d7a77d17d8edb2734cdb107cdeb5fc1ab031ef195e2d0cdc3653a3e8d91e4f56520448aa71289233e7b - languageName: node - linkType: hard - "cli-spinners@npm:^2.5.0": - version: 2.6.1 - resolution: "cli-spinners@npm:2.6.1" - checksum: 423409baaa7a58e5104b46ca1745fbfc5888bbd0b0c5a626e052ae1387060839c8efd512fb127e25769b3dc9562db1dc1b5add6e0b93b7ef64f477feb6416a45 - languageName: node - linkType: hard - -"cli-table3@npm:0.6.1": - version: 0.6.1 - resolution: "cli-table3@npm:0.6.1" - dependencies: - colors: 1.4.0 - string-width: ^4.2.0 - dependenciesMeta: - colors: - optional: true - checksum: 956e175f8eb019c26465b9f1e51121c08d8978e2aab04be7f8520ea8a4e67906fcbd8516dfb77e386ae3730ef0281aa21a65613dffbfa3d62969263252bd25a9 - languageName: node - linkType: hard - -"cli-table@npm:^0.3.1": - version: 0.3.11 - resolution: "cli-table@npm:0.3.11" - dependencies: - colors: 1.0.3 - checksum: 59fb61f992ac9bc8610ed98c72bf7f5d396c5afb42926b6747b46b0f8bb98a0dfa097998e77542ac334c1eb7c18dbf4f104d5783493273c5ec4c34084aa7c663 + version: 2.7.0 + resolution: "cli-spinners@npm:2.7.0" + checksum: a9afaf73f58d1f951fb23742f503631b3cf513f43f4c7acb1b640100eb76bfa16efbcd1994d149ffc6603a6d75dd3d4a516a76f125f90dce437de9b16fd0ee6f languageName: node linkType: hard @@ -6371,80 +4853,6 @@ __metadata: languageName: node linkType: hard -"cli-ux@npm:5.6.7": - version: 5.6.7 - resolution: "cli-ux@npm:5.6.7" - dependencies: - "@oclif/command": ^1.8.15 - "@oclif/errors": ^1.3.5 - "@oclif/linewrap": ^1.0.0 - "@oclif/screen": ^1.0.4 - ansi-escapes: ^4.3.0 - ansi-styles: ^4.2.0 - cardinal: ^2.1.1 - chalk: ^4.1.0 - clean-stack: ^3.0.0 - cli-progress: ^3.4.0 - extract-stack: ^2.0.0 - fs-extra: ^8.1 - hyperlinker: ^1.0.0 - indent-string: ^4.0.0 - is-wsl: ^2.2.0 - js-yaml: ^3.13.1 - lodash: ^4.17.21 - natural-orderby: ^2.0.1 - object-treeify: ^1.1.4 - password-prompt: ^1.1.2 - semver: ^7.3.2 - string-width: ^4.2.0 - strip-ansi: ^6.0.0 - supports-color: ^8.1.0 - supports-hyperlinks: ^2.1.0 - tslib: ^2.0.0 - checksum: a7371fff872603d763ec7dd56a572ce2cace52fcd30de92bcf69b69ec87b76e5618cff82fa8645598e55f1e4fb4cf19696c1f377c9a40dcfeb5245d1aa6df20c - languageName: node - linkType: hard - -"cli-ux@npm:^6.0.9": - version: 6.0.9 - resolution: "cli-ux@npm:6.0.9" - dependencies: - "@oclif/core": ^1.1.1 - "@oclif/linewrap": ^1.0.0 - "@oclif/screen": "^1.0.4 " - ansi-escapes: ^4.3.0 - ansi-styles: ^4.2.0 - cardinal: ^2.1.1 - chalk: ^4.1.0 - clean-stack: ^3.0.0 - cli-progress: ^3.10.0 - extract-stack: ^2.0.0 - fs-extra: ^8.1 - hyperlinker: ^1.0.0 - indent-string: ^4.0.0 - is-wsl: ^2.2.0 - js-yaml: ^3.13.1 - lodash: ^4.17.21 - natural-orderby: ^2.0.1 - object-treeify: ^1.1.4 - password-prompt: ^1.1.2 - semver: ^7.3.2 - string-width: ^4.2.0 - strip-ansi: ^6.0.0 - supports-color: ^8.1.0 - supports-hyperlinks: ^2.1.0 - tslib: ^2.0.0 - checksum: 4844b98c32424d7601143825765ae0b0efce34b619c72d165f4c91485ac7b75f14aa92c970caa426d14957b3f368886ee148db75dd9e51eb9c40a83c634ec0b7 - languageName: node - linkType: hard - -"cli-width@npm:^3.0.0": - version: 3.0.0 - resolution: "cli-width@npm:3.0.0" - checksum: 4c94af3769367a70e11ed69aa6095f1c600c0ff510f3921ab4045af961820d57c0233acfa8b6396037391f31b4c397e1f614d234294f979ff61430a6c166c3f6 - languageName: node - linkType: hard - "cliui@npm:^7.0.2": version: 7.0.4 resolution: "cliui@npm:7.0.4" @@ -6456,40 +4864,6 @@ __metadata: languageName: node linkType: hard -"clone-buffer@npm:^1.0.0": - version: 1.0.0 - resolution: "clone-buffer@npm:1.0.0" - checksum: a39a35e7fd081e0f362ba8195bd15cbc8205df1fbe4598bb4e09c1f9a13c0320a47ab8a61a8aa83561e4ed34dc07666d73254ee952ddd3985e4286b082fe63b9 - languageName: node - linkType: hard - -"clone-deep@npm:^4.0.1": - version: 4.0.1 - resolution: "clone-deep@npm:4.0.1" - dependencies: - is-plain-object: ^2.0.4 - kind-of: ^6.0.2 - shallow-clone: ^3.0.0 - checksum: 770f912fe4e6f21873c8e8fbb1e99134db3b93da32df271d00589ea4a29dbe83a9808a322c93f3bcaf8584b8b4fa6fc269fc8032efbaa6728e0c9886c74467d2 - languageName: node - linkType: hard - -"clone-response@npm:^1.0.2": - version: 1.0.2 - resolution: "clone-response@npm:1.0.2" - dependencies: - mimic-response: ^1.0.0 - checksum: 2d0e61547fc66276e0903be9654ada422515f5a15741691352000d47e8c00c226061221074ce2c0064d12e975e84a8687cfd35d8b405750cb4e772f87b256eda - languageName: node - linkType: hard - -"clone-stats@npm:^1.0.0": - version: 1.0.0 - resolution: "clone-stats@npm:1.0.0" - checksum: 654c0425afc5c5c55a4d95b2e0c6eccdd55b5247e7a1e7cca9000b13688b96b0a157950c72c5307f9fd61f17333ad796d3cd654778f2d605438012391cc4ada5 - languageName: node - linkType: hard - "clone@npm:^1.0.2": version: 1.0.4 resolution: "clone@npm:1.0.4" @@ -6497,33 +4871,6 @@ __metadata: languageName: node linkType: hard -"clone@npm:^2.1.1": - version: 2.1.2 - resolution: "clone@npm:2.1.2" - checksum: aaf106e9bc025b21333e2f4c12da539b568db4925c0501a1bf4070836c9e848c892fa22c35548ce0d1132b08bbbfa17a00144fe58fccdab6fa900fec4250f67d - languageName: node - linkType: hard - -"cloneable-readable@npm:^1.0.0": - version: 1.1.3 - resolution: "cloneable-readable@npm:1.1.3" - dependencies: - inherits: ^2.0.1 - process-nextick-args: ^2.0.0 - readable-stream: ^2.3.5 - checksum: 23b3741225a80c1760dff58aafb6a45383d5ee2d42de7124e4e674387cfad2404493d685b35ebfca9098f99c296e5c5719e748c9750c13838a2016ea2d2bb83a - languageName: node - linkType: hard - -"cmd-shim@npm:^5.0.0": - version: 5.0.0 - resolution: "cmd-shim@npm:5.0.0" - dependencies: - mkdirp-infer-owner: ^2.0.0 - checksum: 83d2a46cdf4adbb38d3d3184364b2df0e4c001ac770f5ca94373825d7a48838b4cb8a59534ef48f02b0d556caa047728589ca65c640c17c0b417b3afb34acfbb - languageName: node - linkType: hard - "co@npm:^4.6.0": version: 4.6.0 resolution: "co@npm:4.6.0" @@ -6531,13 +4878,6 @@ __metadata: languageName: node linkType: hard -"code-point-at@npm:^1.0.0": - version: 1.1.0 - resolution: "code-point-at@npm:1.1.0" - checksum: 17d5666611f9b16d64fdf48176d9b7fb1c7d1c1607a189f7e600040a11a6616982876af148230336adb7d8fe728a559f743a4e29db3747e3b1a32fa7f4529681 - languageName: node - linkType: hard - "collect-v8-coverage@npm:^1.0.0": version: 1.0.1 resolution: "collect-v8-coverage@npm:1.0.1" @@ -6577,7 +4917,7 @@ __metadata: languageName: node linkType: hard -"color-support@npm:^1.1.2, color-support@npm:^1.1.3": +"color-support@npm:^1.1.3": version: 1.1.3 resolution: "color-support@npm:1.1.3" bin: @@ -6587,23 +4927,9 @@ __metadata: linkType: hard "colorette@npm:^2.0.16": - version: 2.0.16 - resolution: "colorette@npm:2.0.16" - checksum: cd55596a3a2d1071c1a28eee7fd8a5387593ff1bd10a3e8d0a6221499311fe34a9f2b9272d77c391e0e003dcdc8934fb2f8d106e7ef1f7516f8060c901d41a27 - languageName: node - linkType: hard - -"colors@npm:1.0.3": - version: 1.0.3 - resolution: "colors@npm:1.0.3" - checksum: 234e8d3ab7e4003851cdd6a1f02eaa16dabc502ee5f4dc576ad7959c64b7477b15bd21177bab4055a4c0a66aa3d919753958030445f87c39a253d73b7a3637f5 - languageName: node - linkType: hard - -"colors@npm:1.4.0": - version: 1.4.0 - resolution: "colors@npm:1.4.0" - checksum: 98aa2c2418ad87dedf25d781be69dc5fc5908e279d9d30c34d8b702e586a0474605b3a189511482b9d5ed0d20c867515d22749537f7bc546256c6014f3ebdcec + version: 2.0.19 + resolution: "colorette@npm:2.0.19" + checksum: 888cf5493f781e5fcf54ce4d49e9d7d698f96ea2b2ef67906834bb319a392c667f9ec69f4a10e268d2946d13a9503d2d19b3abaaaf174e3451bfe91fb9d82427 languageName: node linkType: hard @@ -6616,45 +4942,10 @@ __metadata: languageName: node linkType: hard -"commander@npm:4.1.1": - version: 4.1.1 - resolution: "commander@npm:4.1.1" - checksum: d7b9913ff92cae20cb577a4ac6fcc121bd6223319e54a40f51a14740a681ad5c574fd29a57da478a5f234a6fa6c52cbf0b7c641353e03c648b1ae85ba670b977 - languageName: node - linkType: hard - -"commander@npm:7.1.0": - version: 7.1.0 - resolution: "commander@npm:7.1.0" - checksum: 99c120b939b610b1fb4a14424b48dc6431643ec46836f251a26434ad77b1eed22577a36378cfd66ed4b56fc69f98553f7dcb30f1539e3685874fd77cfb6e52fb - languageName: node - linkType: hard - -"commander@npm:^2.19.0, commander@npm:^2.20.0, commander@npm:^2.20.3": - version: 2.20.3 - resolution: "commander@npm:2.20.3" - checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e - languageName: node - linkType: hard - -"commander@npm:^8.3.0": - version: 8.3.0 - resolution: "commander@npm:8.3.0" - checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0 - languageName: node - linkType: hard - -"common-ancestor-path@npm:^1.0.1": - version: 1.0.1 - resolution: "common-ancestor-path@npm:1.0.1" - checksum: 1d2e4186067083d8cc413f00fc2908225f04ae4e19417ded67faa6494fb313c4fcd5b28a52326d1a62b466e2b3a4325e92c31133c5fee628cdf8856b3a57c3d7 - languageName: node - linkType: hard - -"commondir@npm:^1.0.1": - version: 1.0.1 - resolution: "commondir@npm:1.0.1" - checksum: 59715f2fc456a73f68826285718503340b9f0dd89bfffc42749906c5cf3d4277ef11ef1cca0350d0e79204f00f1f6d83851ececc9095dc88512a697ac0b9bdcb +"commander@npm:^9.3.0": + version: 9.4.0 + resolution: "commander@npm:9.4.0" + checksum: a322de584a6ccd1ea83c24f6a660e52d16ffbe2613fcfbb8d2cc68bc9dec637492456d754fe8bb5b039ad843ed8e04fb0b107e581a75f62cde9e1a0ab1546e09 languageName: node linkType: hard @@ -6677,49 +4968,10 @@ __metadata: resolution: "concat-stream@npm:1.6.2" dependencies: buffer-from: ^1.0.0 - inherits: ^2.0.3 - readable-stream: ^2.2.2 - typedarray: ^0.0.6 - checksum: 1ef77032cb4459dcd5187bd710d6fc962b067b64ec6a505810de3d2b8cc0605638551b42f8ec91edf6fcd26141b32ef19ad749239b58fae3aba99187adc32285 - languageName: node - linkType: hard - -"concurrently@npm:^7.0.0": - version: 7.1.0 - resolution: "concurrently@npm:7.1.0" - dependencies: - chalk: ^4.1.0 - date-fns: ^2.16.1 - lodash: ^4.17.21 - rxjs: ^6.6.3 - spawn-command: ^0.0.2-1 - supports-color: ^8.1.0 - tree-kill: ^1.2.2 - yargs: ^16.2.0 - bin: - concurrently: dist/bin/concurrently.js - checksum: 723996afc73af7ea914a03726c75b63be6ce83f0825b0bc54de0568ba89490e217ca88523f251fe1e5c30ee2780572dce830b530ef35e435e64c1f94cfd4e4af - languageName: node - linkType: hard - -"configstore@npm:^5.0.1": - version: 5.0.1 - resolution: "configstore@npm:5.0.1" - dependencies: - dot-prop: ^5.2.0 - graceful-fs: ^4.1.2 - make-dir: ^3.0.0 - unique-string: ^2.0.0 - write-file-atomic: ^3.0.0 - xdg-basedir: ^4.0.0 - checksum: 60ef65d493b63f96e14b11ba7ec072fdbf3d40110a94fb7199d1c287761bdea5c5244e76b2596325f30c1b652213aa75de96ea20afd4a5f82065e61ea090988e - languageName: node - linkType: hard - -"confusing-browser-globals@npm:1.0.10": - version: 1.0.10 - resolution: "confusing-browser-globals@npm:1.0.10" - checksum: 7ccdc44c2ca419cf6576c3e4336106e18d1c5337f547e461342f51aec4a10f96fdfe45414b522be3c7d24ea0b62bf4372cd37768022e4d6161707ffb2c0987e6 + inherits: ^2.0.3 + readable-stream: ^2.2.2 + typedarray: ^0.0.6 + checksum: 1ef77032cb4459dcd5187bd710d6fc962b067b64ec6a505810de3d2b8cc0605638551b42f8ec91edf6fcd26141b32ef19ad749239b58fae3aba99187adc32285 languageName: node linkType: hard @@ -6730,7 +4982,7 @@ __metadata: languageName: node linkType: hard -"console-control-strings@npm:^1.0.0, console-control-strings@npm:^1.1.0": +"console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed @@ -6746,7 +4998,7 @@ __metadata: languageName: node linkType: hard -"content-type@npm:^1.0.4, content-type@npm:~1.0.4": +"content-type@npm:~1.0.4": version: 1.0.4 resolution: "content-type@npm:1.0.4" checksum: 3d93585fda985d1554eca5ebd251994327608d2e200978fdbfba21c0c679914d5faf266d17027de44b34a72c7b0745b18584ecccaa7e1fdfb6a68ac7114f12e0 @@ -6769,10 +5021,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.4.2": - version: 0.4.2 - resolution: "cookie@npm:0.4.2" - checksum: a00833c998bedf8e787b4c342defe5fa419abd96b32f4464f718b91022586b8f1bafbddd499288e75c037642493c83083da426c6a9080d309e3bd90fd11baa9b +"cookie@npm:0.5.0": + version: 0.5.0 + resolution: "cookie@npm:0.5.0" + checksum: 1f4bd2ca5765f8c9689a7e8954183f5332139eb72b6ff783d8947032ec1fdf43109852c178e21a953a30c0dd42257828185be01b49d1eb1a67fd054ca588a180 languageName: node linkType: hard @@ -6784,12 +5036,11 @@ __metadata: linkType: hard "core-js-compat@npm:^3.21.0, core-js-compat@npm:^3.22.1": - version: 3.22.4 - resolution: "core-js-compat@npm:3.22.4" + version: 3.25.1 + resolution: "core-js-compat@npm:3.25.1" dependencies: - browserslist: ^4.20.3 - semver: 7.0.0 - checksum: b58111ba60091ad99be7246ecbb806ff89f504a80f74d1ddd0f219fd51a8b9460db6043bd7fe046acd8bd1b4370c595cfadf70b18fca8520ad8fed52b1f837b5 + browserslist: ^4.21.3 + checksum: 34dbec657adc2f660f4cd701709c9c5e27cbd608211c65df09458f80f3e357b9492ba1c5173e17cca72d889dcc6da01268cadf88fb407cf1726e76d301c6143e languageName: node linkType: hard @@ -6800,7 +5051,7 @@ __metadata: languageName: node linkType: hard -"cors@npm:2.8.5, cors@npm:^2.8.5": +"cors@npm:2.8.5": version: 2.8.5 resolution: "cors@npm:2.8.5" dependencies: @@ -6810,16 +5061,30 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^7.0.1": - version: 7.0.1 - resolution: "cosmiconfig@npm:7.0.1" +"create-hash@npm:^1.1.0, create-hash@npm:^1.1.2, create-hash@npm:^1.2.0": + version: 1.2.0 + resolution: "create-hash@npm:1.2.0" dependencies: - "@types/parse-json": ^4.0.0 - import-fresh: ^3.2.1 - parse-json: ^5.0.0 - path-type: ^4.0.0 - yaml: ^1.10.0 - checksum: 4be63e7117955fd88333d7460e4c466a90f556df6ef34efd59034d2463484e339666c41f02b523d574a797ec61f4a91918c5b89a316db2ea2f834e0d2d09465b + cipher-base: ^1.0.1 + inherits: ^2.0.1 + md5.js: ^1.3.4 + ripemd160: ^2.0.1 + sha.js: ^2.4.0 + checksum: 02a6ae3bb9cd4afee3fabd846c1d8426a0e6b495560a977ba46120c473cb283be6aa1cace76b5f927cf4e499c6146fb798253e48e83d522feba807d6b722eaa9 + languageName: node + linkType: hard + +"create-hmac@npm:^1.1.4, create-hmac@npm:^1.1.7": + version: 1.1.7 + resolution: "create-hmac@npm:1.1.7" + dependencies: + cipher-base: ^1.0.3 + create-hash: ^1.1.0 + inherits: ^2.0.1 + ripemd160: ^2.0.0 + safe-buffer: ^5.0.1 + sha.js: ^2.4.8 + checksum: ba12bb2257b585a0396108c72830e85f882ab659c3320c83584b1037f8ab72415095167ced80dc4ce8e446a8ecc4b2acf36d87befe0707d73b26cf9dc77440ed languageName: node linkType: hard @@ -6839,16 +5104,12 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^6.0.0, cross-spawn@npm:^6.0.5": - version: 6.0.5 - resolution: "cross-spawn@npm:6.0.5" +"cross-fetch@npm:^3.1.4": + version: 3.1.5 + resolution: "cross-fetch@npm:3.1.5" dependencies: - nice-try: ^1.0.4 - path-key: ^2.0.1 - semver: ^5.5.0 - shebang-command: ^1.2.0 - which: ^1.2.9 - checksum: f893bb0d96cd3d5751d04e67145bdddf25f99449531a72e82dcbbd42796bbc8268c1076c6b3ea51d4d455839902804b94bc45dfb37ecbb32ea8e54a6741c3ab9 + node-fetch: 2.6.7 + checksum: f6b8c6ee3ef993ace6277fd789c71b6acf1b504fd5f5c7128df4ef2f125a429e29cd62dc8c127523f04a5f2fa4771ed80e3f3d9695617f441425045f505cf3bb languageName: node linkType: hard @@ -6863,20 +5124,6 @@ __metadata: languageName: node linkType: hard -"crypto-random-string@npm:^2.0.0": - version: 2.0.0 - resolution: "crypto-random-string@npm:2.0.0" - checksum: 0283879f55e7c16fdceacc181f87a0a65c53bc16ffe1d58b9d19a6277adcd71900d02bb2c4843dd55e78c51e30e89b0fec618a7f170ebcc95b33182c28f05fd6 - languageName: node - linkType: hard - -"cssfilter@npm:0.0.10": - version: 0.0.10 - resolution: "cssfilter@npm:0.0.10" - checksum: bc2c52bbb3426c3f2e4832edb6f8573e6cfa65b40b540932762d1e018f0f0157725e2991b77344bbc8266c6bbf4daa2803b0707cfb1bd0877505bf83a68e4b04 - languageName: node - linkType: hard - "cssom@npm:^0.4.4": version: 0.4.4 resolution: "cssom@npm:0.4.4" @@ -6910,13 +5157,6 @@ __metadata: languageName: node linkType: hard -"dargs@npm:^7.0.0": - version: 7.0.0 - resolution: "dargs@npm:7.0.0" - checksum: b8f1e3cba59c42e1f13a114ad4848c3fc1cf7470f633ee9e9f1043762429bc97d91ae31b826fb135eefde203a3fdb20deb0c0a0222ac29d937b8046085d668d1 - languageName: node - linkType: hard - "data-urls@npm:^2.0.0": version: 2.0.0 resolution: "data-urls@npm:2.0.0" @@ -6928,24 +5168,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1": - version: 2.28.0 - resolution: "date-fns@npm:2.28.0" - checksum: a0516b2e4f99b8bffc6cc5193349f185f195398385bdcaf07f17c2c4a24473c99d933eb0018be4142a86a6d46cb0b06be6440ad874f15e795acbedd6fd727a1f - languageName: node - linkType: hard - -"dateformat@npm:^4.5.0": - version: 4.6.3 - resolution: "dateformat@npm:4.6.3" - checksum: c3aa0617c0a5b30595122bc8d1bee6276a9221e4d392087b41cbbdf175d9662ae0e50d0d6dcdf45caeac5153c4b5b0844265f8cd2b2245451e3da19e39e3b65d - languageName: node - linkType: hard - "dayjs@npm:^1.10.7": - version: 1.11.2 - resolution: "dayjs@npm:1.11.2" - checksum: 78f8bd04a9e5f5554aa06eacda65a7d59e162d39f621a46fd34fb3b51367c3662426d86b4e2f4ac535f81e0c4d5af3e8a83b37e672412eb556267d726c61f8f3 + version: 1.11.5 + resolution: "dayjs@npm:1.11.5" + checksum: e3bbaa7b4883b31be4bf75a181f1447fbb19800c29b332852125aab96baeff3ac232dcba8b88c4ea17d3b636c99dac5fb9d1af4bb6ae26615698bbc4a852dffb languageName: node linkType: hard @@ -6958,7 +5184,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:>=3 <5, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -6979,26 +5205,10 @@ __metadata: languageName: node linkType: hard -"debuglog@npm:^1.0.1": - version: 1.0.1 - resolution: "debuglog@npm:1.0.1" - checksum: 970679f2eb7a73867e04d45b52583e7ec6dee1f33c058e9147702e72a665a9647f9c3d6e7c2f66f6bf18510b23eb5ded1b617e48ac1db23603809c5ddbbb9763 - languageName: node - linkType: hard - "decimal.js@npm:^10.2.1": - version: 10.3.1 - resolution: "decimal.js@npm:10.3.1" - checksum: 0351ac9f05fe050f23227aa6a4573bee2d58fa7378fcf28d969a8c789525032effb488a90320fd3fe86a66e17b4bc507d811b15eada5b7f0e7ec5d2af4c24a59 - languageName: node - linkType: hard - -"decompress-response@npm:^3.3.0": - version: 3.3.0 - resolution: "decompress-response@npm:3.3.0" - dependencies: - mimic-response: ^1.0.0 - checksum: 952552ac3bd7de2fc18015086b09468645c9638d98a551305e485230ada278c039c91116e946d07894b39ee53c0f0d5b6473f25a224029344354513b412d7380 + version: 10.4.0 + resolution: "decimal.js@npm:10.4.0" + checksum: 98702d9d817a9e5b3767ea6580e7f3b35544b9454e463a5dd5d3232131470f39067d02864c45cab009eb1200bc162cd26a33d34c622cd79e4657a3e25e95fb4e languageName: node linkType: hard @@ -7009,13 +5219,6 @@ __metadata: languageName: node linkType: hard -"deep-extend@npm:^0.6.0": - version: 0.6.0 - resolution: "deep-extend@npm:0.6.0" - checksum: 7be7e5a8d468d6b10e6a67c3de828f55001b6eb515d014f7aeb9066ce36bd5717161eb47d6a0f7bed8a9083935b465bc163ee2581c8b128d29bf61092fdf57a7 - languageName: node - linkType: hard - "deep-is@npm:^0.1.3, deep-is@npm:~0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -7039,13 +5242,6 @@ __metadata: languageName: node linkType: hard -"defer-to-connect@npm:^1.0.1": - version: 1.1.3 - resolution: "defer-to-connect@npm:1.1.3" - checksum: 9491b301dcfa04956f989481ba7a43c2231044206269eb4ab64a52d6639ee15b1252262a789eb4239fb46ab63e44d4e408641bae8e0793d640aee55398cb3930 - languageName: node - linkType: hard - "deferred-leveldown@npm:~5.3.0": version: 5.3.0 resolution: "deferred-leveldown@npm:5.3.0" @@ -7087,14 +5283,14 @@ __metadata: languageName: node linkType: hard -"depd@npm:^1.1.2, depd@npm:~1.1.2": +"depd@npm:^1.1.2": version: 1.1.2 resolution: "depd@npm:1.1.2" checksum: 6b406620d269619852885ce15965272b829df6f409724415e0002c8632ab6a8c0a08ec1f0bd2add05dc7bd7507606f7e2cc034fa24224ab829580040b835ecd9 languageName: node linkType: hard -"deprecation@npm:^2.0.0, deprecation@npm:^2.3.1": +"deprecation@npm:^2.0.0": version: 2.3.1 resolution: "deprecation@npm:2.3.1" checksum: f56a05e182c2c195071385455956b0c4106fe14e36245b00c689ceef8e8ab639235176a96977ba7c74afb173317fac2e0ec6ec7a1c6d1e6eaa401c586c714132 @@ -7108,20 +5304,6 @@ __metadata: languageName: node linkType: hard -"destroy@npm:~1.0.4": - version: 1.0.4 - resolution: "destroy@npm:1.0.4" - checksum: da9ab4961dc61677c709da0c25ef01733042614453924d65636a7db37308fef8a24cd1e07172e61173d471ca175371295fbc984b0af5b2b4ff47cd57bd784c03 - languageName: node - linkType: hard - -"detect-indent@npm:^6.0.0": - version: 6.1.0 - resolution: "detect-indent@npm:6.1.0" - checksum: ab953a73c72dbd4e8fc68e4ed4bfd92c97eb6c43734af3900add963fd3a9316f3bc0578b018b24198d4c31a358571eff5f0656e81a1f3b9ad5c547d58b2d093d - languageName: node - linkType: hard - "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -7152,26 +5334,6 @@ __metadata: languageName: node linkType: hard -"dezalgo@npm:^1.0.0": - version: 1.0.4 - resolution: "dezalgo@npm:1.0.4" - dependencies: - asap: ^2.0.0 - wrappy: 1 - checksum: 895389c6aead740d2ab5da4d3466d20fa30f738010a4d3f4dcccc9fc645ca31c9d10b7e1804ae489b1eb02c7986f9f1f34ba132d409b043082a86d9a4e745624 - languageName: node - linkType: hard - -"dicer@npm:0.2.5": - version: 0.2.5 - resolution: "dicer@npm:0.2.5" - dependencies: - readable-stream: 1.1.x - streamsearch: 0.1.2 - checksum: a6f0ce9ac5099c7ffeaec7398d711eea1dd803eb99036d0f05342e9ed46a4235a5ed0ea01ad5d6c785fdb0aae6d61d2722e6e64f9fabdfe39885f7f52eb635ee - languageName: node - linkType: hard - "diff-sequences@npm:^27.5.1": version: 27.5.1 resolution: "diff-sequences@npm:27.5.1" @@ -7186,13 +5348,6 @@ __metadata: languageName: node linkType: hard -"diff@npm:^5.0.0": - version: 5.0.0 - resolution: "diff@npm:5.0.0" - checksum: f19fe29284b633afdb2725c2a8bb7d25761ea54d321d8e67987ac851c5294be4afeab532bd84531e02583a3fe7f4014aa314a3eda84f5590e7a9e6b371ef3b46 - languageName: node - linkType: hard - "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -7240,15 +5395,6 @@ __metadata: languageName: node linkType: hard -"dot-prop@npm:^5.2.0": - version: 5.3.0 - resolution: "dot-prop@npm:5.3.0" - dependencies: - is-obj: ^2.0.0 - checksum: d5775790093c234ef4bfd5fbe40884ff7e6c87573e5339432870616331189f7f5d86575c5b5af2dcf0f61172990f4f734d07844b1f23482fff09e3c4bead05ea - languageName: node - linkType: hard - "dotenv@npm:^15.0.1": version: 15.0.1 resolution: "dotenv@npm:15.0.1" @@ -7263,13 +5409,6 @@ __metadata: languageName: node linkType: hard -"duplexer3@npm:^0.1.4": - version: 0.1.4 - resolution: "duplexer3@npm:0.1.4" - checksum: c2fd6969314607d23439c583699aaa43c4100d66b3e161df55dccd731acc57d5c81a64bb4f250805fbe434ddb1d2623fee2386fb890f5886ca1298690ec53415 - languageName: node - linkType: hard - "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -7277,15 +5416,6 @@ __metadata: languageName: node linkType: hard -"ecdsa-sig-formatter@npm:1.0.11": - version: 1.0.11 - resolution: "ecdsa-sig-formatter@npm:1.0.11" - dependencies: - safe-buffer: ^5.0.1 - checksum: 207f9ab1c2669b8e65540bce29506134613dd5f122cccf1e6a560f4d63f2732d427d938f8481df175505aad94583bcb32c688737bb39a6df0625f903d6d93c03 - languageName: node - linkType: hard - "ed2curve@npm:^0.3.0": version: 0.3.0 resolution: "ed2curve@npm:0.3.0" @@ -7302,17 +5432,6 @@ __metadata: languageName: node linkType: hard -"ejs@npm:^3.1.6": - version: 3.1.7 - resolution: "ejs@npm:3.1.7" - dependencies: - jake: ^10.8.5 - bin: - ejs: bin/cli.js - checksum: fe40764af39955ce8f8b116716fc8b911959946698edb49ecab85df597746c07aa65d5b74ead28a1e2ffa75b0f92d9bedd752f1c29437da6137b3518271e988c - languageName: node - linkType: hard - "electron-fetch@npm:^1.7.2": version: 1.8.0 resolution: "electron-fetch@npm:1.8.0" @@ -7322,10 +5441,25 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.118": - version: 1.4.137 - resolution: "electron-to-chromium@npm:1.4.137" - checksum: 639d7b94906efafcf363519c3698eecc44be46755a6a5cdc9088954329978866cc93fbd57e08b97290599b68d5226243d21de9fa50be416b8a5d3fa8fd42c3a0 +"electron-to-chromium@npm:^1.4.202": + version: 1.4.249 + resolution: "electron-to-chromium@npm:1.4.249" + checksum: 830a35a157af7ae226f1528d727e369bb13f53bc7a4edefdf718651ace09d7d7b4bd7b70d33b5018b8eff6cf99ee58409b6c4140cd6d56350c1966f280ac5c93 + languageName: node + linkType: hard + +"elliptic@npm:6.5.4, elliptic@npm:^6.5.4": + version: 6.5.4 + resolution: "elliptic@npm:6.5.4" + dependencies: + bn.js: ^4.11.9 + brorand: ^1.1.0 + hash.js: ^1.0.0 + hmac-drbg: ^1.0.1 + inherits: ^2.0.4 + minimalistic-assert: ^1.0.1 + minimalistic-crypto-utils: ^1.0.1 + checksum: d56d21fd04e97869f7ffcc92e18903b9f67f2d4637a23c860492fbbff5a3155fd9ca0184ce0c865dd6eb2487d234ce9551335c021c376cd2d3b7cb749c7d10f4 languageName: node linkType: hard @@ -7350,13 +5484,6 @@ __metadata: languageName: node linkType: hard -"emojis-list@npm:^3.0.0": - version: 3.0.0 - resolution: "emojis-list@npm:3.0.0" - checksum: ddaaa02542e1e9436c03970eeed445f4ed29a5337dfba0fe0c38dfdd2af5da2429c2a0821304e8a8d1cadf27fdd5b22ff793571fa803ae16852a6975c65e8e70 - languageName: node - linkType: hard - "encodeurl@npm:~1.0.2": version: 1.0.2 resolution: "encodeurl@npm:1.0.2" @@ -7376,7 +5503,7 @@ __metadata: languageName: node linkType: hard -"encoding@npm:^0.1.12, encoding@npm:^0.1.13": +"encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" dependencies: @@ -7385,7 +5512,7 @@ __metadata: languageName: node linkType: hard -"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": +"end-of-stream@npm:^1.1.0": version: 1.4.4 resolution: "end-of-stream@npm:1.4.4" dependencies: @@ -7394,13 +5521,13 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.7.0, enhanced-resolve@npm:^5.9.2": - version: 5.9.3 - resolution: "enhanced-resolve@npm:5.9.3" +"enhanced-resolve@npm:^5.0.0": + version: 5.10.0 + resolution: "enhanced-resolve@npm:5.10.0" dependencies: graceful-fs: ^4.2.4 tapable: ^2.2.0 - checksum: 64c2dbbdd608d1a4df93b6e60786c603a1faf3b2e66dfd051d62cf4cfaeeb5e800166183685587208d62e9f7afff3f78f3d5978e32cd80125ba0c83b59a79d78 + checksum: 0bb9830704db271610f900e8d79d70a740ea16f251263362b0c91af545576d09fe50103496606c1300a05e588372d6f9780a9bc2e30ce8ef9b827ec8f44687ff languageName: node linkType: hard @@ -7445,22 +5572,15 @@ __metadata: languageName: node linkType: hard -"error@npm:^10.4.0": - version: 10.4.0 - resolution: "error@npm:10.4.0" - checksum: 26c9ecb7af8de775c7f8c143aa2557cf42bf6dddbef1d68db8ad3501a29af872bea53ca4e2af20ac464bf7475a2827bd37898846fea27692c3ce66500a3e3fc2 - languageName: node - linkType: hard - "es-abstract@npm:^1.19.0, es-abstract@npm:^1.19.1, es-abstract@npm:^1.19.2, es-abstract@npm:^1.19.5": - version: 1.20.0 - resolution: "es-abstract@npm:1.20.0" + version: 1.20.2 + resolution: "es-abstract@npm:1.20.2" dependencies: call-bind: ^1.0.2 es-to-primitive: ^1.2.1 function-bind: ^1.1.1 function.prototype.name: ^1.1.5 - get-intrinsic: ^1.1.1 + get-intrinsic: ^1.1.2 get-symbol-description: ^1.0.0 has: ^1.0.3 has-property-descriptors: ^1.0.0 @@ -7472,21 +5592,14 @@ __metadata: is-shared-array-buffer: ^1.0.2 is-string: ^1.0.7 is-weakref: ^1.0.2 - object-inspect: ^1.12.0 + object-inspect: ^1.12.2 object-keys: ^1.1.1 - object.assign: ^4.1.2 - regexp.prototype.flags: ^1.4.1 + object.assign: ^4.1.4 + regexp.prototype.flags: ^1.4.3 string.prototype.trimend: ^1.0.5 string.prototype.trimstart: ^1.0.5 unbox-primitive: ^1.0.2 - checksum: c9cc85a7aa0e3cdef740293b4b90892d6954e4e834d0888e3071cc9544bce0ae12923f5026a1970e0ac75a254d311d53e72ba4675647b81e7ca05acb703004e6 - languageName: node - linkType: hard - -"es-module-lexer@npm:^0.9.0": - version: 0.9.3 - resolution: "es-module-lexer@npm:0.9.3" - checksum: 84bbab23c396281db2c906c766af58b1ae2a1a2599844a504df10b9e8dc77ec800b3211fdaa133ff700f5703d791198807bba25d9667392d27a5e9feda344da8 + checksum: ab893dd1f849250f5a2da82656b4e21b511f76429b25a4aea5c8b2a3007ff01cb8e112987d0dd7693b9ad9e6399f8f7be133285d6196a5ebd1b13a4ee2258f70 languageName: node linkType: hard @@ -7511,13 +5624,13 @@ __metadata: linkType: hard "es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.50": - version: 0.10.61 - resolution: "es5-ext@npm:0.10.61" + version: 0.10.62 + resolution: "es5-ext@npm:0.10.62" dependencies: es6-iterator: ^2.0.3 es6-symbol: ^3.1.3 next-tick: ^1.1.0 - checksum: 2f2034e91e77fe247d94f0fd13a94bcf113273b7cc4650794d6795e377267ffb2425d3a891bd8c4d9c8b990e16e17dd7c28f12dbd3fa4b0909d0874892f491bf + checksum: 25f42f6068cfc6e393cf670bc5bba249132c5f5ec2dd0ed6e200e6274aca2fed8e9aec8a31c76031744c78ca283c57f0b41c7e737804c6328c7b8d3fbcba7983 languageName: node linkType: hard @@ -7532,6 +5645,13 @@ __metadata: languageName: node linkType: hard +"es6-promise@npm:^4.2.8": + version: 4.2.8 + resolution: "es6-promise@npm:4.2.8" + checksum: 95614a88873611cb9165a85d36afa7268af5c03a378b35ca7bda9508e1d4f1f6f19a788d4bc755b3fd37c8ebba40782018e02034564ff24c9d6fa37e959ad57d + languageName: node + linkType: hard + "es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3": version: 3.1.3 resolution: "es6-symbol@npm:3.1.3" @@ -7549,13 +5669,6 @@ __metadata: languageName: node linkType: hard -"escape-goat@npm:^2.0.0": - version: 2.1.1 - resolution: "escape-goat@npm:2.1.1" - checksum: ce05c70c20dd7007b60d2d644b625da5412325fdb57acf671ba06cb2ab3cd6789e2087026921a05b665b0a03fadee2955e7fc0b9a67da15a6551a980b260eba7 - languageName: node - linkType: hard - "escape-html@npm:~1.0.3": version: 1.0.3 resolution: "escape-html@npm:1.0.3" @@ -7563,14 +5676,7 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": - version: 4.0.0 - resolution: "escape-string-regexp@npm:4.0.0" - checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 - languageName: node - linkType: hard - -"escape-string-regexp@npm:^1.0.2, escape-string-regexp@npm:^1.0.5": +"escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 @@ -7584,6 +5690,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^4.0.0": + version: 4.0.0 + resolution: "escape-string-regexp@npm:4.0.0" + checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 + languageName: node + linkType: hard + "escodegen@npm:^2.0.0": version: 2.0.0 resolution: "escodegen@npm:2.0.0" @@ -7603,31 +5716,6 @@ __metadata: languageName: node linkType: hard -"eslint-config-oclif-typescript@npm:^1.0.2": - version: 1.0.2 - resolution: "eslint-config-oclif-typescript@npm:1.0.2" - dependencies: - "@typescript-eslint/eslint-plugin": ^4.31.2 - "@typescript-eslint/parser": ^4.31.2 - eslint-config-xo-space: ^0.29.0 - eslint-plugin-mocha: ^9.0.0 - eslint-plugin-node: ^11.1.0 - checksum: 146ca81b8d41fa96f85b9b45726d8dff09da7b773dc9282fdf543bac7e306b73f1dcd51adedc64f8f0470947c01b4253f3212f3ae32fc2a64292c9864717551c - languageName: node - linkType: hard - -"eslint-config-oclif@npm:^4.0.0": - version: 4.0.0 - resolution: "eslint-config-oclif@npm:4.0.0" - dependencies: - eslint-config-xo-space: ^0.27.0 - eslint-plugin-mocha: ^9.0.0 - eslint-plugin-node: ^11.1.0 - eslint-plugin-unicorn: ^36.0.0 - checksum: 271f5309262f474b4542e93144572c6a5c9a1b75adda34939aeb2138286ea43c60fd12760b016d7dcd4dc6bde1c9c24d34e61c3b138f8e47cf83534bd70b7394 - languageName: node - linkType: hard - "eslint-config-prettier@npm:^8.3.0": version: 8.5.0 resolution: "eslint-config-prettier@npm:8.5.0" @@ -7639,50 +5727,6 @@ __metadata: languageName: node linkType: hard -"eslint-config-xo-space@npm:^0.27.0": - version: 0.27.0 - resolution: "eslint-config-xo-space@npm:0.27.0" - dependencies: - eslint-config-xo: ^0.35.0 - peerDependencies: - eslint: ">=7.20.0" - checksum: 5ea4a7abd65835748a19134f75ce1c874afc006da6a17d535b658d9f07cef5f520c1587c4789045cd7ee5c19484ba1d7b4880d77b286564961f6b25400152602 - languageName: node - linkType: hard - -"eslint-config-xo-space@npm:^0.29.0": - version: 0.29.0 - resolution: "eslint-config-xo-space@npm:0.29.0" - dependencies: - eslint-config-xo: ^0.38.0 - peerDependencies: - eslint: ">=7.32.0" - checksum: 16aa57e65732b56cd14ab87d01c8eda705f2e980a51a9aefbdd38cc51551a81308c9e25ae28d336936f4db3e0ca98ed0f4a0cbb031805e1277f1648ae8981ce1 - languageName: node - linkType: hard - -"eslint-config-xo@npm:^0.35.0": - version: 0.35.0 - resolution: "eslint-config-xo@npm:0.35.0" - dependencies: - confusing-browser-globals: 1.0.10 - peerDependencies: - eslint: ">=7.20.0" - checksum: 360d71c474c4968b334a59a9b8be26d60713baa3fc69f154283299ed27dc393418dd0178d944eebc4cb6d41d1ab823f6646bd864d2750cd8d87fee0b50ebc249 - languageName: node - linkType: hard - -"eslint-config-xo@npm:^0.38.0": - version: 0.38.0 - resolution: "eslint-config-xo@npm:0.38.0" - dependencies: - confusing-browser-globals: 1.0.10 - peerDependencies: - eslint: ">=7.20.0" - checksum: 8934892436180f2328b6695efd2e575935527c257396718fb6a4670d6f625d562b39f16fee9fee618a746e481786b428ce3d2623e68b6e00dfceefecd30c1cdd - languageName: node - linkType: hard - "eslint-import-resolver-node@npm:^0.3.6": version: 0.3.6 resolution: "eslint-import-resolver-node@npm:0.3.6" @@ -7694,24 +5738,14 @@ __metadata: linkType: hard "eslint-module-utils@npm:^2.7.3": - version: 2.7.3 - resolution: "eslint-module-utils@npm:2.7.3" + version: 2.7.4 + resolution: "eslint-module-utils@npm:2.7.4" dependencies: debug: ^3.2.7 - find-up: ^2.1.0 - checksum: 77048263f309167a1e6a1e1b896bfb5ddd1d3859b2e2abbd9c32c432aee13d610d46e6820b1ca81b37fba437cf423a404bc6649be64ace9148a3062d1886a678 - languageName: node - linkType: hard - -"eslint-plugin-es@npm:^3.0.0": - version: 3.0.1 - resolution: "eslint-plugin-es@npm:3.0.1" - dependencies: - eslint-utils: ^2.0.0 - regexpp: ^3.0.0 - peerDependencies: - eslint: ">=4.19.1" - checksum: e57592c52301ee8ddc296ae44216df007f3a870bcb3be8d1fbdb909a1d3a3efe3fa3785de02066f9eba1d6466b722d3eb3cc3f8b75b3cf6a1cbded31ac6298e4 + peerDependenciesMeta: + eslint: + optional: true + checksum: 5da13645daff145a5c922896b258f8bba560722c3767254e458d894ff5fbb505d6dfd945bffa932a5b0ae06714da2379bd41011c4c20d2d59cc83e23895360f7 languageName: node linkType: hard @@ -7747,37 +5781,9 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-mocha@npm:^9.0.0": - version: 9.0.0 - resolution: "eslint-plugin-mocha@npm:9.0.0" - dependencies: - eslint-utils: ^3.0.0 - ramda: ^0.27.1 - peerDependencies: - eslint: ">=7.0.0" - checksum: f33143815a998ed5057ca9b2e8f0dd2ca062dc311a046490a832ab84f9de0ecf1b933276bd9db3c84b34b315ba07ac68d586f468f98d424bbeb44e1505ba94e8 - languageName: node - linkType: hard - -"eslint-plugin-node@npm:^11.1.0": - version: 11.1.0 - resolution: "eslint-plugin-node@npm:11.1.0" - dependencies: - eslint-plugin-es: ^3.0.0 - eslint-utils: ^2.0.0 - ignore: ^5.1.1 - minimatch: ^3.0.4 - resolve: ^1.10.1 - semver: ^6.1.0 - peerDependencies: - eslint: ">=5.16.0" - checksum: 5804c4f8a6e721f183ef31d46fbe3b4e1265832f352810060e0502aeac7de034df83352fc88643b19641bb2163f2587f1bd4119aff0fd21e8d98c57c450e013b - languageName: node - linkType: hard - "eslint-plugin-prettier@npm:^4.0.0": - version: 4.0.0 - resolution: "eslint-plugin-prettier@npm:4.0.0" + version: 4.2.1 + resolution: "eslint-plugin-prettier@npm:4.2.1" dependencies: prettier-linter-helpers: ^1.0.0 peerDependencies: @@ -7786,7 +5792,7 @@ __metadata: peerDependenciesMeta: eslint-config-prettier: optional: true - checksum: 03d69177a3c21fa2229c7e427ce604429f0b20ab7f411e2e824912f572a207c7f5a41fd1f0a95b9b8afe121e291c1b1f1dc1d44c7aad4b0837487f9c19f5210d + checksum: b9e839d2334ad8ec7a5589c5cb0f219bded260839a857d7a486997f9870e95106aa59b8756ff3f37202085ebab658de382b0267cae44c3a7f0eb0bcc03a4f6d6 languageName: node linkType: hard @@ -7801,29 +5807,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-unicorn@npm:^36.0.0": - version: 36.0.0 - resolution: "eslint-plugin-unicorn@npm:36.0.0" - dependencies: - "@babel/helper-validator-identifier": ^7.14.9 - ci-info: ^3.2.0 - clean-regexp: ^1.0.0 - eslint-template-visitor: ^2.3.2 - eslint-utils: ^3.0.0 - is-builtin-module: ^3.1.0 - lodash: ^4.17.21 - pluralize: ^8.0.0 - read-pkg-up: ^7.0.1 - regexp-tree: ^0.1.23 - safe-regex: ^2.1.1 - semver: ^7.3.5 - peerDependencies: - eslint: ">=7.32.0" - checksum: 8c1051036b65509228639bdf7eafaa034982985071a817a3b275f58b68ad525e8741eca2ba0a2b56cd8b5e82b9a8911bd1f65456659cdef267e9e230d2edd1e3 - languageName: node - linkType: hard - -"eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": +"eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" dependencies: @@ -7843,30 +5827,6 @@ __metadata: languageName: node linkType: hard -"eslint-template-visitor@npm:^2.3.2": - version: 2.3.2 - resolution: "eslint-template-visitor@npm:2.3.2" - dependencies: - "@babel/core": ^7.12.16 - "@babel/eslint-parser": ^7.12.16 - eslint-visitor-keys: ^2.0.0 - esquery: ^1.3.1 - multimap: ^1.1.0 - peerDependencies: - eslint: ">=7.0.0" - checksum: 83da75f46251d0f3c72367db23993194b105e8dde96f70d1fc782ece5ed7f8d299c4d7f9330fd1f2774458bed90c21c445984f659efc11c4bb49491a8d934e3e - languageName: node - linkType: hard - -"eslint-utils@npm:^2.0.0": - version: 2.1.0 - resolution: "eslint-utils@npm:2.1.0" - dependencies: - eslint-visitor-keys: ^1.1.0 - checksum: 27500938f348da42100d9e6ad03ae29b3de19ba757ae1a7f4a087bdcf83ac60949bbb54286492ca61fac1f5f3ac8692dd21537ce6214240bf95ad0122f24d71d - languageName: node - linkType: hard - "eslint-utils@npm:^3.0.0": version: 3.0.0 resolution: "eslint-utils@npm:3.0.0" @@ -7878,21 +5838,14 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^1.1.0": - version: 1.3.0 - resolution: "eslint-visitor-keys@npm:1.3.0" - checksum: 37a19b712f42f4c9027e8ba98c2b06031c17e0c0a4c696cd429bd9ee04eb43889c446f2cd545e1ff51bef9593fcec94ecd2c2ef89129fcbbf3adadbef520376a - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^2.0.0, eslint-visitor-keys@npm:^2.1.0": +"eslint-visitor-keys@npm:^2.0.0": version: 2.1.0 resolution: "eslint-visitor-keys@npm:2.1.0" checksum: e3081d7dd2611a35f0388bbdc2f5da60b3a3c5b8b6e928daffff7391146b434d691577aa95064c8b7faad0b8a680266bcda0a42439c18c717b80e6718d7e267d languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.0.0, eslint-visitor-keys@npm:^3.3.0": +"eslint-visitor-keys@npm:^3.3.0": version: 3.3.0 resolution: "eslint-visitor-keys@npm:3.3.0" checksum: d59e68a7c5a6d0146526b0eec16ce87fbf97fe46b8281e0d41384224375c4e52f5ffb9e16d48f4ea50785cde93f766b0c898e31ab89978d88b0e1720fbfb7808 @@ -7900,11 +5853,13 @@ __metadata: linkType: hard "eslint@npm:^8.8.0": - version: 8.15.0 - resolution: "eslint@npm:8.15.0" + version: 8.23.1 + resolution: "eslint@npm:8.23.1" dependencies: - "@eslint/eslintrc": ^1.2.3 - "@humanwhocodes/config-array": ^0.9.2 + "@eslint/eslintrc": ^1.3.2 + "@humanwhocodes/config-array": ^0.10.4 + "@humanwhocodes/gitignore-to-minimatch": ^1.0.2 + "@humanwhocodes/module-importer": ^1.0.1 ajv: ^6.10.0 chalk: ^4.0.0 cross-spawn: ^7.0.2 @@ -7914,18 +5869,21 @@ __metadata: eslint-scope: ^7.1.1 eslint-utils: ^3.0.0 eslint-visitor-keys: ^3.3.0 - espree: ^9.3.2 + espree: ^9.4.0 esquery: ^1.4.0 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 file-entry-cache: ^6.0.1 - functional-red-black-tree: ^1.0.1 + find-up: ^5.0.0 glob-parent: ^6.0.1 - globals: ^13.6.0 + globals: ^13.15.0 + globby: ^11.1.0 + grapheme-splitter: ^1.0.4 ignore: ^5.2.0 import-fresh: ^3.0.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 + js-sdsl: ^4.1.4 js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 levn: ^0.4.1 @@ -7937,25 +5895,24 @@ __metadata: strip-ansi: ^6.0.1 strip-json-comments: ^3.1.0 text-table: ^0.2.0 - v8-compile-cache: ^2.0.3 bin: eslint: bin/eslint.js - checksum: d8896393832e154e1381a21041cfe4d12a73a76fac26ea27cabbc0e5fdac87918ad651f07f804ef6faacd3868572de3c1ec5d96edf5502bc999eff0c423638f7 + checksum: a727e15492786a03b438bcf021db49f715680679846a7b8d79b98ad34576f2a570404ffe882d3c3e26f6359bff7277ef11fae5614bfe8629adb653f20d018c71 languageName: node linkType: hard -"espree@npm:^9.3.2": - version: 9.3.2 - resolution: "espree@npm:9.3.2" +"espree@npm:^9.4.0": + version: 9.4.0 + resolution: "espree@npm:9.4.0" dependencies: - acorn: ^8.7.1 + acorn: ^8.8.0 acorn-jsx: ^5.3.2 eslint-visitor-keys: ^3.3.0 - checksum: 9a790d6779847051e87f70d720a0f6981899a722419e80c92ab6dee01e1ab83b8ce52d11b4dc96c2c490182efb5a4c138b8b0d569205bfe1cd4629e658e58c30 + checksum: 2e3020dde67892d2ba3632413b44d0dc31d92c29ce72267d7ec24216a562f0a6494d3696e2fa39a3ec8c0e0088d773947ab2925fbb716801a11eb8dd313ac89c languageName: node linkType: hard -"esprima@npm:^4.0.0, esprima@npm:^4.0.1, esprima@npm:~4.0.0": +"esprima@npm:^4.0.0, esprima@npm:^4.0.1": version: 4.0.1 resolution: "esprima@npm:4.0.1" bin: @@ -7965,7 +5922,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.3.1, esquery@npm:^1.4.0": +"esquery@npm:^1.4.0": version: 1.4.0 resolution: "esquery@npm:1.4.0" dependencies: @@ -8011,6 +5968,99 @@ __metadata: languageName: node linkType: hard +"ethereum-bloom-filters@npm:^1.0.6": + version: 1.0.10 + resolution: "ethereum-bloom-filters@npm:1.0.10" + dependencies: + js-sha3: ^0.8.0 + checksum: 4019cc6f9274ae271a52959194a72f6e9b013366f168f922dc3b349319faf7426bf1010125ee0676b4f75714fe4a440edd4e7e62342c121a046409f4cd4c0af9 + languageName: node + linkType: hard + +"ethereum-cryptography@npm:^0.1.3": + version: 0.1.3 + resolution: "ethereum-cryptography@npm:0.1.3" + dependencies: + "@types/pbkdf2": ^3.0.0 + "@types/secp256k1": ^4.0.1 + blakejs: ^1.1.0 + browserify-aes: ^1.2.0 + bs58check: ^2.1.2 + create-hash: ^1.2.0 + create-hmac: ^1.1.7 + hash.js: ^1.1.7 + keccak: ^3.0.0 + pbkdf2: ^3.0.17 + randombytes: ^2.1.0 + safe-buffer: ^5.1.2 + scrypt-js: ^3.0.0 + secp256k1: ^4.0.1 + setimmediate: ^1.0.5 + checksum: 54bae7a4a96bd81398cdc35c91cfcc74339f71a95ed1b5b694663782e69e8e3afd21357de3b8bac9ff4877fd6f043601e200a7ad9133d94be6fd7d898ee0a449 + languageName: node + linkType: hard + +"ethereumjs-util@npm:^7.1.0": + version: 7.1.5 + resolution: "ethereumjs-util@npm:7.1.5" + dependencies: + "@types/bn.js": ^5.1.0 + bn.js: ^5.1.2 + create-hash: ^1.1.2 + ethereum-cryptography: ^0.1.3 + rlp: ^2.2.4 + checksum: 27a3c79d6e06b2df34b80d478ce465b371c8458b58f5afc14d91c8564c13363ad336e6e83f57eb0bd719fde94d10ee5697ceef78b5aa932087150c5287b286d1 + languageName: node + linkType: hard + +"ethers@npm:^5.6.1, ethers@npm:^5.7.1": + version: 5.7.1 + resolution: "ethers@npm:5.7.1" + dependencies: + "@ethersproject/abi": 5.7.0 + "@ethersproject/abstract-provider": 5.7.0 + "@ethersproject/abstract-signer": 5.7.0 + "@ethersproject/address": 5.7.0 + "@ethersproject/base64": 5.7.0 + "@ethersproject/basex": 5.7.0 + "@ethersproject/bignumber": 5.7.0 + "@ethersproject/bytes": 5.7.0 + "@ethersproject/constants": 5.7.0 + "@ethersproject/contracts": 5.7.0 + "@ethersproject/hash": 5.7.0 + "@ethersproject/hdnode": 5.7.0 + "@ethersproject/json-wallets": 5.7.0 + "@ethersproject/keccak256": 5.7.0 + "@ethersproject/logger": 5.7.0 + "@ethersproject/networks": 5.7.1 + "@ethersproject/pbkdf2": 5.7.0 + "@ethersproject/properties": 5.7.0 + "@ethersproject/providers": 5.7.1 + "@ethersproject/random": 5.7.0 + "@ethersproject/rlp": 5.7.0 + "@ethersproject/sha2": 5.7.0 + "@ethersproject/signing-key": 5.7.0 + "@ethersproject/solidity": 5.7.0 + "@ethersproject/strings": 5.7.0 + "@ethersproject/transactions": 5.7.0 + "@ethersproject/units": 5.7.0 + "@ethersproject/wallet": 5.7.0 + "@ethersproject/web": 5.7.1 + "@ethersproject/wordlists": 5.7.0 + checksum: 7a61b7a105c41f9fec327887414f1950dc27bfa2d12fe29a068419eaaa3d415e6a12275685c87f700abd88c3b639ae79c09a2f90edea1e69edc8126cb0dce708 + languageName: node + linkType: hard + +"ethjs-unit@npm:0.1.6": + version: 0.1.6 + resolution: "ethjs-unit@npm:0.1.6" + dependencies: + bn.js: 4.11.6 + number-to-bn: 1.7.0 + checksum: df6b4752ff7461a59a20219f4b1684c631ea601241c39660e3f6c6bd63c950189723841c22b3c6c0ebeb3c9fc99e0e803e3c613101206132603705fcbcf4def5 + languageName: node + linkType: hard + "event-target-shim@npm:^5.0.0": version: 5.0.1 resolution: "event-target-shim@npm:5.0.1" @@ -8026,56 +6076,38 @@ __metadata: linkType: hard "eventemitter2@npm:^6.4.5": - version: 6.4.5 - resolution: "eventemitter2@npm:6.4.5" - checksum: 84504f9cf0cc30205cdd46783fe9df3733435e5097f13070b678023110b5ef07847651808ae280cd94c42cd5976880211c7a40321a8ff8fa56f7c5f9c5c11960 + version: 6.4.9 + resolution: "eventemitter2@npm:6.4.9" + checksum: be59577c1e1c35509c7ba0e2624335c35bbcfd9485b8a977384c6cc6759341ea1a98d3cb9dbaa5cea4fff9b687e504504e3f9c2cc1674cf3bd8a43a7c74ea3eb languageName: node linkType: hard -"eventemitter3@npm:^3.1.0": - version: 3.1.2 - resolution: "eventemitter3@npm:3.1.2" - checksum: 81e4e82b8418f5cfd986d2b4a2fa5397ac4eb8134e09bcb47005545e22fdf8e9e61d5c053d34651112245aae411bdfe6d0ad5511da0400743fef5fc38bfcfbe3 +"eventemitter3@npm:4.0.4": + version: 4.0.4 + resolution: "eventemitter3@npm:4.0.4" + checksum: 7afb1cd851d19898bc99cc55ca894fe18cb1f8a07b0758652830a09bd6f36082879a25345be6219b81d74764140688b1a8fa75bcd1073d96b9a6661e444bc2ea languageName: node linkType: hard -"eventemitter3@npm:^4.0.4, eventemitter3@npm:^4.0.7": +"eventemitter3@npm:^4.0.7": version: 4.0.7 resolution: "eventemitter3@npm:4.0.7" checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 languageName: node linkType: hard -"events@npm:1.1.1": - version: 1.1.1 - resolution: "events@npm:1.1.1" - checksum: 40431eb005cc4c57861b93d44c2981a49e7feb99df84cf551baed299ceea4444edf7744733f6a6667e942af687359b1f4a87ec1ec4f21d5127dac48a782039b9 - languageName: node - linkType: hard - -"events@npm:^3.2.0": - version: 3.3.0 - resolution: "events@npm:3.3.0" - checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 - languageName: node - linkType: hard - -"execa@npm:^0.10.0": - version: 0.10.0 - resolution: "execa@npm:0.10.0" +"evp_bytestokey@npm:^1.0.3": + version: 1.0.3 + resolution: "evp_bytestokey@npm:1.0.3" dependencies: - cross-spawn: ^6.0.0 - get-stream: ^3.0.0 - is-stream: ^1.1.0 - npm-run-path: ^2.0.0 - p-finally: ^1.0.0 - signal-exit: ^3.0.0 - strip-eof: ^1.0.0 - checksum: da132af2b209e69d79f91751ac6d15ddbb8d9414f9e5f7a53405232679a3dca00fe11eb14e0cd5c2c374a749061410a7717fcc3094f6dd779cf4d259faa58d9a + md5.js: ^1.3.4 + node-gyp: latest + safe-buffer: ^5.1.1 + checksum: ad4e1577f1a6b721c7800dcc7c733fe01f6c310732bb5bf2240245c2a5b45a38518b91d8be2c610611623160b9d1c0e91f1ce96d639f8b53e8894625cf20fa45 languageName: node linkType: hard -"execa@npm:^4.0.0, execa@npm:^4.0.2, execa@npm:^4.1.0": +"execa@npm:^4.0.0": version: 4.1.0 resolution: "execa@npm:4.1.0" dependencies: @@ -8128,77 +6160,51 @@ __metadata: languageName: node linkType: hard -"express-pino-logger@npm:^6.0.0": - version: 6.0.0 - resolution: "express-pino-logger@npm:6.0.0" - dependencies: - pino-http: ^5.3.0 - checksum: ea53b364d667de8652421c4d14b27ef18fc4f4e706be98efb3c932a181a108627323a47fdd3c01c32eb40276c0054aa32140bfcb6252a8cec776b16113ced4c2 - languageName: node - linkType: hard - -"express@npm:4.17.3": - version: 4.17.3 - resolution: "express@npm:4.17.3" +"express@npm:4.18.1": + version: 4.18.1 + resolution: "express@npm:4.18.1" dependencies: accepts: ~1.3.8 array-flatten: 1.1.1 - body-parser: 1.19.2 + body-parser: 1.20.0 content-disposition: 0.5.4 content-type: ~1.0.4 - cookie: 0.4.2 + cookie: 0.5.0 cookie-signature: 1.0.6 debug: 2.6.9 - depd: ~1.1.2 + depd: 2.0.0 encodeurl: ~1.0.2 escape-html: ~1.0.3 etag: ~1.8.1 - finalhandler: ~1.1.2 + finalhandler: 1.2.0 fresh: 0.5.2 + http-errors: 2.0.0 merge-descriptors: 1.0.1 methods: ~1.1.2 - on-finished: ~2.3.0 + on-finished: 2.4.1 parseurl: ~1.3.3 path-to-regexp: 0.1.7 proxy-addr: ~2.0.7 - qs: 6.9.7 + qs: 6.10.3 range-parser: ~1.2.1 safe-buffer: 5.2.1 - send: 0.17.2 - serve-static: 1.14.2 + send: 0.18.0 + serve-static: 1.15.0 setprototypeof: 1.2.0 - statuses: ~1.5.0 + statuses: 2.0.1 type-is: ~1.6.18 utils-merge: 1.0.1 vary: ~1.1.2 - checksum: 967e53b74a37eafdf9789b9938c8df86102928b4985b1ad5e385c709deeab405a364de95ca744bc2cc5d05b5d9cc1efc69ae2ae17688a462038648d5a924bfad + checksum: c3d44c92e48226ef32ec978becfedb0ecf0ca21316bfd33674b3c5d20459840584f2325726a4f17f33d9c99f769636f728982d1c5433a5b6fe6eb95b8cf0c854 languageName: node linkType: hard "ext@npm:^1.1.2": - version: 1.6.0 - resolution: "ext@npm:1.6.0" - dependencies: - type: ^2.5.0 - checksum: ca3ef4619e838f441a92238a98b77ac873da2175ace746c64303ffe2c3208e79a3acf3bf7004e40b720f3c2a83bf0143e6dd4a7cdfae6e73f54a3bfc7a14b5c2 - languageName: node - linkType: hard - -"external-editor@npm:^3.0.3": - version: 3.1.0 - resolution: "external-editor@npm:3.1.0" + version: 1.7.0 + resolution: "ext@npm:1.7.0" dependencies: - chardet: ^0.7.0 - iconv-lite: ^0.4.24 - tmp: ^0.0.33 - checksum: 1c2a616a73f1b3435ce04030261bed0e22d4737e14b090bb48e58865da92529c9f2b05b893de650738d55e692d071819b45e1669259b2b354bc3154d27a698c7 - languageName: node - linkType: hard - -"extract-stack@npm:^2.0.0": - version: 2.0.0 - resolution: "extract-stack@npm:2.0.0" - checksum: 16a45ae6cfe7fe105061f192124cb7d98653728d81827426c4f900763f9fda56c13dd9048de6838107898536b969d1c6f98028fcf4092e542fa2616d4dacb34d + type: ^2.7.2 + checksum: ef481f9ef45434d8c867cfd09d0393b60945b7c8a1798bedc4514cb35aac342ccb8d8ecb66a513e6a2b4ec1e294a338e3124c49b29736f8e7c735721af352c31 languageName: node linkType: hard @@ -8223,20 +6229,20 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.9": - version: 3.2.11 - resolution: "fast-glob@npm:3.2.11" +"fast-glob@npm:^3.2.9": + version: 3.2.12 + resolution: "fast-glob@npm:3.2.12" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: f473105324a7780a20c06de842e15ddbb41d3cb7e71d1e4fe6e8373204f22245d54f5ab9e2061e6a1c613047345954d29b022e0e76f5c28b1df9858179a0e6d7 + checksum: 0b1990f6ce831c7e28c4d505edcdaad8e27e88ab9fa65eedadb730438cfc7cde4910d6c975d6b7b8dc8a73da4773702ebcfcd6e3518e73938bb1383badfe01c2 languageName: node linkType: hard -"fast-json-stable-stringify@npm:2.1.0, fast-json-stable-stringify@npm:2.x, fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": +"fast-json-stable-stringify@npm:2.1.0, fast-json-stable-stringify@npm:2.x, fast-json-stable-stringify@npm:^2.0.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb @@ -8250,19 +6256,10 @@ __metadata: languageName: node linkType: hard -"fast-levenshtein@npm:^3.0.0": - version: 3.0.0 - resolution: "fast-levenshtein@npm:3.0.0" - dependencies: - fastest-levenshtein: ^1.0.7 - checksum: 02732ba6c656797ca7e987c25f3e53718c8fcc39a4bfab46def78eef7a8729eb629632d4a7eca4c27a33e10deabffa9984839557e18a96e91ecf7ccaeedb9890 - languageName: node - linkType: hard - "fast-redact@npm:^3.0.0": - version: 3.1.1 - resolution: "fast-redact@npm:3.1.1" - checksum: e486cc9990b5c9724f39bf4e392c1b250c8fd5e8c0145be80c73de3461fc390babe7b48f35746b50bf3cbcd917e093b5685ae66295162c7d9b686a761d48e989 + version: 3.1.2 + resolution: "fast-redact@npm:3.1.2" + checksum: a30eb6b6830333ab213e0def55f46453ca777544dbd3a883016cb590a0eeb95e6fdf546553c1a13d509896bfba889b789991160a6d0996ceb19fce0a02e8b753 languageName: node linkType: hard @@ -8273,22 +6270,6 @@ __metadata: languageName: node linkType: hard -"fast-url-parser@npm:^1.1.3": - version: 1.1.3 - resolution: "fast-url-parser@npm:1.1.3" - dependencies: - punycode: ^1.3.2 - checksum: 5043d0c4a8d775ff58504d56c096563c11b113e4cb8a2668c6f824a1cd4fb3812e2fdf76537eb24a7ce4ae7def6bd9747da630c617cf2a4b6ce0c42514e4f21c - languageName: node - linkType: hard - -"fastest-levenshtein@npm:^1.0.7": - version: 1.0.12 - resolution: "fastest-levenshtein@npm:1.0.12" - checksum: e1a013698dd1d302c7a78150130c7d50bb678c2c2f8839842a796d66cc7cdf50ea6b3d7ca930b0c8e7e8c2cd84fea8ab831023b382f7aab6922c318c1451beab - languageName: node - linkType: hard - "fastq@npm:^1.6.0": version: 1.13.0 resolution: "fastq@npm:1.13.0" @@ -8307,30 +6288,6 @@ __metadata: languageName: node linkType: hard -"fetch-h2@npm:3.0.2": - version: 3.0.2 - resolution: "fetch-h2@npm:3.0.2" - dependencies: - "@types/tough-cookie": ^4.0.0 - already: ^2.2.1 - callguard: ^2.0.0 - get-stream: ^6.0.1 - through2: ^4.0.2 - to-arraybuffer: ^1.0.1 - tough-cookie: ^4.0.0 - checksum: 7814fd95e51b3b4529eb3807b7b2b044d548decf284fa39b5d8946f80e4ae44f4eb9e0d813a709cfee2c6a2de53c1a4e74181a657c5c022ac1355bd4d647561e - languageName: node - linkType: hard - -"figures@npm:^3.0.0, figures@npm:^3.2.0": - version: 3.2.0 - resolution: "figures@npm:3.2.0" - dependencies: - escape-string-regexp: ^1.0.5 - checksum: 85a6ad29e9aca80b49b817e7c89ecc4716ff14e3779d9835af554db91bac41c0f289c418923519392a1e582b4d10482ad282021330cd045bb7b80c84152f2a2b - languageName: node - linkType: hard - "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -8340,15 +6297,6 @@ __metadata: languageName: node linkType: hard -"filelist@npm:^1.0.1": - version: 1.0.3 - resolution: "filelist@npm:1.0.3" - dependencies: - minimatch: ^5.0.1 - checksum: c78048691a31b91d54908ce2eac4731bf108613c7b2e4d1a05a6cbe6739bd067e4c1a3baa4f7d07b7143b8c374c0c0d59864b5c8d9168ec8e2a85f84fb7170ad - languageName: node - linkType: hard - "fill-range@npm:^7.0.1": version: 7.0.1 resolution: "fill-range@npm:7.0.1" @@ -8358,7 +6306,7 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:^1.0.6": +"finalhandler@npm:1.2.0": version: 1.2.0 resolution: "finalhandler@npm:1.2.0" dependencies: @@ -8373,30 +6321,6 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:~1.1.2": - version: 1.1.2 - resolution: "finalhandler@npm:1.1.2" - dependencies: - debug: 2.6.9 - encodeurl: ~1.0.2 - escape-html: ~1.0.3 - on-finished: ~2.3.0 - parseurl: ~1.3.3 - statuses: ~1.5.0 - unpipe: ~1.0.0 - checksum: 617880460c5138dd7ccfd555cb5dde4d8f170f4b31b8bd51e4b646bb2946c30f7db716428a1f2882d730d2b72afb47d1f67cc487b874cb15426f95753a88965e - languageName: node - linkType: hard - -"find-up@npm:^2.1.0": - version: 2.1.0 - resolution: "find-up@npm:2.1.0" - dependencies: - locate-path: ^2.0.0 - checksum: 43284fe4da09f89011f08e3c32cd38401e786b19226ea440b75386c1b12a4cb738c94969808d53a84f564ede22f732c8409e3cfc3f7fb5b5c32378ad0bbf28bd - languageName: node - linkType: hard - "find-up@npm:^4.0.0, find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" @@ -8417,34 +6341,6 @@ __metadata: languageName: node linkType: hard -"find-yarn-workspace-root2@npm:1.2.16": - version: 1.2.16 - resolution: "find-yarn-workspace-root2@npm:1.2.16" - dependencies: - micromatch: ^4.0.2 - pkg-dir: ^4.2.0 - checksum: b4abdd37ab87c2172e2abab69ecbfed365d63232742cd1f0a165020fba1b200478e944ec2035c6aaf0ae142ac4c523cbf08670f45e59b242bcc295731b017825 - languageName: node - linkType: hard - -"find-yarn-workspace-root@npm:^2.0.0": - version: 2.0.0 - resolution: "find-yarn-workspace-root@npm:2.0.0" - dependencies: - micromatch: ^4.0.2 - checksum: fa5ca8f9d08fe7a54ce7c0a5931ff9b7e36f9ee7b9475fb13752bcea80ec6b5f180fa5102d60b376d5526ce924ea3fc6b19301262efa0a5d248dd710f3644242 - languageName: node - linkType: hard - -"first-chunk-stream@npm:^2.0.0": - version: 2.0.0 - resolution: "first-chunk-stream@npm:2.0.0" - dependencies: - readable-stream: ^2.0.2 - checksum: 2fa86f93a455eac09a9dd1339464f06510183fb4f1062b936d10605bce5728ec5c564a268318efd7f2b55a1ce3ff4dc795585a99fe5dd1940caf28afeb284b47 - languageName: node - linkType: hard - "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -8463,45 +6359,19 @@ __metadata: linkType: hard "flatted@npm:^3.1.0, flatted@npm:^3.2.2, flatted@npm:^3.2.5": - version: 3.2.5 - resolution: "flatted@npm:3.2.5" - checksum: 3c436e9695ccca29620b4be5671dd72e5dd0a7500e0856611b7ca9bd8169f177f408c3b9abfa78dfe1493ee2d873e2c119080a8a9bee4e1a186a9e60ca6c89f1 + version: 3.2.7 + resolution: "flatted@npm:3.2.7" + checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 languageName: node linkType: hard -"follow-redirects@npm:^1.14.4, follow-redirects@npm:^1.14.8, follow-redirects@npm:^1.14.9": - version: 1.15.0 - resolution: "follow-redirects@npm:1.15.0" +"follow-redirects@npm:^1.14.9": + version: 1.15.2 + resolution: "follow-redirects@npm:1.15.2" peerDependenciesMeta: debug: optional: true - checksum: eaec81c3e0ae57aae2422e38ad3539d0e7279b3a63f9681eeea319bb683dea67502c4e097136b8ce9721542b4e236e092b6b49e34e326cdd7733c274f0a3f378 - languageName: node - linkType: hard - -"fork-ts-checker-webpack-plugin@npm:7.2.3": - version: 7.2.3 - resolution: "fork-ts-checker-webpack-plugin@npm:7.2.3" - dependencies: - "@babel/code-frame": ^7.16.7 - chalk: ^4.1.2 - chokidar: ^3.5.3 - cosmiconfig: ^7.0.1 - deepmerge: ^4.2.2 - fs-extra: ^10.0.0 - memfs: ^3.4.1 - minimatch: ^3.0.4 - schema-utils: ^3.1.1 - semver: ^7.3.5 - tapable: ^2.2.1 - peerDependencies: - typescript: ">3.6.0" - vue-template-compiler: "*" - webpack: ^5.11.0 - peerDependenciesMeta: - vue-template-compiler: - optional: true - checksum: aaf00d911a4561f4f7c72ef79723dd87bd970fbee9e2f7d245af04c5d647ccd432550024dc94dcbd0ceb448b849e9236dcc51145e65dbd62a79fa65036a88c11 + checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190 languageName: node linkType: hard @@ -8560,14 +6430,7 @@ __metadata: languageName: node linkType: hard -"fs-constants@npm:^1.0.0": - version: 1.0.0 - resolution: "fs-constants@npm:1.0.0" - checksum: 18f5b718371816155849475ac36c7d0b24d39a11d91348cfcb308b4494824413e03572c403c86d3a260e049465518c4f0d5bd00f0371cdfcad6d4f30a85b350d - languageName: node - linkType: hard - -"fs-extra@npm:10.1.0, fs-extra@npm:^10.0.0, fs-extra@npm:^10.1.0": +"fs-extra@npm:10.1.0, fs-extra@npm:^10.1.0": version: 10.1.0 resolution: "fs-extra@npm:10.1.0" dependencies: @@ -8578,40 +6441,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^6.0.1": - version: 6.0.1 - resolution: "fs-extra@npm:6.0.1" - dependencies: - graceful-fs: ^4.1.2 - jsonfile: ^4.0.0 - universalify: ^0.1.0 - checksum: 133dbd765e05c1cdaaf723308e00ffbe746da5ad516ad890ae2da2a538982c1175371055c778fbe68d1fca1da9ed4003ba55c4a14e070372eabf6a7c48062759 - languageName: node - linkType: hard - -"fs-extra@npm:^8.1": - version: 8.1.0 - resolution: "fs-extra@npm:8.1.0" - dependencies: - graceful-fs: ^4.2.0 - jsonfile: ^4.0.0 - universalify: ^0.1.0 - checksum: bf44f0e6cea59d5ce071bba4c43ca76d216f89e402dc6285c128abc0902e9b8525135aa808adad72c9d5d218e9f4bcc63962815529ff2f684ad532172a284880 - languageName: node - linkType: hard - -"fs-extra@npm:^9.0.1, fs-extra@npm:^9.1.0": - version: 9.1.0 - resolution: "fs-extra@npm:9.1.0" - dependencies: - at-least-node: ^1.0.0 - graceful-fs: ^4.2.0 - jsonfile: ^6.0.1 - universalify: ^2.0.0 - checksum: ba71ba32e0faa74ab931b7a0031d1523c66a73e225de7426e275e238e312d07313d2da2d33e34a52aa406c8763ade5712eb3ec9ba4d9edce652bcacdc29e6b20 - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -8621,13 +6450,6 @@ __metadata: languageName: node linkType: hard -"fs-monkey@npm:1.0.3": - version: 1.0.3 - resolution: "fs-monkey@npm:1.0.3" - checksum: cf50804833f9b88a476911ae911fe50f61a98d986df52f890bd97e7262796d023698cb2309fa9b74fdd8974f04315b648748a0a8ee059e7d5257b293bfc409c0 - languageName: node - linkType: hard - "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -8706,30 +6528,6 @@ __metadata: languageName: node linkType: hard -"fuzzy@npm:^0.1.3": - version: 0.1.3 - resolution: "fuzzy@npm:0.1.3" - checksum: acc09c6173e12d5dc8ae51857551ddbe834befa9ebc6be6d5581d09117265d704809d80407d220fd0652f347a9975a4d106854cacc8bd031487a0ede86982f84 - languageName: node - linkType: hard - -"gauge@npm:^3.0.0": - version: 3.0.2 - resolution: "gauge@npm:3.0.2" - dependencies: - aproba: ^1.0.3 || ^2.0.0 - color-support: ^1.1.2 - console-control-strings: ^1.0.0 - has-unicode: ^2.0.1 - object-assign: ^4.1.1 - signal-exit: ^3.0.0 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - wide-align: ^1.1.2 - checksum: 81296c00c7410cdd48f997800155fbead4f32e4f82109be0719c63edc8560e6579946cc8abd04205297640691ec26d21b578837fd13a4e96288ab4b40b1dc3e9 - languageName: node - linkType: hard - "gauge@npm:^4.0.3": version: 4.0.4 resolution: "gauge@npm:4.0.4" @@ -8760,14 +6558,14 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.0, get-intrinsic@npm:^1.1.1": - version: 1.1.1 - resolution: "get-intrinsic@npm:1.1.1" +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.0, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.2": + version: 1.1.3 + resolution: "get-intrinsic@npm:1.1.3" dependencies: function-bind: ^1.1.1 has: ^1.0.3 - has-symbols: ^1.0.1 - checksum: a9fe2ca8fa3f07f9b0d30fb202bcd01f3d9b9b6b732452e79c48e79f7d6d8d003af3f9e38514250e3553fdc83c61650851cb6870832ac89deaaceb08e3721a17 + has-symbols: ^1.0.3 + checksum: 152d79e87251d536cf880ba75cfc3d6c6c50e12b3a64e1ea960e73a3752b47c69f46034456eae1b0894359ce3bc64c55c186f2811f8a788b75b638b06fab228a languageName: node linkType: hard @@ -8785,30 +6583,7 @@ __metadata: languageName: node linkType: hard -"get-stdin@npm:^4.0.1": - version: 4.0.1 - resolution: "get-stdin@npm:4.0.1" - checksum: 4f73d3fe0516bc1f3dc7764466a68ad7c2ba809397a02f56c2a598120e028430fcff137a648a01876b2adfb486b4bc164119f98f1f7d7c0abd63385bdaa0113f - languageName: node - linkType: hard - -"get-stream@npm:^3.0.0": - version: 3.0.0 - resolution: "get-stream@npm:3.0.0" - checksum: 36142f46005ed74ce3a45c55545ec4e7da8e243554179e345a786baf144e5c4a35fb7bdc49fadfa9f18bd08000589b6fe364abdadfc4e1eb0e1b9914a6bb9c56 - languageName: node - linkType: hard - -"get-stream@npm:^4.1.0": - version: 4.1.0 - resolution: "get-stream@npm:4.1.0" - dependencies: - pump: ^3.0.0 - checksum: 443e1914170c15bd52ff8ea6eff6dfc6d712b031303e36302d2778e3de2506af9ee964d6124010f7818736dcfde05c04ba7ca6cc26883106e084357a17ae7d73 - languageName: node - linkType: hard - -"get-stream@npm:^5.0.0, get-stream@npm:^5.1.0": +"get-stream@npm:^5.0.0": version: 5.2.0 resolution: "get-stream@npm:5.2.0" dependencies: @@ -8817,7 +6592,7 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": +"get-stream@npm:^6.0.0": version: 6.0.1 resolution: "get-stream@npm:6.0.1" checksum: e04ecece32c92eebf5b8c940f51468cd53554dcbb0ea725b2748be583c9523d00128137966afce410b9b051eb2ef16d657cd2b120ca8edafcf5a65e81af63cad @@ -8834,22 +6609,6 @@ __metadata: languageName: node linkType: hard -"github-slugger@npm:^1.2.1, github-slugger@npm:^1.4.0": - version: 1.4.0 - resolution: "github-slugger@npm:1.4.0" - checksum: 4f52e7a21f5c6a4c5328f01fe4fe13ae8881fea78bfe31f9e72c4038f97e3e70d52fb85aa7633a52c501dc2486874474d9abd22aa61cbe9b113099a495551c6b - languageName: node - linkType: hard - -"github-username@npm:^6.0.0": - version: 6.0.0 - resolution: "github-username@npm:6.0.0" - dependencies: - "@octokit/rest": ^18.0.6 - checksum: c40a6151dc293b66809c4c52c21dde2b0ea91a256e1a2eb489658947c12032aecd781c61b921e613f52290feb88c53994ee59a09450bfde2eeded34b3e07e2b7 - languageName: node - linkType: hard - "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -8868,47 +6627,30 @@ __metadata: languageName: node linkType: hard -"glob-to-regexp@npm:^0.4.1": - version: 0.4.1 - resolution: "glob-to-regexp@npm:0.4.1" - checksum: e795f4e8f06d2a15e86f76e4d92751cf8bbfcf0157cea5c2f0f35678a8195a750b34096b1256e436f0cebc1883b5ff0888c47348443e69546a5a87f9e1eb1167 - languageName: node - linkType: hard - -"glob@npm:^7.0.0, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": - version: 7.2.0 - resolution: "glob@npm:7.2.0" +"glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4": + version: 7.2.3 + resolution: "glob@npm:7.2.3" dependencies: fs.realpath: ^1.0.0 inflight: ^1.0.4 inherits: 2 - minimatch: ^3.0.4 + minimatch: ^3.1.1 once: ^1.3.0 path-is-absolute: ^1.0.0 - checksum: 78a8ea942331f08ed2e055cb5b9e40fe6f46f579d7fd3d694f3412fe5db23223d29b7fee1575440202e9a7ff9a72ab106a39fee39934c7bedafe5e5f8ae20134 + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 languageName: node linkType: hard "glob@npm:^8.0.1": - version: 8.0.1 - resolution: "glob@npm:8.0.1" + version: 8.0.3 + resolution: "glob@npm:8.0.3" dependencies: fs.realpath: ^1.0.0 inflight: ^1.0.4 inherits: 2 minimatch: ^5.0.1 once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 7ac782f3ef1c08005884447479e68ceb0ad56997eb2003e1e9aefae71bad3cb48eb7c49190d3d6736f2ffcd8af4985d53a46831b3d5e0052cc5756822a38b61a - languageName: node - linkType: hard - -"global-dirs@npm:^3.0.0": - version: 3.0.0 - resolution: "global-dirs@npm:3.0.0" - dependencies: - ini: 2.0.0 - checksum: 953c17cf14bf6ee0e2100ae82a0d779934eed8a3ec5c94a7a4f37c5b3b592c31ea015fb9a15cf32484de13c79f4a814f3015152f3e1d65976cfbe47c1bfe4a88 + checksum: 50bcdea19d8e79d8de5f460b1939ffc2b3299eac28deb502093fdca22a78efebc03e66bf54f0abc3d3d07d8134d19a32850288b7440d77e072aa55f9d33b18c5 languageName: node linkType: hard @@ -8919,32 +6661,16 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.6.0, globals@npm:^13.9.0": - version: 13.14.0 - resolution: "globals@npm:13.14.0" +"globals@npm:^13.15.0": + version: 13.17.0 + resolution: "globals@npm:13.17.0" dependencies: type-fest: ^0.20.2 - checksum: a8d560119c611b434fa7bd0f305d34fec03e2cc63dcf8ef8bc352f075c54f2653bc6f9c85a1ef9422d82916e6fe5a4fc87fdd6a3e691afcff04545a7d876e078 - languageName: node - linkType: hard - -"globby@npm:^10.0.1": - version: 10.0.2 - resolution: "globby@npm:10.0.2" - dependencies: - "@types/glob": ^7.1.1 - array-union: ^2.1.0 - dir-glob: ^3.0.1 - fast-glob: ^3.0.3 - glob: ^7.1.3 - ignore: ^5.1.1 - merge2: ^1.2.3 - slash: ^3.0.0 - checksum: 167cd067f2cdc030db2ec43232a1e835fa06217577d545709dbf29fd21631b30ff8258705172069c855dc4d5766c3b2690834e35b936fbff01ad0329fb95a26f + checksum: fbaf4112e59b92c9f5575e85ce65e9e17c0b82711196ec5f58beb08599bbd92fd72703d6dfc9b080381fd35b644e1b11dcf25b38cc2341ec21df942594cbc8ce languageName: node linkType: hard -"globby@npm:^11, globby@npm:^11.0.1, globby@npm:^11.0.3, globby@npm:^11.0.4, globby@npm:^11.1.0": +"globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -8958,118 +6684,21 @@ __metadata: languageName: node linkType: hard -"got@npm:^9.6.0": - version: 9.6.0 - resolution: "got@npm:9.6.0" - dependencies: - "@sindresorhus/is": ^0.14.0 - "@szmarczak/http-timer": ^1.1.2 - cacheable-request: ^6.0.0 - decompress-response: ^3.3.0 - duplexer3: ^0.1.4 - get-stream: ^4.1.0 - lowercase-keys: ^1.0.1 - mimic-response: ^1.0.1 - p-cancelable: ^1.0.0 - to-readable-stream: ^1.0.0 - url-parse-lax: ^3.0.0 - checksum: 941807bd9704bacf5eb401f0cc1212ffa1f67c6642f2d028fd75900471c221b1da2b8527f4553d2558f3faeda62ea1cf31665f8b002c6137f5de8732f07370b0 - languageName: node - linkType: hard - -"graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.5, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.10 resolution: "graceful-fs@npm:4.2.10" checksum: 3f109d70ae123951905d85032ebeae3c2a5a7a997430df00ea30df0e3a6c60cf6689b109654d6fdacd28810a053348c4d14642da1d075049e6be1ba5216218da languageName: node linkType: hard -"graphile-build-pg@npm:4.12.2, graphile-build-pg@npm:^4.12.2": - version: 4.12.2 - resolution: "graphile-build-pg@npm:4.12.2" - dependencies: - "@graphile/lru": 4.11.0 - chalk: ^2.4.2 - debug: ^4.1.1 - graphile-build: 4.12.2 - jsonwebtoken: ^8.5.1 - lodash: ">=4 <5" - lru-cache: ">=4 <5" - pg-sql2: 4.12.1 - peerDependencies: - pg: ">=6.1.0 <9" - checksum: 45531c07fdda22e24c7b20be5754ae057a703f24bbb2f5d192665666f0f99a0f28bb8ef54498d0d753ddfd5f562c4e3bbd56c21904c6c5c87fb57551d18a9378 - languageName: node - linkType: hard - -"graphile-build@npm:4.12.2, graphile-build@npm:^4.12.2": - version: 4.12.2 - resolution: "graphile-build@npm:4.12.2" - dependencies: - "@graphile/lru": 4.11.0 - chalk: ^2.4.2 - debug: ^4.1.1 - graphql-parse-resolve-info: 4.12.0 - iterall: ^1.2.2 - lodash: ">=4 <5" - lru-cache: ^5.0.0 - pluralize: ^7.0.0 - semver: ^6.0.0 - peerDependencies: - graphql: ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" - checksum: ebd2c91a71c6826011599f1cd4f57b0d312e47e3c3b26d46deb01127d03821e2528a1fb4d3fa7570d03121f8be2cff1e9617479a47d339797d22d47a23d10c83 - languageName: node - linkType: hard - -"graphile-utils@npm:^4.12.0-alpha.0, graphile-utils@npm:^4.12.2": - version: 4.12.2 - resolution: "graphile-utils@npm:4.12.2" - dependencies: - debug: ^4.1.1 - graphql: ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" - tslib: ^2.0.1 - peerDependencies: - graphile-build: ^4.5.0 - graphile-build-pg: ^4.5.0 - checksum: 6782106878d9952da99150b9d6249e79e306a654da290c545f72e42b9cb6b2c3540e883d4369c0dea89b87341161303d736f879710cb5438bf96064e29319de9 - languageName: node - linkType: hard - -"graphql-parse-resolve-info@npm:4.12.0": - version: 4.12.0 - resolution: "graphql-parse-resolve-info@npm:4.12.0" - dependencies: - debug: ^4.1.1 - tslib: ^2.0.1 - peerDependencies: - graphql: ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" - checksum: d15554985407b34150a36f8526d3ce63cd97a1fa898eadd74ba5e6d099984d13929de64924332832613d59fba7946222b0a07a127e93ad58bdb82f3548cc497b - languageName: node - linkType: hard - -"graphql-query-complexity@npm:^0.11.0": - version: 0.11.0 - resolution: "graphql-query-complexity@npm:0.11.0" - dependencies: - lodash.get: ^4.4.2 - peerDependencies: - graphql: ^14.6.0 || ^15.0.0 || ^16.0.0 - checksum: 7086c26f39eda9e2b4a538e6619486819dd65a48f319ea0bad732712875d86169c10a1a570bab00b3c82440dc6c083e2bff11334e950911b08a8b15cee82823f - languageName: node - linkType: hard - -"graphql-subscriptions@npm:^1.1.0": - version: 1.2.1 - resolution: "graphql-subscriptions@npm:1.2.1" - dependencies: - iterall: ^1.3.0 - peerDependencies: - graphql: ^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 - checksum: 2b9533c6774e7be46acd6fbee528aab06429f15dc222eabd991e82c02bf74e390b638dffa1a3fd86c1e26212c40a42a0418d7f4a7c3a1edf0534978ef128e528 +"grapheme-splitter@npm:^1.0.4": + version: 1.0.4 + resolution: "grapheme-splitter@npm:1.0.4" + checksum: 0c22ec54dee1b05cd480f78cf14f732cb5b108edc073572c4ec205df4cd63f30f8db8025afc5debc8835a8ddeacf648a1c7992fe3dcd6ad38f9a476d84906620 languageName: node linkType: hard -"graphql-tag@npm:^2.11.0, graphql-tag@npm:^2.12.3, graphql-tag@npm:^2.12.5, graphql-tag@npm:^2.12.6": +"graphql-tag@npm:^2.12.3, graphql-tag@npm:^2.12.5, graphql-tag@npm:^2.12.6": version: 2.12.6 resolution: "graphql-tag@npm:2.12.6" dependencies: @@ -9080,45 +6709,13 @@ __metadata: languageName: node linkType: hard -"graphql-ws@npm:^5.6.2": - version: 5.8.1 - resolution: "graphql-ws@npm:5.8.1" - peerDependencies: - graphql: ">=0.11 <=16" - checksum: 0e8d08a1155204655510f8dc902f295ae5494cf01390c87226cef8d9b460fac5101ec96802ccf056d479d7e57a2a6b575fc4769b2123ae330396ac1d44912a8a - languageName: node - linkType: hard - -"graphql@npm:*": - version: 16.5.0 - resolution: "graphql@npm:16.5.0" - checksum: a82a926d085818934d04fdf303a269af170e79de943678bd2726370a96194f9454ade9d6d76c2de69afbd7b9f0b4f8061619baecbbddbe82125860e675ac219e - languageName: node - linkType: hard - -"graphql@npm:>=0.9 <0.14 || ^14.0.2 || ^15.4.0, graphql@npm:^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.2 || ^15.0.0, graphql@npm:^15.7.2, graphql@npm:^15.8.0": +"graphql@npm:^15.7.2, graphql@npm:^15.8.0": version: 15.8.0 resolution: "graphql@npm:15.8.0" checksum: 423325271db8858428641b9aca01699283d1fe5b40ef6d4ac622569ecca927019fce8196208b91dd1d8eb8114f00263fe661d241d0eb40c10e5bfd650f86ec5e languageName: node linkType: hard -"grouped-queue@npm:^2.0.0": - version: 2.0.0 - resolution: "grouped-queue@npm:2.0.0" - checksum: be5c6cfac0db6b6f147d82d6a6629170afe84df8f8fe56bc3acfa53603c30141cf8a6a31b341c08d4acacd323385044fef2d750a979942c967c501fad5b6a633 - languageName: node - linkType: hard - -"has-ansi@npm:^2.0.0": - version: 2.0.0 - resolution: "has-ansi@npm:2.0.0" - dependencies: - ansi-regex: ^2.0.0 - checksum: 1b51daa0214440db171ff359d0a2d17bc20061164c57e76234f614c91dbd2a79ddd68dfc8ee73629366f7be45a6df5f2ea9de83f52e1ca24433f2cc78c35d8ec - languageName: node - linkType: hard - "has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" @@ -9149,7 +6746,7 @@ __metadata: languageName: node linkType: hard -"has-symbols@npm:^1.0.1, has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": +"has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 @@ -9172,13 +6769,6 @@ __metadata: languageName: node linkType: hard -"has-yarn@npm:^2.1.0": - version: 2.1.0 - resolution: "has-yarn@npm:2.1.0" - checksum: 5eb1d0bb8518103d7da24532bdbc7124ffc6d367b5d3c10840b508116f2f1bcbcf10fd3ba843ff6e2e991bdf9969fd862d42b2ed58aade88343326c950b7e7f7 - languageName: node - linkType: hard - "has@npm:^1.0.3": version: 1.0.3 resolution: "has@npm:1.0.3" @@ -9188,6 +6778,27 @@ __metadata: languageName: node linkType: hard +"hash-base@npm:^3.0.0": + version: 3.1.0 + resolution: "hash-base@npm:3.1.0" + dependencies: + inherits: ^2.0.4 + readable-stream: ^3.6.0 + safe-buffer: ^5.2.0 + checksum: 26b7e97ac3de13cb23fc3145e7e3450b0530274a9562144fc2bf5c1e2983afd0e09ed7cc3b20974ba66039fad316db463da80eb452e7373e780cbee9a0d2f2dc + languageName: node + linkType: hard + +"hash.js@npm:1.1.7, hash.js@npm:^1.0.0, hash.js@npm:^1.0.3, hash.js@npm:^1.1.7": + version: 1.1.7 + resolution: "hash.js@npm:1.1.7" + dependencies: + inherits: ^2.0.3 + minimalistic-assert: ^1.0.1 + checksum: e350096e659c62422b85fa508e4b3669017311aa4c49b74f19f8e1bc7f3a54a584fdfd45326d4964d6011f2b2d882e38bea775a96046f2a61b7779a979629d8f + languageName: node + linkType: hard + "hexoid@npm:1.0.0": version: 1.0.0 resolution: "hexoid@npm:1.0.0" @@ -9202,6 +6813,17 @@ __metadata: languageName: node linkType: hard +"hmac-drbg@npm:^1.0.1": + version: 1.0.1 + resolution: "hmac-drbg@npm:1.0.1" + dependencies: + hash.js: ^1.0.3 + minimalistic-assert: ^1.0.0 + minimalistic-crypto-utils: ^1.0.1 + checksum: bd30b6a68d7f22d63f10e1888aee497d7c2c5c0bb469e66bbdac99f143904d1dfe95f8131f95b3e86c86dd239963c9d972fcbe147e7cffa00e55d18585c43fe0 + languageName: node + linkType: hard + "hoist-non-react-statics@npm:^3.3.2": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" @@ -9211,22 +6833,6 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^2.1.4": - version: 2.8.9 - resolution: "hosted-git-info@npm:2.8.9" - checksum: c955394bdab888a1e9bb10eb33029e0f7ce5a2ac7b3f158099dc8c486c99e73809dca609f5694b223920ca2174db33d32b12f9a2a47141dc59607c29da5a62dd - languageName: node - linkType: hard - -"hosted-git-info@npm:^4.0.1": - version: 4.1.0 - resolution: "hosted-git-info@npm:4.1.0" - dependencies: - lru-cache: ^6.0.0 - checksum: c3f87b3c2f7eb8c2748c8f49c0c2517c9a95f35d26f4bf54b2a8cba05d2e668f3753548b6ea366b18ec8dadb4e12066e19fa382a01496b0ffa0497eb23cbe461 - languageName: node - linkType: hard - "html-encoding-sniffer@npm:^2.0.1": version: 2.0.1 resolution: "html-encoding-sniffer@npm:2.0.1" @@ -9243,40 +6849,13 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.0": +"http-cache-semantics@npm:^4.1.0": version: 4.1.0 resolution: "http-cache-semantics@npm:4.1.0" checksum: 974de94a81c5474be07f269f9fd8383e92ebb5a448208223bfb39e172a9dbc26feff250192ecc23b9593b3f92098e010406b0f24bd4d588d631f80214648ed42 languageName: node linkType: hard -"http-call@npm:^5.1.2, http-call@npm:^5.2.2": - version: 5.3.0 - resolution: "http-call@npm:5.3.0" - dependencies: - content-type: ^1.0.4 - debug: ^4.1.1 - is-retry-allowed: ^1.1.0 - is-stream: ^2.0.0 - parse-json: ^4.0.0 - tunnel-agent: ^0.6.0 - checksum: 06e9342e1fc9d805ab666c862cac58ece953e0a72007410f4fba9aef40075f4c8bf0fdebbcfa1648433db05003ce1e00496ddb92e8dcff319a976638b2be4057 - languageName: node - linkType: hard - -"http-errors@npm:1.8.1, http-errors@npm:^1.5.1": - version: 1.8.1 - resolution: "http-errors@npm:1.8.1" - dependencies: - depd: ~1.1.2 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: ">= 1.5.0 < 2" - toidentifier: 1.0.1 - checksum: d3c7e7e776fd51c0a812baff570bdf06fe49a5dc448b700ab6171b1250e4cf7db8b8f4c0b133e4bfe2451022a5790c1ca6c2cae4094dedd6ac8304a1267f91d2 - languageName: node - linkType: hard - "http-errors@npm:2.0.0": version: 2.0.0 resolution: "http-errors@npm:2.0.0" @@ -9354,14 +6933,7 @@ __metadata: languageName: node linkType: hard -"hyperlinker@npm:^1.0.0": - version: 1.0.0 - resolution: "hyperlinker@npm:1.0.0" - checksum: f6d020ac552e9d048668206c805a737262b4c395546c773cceea3bc45252c46b4fa6eeb67c5896499dad00d21cb2f20f89fdd480a4529cfa3d012da2957162f9 - languageName: node - linkType: hard - -"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24": +"iconv-lite@npm:0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" dependencies: @@ -9379,14 +6951,7 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:1.1.13": - version: 1.1.13 - resolution: "ieee754@npm:1.1.13" - checksum: 102df1ba662e316e6160f7ce29c7c7fa3e04f2014c288336c5a9ff40bbcc2a27d209fa2a81ebfb33f28b1941021343d30e9ad8ee85a2d61f79f5936c35edc33d - languageName: node - linkType: hard - -"ieee754@npm:^1.1.13, ieee754@npm:^1.1.4, ieee754@npm:^1.2.1": +"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e @@ -9400,16 +6965,7 @@ __metadata: languageName: node linkType: hard -"ignore-walk@npm:^4.0.1": - version: 4.0.1 - resolution: "ignore-walk@npm:4.0.1" - dependencies: - minimatch: ^3.0.4 - checksum: 903cd5cb68d57b2e70fddb83d885aea55f137a44636254a29b08037797376d8d3e09d1c58935778f3a271bf6a2b41ecc54fc22260ac07190e09e1ec7253b49f3 - languageName: node - linkType: hard - -"ignore@npm:^5.1.1, ignore@npm:^5.1.4, ignore@npm:^5.1.8, ignore@npm:^5.2.0": +"ignore@npm:^5.1.4, ignore@npm:^5.2.0": version: 5.2.0 resolution: "ignore@npm:5.2.0" checksum: 6b1f926792d614f64c6c83da3a1f9c83f6196c2839aa41e1e32dd7b8d174cef2e329d75caabb62cb61ce9dc432f75e67d07d122a037312db7caa73166a1bdb77 @@ -9433,13 +6989,6 @@ __metadata: languageName: node linkType: hard -"import-lazy@npm:^2.1.0": - version: 2.1.0 - resolution: "import-lazy@npm:2.1.0" - checksum: 05294f3b9dd4971d3a996f0d2f176410fb6745d491d6e73376429189f5c1c3d290548116b2960a7cf3e89c20cdf11431739d1d2d8c54b84061980795010e803a - languageName: node - linkType: hard - "import-local@npm:^3.0.2": version: 3.1.0 resolution: "import-local@npm:3.1.0" @@ -9490,108 +7039,13 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.1, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 languageName: node linkType: hard -"ini@npm:2.0.0": - version: 2.0.0 - resolution: "ini@npm:2.0.0" - checksum: e7aadc5fb2e4aefc666d74ee2160c073995a4061556b1b5b4241ecb19ad609243b9cceafe91bae49c219519394bbd31512516cb22a3b1ca6e66d869e0447e84e - languageName: node - linkType: hard - -"ini@npm:~1.3.0": - version: 1.3.8 - resolution: "ini@npm:1.3.8" - checksum: dfd98b0ca3a4fc1e323e38a6c8eb8936e31a97a918d3b377649ea15bdb15d481207a0dda1021efbd86b464cae29a0d33c1d7dcaf6c5672bee17fa849bc50a1b3 - languageName: node - linkType: hard - -"inquirer-autocomplete-prompt@npm:^1.4.0": - version: 1.4.0 - resolution: "inquirer-autocomplete-prompt@npm:1.4.0" - dependencies: - ansi-escapes: ^4.3.1 - chalk: ^4.0.0 - figures: ^3.2.0 - run-async: ^2.4.0 - rxjs: ^6.6.2 - peerDependencies: - inquirer: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 863d60d6beee2424d3fd9fbdbc027dcc36b20106509f56edd0aab49dea8b033451edec5936ca929b24b685a7137097c98c21757889df8a87cd3919a732483586 - languageName: node - linkType: hard - -"inquirer@npm:7.3.3": - version: 7.3.3 - resolution: "inquirer@npm:7.3.3" - dependencies: - ansi-escapes: ^4.2.1 - chalk: ^4.1.0 - cli-cursor: ^3.1.0 - cli-width: ^3.0.0 - external-editor: ^3.0.3 - figures: ^3.0.0 - lodash: ^4.17.19 - mute-stream: 0.0.8 - run-async: ^2.4.0 - rxjs: ^6.6.0 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - through: ^2.3.6 - checksum: 4d387fc1eb6126acbd58cbdb9ad99d2887d181df86ab0c2b9abdf734e751093e2d5882c2b6dc7144d9ab16b7ab30a78a1d7f01fb6a2850a44aeb175d1e3f8778 - languageName: node - linkType: hard - -"inquirer@npm:8.2.0": - version: 8.2.0 - resolution: "inquirer@npm:8.2.0" - dependencies: - ansi-escapes: ^4.2.1 - chalk: ^4.1.1 - cli-cursor: ^3.1.0 - cli-width: ^3.0.0 - external-editor: ^3.0.3 - figures: ^3.0.0 - lodash: ^4.17.21 - mute-stream: 0.0.8 - ora: ^5.4.1 - run-async: ^2.4.0 - rxjs: ^7.2.0 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - through: ^2.3.6 - checksum: 861d1a9324ae933b49126b3541d94e4d6a2f2a25411b3f3cc00c34bf1bdab34146362d702cf289efe6d8034900dc5905bcf2ea716092a02b6fc390e5986dd236 - languageName: node - linkType: hard - -"inquirer@npm:^8.0.0, inquirer@npm:^8.2.0": - version: 8.2.4 - resolution: "inquirer@npm:8.2.4" - dependencies: - ansi-escapes: ^4.2.1 - chalk: ^4.1.1 - cli-cursor: ^3.1.0 - cli-width: ^3.0.0 - external-editor: ^3.0.3 - figures: ^3.0.0 - lodash: ^4.17.21 - mute-stream: 0.0.8 - ora: ^5.4.1 - run-async: ^2.4.0 - rxjs: ^7.5.5 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - through: ^2.3.6 - wrap-ansi: ^7.0.0 - checksum: dfcb6529d3af443dfea2241cb471508091b51f5121a088fdb8728b23ec9b349ef0a5e13a0ef2c8e19457b0bed22f7cbbcd561f7a4529d084c562a58c605e2655 - languageName: node - linkType: hard - "interface-datastore@npm:^5.2.0": version: 5.2.0 resolution: "interface-datastore@npm:5.2.0" @@ -9627,13 +7081,6 @@ __metadata: languageName: node linkType: hard -"interpret@npm:^1.0.0": - version: 1.4.0 - resolution: "interpret@npm:1.4.0" - checksum: 2e5f51268b5941e4a17e4ef0575bc91ed0ab5f8515e3cf77486f7c14d13f3010df9c0959f37063dcc96e78d12dc6b0bb1b9e111cdfe69771f4656d2993d36155 - languageName: node - linkType: hard - "ip-regex@npm:^4.0.0": version: 4.3.0 resolution: "ip-regex@npm:4.3.0" @@ -9641,10 +7088,10 @@ __metadata: languageName: node linkType: hard -"ip@npm:^1.1.5": - version: 1.1.6 - resolution: "ip@npm:1.1.6" - checksum: 3e5f72b447fd292801491f03091ef1221fbc37de527d3bf306b297e3e58530e7ad80ae92a2f716d8a25fbb6e16afe05cbcb7cef671107ddb37ac7a1693158c6b +"ip@npm:^2.0.0": + version: 2.0.0 + resolution: "ip@npm:2.0.0" + checksum: cfcfac6b873b701996d71ec82a7dd27ba92450afdb421e356f44044ed688df04567344c36cbacea7d01b1c39a4c732dc012570ebe9bebfb06f27314bca625349 languageName: node linkType: hard @@ -9720,12 +7167,12 @@ __metadata: linkType: hard "ipfs-unixfs@npm:^6.0.3": - version: 6.0.7 - resolution: "ipfs-unixfs@npm:6.0.7" + version: 6.0.9 + resolution: "ipfs-unixfs@npm:6.0.9" dependencies: err-code: ^3.0.1 protobufjs: ^6.10.2 - checksum: d7b2a0ce31554796b5f7452684c7ec3bd45514e41c6bdfad30228ee57581a5ae566ad67c07ed13d6d9466026a8e1129f1f12ffe24917f06af052ffbc7cb9e664 + checksum: 025d852c3cfb09b813b35f7a4f7a06bd0ff904f88b35cdf54c6ea1eb021f1597ab9c2739adabbae9cfe645a2323598bd7974ff4a8898701bc4ba92842bf21736 languageName: node linkType: hard @@ -9788,39 +7235,19 @@ __metadata: languageName: node linkType: hard -"is-builtin-module@npm:^3.1.0": - version: 3.1.0 - resolution: "is-builtin-module@npm:3.1.0" - dependencies: - builtin-modules: ^3.0.0 - checksum: f1e5dd2cd5f252d4d799b20a0c8c4f7e9c399c4d141749af76ca0121058d4062c3015d026f1b1409dd3d2a4ddfb9b15cf6eb9c370fed53fea8652ce35b5e95cb - languageName: node - linkType: hard - "is-callable@npm:^1.1.4, is-callable@npm:^1.2.4": - version: 1.2.4 - resolution: "is-callable@npm:1.2.4" - checksum: 1a28d57dc435797dae04b173b65d6d1e77d4f16276e9eff973f994eadcfdc30a017e6a597f092752a083c1103cceb56c91e3dadc6692fedb9898dfaba701575f - languageName: node - linkType: hard - -"is-ci@npm:^2.0.0": - version: 2.0.0 - resolution: "is-ci@npm:2.0.0" - dependencies: - ci-info: ^2.0.0 - bin: - is-ci: bin.js - checksum: 77b869057510f3efa439bbb36e9be429d53b3f51abd4776eeea79ab3b221337fe1753d1e50058a9e2c650d38246108beffb15ccfd443929d77748d8c0cc90144 + version: 1.2.5 + resolution: "is-callable@npm:1.2.5" + checksum: 308ec9787dddff8ac6d3cf706ace87c31707df627e322e50882f6d76a4d80f5844bc220fee79142fe97b53c7c421d0bc72c2106358e183f85b71a874d479f8c4 languageName: node linkType: hard -"is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1": - version: 2.9.0 - resolution: "is-core-module@npm:2.9.0" +"is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": + version: 2.10.0 + resolution: "is-core-module@npm:2.10.0" dependencies: has: ^1.0.3 - checksum: b27034318b4b462f1c8f1dfb1b32baecd651d891a4e2d1922135daeff4141dfced2b82b07aef83ef54275c4a3526aa38da859223664d0868ca24182badb784ce + checksum: 0f3f77811f430af3256fa7bbc806f9639534b140f8ee69476f632c3e1eb4e28a38be0b9d1b8ecf596179c841b53576129279df95e7051d694dac4ceb6f967593 languageName: node linkType: hard @@ -9833,15 +7260,6 @@ __metadata: languageName: node linkType: hard -"is-docker@npm:^2.0.0": - version: 2.2.1 - resolution: "is-docker@npm:2.2.1" - bin: - is-docker: cli.js - checksum: 3fef7ddbf0be25958e8991ad941901bf5922ab2753c46980b60b05c1bf9c9c2402d35e6dc32e4380b980ef5e1970a5d9d5e5aa2e02d77727c3b6b5e918474c56 - languageName: node - linkType: hard - "is-electron@npm:^2.2.0": version: 2.2.1 resolution: "is-electron@npm:2.2.1" @@ -9856,22 +7274,6 @@ __metadata: languageName: node linkType: hard -"is-fullwidth-code-point@npm:^1.0.0": - version: 1.0.0 - resolution: "is-fullwidth-code-point@npm:1.0.0" - dependencies: - number-is-nan: ^1.0.0 - checksum: 4d46a7465a66a8aebcc5340d3b63a56602133874af576a9ca42c6f0f4bd787a743605771c5f246db77da96605fefeffb65fc1dbe862dcc7328f4b4d03edf5a57 - languageName: node - linkType: hard - -"is-fullwidth-code-point@npm:^2.0.0": - version: 2.0.0 - resolution: "is-fullwidth-code-point@npm:2.0.0" - checksum: eef9c6e15f68085fec19ff6a978a6f1b8f48018fd1265035552078ee945573594933b09bbd6f562553e2a241561439f1ef5339276eba68d272001343084cfab8 - languageName: node - linkType: hard - "is-fullwidth-code-point@npm:^3.0.0": version: 3.0.0 resolution: "is-fullwidth-code-point@npm:3.0.0" @@ -9902,13 +7304,10 @@ __metadata: languageName: node linkType: hard -"is-installed-globally@npm:^0.4.0": - version: 0.4.0 - resolution: "is-installed-globally@npm:0.4.0" - dependencies: - global-dirs: ^3.0.0 - is-path-inside: ^3.0.2 - checksum: 3359840d5982d22e9b350034237b2cda2a12bac1b48a721912e1ab8e0631dd07d45a2797a120b7b87552759a65ba03e819f1bd63f2d7ab8657ec0b44ee0bf399 +"is-hex-prefixed@npm:1.0.0": + version: 1.0.0 + resolution: "is-hex-prefixed@npm:1.0.0" + checksum: 5ac58e6e528fb029cc43140f6eeb380fad23d0041cc23154b87f7c9a1b728bcf05909974e47248fd0b7fcc11ba33cf7e58d64804883056fabd23e2b898be41de languageName: node linkType: hard @@ -9942,13 +7341,6 @@ __metadata: languageName: node linkType: hard -"is-npm@npm:^5.0.0": - version: 5.0.0 - resolution: "is-npm@npm:5.0.0" - checksum: 9baff02b0c69a3d3c79b162cb2f9e67fb40ef6d172c16601b2e2471c21e9a4fa1fc9885a308d7bc6f3a3cd2a324c27fa0bf284c133c3349bb22571ab70d041cc - languageName: node - linkType: hard - "is-number-object@npm:^1.0.4": version: 1.0.7 resolution: "is-number-object@npm:1.0.7" @@ -9965,36 +7357,13 @@ __metadata: languageName: node linkType: hard -"is-obj@npm:^2.0.0": - version: 2.0.0 - resolution: "is-obj@npm:2.0.0" - checksum: c9916ac8f4621962a42f5e80e7ffdb1d79a3fab7456ceaeea394cd9e0858d04f985a9ace45be44433bf605673c8be8810540fe4cc7f4266fc7526ced95af5a08 - languageName: node - linkType: hard - -"is-path-inside@npm:^3.0.2": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 - languageName: node - linkType: hard - -"is-plain-obj@npm:^2.0.0, is-plain-obj@npm:^2.1.0": +"is-plain-obj@npm:^2.1.0": version: 2.1.0 resolution: "is-plain-obj@npm:2.1.0" checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa languageName: node linkType: hard -"is-plain-object@npm:^2.0.4": - version: 2.0.4 - resolution: "is-plain-object@npm:2.0.4" - dependencies: - isobject: ^3.0.1 - checksum: 2a401140cfd86cabe25214956ae2cfee6fbd8186809555cd0e84574f88de7b17abacb2e477a6a658fa54c6083ecbda1e6ae404c7720244cd198903848fca70ca - languageName: node - linkType: hard - "is-plain-object@npm:^5.0.0": version: 5.0.0 resolution: "is-plain-object@npm:5.0.0" @@ -10019,22 +7388,6 @@ __metadata: languageName: node linkType: hard -"is-retry-allowed@npm:^1.1.0": - version: 1.2.0 - resolution: "is-retry-allowed@npm:1.2.0" - checksum: 50d700a89ae31926b1c91b3eb0104dbceeac8790d8b80d02f5c76d9a75c2056f1bb24b5268a8a018dead606bddf116b2262e5ac07401eb8b8783b266ed22558d - languageName: node - linkType: hard - -"is-scoped@npm:^2.1.0": - version: 2.1.0 - resolution: "is-scoped@npm:2.1.0" - dependencies: - scoped-regex: ^2.0.0 - checksum: bc4726ec6c71c10d095e815040e361ce9f75503b9c2b1dadd3af720222034cd35e2601e44002a9e372709abc1dba357195c64977395adac2c100789becc901fb - languageName: node - linkType: hard - "is-shared-array-buffer@npm:^1.0.2": version: 1.0.2 resolution: "is-shared-array-buffer@npm:1.0.2" @@ -10044,13 +7397,6 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^1.1.0": - version: 1.1.0 - resolution: "is-stream@npm:1.1.0" - checksum: 063c6bec9d5647aa6d42108d4c59723d2bd4ae42135a2d4db6eadbd49b7ea05b750fd69d279e5c7c45cf9da753ad2c00d8978be354d65aa9f6bb434969c6a2ae - languageName: node - linkType: hard - "is-stream@npm:^2.0.0": version: 2.0.1 resolution: "is-stream@npm:2.0.1" @@ -10090,13 +7436,6 @@ __metadata: languageName: node linkType: hard -"is-utf8@npm:^0.2.0, is-utf8@npm:^0.2.1": - version: 0.2.1 - resolution: "is-utf8@npm:0.2.1" - checksum: 167ccd2be869fc228cc62c1a28df4b78c6b5485d15a29027d3b5dceb09b383e86a3522008b56dcac14b592b22f0a224388718c2505027a994fd8471465de54b3 - languageName: node - linkType: hard - "is-weakref@npm:^1.0.2": version: 1.0.2 resolution: "is-weakref@npm:1.0.2" @@ -10106,43 +7445,13 @@ __metadata: languageName: node linkType: hard -"is-wsl@npm:^2.1.1, is-wsl@npm:^2.2.0": - version: 2.2.0 - resolution: "is-wsl@npm:2.2.0" - dependencies: - is-docker: ^2.0.0 - checksum: 20849846ae414997d290b75e16868e5261e86ff5047f104027026fd61d8b5a9b0b3ade16239f35e1a067b3c7cc02f70183cb661010ed16f4b6c7c93dad1b19d8 - languageName: node - linkType: hard - -"is-yarn-global@npm:^0.3.0": - version: 0.3.0 - resolution: "is-yarn-global@npm:0.3.0" - checksum: bca013d65fee2862024c9fbb3ba13720ffca2fe750095174c1c80922fdda16402b5c233f5ac9e265bc12ecb5446e7b7f519a32d9541788f01d4d44e24d2bf481 - languageName: node - linkType: hard - -"isarray@npm:0.0.1": - version: 0.0.1 - resolution: "isarray@npm:0.0.1" - checksum: 49191f1425681df4a18c2f0f93db3adb85573bcdd6a4482539d98eac9e705d8961317b01175627e860516a2fc45f8f9302db26e5a380a97a520e272e2a40a8d4 - languageName: node - linkType: hard - -"isarray@npm:^1.0.0, isarray@npm:~1.0.0": +"isarray@npm:~1.0.0": version: 1.0.0 resolution: "isarray@npm:1.0.0" checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab languageName: node linkType: hard -"isbinaryfile@npm:^4.0.8": - version: 4.0.10 - resolution: "isbinaryfile@npm:4.0.10" - checksum: a6b28db7e23ac7a77d3707567cac81356ea18bd602a4f21f424f862a31d0e7ab4f250759c98a559ece35ffe4d99f0d339f1ab884ffa9795172f632ab8f88e686 - languageName: node - linkType: hard - "isexe@npm:^2.0.0": version: 2.0.0 resolution: "isexe@npm:2.0.0" @@ -10157,13 +7466,6 @@ __metadata: languageName: node linkType: hard -"isobject@npm:^3.0.1": - version: 3.0.1 - resolution: "isobject@npm:3.0.1" - checksum: db85c4c970ce30693676487cca0e61da2ca34e8d4967c2e1309143ff910c207133a969f9e4ddb2dc6aba670aabce4e0e307146c310350b298e74a31f7d464703 - languageName: node - linkType: hard - "istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": version: 3.2.0 resolution: "istanbul-lib-coverage@npm:3.2.0" @@ -10207,12 +7509,12 @@ __metadata: linkType: hard "istanbul-reports@npm:^3.1.3": - version: 3.1.4 - resolution: "istanbul-reports@npm:3.1.4" + version: 3.1.5 + resolution: "istanbul-reports@npm:3.1.5" dependencies: html-escaper: ^2.0.0 istanbul-lib-report: ^3.0.0 - checksum: 2132983355710c522f6b26808015cab9a0ee8b9f5ae0db0d3edeff40b886dd83cb670fb123cb7b32dbe59473d7c00cdde2ba6136bc0acdb20a865fccea64dfe1 + checksum: 7867228f83ed39477b188ea07e7ccb9b4f5320b6f73d1db93a0981b7414fa4ef72d3f80c4692c442f90fc250d9406e71d8d7ab65bb615cb334e6292b73192b89 languageName: node linkType: hard @@ -10296,13 +7598,6 @@ __metadata: languageName: node linkType: hard -"iterall@npm:^1.0.2, iterall@npm:^1.2.1, iterall@npm:^1.2.2, iterall@npm:^1.3.0": - version: 1.3.0 - resolution: "iterall@npm:1.3.0" - checksum: c78b99678f8c99be488cca7f33e4acca9b72c1326e050afbaf023f086e55619ee466af0464af94a0cb3f292e60cb5bac53a8fd86bd4249ecad26e09f17bb158b - languageName: node - linkType: hard - "iterare@npm:1.2.1": version: 1.2.1 resolution: "iterare@npm:1.2.1" @@ -10310,20 +7605,6 @@ __metadata: languageName: node linkType: hard -"jake@npm:^10.8.5": - version: 10.8.5 - resolution: "jake@npm:10.8.5" - dependencies: - async: ^3.2.3 - chalk: ^4.0.2 - filelist: ^1.0.1 - minimatch: ^3.0.4 - bin: - jake: ./bin/cli.js - checksum: 56c913ecf5a8d74325d0af9bc17a233bad50977438d44864d925bb6c45c946e0fee8c4c1f5fe2225471ef40df5222e943047982717ebff0d624770564d3c46ba - languageName: node - linkType: hard - "jest-changed-files@npm:^27.5.1": version: 27.5.1 resolution: "jest-changed-files@npm:27.5.1" @@ -10784,7 +8065,7 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^27.4.5, jest-worker@npm:^27.5.1": +"jest-worker@npm:^27.5.1": version: 27.5.1 resolution: "jest-worker@npm:27.5.1" dependencies: @@ -10813,10 +8094,10 @@ __metadata: languageName: node linkType: hard -"jmespath@npm:0.16.0": - version: 0.16.0 - resolution: "jmespath@npm:0.16.0" - checksum: 2d602493a1e4addfd1350ac8c9d54b1b03ed09e305fd863bab84a4ee1f52868cf939dd1a08c5cdea29ce9ba8f86875ebb458b6ed45dab3e1c3f2694503fb2fd9 +"js-sdsl@npm:^4.1.4": + version: 4.1.4 + resolution: "js-sdsl@npm:4.1.4" + checksum: 1977cea4ab18e0e03e28bdf0371d8b443fad65ca0988e0faa216406faf6bb943714fe8f7cc7a5bfe5f35ba3d94ddae399f4d10200f547f2c3320688b0670d726 languageName: node linkType: hard @@ -10827,7 +8108,7 @@ __metadata: languageName: node linkType: hard -"js-sha3@npm:^0.8.0": +"js-sha3@npm:0.8.0, js-sha3@npm:^0.8.0": version: 0.8.0 resolution: "js-sha3@npm:0.8.0" checksum: 75df77c1fc266973f06cce8309ce010e9e9f07ec35ab12022ed29b7f0d9c8757f5a73e1b35aa24840dced0dea7059085aa143d817aea9e188e2a80d569d9adce @@ -10848,7 +8129,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^3.13.0, js-yaml@npm:^3.13.1, js-yaml@npm:^3.14.1": +"js-yaml@npm:^3.13.1": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" dependencies: @@ -10938,20 +8219,6 @@ __metadata: languageName: node linkType: hard -"json-buffer@npm:3.0.0": - version: 3.0.0 - resolution: "json-buffer@npm:3.0.0" - checksum: 0cecacb8025370686a916069a2ff81f7d55167421b6aa7270ee74e244012650dd6bce22b0852202ea7ff8624fce50ff0ec1bdf95914ccb4553426e290d5a63fa - languageName: node - linkType: hard - -"json-parse-better-errors@npm:^1.0.1, json-parse-better-errors@npm:^1.0.2": - version: 1.0.2 - resolution: "json-parse-better-errors@npm:1.0.2" - checksum: ff2b5ba2a70e88fd97a3cb28c1840144c5ce8fae9cbeeddba15afa333a5c407cf0e42300cd0a2885dbb055227fe68d405070faad941beeffbfde9cf3b2c78c5d - languageName: node - linkType: hard - "json-parse-even-better-errors@npm:^2.3.0, json-parse-even-better-errors@npm:^2.3.1": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -10980,13 +8247,6 @@ __metadata: languageName: node linkType: hard -"json-stringify-nice@npm:^1.1.4": - version: 1.1.4 - resolution: "json-stringify-nice@npm:1.1.4" - checksum: 6ddf781148b46857ab04e97f47be05f14c4304b86eb5478369edbeacd070c21c697269964b982fc977e8989d4c59091103b1d9dc291aba40096d6cbb9a392b72 - languageName: node - linkType: hard - "json-stringify-safe@npm:^5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -10994,7 +8254,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:2.x, json5@npm:^2.1.1, json5@npm:^2.2.1": +"json5@npm:2.x, json5@npm:^2.2.1": version: 2.2.1 resolution: "json5@npm:2.2.1" bin: @@ -11003,122 +8263,46 @@ __metadata: languageName: node linkType: hard -"json5@npm:^1.0.1": - version: 1.0.1 - resolution: "json5@npm:1.0.1" - dependencies: - minimist: ^1.2.0 - bin: - json5: lib/cli.js - checksum: e76ea23dbb8fc1348c143da628134a98adf4c5a4e8ea2adaa74a80c455fc2cdf0e2e13e6398ef819bfe92306b610ebb2002668ed9fc1af386d593691ef346fc3 - languageName: node - linkType: hard - -"jsonc-parser@npm:3.0.0": - version: 3.0.0 - resolution: "jsonc-parser@npm:3.0.0" - checksum: 1df2326f1f9688de30c70ff19c5b2a83ba3b89a1036160da79821d1361090775e9db502dc57a67c11b56e1186fc1ed70b887f25c5febf9a3ec4f91435836c99d - languageName: node - linkType: hard - -"jsonfile@npm:^4.0.0": - version: 4.0.0 - resolution: "jsonfile@npm:4.0.0" - dependencies: - graceful-fs: ^4.1.6 - dependenciesMeta: - graceful-fs: - optional: true - checksum: 6447d6224f0d31623eef9b51185af03ac328a7553efcee30fa423d98a9e276ca08db87d71e17f2310b0263fd3ffa6c2a90a6308367f661dc21580f9469897c9e - languageName: node - linkType: hard - -"jsonfile@npm:^6.0.1": - version: 6.1.0 - resolution: "jsonfile@npm:6.1.0" - dependencies: - graceful-fs: ^4.1.6 - universalify: ^2.0.0 - dependenciesMeta: - graceful-fs: - optional: true - checksum: 7af3b8e1ac8fe7f1eccc6263c6ca14e1966fcbc74b618d3c78a0a2075579487547b94f72b7a1114e844a1e15bb00d440e5d1720bfc4612d790a6f285d5ea8354 - languageName: node - linkType: hard - -"jsonparse@npm:^1.3.1": - version: 1.3.1 - resolution: "jsonparse@npm:1.3.1" - checksum: 6514a7be4674ebf407afca0eda3ba284b69b07f9958a8d3113ef1005f7ec610860c312be067e450c569aab8b89635e332cee3696789c750692bb60daba627f4d - languageName: node - linkType: hard - -"jsonwebtoken@npm:^8.0.0, jsonwebtoken@npm:^8.5.1": - version: 8.5.1 - resolution: "jsonwebtoken@npm:8.5.1" - dependencies: - jws: ^3.2.2 - lodash.includes: ^4.3.0 - lodash.isboolean: ^3.0.3 - lodash.isinteger: ^4.0.4 - lodash.isnumber: ^3.0.3 - lodash.isplainobject: ^4.0.6 - lodash.isstring: ^4.0.1 - lodash.once: ^4.0.0 - ms: ^2.1.1 - semver: ^5.6.0 - checksum: 93c9e3f23c59b758ac88ba15f4e4753b3749dfce7a6f7c40fb86663128a1e282db085eec852d4e0cbca4cefdcd3a8275ee255dbd08fcad0df26ad9f6e4cc853a - languageName: node - linkType: hard - -"just-diff-apply@npm:^5.2.0": - version: 5.2.0 - resolution: "just-diff-apply@npm:5.2.0" - checksum: 5e63562665f7b3b279d286f5cd3d73af0e0ffadbdc02cb2c43a50370ad1a614b557842938d157de904be69a4bc6b2187cee3257add1440fdf1e4814de691b0af - languageName: node - linkType: hard - -"just-diff@npm:^5.0.1": - version: 5.0.2 - resolution: "just-diff@npm:5.0.2" - checksum: 1c7408432f53ff67ea4ce41adb5579c08a39f990956ddbf2e94f4161f3802a41179d7412538573972433ce9f50e371afdca019964e51cf500577bf1aa732b842 - languageName: node - linkType: hard - -"jwa@npm:^1.4.1": - version: 1.4.1 - resolution: "jwa@npm:1.4.1" +"json5@npm:^1.0.1": + version: 1.0.1 + resolution: "json5@npm:1.0.1" dependencies: - buffer-equal-constant-time: 1.0.1 - ecdsa-sig-formatter: 1.0.11 - safe-buffer: ^5.0.1 - checksum: ff30ea7c2dcc61f3ed2098d868bf89d43701605090c5b21b5544b512843ec6fd9e028381a4dda466cbcdb885c2d1150f7c62e7168394ee07941b4098e1035e2f + minimist: ^1.2.0 + bin: + json5: lib/cli.js + checksum: e76ea23dbb8fc1348c143da628134a98adf4c5a4e8ea2adaa74a80c455fc2cdf0e2e13e6398ef819bfe92306b610ebb2002668ed9fc1af386d593691ef346fc3 languageName: node linkType: hard -"jws@npm:^3.2.2": - version: 3.2.2 - resolution: "jws@npm:3.2.2" - dependencies: - jwa: ^1.4.1 - safe-buffer: ^5.0.1 - checksum: f0213fe5b79344c56cd443428d8f65c16bf842dc8cb8f5aed693e1e91d79c20741663ad6eff07a6d2c433d1831acc9814e8d7bada6a0471fbb91d09ceb2bf5c2 +"jsonc-parser@npm:3.0.0": + version: 3.0.0 + resolution: "jsonc-parser@npm:3.0.0" + checksum: 1df2326f1f9688de30c70ff19c5b2a83ba3b89a1036160da79821d1361090775e9db502dc57a67c11b56e1186fc1ed70b887f25c5febf9a3ec4f91435836c99d languageName: node linkType: hard -"keyv@npm:^3.0.0": - version: 3.1.0 - resolution: "keyv@npm:3.1.0" +"jsonfile@npm:^6.0.1": + version: 6.1.0 + resolution: "jsonfile@npm:6.1.0" dependencies: - json-buffer: 3.0.0 - checksum: bb7e8f3acffdbafbc2dd5b63f377fe6ec4c0e2c44fc82720449ef8ab54f4a7ce3802671ed94c0f475ae0a8549703353a2124561fcf3317010c141b32ca1ce903 + graceful-fs: ^4.1.6 + universalify: ^2.0.0 + dependenciesMeta: + graceful-fs: + optional: true + checksum: 7af3b8e1ac8fe7f1eccc6263c6ca14e1966fcbc74b618d3c78a0a2075579487547b94f72b7a1114e844a1e15bb00d440e5d1720bfc4612d790a6f285d5ea8354 languageName: node linkType: hard -"kind-of@npm:^6.0.2": - version: 6.0.3 - resolution: "kind-of@npm:6.0.3" - checksum: 3ab01e7b1d440b22fe4c31f23d8d38b4d9b91d9f291df683476576493d5dfd2e03848a8b05813dd0c3f0e835bc63f433007ddeceb71f05cb25c45ae1b19c6d3b +"keccak@npm:^3.0.0": + version: 3.0.2 + resolution: "keccak@npm:3.0.2" + dependencies: + node-addon-api: ^2.0.0 + node-gyp: latest + node-gyp-build: ^4.2.0 + readable-stream: ^3.6.0 + checksum: 39a7d6128b8ee4cb7dcd186fc7e20c6087cc39f573a0f81b147c323f688f1f7c2b34f62c4ae189fe9b81c6730b2d1228d8a399cdc1f3d8a4c8f030cdc4f20272 languageName: node linkType: hard @@ -11129,15 +8313,6 @@ __metadata: languageName: node linkType: hard -"latest-version@npm:^5.1.0": - version: 5.1.0 - resolution: "latest-version@npm:5.1.0" - dependencies: - package-json: ^6.3.0 - checksum: fbc72b071eb66c40f652441fd783a9cca62f08bf42433651937f078cd9ef94bf728ec7743992777826e4e89305aef24f234b515e6030503a2cbee7fc9bdc2c0f - languageName: node - linkType: hard - "level-codec@npm:^9.0.0": version: 9.0.2 resolution: "level-codec@npm:9.0.2" @@ -11269,16 +8444,16 @@ __metadata: linkType: hard "libphonenumber-js@npm:^1.9.43": - version: 1.9.53 - resolution: "libphonenumber-js@npm:1.9.53" - checksum: 36eb4078fbfb2c1f43b6af7709c13d41776396fb3358c6dd5d7177105c296bafe9a9afa891b95f77d484e40200b40b09df3acc49a08a96390cf092c426d5a428 + version: 1.10.13 + resolution: "libphonenumber-js@npm:1.10.13" + checksum: a1740bbed8faa1adb4ae01dda6a7c16b4fd2917efdd9bafac53fa06d9e4b53dc67543d282f7fd0043649edddc0f03359448a17adb837e534358c7ba92c7dc268 languageName: node linkType: hard -"lilconfig@npm:2.0.4": - version: 2.0.4 - resolution: "lilconfig@npm:2.0.4" - checksum: 02ae530aa49218d782eb79e92c600ea5220828987f85aa3403fa512cadc7efe38c0ac7d0cd2edf600ad3fae1f6c1752f5b4bb78c0d9950435b044d53d507c9e1 +"lilconfig@npm:2.0.5": + version: 2.0.5 + resolution: "lilconfig@npm:2.0.5" + checksum: f7bb9e42656f06930ad04e583026f087508ae408d3526b8b54895e934eb2a966b7aafae569656f2c79a29fe6d779b3ec44ba577e80814734c8655d6f71cdf2d1 languageName: node linkType: hard @@ -11297,30 +8472,30 @@ __metadata: linkType: hard "lint-staged@npm:^12.3.3": - version: 12.4.1 - resolution: "lint-staged@npm:12.4.1" + version: 12.5.0 + resolution: "lint-staged@npm:12.5.0" dependencies: cli-truncate: ^3.1.0 colorette: ^2.0.16 - commander: ^8.3.0 - debug: ^4.3.3 + commander: ^9.3.0 + debug: ^4.3.4 execa: ^5.1.1 - lilconfig: 2.0.4 - listr2: ^4.0.1 - micromatch: ^4.0.4 + lilconfig: 2.0.5 + listr2: ^4.0.5 + micromatch: ^4.0.5 normalize-path: ^3.0.0 - object-inspect: ^1.12.0 + object-inspect: ^1.12.2 pidtree: ^0.5.0 string-argv: ^0.3.1 - supports-color: ^9.2.1 + supports-color: ^9.2.2 yaml: ^1.10.2 bin: lint-staged: bin/lint-staged.js - checksum: b57183b537064cda6caef6679918bf271903145f7c28d09567e918b8b13094048b579f8df808ea590dbd7ea2ec332327c5e372cf3d77e85b7b0254f6541ce4c3 + checksum: ac203917be098305bc0aebd5f1a969e88ea0854e8fb2199ebcbbb059d8bce324cf97db8f3d25f7954dd48c0666ae13987fb4db569d5b6fecda06f9fb742278e1 languageName: node linkType: hard -"listr2@npm:^4.0.1": +"listr2@npm:^4.0.5": version: 4.0.5 resolution: "listr2@npm:4.0.5" dependencies: @@ -11341,58 +8516,6 @@ __metadata: languageName: node linkType: hard -"load-json-file@npm:^6.2.0": - version: 6.2.0 - resolution: "load-json-file@npm:6.2.0" - dependencies: - graceful-fs: ^4.1.15 - parse-json: ^5.0.0 - strip-bom: ^4.0.0 - type-fest: ^0.6.0 - checksum: 4429e430ebb99375fc7cd936348e4f7ba729486080ced4272091c1e386a7f5f738ea3337d8ffd4b01c2f5bc3ddde92f2c780045b66838fe98bdb79f901884643 - languageName: node - linkType: hard - -"load-yaml-file@npm:^0.2.0": - version: 0.2.0 - resolution: "load-yaml-file@npm:0.2.0" - dependencies: - graceful-fs: ^4.1.5 - js-yaml: ^3.13.0 - pify: ^4.0.1 - strip-bom: ^3.0.0 - checksum: d86d7ec7b15a1c35b40fb0d8abe710a7de83e0c1186c1d35a7eaaf8581611828089a3e706f64560c2939762bc73f18a7b85aed9335058c640e033933cf317f11 - languageName: node - linkType: hard - -"loader-runner@npm:^4.2.0": - version: 4.3.0 - resolution: "loader-runner@npm:4.3.0" - checksum: a90e00dee9a16be118ea43fec3192d0b491fe03a32ed48a4132eb61d498f5536a03a1315531c19d284392a8726a4ecad71d82044c28d7f22ef62e029bf761569 - languageName: node - linkType: hard - -"loader-utils@npm:^1.4.0": - version: 1.4.0 - resolution: "loader-utils@npm:1.4.0" - dependencies: - big.js: ^5.2.2 - emojis-list: ^3.0.0 - json5: ^1.0.1 - checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717 - languageName: node - linkType: hard - -"locate-path@npm:^2.0.0": - version: 2.0.0 - resolution: "locate-path@npm:2.0.0" - dependencies: - p-locate: ^2.0.0 - path-exists: ^3.0.0 - checksum: 02d581edbbbb0fa292e28d96b7de36b5b62c2fa8b5a7e82638ebb33afa74284acf022d3b1e9ae10e3ffb7658fbc49163fcd5e76e7d1baaa7801c3e05a81da755 - languageName: node - linkType: hard - "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -11418,55 +8541,6 @@ __metadata: languageName: node linkType: hard -"lodash.get@npm:^4.4.2": - version: 4.4.2 - resolution: "lodash.get@npm:4.4.2" - checksum: e403047ddb03181c9d0e92df9556570e2b67e0f0a930fcbbbd779370972368f5568e914f913e93f3b08f6d492abc71e14d4e9b7a18916c31fa04bd2306efe545 - languageName: node - linkType: hard - -"lodash.includes@npm:^4.3.0": - version: 4.3.0 - resolution: "lodash.includes@npm:4.3.0" - checksum: 71092c130515a67ab3bd928f57f6018434797c94def7f46aafa417771e455ce3a4834889f4267b17887d7f75297dfabd96231bf704fd2b8c5096dc4a913568b6 - languageName: node - linkType: hard - -"lodash.isboolean@npm:^3.0.3": - version: 3.0.3 - resolution: "lodash.isboolean@npm:3.0.3" - checksum: b70068b4a8b8837912b54052557b21fc4774174e3512ed3c5b94621e5aff5eb6c68089d0a386b7e801d679cd105d2e35417978a5e99071750aa2ed90bffd0250 - languageName: node - linkType: hard - -"lodash.isinteger@npm:^4.0.4": - version: 4.0.4 - resolution: "lodash.isinteger@npm:4.0.4" - checksum: 6034821b3fc61a2ffc34e7d5644bb50c5fd8f1c0121c554c21ac271911ee0c0502274852845005f8651d51e199ee2e0cfebfe40aaa49c7fe617f603a8a0b1691 - languageName: node - linkType: hard - -"lodash.isnumber@npm:^3.0.3": - version: 3.0.3 - resolution: "lodash.isnumber@npm:3.0.3" - checksum: 913784275b565346255e6ae6a6e30b760a0da70abc29f3e1f409081585875105138cda4a429ff02577e1bc0a7ae2a90e0a3079a37f3a04c3d6c5aaa532f4cab2 - languageName: node - linkType: hard - -"lodash.isplainobject@npm:^4.0.6": - version: 4.0.6 - resolution: "lodash.isplainobject@npm:4.0.6" - checksum: 29c6351f281e0d9a1d58f1a4c8f4400924b4c79f18dfc4613624d7d54784df07efaff97c1ff2659f3e085ecf4fff493300adc4837553104cef2634110b0d5337 - languageName: node - linkType: hard - -"lodash.isstring@npm:^4.0.1": - version: 4.0.1 - resolution: "lodash.isstring@npm:4.0.1" - checksum: eaac87ae9636848af08021083d796e2eea3d02e80082ab8a9955309569cb3a463ce97fd281d7dc119e402b2e7d8c54a23914b15d2fc7fff56461511dc8937ba0 - languageName: node - linkType: hard - "lodash.memoize@npm:4.x": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" @@ -11481,28 +8555,14 @@ __metadata: languageName: node linkType: hard -"lodash.once@npm:^4.0.0": - version: 4.1.1 - resolution: "lodash.once@npm:4.1.1" - checksum: d768fa9f9b4e1dc6453be99b753906f58990e0c45e7b2ca5a3b40a33111e5d17f6edf2f768786e2716af90a8e78f8f91431ab8435f761fef00f9b0c256f6d245 - languageName: node - linkType: hard - -"lodash.sortby@npm:^4.7.0": - version: 4.7.0 - resolution: "lodash.sortby@npm:4.7.0" - checksum: db170c9396d29d11fe9a9f25668c4993e0c1331bcb941ddbd48fb76f492e732add7f2a47cfdf8e9d740fa59ac41bbfaf931d268bc72aab3ab49e9f89354d718c - languageName: node - linkType: hard - -"lodash@npm:>=4 <5, lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.19, lodash@npm:^4.17.21, lodash@npm:^4.7.0": +"lodash@npm:^4.17.21, lodash@npm:^4.7.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 languageName: node linkType: hard -"log-symbols@npm:^4.0.0, log-symbols@npm:^4.1.0": +"log-symbols@npm:^4.1.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" dependencies: @@ -11524,13 +8584,6 @@ __metadata: languageName: node linkType: hard -"loglevel@npm:^1.6.8": - version: 1.8.0 - resolution: "loglevel@npm:1.8.0" - checksum: 41aeea17de24aba8dba68084a31fe9189648bce4f39c1277e021bb276c3c53a75b0d337395919cf271068ad40ecefabad0e4fdeb4a8f11908beee532b898f4a7 - languageName: node - linkType: hard - "long@npm:^4.0.0": version: 4.0.0 resolution: "long@npm:4.0.0" @@ -11549,39 +8602,6 @@ __metadata: languageName: node linkType: hard -"lowercase-keys@npm:^1.0.0, lowercase-keys@npm:^1.0.1": - version: 1.0.1 - resolution: "lowercase-keys@npm:1.0.1" - checksum: 4d045026595936e09953e3867722e309415ff2c80d7701d067546d75ef698dac218a4f53c6d1d0e7368b47e45fd7529df47e6cb56fbb90523ba599f898b3d147 - languageName: node - linkType: hard - -"lowercase-keys@npm:^2.0.0": - version: 2.0.0 - resolution: "lowercase-keys@npm:2.0.0" - checksum: 24d7ebd56ccdf15ff529ca9e08863f3c54b0b9d1edb97a3ae1af34940ae666c01a1e6d200707bce730a8ef76cb57cc10e65f245ecaaf7e6bc8639f2fb460ac23 - languageName: node - linkType: hard - -"lru-cache@npm:>=4 <5": - version: 4.1.5 - resolution: "lru-cache@npm:4.1.5" - dependencies: - pseudomap: ^1.0.2 - yallist: ^2.1.2 - checksum: 4bb4b58a36cd7dc4dcec74cbe6a8f766a38b7426f1ff59d4cf7d82a2aa9b9565cd1cb98f6ff60ce5cd174524868d7bc9b7b1c294371851356066ca9ac4cf135a - languageName: node - linkType: hard - -"lru-cache@npm:^5.0.0": - version: 5.1.1 - resolution: "lru-cache@npm:5.1.1" - dependencies: - yallist: ^3.0.2 - checksum: c154ae1cbb0c2206d1501a0e94df349653c92c8cbb25236d7e85190bcaf4567a03ac6eb43166fabfa36fd35623694da7233e88d9601fbf411a9a481d85dbd2cb - languageName: node - linkType: hard - "lru-cache@npm:^6.0.0": version: 6.0.0 resolution: "lru-cache@npm:6.0.0" @@ -11592,9 +8612,9 @@ __metadata: linkType: hard "lru-cache@npm:^7.7.1": - version: 7.9.0 - resolution: "lru-cache@npm:7.9.0" - checksum: c91a293a103d11ea4f07de4122ba4f73d8203d0de51852fb612b1764296aebf623a3e11dddef1b3aefdc8d71af97d52b222dad5459dcb967713bbab9a19fed7d + version: 7.14.0 + resolution: "lru-cache@npm:7.14.0" + checksum: efdd329f2c1bb790b71d497c6c59272e6bc2d7dd060ba55fc136becd3dd31fc8346edb446275504d94cb60d3c8385dbf5267b79b23789e409b2bdf302d13f0d7 languageName: node linkType: hard @@ -11605,13 +8625,6 @@ __metadata: languageName: node linkType: hard -"macos-release@npm:^2.5.0": - version: 2.5.0 - resolution: "macos-release@npm:2.5.0" - checksum: 57379ba354449898ceca91ca8f1ae4d0b2c45671e8a5200d29054a77b462a0319eb3dcb8a8b6bbe2257079cf682550abcfd8a6214a60ac78e4a71c007df1fc85 - languageName: node - linkType: hard - "magic-string@npm:0.25.7": version: 0.25.7 resolution: "magic-string@npm:0.25.7" @@ -11637,12 +8650,12 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.1, make-fetch-happen@npm:^10.0.3": - version: 10.1.3 - resolution: "make-fetch-happen@npm:10.1.3" +"make-fetch-happen@npm:^10.0.3": + version: 10.2.1 + resolution: "make-fetch-happen@npm:10.2.1" dependencies: agentkeepalive: ^4.2.1 - cacache: ^16.0.2 + cacache: ^16.1.0 http-cache-semantics: ^4.1.0 http-proxy-agent: ^5.0.0 https-proxy-agent: ^5.0.0 @@ -11655,33 +8668,9 @@ __metadata: minipass-pipeline: ^1.2.4 negotiator: ^0.6.3 promise-retry: ^2.0.1 - socks-proxy-agent: ^6.1.1 + socks-proxy-agent: ^7.0.0 ssri: ^9.0.0 - checksum: 14b9bc5fb65a1a1f53b4579c947d1ebdb18db71eb0b35a2eab612e9642a14127917528fe4ffb2c37aaa0d27dfd7507e4044e6e2e47b43985e8fa18722f535b8f - languageName: node - linkType: hard - -"make-fetch-happen@npm:^9.1.0": - version: 9.1.0 - resolution: "make-fetch-happen@npm:9.1.0" - dependencies: - agentkeepalive: ^4.1.3 - cacache: ^15.2.0 - http-cache-semantics: ^4.1.0 - http-proxy-agent: ^4.0.1 - https-proxy-agent: ^5.0.0 - is-lambda: ^1.0.1 - lru-cache: ^6.0.0 - minipass: ^3.1.3 - minipass-collect: ^1.0.2 - minipass-fetch: ^1.3.2 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - negotiator: ^0.6.2 - promise-retry: ^2.0.1 - socks-proxy-agent: ^6.0.0 - ssri: ^8.0.0 - checksum: 0eb371c85fdd0b1584fcfdf3dc3c62395761b3c14658be02620c310305a9a7ecf1617a5e6fb30c1d081c5c8aaf177fa133ee225024313afabb7aa6a10f1e3d04 + checksum: 2332eb9a8ec96f1ffeeea56ccefabcb4193693597b132cd110734d50f2928842e22b84cfa1508e921b8385cdfd06dda9ad68645fed62b50fff629a580f5fb72c languageName: node linkType: hard @@ -11694,54 +8683,21 @@ __metadata: languageName: node linkType: hard -"media-typer@npm:0.3.0": - version: 0.3.0 - resolution: "media-typer@npm:0.3.0" - checksum: af1b38516c28ec95d6b0826f6c8f276c58aec391f76be42aa07646b4e39d317723e869700933ca6995b056db4b09a78c92d5440dc23657e6764be5d28874bba1 - languageName: node - linkType: hard - -"mem-fs-editor@npm:^8.1.2 || ^9.0.0": - version: 9.4.0 - resolution: "mem-fs-editor@npm:9.4.0" - dependencies: - binaryextensions: ^4.16.0 - commondir: ^1.0.1 - deep-extend: ^0.6.0 - ejs: ^3.1.6 - globby: ^11.0.3 - isbinaryfile: ^4.0.8 - minimatch: ^3.0.4 - multimatch: ^5.0.0 - normalize-path: ^3.0.0 - textextensions: ^5.13.0 - peerDependencies: - mem-fs: ^2.1.0 - peerDependenciesMeta: - mem-fs: - optional: true - checksum: 427b71d59a4bd7032b12ef22e8f69fdf3165ec7cc4350f1a1fca190c4211ba8a01e14a04d9a7db8cb44f74034de2bc6e42f0d5ffb5b20590e71646baac5a8a0c - languageName: node - linkType: hard - -"mem-fs@npm:^1.2.0 || ^2.0.0": - version: 2.2.1 - resolution: "mem-fs@npm:2.2.1" +"md5.js@npm:^1.3.4": + version: 1.3.5 + resolution: "md5.js@npm:1.3.5" dependencies: - "@types/node": ^15.6.1 - "@types/vinyl": ^2.0.4 - vinyl: ^2.0.1 - vinyl-file: ^3.0.0 - checksum: e44fb4acf8391a847b9e9494115b27300eda77aa7c6caea533786f43d385253515b0c0ff4f00906744b2bd31010df923cc448bb6efb9593f41df5d40b0e69046 + hash-base: ^3.0.0 + inherits: ^2.0.1 + safe-buffer: ^5.1.2 + checksum: 098494d885684bcc4f92294b18ba61b7bd353c23147fbc4688c75b45cb8590f5a95fd4584d742415dcc52487f7a1ef6ea611cfa1543b0dc4492fe026357f3f0c languageName: node linkType: hard -"memfs@npm:^3.4.1": - version: 3.4.1 - resolution: "memfs@npm:3.4.1" - dependencies: - fs-monkey: 1.0.3 - checksum: 6d2f49d447d1be24ff9c747618933784eeb059189bc6a0d77b7a51c7daf06e2d3a74674a2e2ff1520e2c312bf91e719ed37144cf05087379b3ba0aef0b6aa062 +"media-typer@npm:0.3.0": + version: 0.3.0 + resolution: "media-typer@npm:0.3.0" + checksum: af1b38516c28ec95d6b0826f6c8f276c58aec391f76be42aa07646b4e39d317723e869700933ca6995b056db4b09a78c92d5440dc23657e6764be5d28874bba1 languageName: node linkType: hard @@ -11768,7 +8724,7 @@ __metadata: languageName: node linkType: hard -"merge2@npm:^1.2.3, merge2@npm:^1.3.0, merge2@npm:^1.4.1": +"merge2@npm:^1.3.0, merge2@npm:^1.4.1": version: 1.4.1 resolution: "merge2@npm:1.4.1" checksum: 7268db63ed5169466540b6fb947aec313200bcf6d40c5ab722c22e242f651994619bcd85601602972d3c85bd2cc45a358a4c61937e9f11a061919a1da569b0c2 @@ -11791,7 +8747,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.0, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4": +"micromatch@npm:^4.0.0, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -11808,7 +8764,7 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": +"mime-types@npm:^2.1.12, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": version: 2.1.35 resolution: "mime-types@npm:2.1.35" dependencies: @@ -11826,7 +8782,7 @@ __metadata: languageName: node linkType: hard -"mime@npm:^2.4.6, mime@npm:^2.5.0": +"mime@npm:2.6.0, mime@npm:^2.4.6": version: 2.6.0 resolution: "mime@npm:2.6.0" bin: @@ -11842,14 +8798,21 @@ __metadata: languageName: node linkType: hard -"mimic-response@npm:^1.0.0, mimic-response@npm:^1.0.1": +"minimalistic-assert@npm:^1.0.0, minimalistic-assert@npm:^1.0.1": + version: 1.0.1 + resolution: "minimalistic-assert@npm:1.0.1" + checksum: cc7974a9268fbf130fb055aff76700d7e2d8be5f761fb5c60318d0ed010d839ab3661a533ad29a5d37653133385204c503bfac995aaa4236f4e847461ea32ba7 + languageName: node + linkType: hard + +"minimalistic-crypto-utils@npm:^1.0.1": version: 1.0.1 - resolution: "mimic-response@npm:1.0.1" - checksum: 034c78753b0e622bc03c983663b1cdf66d03861050e0c8606563d149bc2b02d63f62ce4d32be4ab50d0553ae0ffe647fc34d1f5281184c6e1e8cf4d85e8d9823 + resolution: "minimalistic-crypto-utils@npm:1.0.1" + checksum: 6e8a0422b30039406efd4c440829ea8f988845db02a3299f372fceba56ffa94994a9c0f2fd70c17f9969eedfbd72f34b5070ead9656a34d3f71c0bd72583a0ed languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -11859,15 +8822,15 @@ __metadata: linkType: hard "minimatch@npm:^5.0.1": - version: 5.0.1 - resolution: "minimatch@npm:5.0.1" + version: 5.1.0 + resolution: "minimatch@npm:5.1.0" dependencies: brace-expansion: ^2.0.1 - checksum: b34b98463da4754bc526b244d680c69d4d6089451ebe512edaf6dd9eeed0279399cfa3edb19233513b8f830bf4bfcad911dddcdf125e75074100d52f724774f0 + checksum: 15ce53d31a06361e8b7a629501b5c75491bc2b59712d53e802b1987121d91b433d73fcc5be92974fde66b2b51d8fb28d75a9ae900d249feb792bb1ba2a4f0a90 languageName: node linkType: hard -"minimist@npm:1.2.6, minimist@npm:^1.1.0, minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6": +"minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.6 resolution: "minimist@npm:1.2.6" checksum: d15428cd1e11eb14e1233bcfb88ae07ed7a147de251441d61158619dfb32c4d7e9061d09cab4825fdee18ecd6fce323228c8c47b5ba7cd20af378ca4048fb3fb @@ -11883,24 +8846,9 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^1.3.2, minipass-fetch@npm:^1.4.1": - version: 1.4.1 - resolution: "minipass-fetch@npm:1.4.1" - dependencies: - encoding: ^0.1.12 - minipass: ^3.1.0 - minipass-sized: ^1.0.3 - minizlib: ^2.0.0 - dependenciesMeta: - encoding: - optional: true - checksum: ec93697bdb62129c4e6c0104138e681e30efef8c15d9429dd172f776f83898471bc76521b539ff913248cc2aa6d2b37b652c993504a51cc53282563640f29216 - languageName: node - linkType: hard - "minipass-fetch@npm:^2.0.3": - version: 2.1.0 - resolution: "minipass-fetch@npm:2.1.0" + version: 2.1.2 + resolution: "minipass-fetch@npm:2.1.2" dependencies: encoding: ^0.1.13 minipass: ^3.1.6 @@ -11909,7 +8857,7 @@ __metadata: dependenciesMeta: encoding: optional: true - checksum: 1334732859a3f7959ed22589bafd9c40384b885aebb5932328071c33f86b3eb181d54c86919675d1825ab5f1c8e4f328878c863873258d113c29d79a4b0c9c9f + checksum: 3f216be79164e915fc91210cea1850e488793c740534985da017a4cbc7a5ff50506956d0f73bb0cb60e4fe91be08b6b61ef35101706d3ef5da2c8709b5f08f91 languageName: node linkType: hard @@ -11922,17 +8870,7 @@ __metadata: languageName: node linkType: hard -"minipass-json-stream@npm:^1.0.1": - version: 1.0.1 - resolution: "minipass-json-stream@npm:1.0.1" - dependencies: - jsonparse: ^1.3.1 - minipass: ^3.0.0 - checksum: 791b696a27d1074c4c08dab1bf5a9f3201145c2933e428f45d880467bce12c60de4703203d2928de4b162d0ae77b0bb4b55f96cb846645800aa0eb4919b3e796 - languageName: node - linkType: hard - -"minipass-pipeline@npm:^1.2.2, minipass-pipeline@npm:^1.2.4": +"minipass-pipeline@npm:^1.2.4": version: 1.2.4 resolution: "minipass-pipeline@npm:1.2.4" dependencies: @@ -11950,16 +8888,16 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.0, minipass@npm:^3.1.1, minipass@npm:^3.1.3, minipass@npm:^3.1.6": - version: 3.1.6 - resolution: "minipass@npm:3.1.6" +"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6, minipass@npm:^3.3.5": + version: 3.3.5 + resolution: "minipass@npm:3.3.5" dependencies: yallist: ^4.0.0 - checksum: 57a04041413a3531a65062452cb5175f93383ef245d6f4a2961d34386eb9aa8ac11ac7f16f791f5e8bbaf1dfb1ef01596870c88e8822215db57aa591a5bb0a77 + checksum: f89f02bcaa0e0e4bb4c44ec796008e69fbca62db0aba6ead1bc57d25bdaefdf42102130f4f9ecb7d9c6b6cd35ff7b0c7b97d001d3435da8e629fb68af3aea57e languageName: node linkType: hard -"minizlib@npm:^2.0.0, minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": +"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" dependencies: @@ -11969,24 +8907,6 @@ __metadata: languageName: node linkType: hard -"mkdirp-classic@npm:^0.5.2": - version: 0.5.3 - resolution: "mkdirp-classic@npm:0.5.3" - checksum: 3f4e088208270bbcc148d53b73e9a5bd9eef05ad2cbf3b3d0ff8795278d50dd1d11a8ef1875ff5aea3fa888931f95bfcb2ad5b7c1061cfefd6284d199e6776ac - languageName: node - linkType: hard - -"mkdirp-infer-owner@npm:^2.0.0": - version: 2.0.0 - resolution: "mkdirp-infer-owner@npm:2.0.0" - dependencies: - chownr: ^2.0.0 - infer-owner: ^1.0.4 - mkdirp: ^1.0.3 - checksum: d8f4ecd32f6762459d6b5714eae6487c67ae9734ab14e26d14377ddd9b2a1bf868d8baa18c0f3e73d3d513f53ec7a698e0f81a9367102c870a55bef7833880f7 - languageName: node - linkType: hard - "mkdirp@npm:^0.5.4": version: 0.5.6 resolution: "mkdirp@npm:0.5.6" @@ -12015,18 +8935,18 @@ __metadata: linkType: hard "moment-timezone@npm:^0.5.34, moment-timezone@npm:^0.5.x": - version: 0.5.34 - resolution: "moment-timezone@npm:0.5.34" + version: 0.5.37 + resolution: "moment-timezone@npm:0.5.37" dependencies: moment: ">= 2.9.0" - checksum: 12a1d3d52e4ba509cf1fa36bbda59d898a08fa80ab35f6c358747e93aec1f07e617cec647eaf2e8acf5f9132e581d4704d34a9edffa9a80c5cd04bf23b277595 + checksum: b3fc24848a396ee3801331a4b5511591df0e22241e59f55200a475603f23a8429f01887294c7a0c005dae25b8e4bef20472fbc875ff20080f26fded066559f1a languageName: node linkType: hard "moment@npm:>= 2.9.0, moment@npm:^2.29.1": - version: 2.29.3 - resolution: "moment@npm:2.29.3" - checksum: 2e780e36d9a1823c08a1b6313cbb08bd01ecbb2a9062095820a34f42c878991ccba53abaa6abb103fd5c01e763724f295162a8c50b7e95b4f1c992ef0772d3f0 + version: 2.29.4 + resolution: "moment@npm:2.29.4" + checksum: 0ec3f9c2bcba38dc2451b1daed5daded747f17610b92427bebe1d08d48d8b7bdd8d9197500b072d14e326dd0ccf3e326b9e3d07c5895d3d49e39b6803b76e80e languageName: node linkType: hard @@ -12058,19 +8978,18 @@ __metadata: languageName: node linkType: hard -"multer@npm:1.4.4": - version: 1.4.4 - resolution: "multer@npm:1.4.4" +"multer@npm:1.4.4-lts.1": + version: 1.4.4-lts.1 + resolution: "multer@npm:1.4.4-lts.1" dependencies: append-field: ^1.0.0 - busboy: ^0.2.11 + busboy: ^1.0.0 concat-stream: ^1.5.2 mkdirp: ^0.5.4 object-assign: ^4.1.1 - on-finished: ^2.3.0 type-is: ^1.6.4 xtend: ^4.0.0 - checksum: b5550d250aeee9c4d630eaecd133af0899239f6b10cec4b448ddd0a808025b383520b8227198a8612f60c2cd2094bcb60de93d973084f889d4e40efe6dbd641e + checksum: da04b06efdbff9bd42d9f71297eeb2c0566231a4b9c895f49479c09b163c5e404aa6e58bd1c19f006f82e2114362545e39cbf7e0163ffd8d73d0f88adf4489e2 languageName: node linkType: hard @@ -12098,16 +9017,9 @@ __metadata: linkType: hard "multiformats@npm:^9.4.1, multiformats@npm:^9.4.2, multiformats@npm:^9.4.5, multiformats@npm:^9.5.4": - version: 9.6.5 - resolution: "multiformats@npm:9.6.5" - checksum: f4fce459bf19e1c38e4daa0e6de3aeea55ab000620d23ef599943495ab65d1c0351c5aa53d15eb365181d30a4b0629785a0d8901d17b5d153c48f4f1a683cd47 - languageName: node - linkType: hard - -"multimap@npm:^1.1.0": - version: 1.1.0 - resolution: "multimap@npm:1.1.0" - checksum: 42769c9dd74096d989618fd0f47c69d19f9bab48d1b0b673cfa6c44042a0bd5847524533a06afde80334b4a24defec27754dc8d1f083ee7bb880f69f437efabc + version: 9.8.1 + resolution: "multiformats@npm:9.8.1" + checksum: f75518e2c21c7a90750279ba64913b26a1c1e33309e894662c3a49580c62abfdd91668240eac608c52024e133b6e7489da7e3e8095c849112bd2fa55bcc0550b languageName: node linkType: hard @@ -12124,26 +9036,6 @@ __metadata: languageName: node linkType: hard -"multimatch@npm:^5.0.0": - version: 5.0.0 - resolution: "multimatch@npm:5.0.0" - dependencies: - "@types/minimatch": ^3.0.3 - array-differ: ^3.0.0 - array-union: ^2.1.0 - arrify: ^2.0.1 - minimatch: ^3.0.4 - checksum: 82c8030a53af965cab48da22f1b0f894ef99e16ee680dabdfbd38d2dfacc3c8208c475203d747afd9e26db44118ed0221d5a0d65268c864f06d6efc7ac6df812 - languageName: node - linkType: hard - -"mute-stream@npm:0.0.8": - version: 0.0.8 - resolution: "mute-stream@npm:0.0.8" - checksum: ff48d251fc3f827e5b1206cda0ffdaec885e56057ee86a3155e1951bc940fd5f33531774b1cc8414d7668c10a8907f863f6561875ee6e8768931a62121a531a1 - languageName: node - linkType: hard - "nanoid@npm:^3.0.2, nanoid@npm:^3.1.12, nanoid@npm:^3.1.20": version: 3.3.4 resolution: "nanoid@npm:3.3.4" @@ -12173,7 +9065,7 @@ __metadata: version: 3.0.0 resolution: "native-fetch@npm:3.0.0" peerDependencies: - node-fetch: 2.6.7 + node-fetch: "*" checksum: eec8cc78d6da4d0f3f56055e3e557473ac86dd35fd40053ea268d644af7b20babc891d2b53ef821b77ed2428265f60b85e49d754c555de89bfa071a743b853bb languageName: node linkType: hard @@ -12192,27 +9084,13 @@ __metadata: languageName: node linkType: hard -"natural-orderby@npm:^2.0.1, natural-orderby@npm:^2.0.3": - version: 2.0.3 - resolution: "natural-orderby@npm:2.0.3" - checksum: 039be7f0b6cf81e63d2ae5299553f8e6c8f6ae4f571c7c002eab9c6d36a2e33101704e0ec64c3cecef956fa3b1a68bb0ddfc03208e89f31c0b0bb806f3198646 - languageName: node - linkType: hard - -"negotiator@npm:0.6.3, negotiator@npm:^0.6.2, negotiator@npm:^0.6.3": +"negotiator@npm:0.6.3, negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" checksum: b8ffeb1e262eff7968fc90a2b6767b04cfd9842582a9d0ece0af7049537266e7b2506dfb1d107a32f06dd849ab2aea834d5830f7f4d0e5cb7d36e1ae55d021d9 languageName: node linkType: hard -"neo-async@npm:^2.6.2": - version: 2.6.2 - resolution: "neo-async@npm:2.6.2" - checksum: deac9f8d00eda7b2e5cd1b2549e26e10a0faa70adaa6fdadca701cc55f49ee9018e427f424bac0c790b7c7e2d3068db97f3093f1093975f2acb8f8818b936ed9 - languageName: node - linkType: hard - "next-tick@npm:^1.1.0": version: 1.1.0 resolution: "next-tick@npm:1.1.0" @@ -12220,13 +9098,6 @@ __metadata: languageName: node linkType: hard -"nice-try@npm:^1.0.4": - version: 1.0.5 - resolution: "nice-try@npm:1.0.5" - checksum: 0b4af3b5bb5d86c289f7a026303d192a7eb4417231fe47245c460baeabae7277bcd8fd9c728fb6bd62c30b3e15cd6620373e2cf33353b095d8b403d3e8a15aff - languageName: node - linkType: hard - "nock@npm:^13.2.9": version: 13.2.9 resolution: "nock@npm:13.2.9" @@ -12239,12 +9110,12 @@ __metadata: languageName: node linkType: hard -"node-emoji@npm:1.11.0": - version: 1.11.0 - resolution: "node-emoji@npm:1.11.0" +"node-addon-api@npm:^2.0.0": + version: 2.0.2 + resolution: "node-addon-api@npm:2.0.2" dependencies: - lodash: ^4.17.21 - checksum: e8c856c04a1645062112a72e59a98b203505ed5111ff84a3a5f40611afa229b578c7d50f1e6a7f17aa62baeea4a640d2e2f61f63afc05423aa267af10977fb2b + node-gyp: latest + checksum: 31fb22d674648204f8dd94167eb5aac896c841b84a9210d614bf5d97c74ef059cc6326389cf0c54d2086e35312938401d4cc82e5fcd679202503eb8ac84814f8 languageName: node linkType: hard @@ -12262,51 +9133,31 @@ __metadata: languageName: node linkType: hard -"node-gyp-build@npm:^4.3.0": - version: 4.4.0 - resolution: "node-gyp-build@npm:4.4.0" +"node-gyp-build@npm:^4.2.0, node-gyp-build@npm:^4.3.0": + version: 4.5.0 + resolution: "node-gyp-build@npm:4.5.0" bin: node-gyp-build: bin.js node-gyp-build-optional: optional.js node-gyp-build-test: build-test.js - checksum: 972a059f960253d254e0b23ce10f54c8982236fc0edcab85166d0b7f87443b2ce98391c877cfb2f6eeafcf03c538c5f4dd3e0bfff03828eb48634f58f4c64343 - languageName: node - linkType: hard - -"node-gyp-build@npm:~4.1.0": - version: 4.1.1 - resolution: "node-gyp-build@npm:4.1.1" - bin: - node-gyp-build: ./bin.js - node-gyp-build-optional: ./optional.js - node-gyp-build-test: ./build-test.js - checksum: 959d42221cc44b92700003efae741652bc4e379e4cf375830ddde03ba43c89f99694bf0883078ed0d4e03ffe2f85decab0572e04068d3900b8538d165dbc17df + checksum: d888bae0fb88335f69af1b57a2294a931c5042f36e413d8d364c992c9ebfa0b96ffe773179a5a2c8f04b73856e8634e09cce108dbb9804396d3cc8c5455ff2db languageName: node linkType: hard -"node-gyp@npm:^8.2.0": - version: 8.4.1 - resolution: "node-gyp@npm:8.4.1" - dependencies: - env-paths: ^2.2.0 - glob: ^7.1.4 - graceful-fs: ^4.2.6 - make-fetch-happen: ^9.1.0 - nopt: ^5.0.0 - npmlog: ^6.0.0 - rimraf: ^3.0.2 - semver: ^7.3.5 - tar: ^6.1.2 - which: ^2.0.2 +"node-gyp-build@npm:~4.1.0": + version: 4.1.1 + resolution: "node-gyp-build@npm:4.1.1" bin: - node-gyp: bin/node-gyp.js - checksum: 341710b5da39d3660e6a886b37e210d33f8282047405c2e62c277bcc744c7552c5b8b972ebc3a7d5c2813794e60cc48c3ebd142c46d6e0321db4db6c92dd0355 + node-gyp-build: ./bin.js + node-gyp-build-optional: ./optional.js + node-gyp-build-test: ./build-test.js + checksum: 959d42221cc44b92700003efae741652bc4e379e4cf375830ddde03ba43c89f99694bf0883078ed0d4e03ffe2f85decab0572e04068d3900b8538d165dbc17df languageName: node linkType: hard "node-gyp@npm:latest": - version: 9.0.0 - resolution: "node-gyp@npm:9.0.0" + version: 9.1.0 + resolution: "node-gyp@npm:9.1.0" dependencies: env-paths: ^2.2.0 glob: ^7.1.4 @@ -12320,7 +9171,7 @@ __metadata: which: ^2.0.2 bin: node-gyp: bin/node-gyp.js - checksum: 4d8ef8860f7e4f4d86c91db3f519d26ed5cc23b48fe54543e2afd86162b4acbd14f21de42a5db344525efb69a991e021b96a68c70c6e2d5f4a5cb770793da6d3 + checksum: 1437fa4a879b5b9010604128e8da8609b57c66034262087539ee04a8b764b8436af2be01bab66f8fc729a3adba2dcc21b10a32b9f552696c3fa8cd657d134fc4 languageName: node linkType: hard @@ -12331,16 +9182,16 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.3": - version: 2.0.4 - resolution: "node-releases@npm:2.0.4" - checksum: b32d6c2032c7b169ae3938b416fc50f123f5bd577d54a79b2ae201febf27b22846b01c803dd35ac8689afe840f8ba4e5f7154723db629b80f359836b6707b92f +"node-releases@npm:^2.0.6": + version: 2.0.6 + resolution: "node-releases@npm:2.0.6" + checksum: e86a926dc9fbb3b41b4c4a89d998afdf140e20a4e8dbe6c0a807f7b2948b42ea97d7fd3ad4868041487b6e9ee98409829c6e4d84a734a4215dff060a7fbeb4bf languageName: node linkType: hard "nodemon@npm:^2.0.15": - version: 2.0.16 - resolution: "nodemon@npm:2.0.16" + version: 2.0.19 + resolution: "nodemon@npm:2.0.19" dependencies: chokidar: ^3.5.2 debug: ^3.2.7 @@ -12348,13 +9199,13 @@ __metadata: minimatch: ^3.0.4 pstree.remy: ^1.1.8 semver: ^5.7.1 + simple-update-notifier: ^1.0.7 supports-color: ^5.5.0 touch: ^3.1.0 undefsafe: ^2.0.5 - update-notifier: ^5.1.0 bin: nodemon: bin/nodemon.js - checksum: ff818aa91b283bd0f1f6cfb8fdc9b5c3e74d5efa0cb72276dc242b742dc35d3f0720d35d99dbe85ecf6df7185f083ef9b1f7908094e43fd4e2508b6805d644dc + checksum: c6cf89435a8945693fac2701285eb1f539b5003d943a1be89a9ffbfc9d0275aa7779f85a9eee509e9f19a988d53ce293266d8b35b91010e36ad9e78683f8eb07 languageName: node linkType: hard @@ -12380,30 +9231,6 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^2.5.0": - version: 2.5.0 - resolution: "normalize-package-data@npm:2.5.0" - dependencies: - hosted-git-info: ^2.1.4 - resolve: ^1.10.0 - semver: 2 || 3 || 4 || 5 - validate-npm-package-license: ^3.0.1 - checksum: 7999112efc35a6259bc22db460540cae06564aa65d0271e3bdfa86876d08b0e578b7b5b0028ee61b23f1cae9fc0e7847e4edc0948d3068a39a2a82853efc8499 - languageName: node - linkType: hard - -"normalize-package-data@npm:^3.0.0, normalize-package-data@npm:^3.0.3": - version: 3.0.3 - resolution: "normalize-package-data@npm:3.0.3" - dependencies: - hosted-git-info: ^4.0.1 - is-core-module: ^2.5.0 - semver: ^7.3.4 - validate-npm-package-license: ^3.0.1 - checksum: bbcee00339e7c26fdbc760f9b66d429258e2ceca41a5df41f5df06cc7652de8d82e8679ff188ca095cad8eff2b6118d7d866af2b68400f74602fbcbce39c160a - languageName: node - linkType: hard - "normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": version: 3.0.0 resolution: "normalize-path@npm:3.0.0" @@ -12411,98 +9238,6 @@ __metadata: languageName: node linkType: hard -"normalize-url@npm:^4.1.0": - version: 4.5.1 - resolution: "normalize-url@npm:4.5.1" - checksum: 9a9dee01df02ad23e171171893e56e22d752f7cff86fb96aafeae074819b572ea655b60f8302e2d85dbb834dc885c972cc1c573892fea24df46b2765065dd05a - languageName: node - linkType: hard - -"npm-bundled@npm:^1.1.1": - version: 1.1.2 - resolution: "npm-bundled@npm:1.1.2" - dependencies: - npm-normalize-package-bin: ^1.0.1 - checksum: 6e599155ef28d0b498622f47f1ba189dfbae05095a1ed17cb3a5babf961e965dd5eab621f0ec6f0a98de774e5836b8f5a5ee639010d64f42850a74acec3d4d09 - languageName: node - linkType: hard - -"npm-install-checks@npm:^4.0.0": - version: 4.0.0 - resolution: "npm-install-checks@npm:4.0.0" - dependencies: - semver: ^7.1.1 - checksum: 8308ff48e61e0863d7f148f62543e1f6c832525a7d8002ea742d5e478efa8b29bf65a87f9fb82786e15232e4b3d0362b126c45afdceed4c051c0d3c227dd0ace - languageName: node - linkType: hard - -"npm-normalize-package-bin@npm:^1.0.0, npm-normalize-package-bin@npm:^1.0.1": - version: 1.0.1 - resolution: "npm-normalize-package-bin@npm:1.0.1" - checksum: ae7f15155a1e3ace2653f12ddd1ee8eaa3c84452fdfbf2f1943e1de264e4b079c86645e2c55931a51a0a498cba31f70022a5219d5665fbcb221e99e58bc70122 - languageName: node - linkType: hard - -"npm-package-arg@npm:^8.0.1, npm-package-arg@npm:^8.1.2, npm-package-arg@npm:^8.1.5": - version: 8.1.5 - resolution: "npm-package-arg@npm:8.1.5" - dependencies: - hosted-git-info: ^4.0.1 - semver: ^7.3.4 - validate-npm-package-name: ^3.0.0 - checksum: ae76afbcebb4ea8d0b849b8b18ed1b0491030fb04a0af5d75f1b8390cc50bec186ced9fbe60f47d939eab630c7c0db0919d879ac56a87d3782267dfe8eec60d3 - languageName: node - linkType: hard - -"npm-packlist@npm:^3.0.0": - version: 3.0.0 - resolution: "npm-packlist@npm:3.0.0" - dependencies: - glob: ^7.1.6 - ignore-walk: ^4.0.1 - npm-bundled: ^1.1.1 - npm-normalize-package-bin: ^1.0.1 - bin: - npm-packlist: bin/index.js - checksum: 8550ecdec5feb2708aa8289e71c3e9ed72dd792642dd3d2c871955504c0e460bc1c2106483a164eb405b3cdfcfddf311315d4a647fca1a511f710654c015a91e - languageName: node - linkType: hard - -"npm-pick-manifest@npm:^6.0.0, npm-pick-manifest@npm:^6.1.0, npm-pick-manifest@npm:^6.1.1": - version: 6.1.1 - resolution: "npm-pick-manifest@npm:6.1.1" - dependencies: - npm-install-checks: ^4.0.0 - npm-normalize-package-bin: ^1.0.1 - npm-package-arg: ^8.1.2 - semver: ^7.3.4 - checksum: 7a7b9475ae95cf903d37471229efbd12a829a9a7a1020ba36e75768aaa35da4c3a087fde3f06070baf81ec6b2ea2b660f022a1172644e6e7188199d7c1d2954b - languageName: node - linkType: hard - -"npm-registry-fetch@npm:^12.0.0, npm-registry-fetch@npm:^12.0.1": - version: 12.0.2 - resolution: "npm-registry-fetch@npm:12.0.2" - dependencies: - make-fetch-happen: ^10.0.1 - minipass: ^3.1.6 - minipass-fetch: ^1.4.1 - minipass-json-stream: ^1.0.1 - minizlib: ^2.1.2 - npm-package-arg: ^8.1.5 - checksum: 88ef49b6fad104165f183ec804a65471a23cead40fa035ac57f2cbe084feffe9c10bed8c4234af3fa549d947108450d5359b41ae5dec9a1ffca4d8fa7c7f78b8 - languageName: node - linkType: hard - -"npm-run-path@npm:^2.0.0": - version: 2.0.2 - resolution: "npm-run-path@npm:2.0.2" - dependencies: - path-key: ^2.0.0 - checksum: acd5ad81648ba4588ba5a8effb1d98d2b339d31be16826a118d50f182a134ac523172101b82eab1d01cb4c2ba358e857d54cfafd8163a1ffe7bd52100b741125 - languageName: node - linkType: hard - "npm-run-path@npm:^4.0.0, npm-run-path@npm:^4.0.1": version: 4.0.1 resolution: "npm-run-path@npm:4.0.1" @@ -12512,18 +9247,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^5.0.1": - version: 5.0.1 - resolution: "npmlog@npm:5.0.1" - dependencies: - are-we-there-yet: ^2.0.0 - console-control-strings: ^1.1.0 - gauge: ^3.0.0 - set-blocking: ^2.0.0 - checksum: 516b2663028761f062d13e8beb3f00069c5664925871a9b57989642ebe09f23ab02145bf3ab88da7866c4e112cafff72401f61a672c7c8a20edc585a7016ef5f - languageName: node - linkType: hard - "npmlog@npm:^6.0.0": version: 6.0.2 resolution: "npmlog@npm:6.0.2" @@ -12536,17 +9259,20 @@ __metadata: languageName: node linkType: hard -"number-is-nan@npm:^1.0.0": - version: 1.0.1 - resolution: "number-is-nan@npm:1.0.1" - checksum: 13656bc9aa771b96cef209ffca31c31a03b507ca6862ba7c3f638a283560620d723d52e626d57892c7fff475f4c36ac07f0600f14544692ff595abff214b9ffb +"number-to-bn@npm:1.7.0": + version: 1.7.0 + resolution: "number-to-bn@npm:1.7.0" + dependencies: + bn.js: 4.11.6 + strip-hex-prefix: 1.0.0 + checksum: 5b8c9dbe7b49dc7a069e5f0ba4e197257c89db11463478cb002fee7a34dc8868636952bd9f6310e5fdf22b266e0e6dffb5f9537c741734718107e90ae59b3de4 languageName: node linkType: hard "nwsapi@npm:^2.2.0": - version: 2.2.0 - resolution: "nwsapi@npm:2.2.0" - checksum: 5ef4a9bc0c1a5b7f2e014aa6a4b359a257503b796618ed1ef0eb852098f77e772305bb0e92856e4bbfa3e6c75da48c0113505c76f144555ff38867229c2400a7 + version: 2.2.2 + resolution: "nwsapi@npm:2.2.2" + checksum: 43769106292bc95f776756ca2f3513dab7b4d506a97c67baec32406447841a35f65f29c1f95ab5d42785210fd41668beed33ca16fa058780be43b101ad73e205 languageName: node linkType: hard @@ -12564,10 +9290,10 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.12.0, object-inspect@npm:^1.9.0": - version: 1.12.0 - resolution: "object-inspect@npm:1.12.0" - checksum: 2b36d4001a9c921c6b342e2965734519c9c58c355822243c3207fbf0aac271f8d44d30d2d570d450b2cc6f0f00b72bcdba515c37827d2560e5f22b1899a31cf4 +"object-inspect@npm:^1.12.2, object-inspect@npm:^1.9.0": + version: 1.12.2 + resolution: "object-inspect@npm:1.12.2" + checksum: a534fc1b8534284ed71f25ce3a496013b7ea030f3d1b77118f6b7b1713829262be9e6243acbcb3ef8c626e2b64186112cb7f6db74e37b2789b9c789ca23048b2 languageName: node linkType: hard @@ -12578,22 +9304,15 @@ __metadata: languageName: node linkType: hard -"object-treeify@npm:^1.1.33, object-treeify@npm:^1.1.4": - version: 1.1.33 - resolution: "object-treeify@npm:1.1.33" - checksum: 3af7f889349571ee73f5bdfb5ac478270c85eda8bcba950b454eb598ce41759a1ed6b0b43fbd624cb449080a4eb2df906b602e5138b6186b9563b692231f1694 - languageName: node - linkType: hard - -"object.assign@npm:^4.1.0, object.assign@npm:^4.1.2": - version: 4.1.2 - resolution: "object.assign@npm:4.1.2" +"object.assign@npm:^4.1.0, object.assign@npm:^4.1.4": + version: 4.1.4 + resolution: "object.assign@npm:4.1.4" dependencies: - call-bind: ^1.0.0 - define-properties: ^1.1.3 - has-symbols: ^1.0.1 + call-bind: ^1.0.2 + define-properties: ^1.1.4 + has-symbols: ^1.0.3 object-keys: ^1.1.1 - checksum: d621d832ed7b16ac74027adb87196804a500d80d9aca536fccb7ba48d33a7e9306a75f94c1d29cbfa324bc091bfc530bc24789568efdaee6a47fcfa298993814 + checksum: 76cab513a5999acbfe0ff355f15a6a125e71805fcf53de4e9d4e082e1989bdb81d1e329291e1e4e0ae7719f0e4ef80e88fb2d367ae60500d79d25a6224ac8864 languageName: node linkType: hard @@ -12608,35 +9327,7 @@ __metadata: languageName: node linkType: hard -"oclif@npm:^2.4.4": - version: 2.6.3 - resolution: "oclif@npm:2.6.3" - dependencies: - "@oclif/core": ^1.6.4 - "@oclif/plugin-help": ^5.1.11 - "@oclif/plugin-not-found": ^2.3.1 - "@oclif/plugin-warn-if-update-available": ^2.0.4 - aws-sdk: ^2.1069.0 - concurrently: ^7.0.0 - debug: ^4.3.3 - find-yarn-workspace-root: ^2.0.0 - fs-extra: ^8.1 - github-slugger: ^1.4.0 - lodash: ^4.17.21 - normalize-package-data: ^3.0.3 - qqjs: ^0.3.11 - semver: ^7.3.5 - tslib: ^2.3.1 - yeoman-environment: ^3.9.1 - yeoman-generator: ^5.6.1 - yosay: ^2.0.2 - bin: - oclif: bin/run - checksum: 70bf08306d1f94cf0b85286c37da2ae81800ed6c31db1f59c7de3104dd5c038f4ee7fac80d0d5f303ea8213b9ea0def0e657e1f04df16b2f5742c1ae44fd1875 - languageName: node - linkType: hard - -"on-finished@npm:2.4.1, on-finished@npm:^2.3.0": +"on-finished@npm:2.4.1": version: 2.4.1 resolution: "on-finished@npm:2.4.1" dependencies: @@ -12645,15 +9336,6 @@ __metadata: languageName: node linkType: hard -"on-finished@npm:~2.3.0": - version: 2.3.0 - resolution: "on-finished@npm:2.3.0" - dependencies: - ee-first: 1.1.1 - checksum: 1db595bd963b0124d6fa261d18320422407b8f01dc65863840f3ddaaf7bcad5b28ff6847286703ca53f4ec19595bd67a2f1253db79fc4094911ec6aa8df1671b - languageName: node - linkType: hard - "once@npm:1.4.0, once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" @@ -12682,13 +9364,6 @@ __metadata: languageName: node linkType: hard -"optional@npm:0.1.4": - version: 0.1.4 - resolution: "optional@npm:0.1.4" - checksum: 81fd9884eac9c13b3624821f99aa825b71d46ffd547cd3f8cf9e1dfb0165e531448005288455895550f804bdd66459e4e7ae6e753805b8bf11a5983050d5b7c4 - languageName: node - linkType: hard - "optionator@npm:^0.8.1": version: 0.8.3 resolution: "optionator@npm:0.8.3" @@ -12717,7 +9392,7 @@ __metadata: languageName: node linkType: hard -"ora@npm:5.4.1, ora@npm:^5.4.1": +"ora@npm:5.4.1": version: 5.4.1 resolution: "ora@npm:5.4.1" dependencies: @@ -12734,30 +9409,6 @@ __metadata: languageName: node linkType: hard -"os-name@npm:4.0.1": - version: 4.0.1 - resolution: "os-name@npm:4.0.1" - dependencies: - macos-release: ^2.5.0 - windows-release: ^4.0.0 - checksum: 507ae75979ec410b5fccaddddc7e8afb3f9fd096e902230d8ae940590513e64fce6fe25fd1ccc410ec89defc78b5593d71cb1c323e546621c210c4a7086c7399 - languageName: node - linkType: hard - -"os-tmpdir@npm:~1.0.2": - version: 1.0.2 - resolution: "os-tmpdir@npm:1.0.2" - checksum: 5666560f7b9f10182548bf7013883265be33620b1c1b4a4d405c25be2636f970c5488ff3e6c48de75b55d02bde037249fe5dbfbb4c0fb7714953d56aed062e6d - languageName: node - linkType: hard - -"p-cancelable@npm:^1.0.0": - version: 1.1.0 - resolution: "p-cancelable@npm:1.1.0" - checksum: 2db3814fef6d9025787f30afaee4496a8857a28be3c5706432cbad76c688a6db1874308f48e364a42f5317f5e41e8e7b4f2ff5c8ff2256dbb6264bc361704ece - languageName: node - linkType: hard - "p-defer@npm:^3.0.0": version: 3.0.0 resolution: "p-defer@npm:3.0.0" @@ -12775,22 +9426,6 @@ __metadata: languageName: node linkType: hard -"p-finally@npm:^1.0.0": - version: 1.0.0 - resolution: "p-finally@npm:1.0.0" - checksum: 93a654c53dc805dd5b5891bab16eb0ea46db8f66c4bfd99336ae929323b1af2b70a8b0654f8f1eae924b2b73d037031366d645f1fd18b3d30cbd15950cc4b1d4 - languageName: node - linkType: hard - -"p-limit@npm:^1.1.0": - version: 1.3.0 - resolution: "p-limit@npm:1.3.0" - dependencies: - p-try: ^1.0.0 - checksum: 281c1c0b8c82e1ac9f81acd72a2e35d402bf572e09721ce5520164e9de07d8274451378a3470707179ad13240535558f4b277f02405ad752e08c7d5b0d54fbfd - languageName: node - linkType: hard - "p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" @@ -12809,15 +9444,6 @@ __metadata: languageName: node linkType: hard -"p-locate@npm:^2.0.0": - version: 2.0.0 - resolution: "p-locate@npm:2.0.0" - dependencies: - p-limit: ^1.1.0 - checksum: e2dceb9b49b96d5513d90f715780f6f4972f46987dc32a0e18bc6c3fc74a1a5d73ec5f81b1398af5e58b99ea1ad03fd41e9181c01fa81b4af2833958696e3081 - languageName: node - linkType: hard - "p-locate@npm:^4.1.0": version: 4.1.0 resolution: "p-locate@npm:4.1.0" @@ -12845,42 +9471,6 @@ __metadata: languageName: node linkType: hard -"p-queue@npm:^6.6.2": - version: 6.6.2 - resolution: "p-queue@npm:6.6.2" - dependencies: - eventemitter3: ^4.0.4 - p-timeout: ^3.2.0 - checksum: 832642fcc4ab6477b43e6d7c30209ab10952969ed211c6d6f2931be8a4f9935e3578c72e8cce053dc34f2eb6941a408a2c516a54904e989851a1a209cf19761c - languageName: node - linkType: hard - -"p-timeout@npm:^3.2.0": - version: 3.2.0 - resolution: "p-timeout@npm:3.2.0" - dependencies: - p-finally: ^1.0.0 - checksum: 3dd0eaa048780a6f23e5855df3dd45c7beacff1f820476c1d0d1bcd6648e3298752ba2c877aa1c92f6453c7dd23faaf13d9f5149fc14c0598a142e2c5e8d649c - languageName: node - linkType: hard - -"p-transform@npm:^1.3.0": - version: 1.3.0 - resolution: "p-transform@npm:1.3.0" - dependencies: - debug: ^4.3.2 - p-queue: ^6.6.2 - checksum: d1e2d6ad75241878c302531c262e3c13ea50f5e8c9fbfbf119faf415b719158858ae97dda44b8ec91ad9a7efbbcdb731e452b75df860f9515569d57ea66f9cec - languageName: node - linkType: hard - -"p-try@npm:^1.0.0": - version: 1.0.0 - resolution: "p-try@npm:1.0.0" - checksum: 3b5303f77eb7722144154288bfd96f799f8ff3e2b2b39330efe38db5dd359e4fb27012464cd85cb0a76e9b7edd1b443568cb3192c22e7cffc34989df0bafd605 - languageName: node - linkType: hard - "p-try@npm:^2.0.0": version: 2.2.0 resolution: "p-try@npm:2.2.0" @@ -12888,25 +9478,6 @@ __metadata: languageName: node linkType: hard -"package-json-type@npm:^1.0.3": - version: 1.0.3 - resolution: "package-json-type@npm:1.0.3" - checksum: ea93a2ee1cbc480feee94974158605463b8ce8f899e8a09dc008ac83c060fd10d8f38bfdd5f28222196dba1f57de4e65b46b057dc889a704967714da393c2ad9 - languageName: node - linkType: hard - -"package-json@npm:^6.3.0": - version: 6.5.0 - resolution: "package-json@npm:6.5.0" - dependencies: - got: ^9.6.0 - registry-auth-token: ^4.0.0 - registry-url: ^5.0.0 - semver: ^6.2.0 - checksum: cc9f890d3667d7610e6184decf543278b87f657d1ace0deb4a9c9155feca738ef88f660c82200763d3348010f4e42e9c7adc91e96ab0f86a770955995b5351e2 - languageName: node - linkType: hard - "packet-reader@npm:1.0.0": version: 1.0.0 resolution: "packet-reader@npm:1.0.0" @@ -12914,42 +9485,6 @@ __metadata: languageName: node linkType: hard -"pacote@npm:^12.0.0, pacote@npm:^12.0.2": - version: 12.0.3 - resolution: "pacote@npm:12.0.3" - dependencies: - "@npmcli/git": ^2.1.0 - "@npmcli/installed-package-contents": ^1.0.6 - "@npmcli/promise-spawn": ^1.2.0 - "@npmcli/run-script": ^2.0.0 - cacache: ^15.0.5 - chownr: ^2.0.0 - fs-minipass: ^2.1.0 - infer-owner: ^1.0.4 - minipass: ^3.1.3 - mkdirp: ^1.0.3 - npm-package-arg: ^8.0.1 - npm-packlist: ^3.0.0 - npm-pick-manifest: ^6.0.0 - npm-registry-fetch: ^12.0.0 - promise-retry: ^2.0.1 - read-package-json-fast: ^2.0.1 - rimraf: ^3.0.2 - ssri: ^8.0.1 - tar: ^6.1.0 - bin: - pacote: lib/bin.js - checksum: 730e2b344619daff078b1f7c085c2da3b1417f1667204384cba981409098af2375b130a6470f75ea22f09b83c00fe227143b68e50d0dd7ff972e28a697b9c1d5 - languageName: node - linkType: hard - -"pad-component@npm:0.0.1": - version: 0.0.1 - resolution: "pad-component@npm:0.0.1" - checksum: 2d92ad68b6c86ce2afcc75c9536401ef8b25a03f9b1330fbe5a9a9862a5cbb0e4088848d427919f4cb7526c333b7eada7cb590328e69775257e20363023bb424 - languageName: node - linkType: hard - "pako@npm:^2.0.4": version: 2.0.4 resolution: "pako@npm:2.0.4" @@ -12966,17 +9501,6 @@ __metadata: languageName: node linkType: hard -"parse-conflict-json@npm:^2.0.1": - version: 2.0.2 - resolution: "parse-conflict-json@npm:2.0.2" - dependencies: - json-parse-even-better-errors: ^2.3.1 - just-diff: ^5.0.1 - just-diff-apply: ^5.2.0 - checksum: 076f65c958696586daefb153f59d575dfb59648be43116a21b74d5ff69ec63dd56f585a27cc2da56d8e64ca5abf0373d6619b8330c035131f8d1e990c8406378 - languageName: node - linkType: hard - "parse-duration@npm:^1.0.0": version: 1.0.2 resolution: "parse-duration@npm:1.0.2" @@ -12984,17 +9508,7 @@ __metadata: languageName: node linkType: hard -"parse-json@npm:^4.0.0": - version: 4.0.0 - resolution: "parse-json@npm:4.0.0" - dependencies: - error-ex: ^1.3.1 - json-parse-better-errors: ^1.0.1 - checksum: 0fe227d410a61090c247e34fa210552b834613c006c2c64d9a05cfe9e89cf8b4246d1246b1a99524b53b313e9ac024438d0680f67e33eaed7e6f38db64cfe7b5 - languageName: node - linkType: hard - -"parse-json@npm:^5.0.0, parse-json@npm:^5.2.0": +"parse-json@npm:^5.2.0": version: 5.2.0 resolution: "parse-json@npm:5.2.0" dependencies: @@ -13025,30 +9539,13 @@ __metadata: languageName: node linkType: hard -"parseurl@npm:^1.3.2, parseurl@npm:^1.3.3, parseurl@npm:~1.3.3": +"parseurl@npm:~1.3.3": version: 1.3.3 resolution: "parseurl@npm:1.3.3" checksum: 407cee8e0a3a4c5cd472559bca8b6a45b82c124e9a4703302326e9ab60fc1081442ada4e02628efef1eb16197ddc7f8822f5a91fd7d7c86b51f530aedb17dfa2 languageName: node linkType: hard -"password-prompt@npm:^1.1.2": - version: 1.1.2 - resolution: "password-prompt@npm:1.1.2" - dependencies: - ansi-escapes: ^3.1.0 - cross-spawn: ^6.0.5 - checksum: 4763ec1b48cb311d60df37186e31f1b85ec3249a21cc17bbf8407d66c5b55cffe34b4eb529ebd044ed4ced7f3ea3fad744fe15e30a5de31645433e94cd444266 - languageName: node - linkType: hard - -"path-exists@npm:^3.0.0": - version: 3.0.0 - resolution: "path-exists@npm:3.0.0" - checksum: 96e92643aa34b4b28d0de1cd2eba52a1c5313a90c6542d03f62750d82480e20bfa62bc865d5cfc6165f5fcd5aeb0851043c40a39be5989646f223300021bae0a - languageName: node - linkType: hard - "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -13063,13 +9560,6 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^2.0.0, path-key@npm:^2.0.1": - version: 2.0.1 - resolution: "path-key@npm:2.0.1" - checksum: f7ab0ad42fe3fb8c7f11d0c4f849871e28fbd8e1add65c370e422512fc5887097b9cf34d09c1747d45c942a8c1e26468d6356e2df3f740bf177ab8ca7301ebfd - languageName: node - linkType: hard - "path-key@npm:^3.0.0, path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" @@ -13105,7 +9595,20 @@ __metadata: languageName: node linkType: hard -"pg-connection-string@npm:^2.0.0, pg-connection-string@npm:^2.5.0": +"pbkdf2@npm:^3.0.17": + version: 3.1.2 + resolution: "pbkdf2@npm:3.1.2" + dependencies: + create-hash: ^1.1.2 + create-hmac: ^1.1.4 + ripemd160: ^2.0.1 + safe-buffer: ^5.0.1 + sha.js: ^2.4.8 + checksum: 2c950a100b1da72123449208e231afc188d980177d021d7121e96a2de7f2abbc96ead2b87d03d8fe5c318face097f203270d7e27908af9f471c165a4e8e69c92 + languageName: node + linkType: hard + +"pg-connection-string@npm:^2.5.0": version: 2.5.0 resolution: "pg-connection-string@npm:2.5.0" checksum: a6f3a068f7c9416a5b33a326811caf0dfaaee045c225b7c628b4c9b4e9a2b25bdd12a21e4c48940e1000ea223a4e608ca122d2ff3dd08c8b1db0fc9f5705133a @@ -13119,37 +9622,23 @@ __metadata: languageName: node linkType: hard -"pg-pool@npm:^3.5.1": - version: 3.5.1 - resolution: "pg-pool@npm:3.5.1" +"pg-pool@npm:^3.5.2": + version: 3.5.2 + resolution: "pg-pool@npm:3.5.2" peerDependencies: pg: ">=8.0" - checksum: 42833c25f18fee41a1b2d955978f1403e93164762a7e57d3a870429103d302f1899b393ab021bb8144272037eb3f13bdb9f16a4c4afaa3efd3d2c3689738038f + checksum: a5d029200257671f0c17ca54b9ab6213e2060e64e5cc792b78edd50ab471a26cd364890d05d546d9296949e079e943821cf2ceb4d488f4e6a6789fb781a628bf languageName: node linkType: hard -"pg-protocol@npm:*, pg-protocol@npm:^1.5.0": +"pg-protocol@npm:^1.5.0": version: 1.5.0 resolution: "pg-protocol@npm:1.5.0" checksum: b839d12cafe942ef9cbc5b13c174eb2356804fb4fe8ead8279f46a36be90722d19a91409955beb8a3d5301639c44854e49749de4aef02dc361fee3e2a61fb1e4 languageName: node linkType: hard -"pg-sql2@npm:4.12.1": - version: 4.12.1 - resolution: "pg-sql2@npm:4.12.1" - dependencies: - "@graphile/lru": 4.11.0 - "@types/pg": ">=6 <9" - debug: ">=3 <5" - tslib: ^2.0.1 - peerDependencies: - pg: ">=6.1.0 <9" - checksum: 86cfe2a766f7cca5609c212a4cfed065ffb28f7b6125a78643e924f72f9605c8c4133f3009dacab5601463e18a51ac0f5565ee1e7021306fb5ea289a3bc6e010 - languageName: node - linkType: hard - -"pg-types@npm:^2.1.0, pg-types@npm:^2.2.0": +"pg-types@npm:^2.1.0": version: 2.2.0 resolution: "pg-types@npm:2.2.0" dependencies: @@ -13162,23 +9651,23 @@ __metadata: languageName: node linkType: hard -"pg@npm:>=6.1.0 <9, pg@npm:^8.7.1": - version: 8.7.3 - resolution: "pg@npm:8.7.3" +"pg@npm:^8.7.1": + version: 8.8.0 + resolution: "pg@npm:8.8.0" dependencies: buffer-writer: 2.0.0 packet-reader: 1.0.0 pg-connection-string: ^2.5.0 - pg-pool: ^3.5.1 + pg-pool: ^3.5.2 pg-protocol: ^1.5.0 pg-types: ^2.1.0 pgpass: 1.x peerDependencies: - pg-native: ">=2.0.0" + pg-native: ">=3.0.1" peerDependenciesMeta: pg-native: optional: true - checksum: d0e7040967779b9ccea16897f099510bcaf6bc86f77a6d8fa7e293c24d8bd2fd2ec46d99d6d1adc9be4cc8f254aa909361346b693088c1ba4501414f7afb2fe3 + checksum: fa30a85814dd7238b582c3bc6c0b9e2b0ae38dd0a6bb485ef480e64bb5ce589de6cb873ce4d3cd10c37a3e0a1e1281ba75dc7d80b1a68bae91999cd5b70d398b languageName: node linkType: hard @@ -13214,31 +9703,6 @@ __metadata: languageName: node linkType: hard -"pify@npm:^2.3.0": - version: 2.3.0 - resolution: "pify@npm:2.3.0" - checksum: 9503aaeaf4577acc58642ad1d25c45c6d90288596238fb68f82811c08104c800e5a7870398e9f015d82b44ecbcbef3dc3d4251a1cbb582f6e5959fe09884b2ba - languageName: node - linkType: hard - -"pify@npm:^4.0.1": - version: 4.0.1 - resolution: "pify@npm:4.0.1" - checksum: 9c4e34278cb09987685fa5ef81499c82546c033713518f6441778fbec623fc708777fe8ac633097c72d88470d5963094076c7305cafc7ad340aae27cfacd856b - languageName: node - linkType: hard - -"pino-http@npm:^5.3.0": - version: 5.8.0 - resolution: "pino-http@npm:5.8.0" - dependencies: - fast-url-parser: ^1.1.3 - pino: ^6.13.0 - pino-std-serializers: ^4.0.0 - checksum: 1bb38dfa720ab931c3eaa1f614777e6edee83ef0cfbaaf3af5da0d18b02549d1e3fa23436333a324f1b64f8e2211bfd2e90ef9128f7bef27578cf04e766d2aa2 - languageName: node - linkType: hard - "pino-std-serializers@npm:^3.1.0": version: 3.2.0 resolution: "pino-std-serializers@npm:3.2.0" @@ -13246,14 +9710,7 @@ __metadata: languageName: node linkType: hard -"pino-std-serializers@npm:^4.0.0": - version: 4.0.0 - resolution: "pino-std-serializers@npm:4.0.0" - checksum: 89d487729b58c9d3273a0ee851ead068d6d2e2ccc1af8e1c1d28f1b3442423679bec7ec04d9a2aba36f94f335e82be9f4de19dc4fbc161e71c136aaa15b85ad3 - languageName: node - linkType: hard - -"pino@npm:^6.13.0, pino@npm:^6.13.3": +"pino@npm:^6.13.3": version: 6.14.0 resolution: "pino@npm:6.14.0" dependencies: @@ -13286,80 +9743,13 @@ __metadata: languageName: node linkType: hard -"pluralize@npm:8.0.0, pluralize@npm:^8.0.0": - version: 8.0.0 - resolution: "pluralize@npm:8.0.0" - checksum: 08931d4a6a4a5561a7f94f67a31c17e6632cb21e459ab3ff4f6f629d9a822984cf8afef2311d2005fbea5d7ef26016ebb090db008e2d8bce39d0a9a9d218736e - languageName: node - linkType: hard - -"pluralize@npm:^7.0.0": - version: 7.0.0 - resolution: "pluralize@npm:7.0.0" - checksum: e3f694924b7c8c03dc9fa40b2312e17787998ac6e20fccace11efa1146046eb9931541bfd247b3ec5535e730d902a5aee7c32681d5bf9a00fc74a72039a3e609 - languageName: node - linkType: hard - -"postgraphile-core@npm:4.12.2, postgraphile-core@npm:^4.12.2": - version: 4.12.2 - resolution: "postgraphile-core@npm:4.12.2" - dependencies: - graphile-build: 4.12.2 - graphile-build-pg: 4.12.2 - tslib: ^2.0.1 - peerDependencies: - graphql: ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" - pg: ">=6.1.0 <9" - checksum: 086168f2c1954c033dc78f765fa0e46d2fcfa0720823a26690cf118d7c81a1cc9c67ade609ca4001bf8c4e0df4cea84c99f879fc6aa81021549f6848f77a1228 - languageName: node - linkType: hard - -"postgraphile-plugin-connection-filter@npm:^2.2.2": - version: 2.3.0 - resolution: "postgraphile-plugin-connection-filter@npm:2.3.0" - dependencies: - tslib: ^2.3.0 - checksum: b5bf7ae847225682ebc48e9224c45ccf1d3e16dfd820f2bdfe3dfc26f049e7c995278bf77123a2be04561b6b23438063590845e0456492f4ee67db0ae3a99771 - languageName: node - linkType: hard - -"postgraphile@npm:^4.12.9": - version: 4.12.10 - resolution: "postgraphile@npm:4.12.10" - dependencies: - "@graphile/lru": 4.11.0 - "@types/json5": ^0.0.30 - "@types/jsonwebtoken": ^8.3.2 - "@types/pg": ">=6 <9" - "@types/ws": ^7.4.0 - body-parser: ^1.15.2 - chalk: ^2.4.2 - commander: ^2.19.0 - debug: ^4.1.1 - finalhandler: ^1.0.6 - graphile-build: 4.12.2 - graphile-build-pg: 4.12.2 - graphile-utils: ^4.12.2 - graphql: ^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.2 || ^15.0.0 - graphql-ws: ^5.6.2 - http-errors: ^1.5.1 - iterall: ^1.0.2 - json5: ^2.1.1 - jsonwebtoken: ^8.0.0 - parseurl: ^1.3.2 - pg: ">=6.1.0 <9" - pg-connection-string: ^2.0.0 - pg-sql2: 4.12.1 - postgraphile-core: 4.12.2 - subscriptions-transport-ws: ^0.9.18 - tslib: ^2.1.0 - ws: ^7.4.2 - bin: - postgraphile: cli.js - checksum: 0990af539171e509f6d4352e51ed5fb515b9c5694b507ede4be148066ce23e8c878756386e92688120259de324bdf84baf4dbeda5210d5b56e51f5fa190bafa3 - languageName: node - linkType: hard - +"pluralize@npm:8.0.0": + version: 8.0.0 + resolution: "pluralize@npm:8.0.0" + checksum: 08931d4a6a4a5561a7f94f67a31c17e6632cb21e459ab3ff4f6f629d9a822984cf8afef2311d2005fbea5d7ef26016ebb090db008e2d8bce39d0a9a9d218736e + languageName: node + linkType: hard + "postgres-array@npm:~2.0.0": version: 2.0.0 resolution: "postgres-array@npm:2.0.0" @@ -13390,18 +9780,6 @@ __metadata: languageName: node linkType: hard -"preferred-pm@npm:^3.0.3": - version: 3.0.3 - resolution: "preferred-pm@npm:3.0.3" - dependencies: - find-up: ^5.0.0 - find-yarn-workspace-root2: 1.2.16 - path-exists: ^4.0.0 - which-pm: 2.0.0 - checksum: 0de0948cb6ae22213f2ad7868032d89f1e1443d9caabc22ceeb9d284f19d359d65b67fab178f4db5c8c6ca6ae34642bdc72730b70ab1899ea158e2677a88a6d0 - languageName: node - linkType: hard - "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -13416,13 +9794,6 @@ __metadata: languageName: node linkType: hard -"prepend-http@npm:^2.0.0": - version: 2.0.0 - resolution: "prepend-http@npm:2.0.0" - checksum: 7694a9525405447662c1ffd352fcb41b6410c705b739b6f4e3a3e21cf5fdede8377890088e8934436b8b17ba55365a615f153960f30877bf0d0392f9e93503ea - languageName: node - linkType: hard - "prettier-linter-helpers@npm:^1.0.0": version: 1.0.0 resolution: "prettier-linter-helpers@npm:1.0.0" @@ -13433,18 +9804,11 @@ __metadata: linkType: hard "prettier@npm:^2.5.1": - version: 2.6.2 - resolution: "prettier@npm:2.6.2" + version: 2.7.1 + resolution: "prettier@npm:2.7.1" bin: prettier: bin-prettier.js - checksum: 48d08dde8e9fb1f5bccdd205baa7f192e9fc8bc98f86e1b97d919de804e28c806b0e6cc685e4a88211aa7987fa9668f30baae19580d87ced3ed0f2ec6572106f - languageName: node - linkType: hard - -"pretty-bytes@npm:^5.3.0": - version: 5.6.0 - resolution: "pretty-bytes@npm:5.6.0" - checksum: 9c082500d1e93434b5b291bd651662936b8bd6204ec9fa17d563116a192d6d86b98f6d328526b4e8d783c07d5499e2614a807520249692da9ec81564b2f439cd + checksum: 55a4409182260866ab31284d929b3cb961e5fdb91fe0d2e099dac92eaecec890f36e524b4c19e6ceae839c99c6d7195817579cdffc8e2c80da0cb794463a748b languageName: node linkType: hard @@ -13477,14 +9841,7 @@ __metadata: languageName: node linkType: hard -"proc-log@npm:^1.0.0": - version: 1.0.0 - resolution: "proc-log@npm:1.0.0" - checksum: 249605d5b28bfa0499d70da24ab056ad1e082a301f0a46d0ace6e8049cf16aaa0e71d9ea5cab29b620ffb327c18af97f0e012d1db090673447e7c1d33239dd96 - languageName: node - linkType: hard - -"process-nextick-args@npm:^2.0.0, process-nextick-args@npm:~2.0.0": +"process-nextick-args@npm:~2.0.0": version: 2.0.1 resolution: "process-nextick-args@npm:2.0.1" checksum: 1d38588e520dab7cea67cbbe2efdd86a10cc7a074c09657635e34f035277b59fbb57d09d8638346bf7090f8e8ebc070c96fa5fd183b777fff4f5edff5e9466cf @@ -13499,25 +9856,11 @@ __metadata: linkType: hard "prom-client@npm:^14.0.1": - version: 14.0.1 - resolution: "prom-client@npm:14.0.1" + version: 14.1.0 + resolution: "prom-client@npm:14.1.0" dependencies: tdigest: ^0.1.1 - checksum: 864c19b7086eda8fae652385bc8b8aeb155f85922e58672d07a64918a603341e120e65e08f9d77ccab546518dc18930284da8743c2aac3c968f626d7063d6bba - languageName: node - linkType: hard - -"promise-all-reject-late@npm:^1.0.0": - version: 1.0.1 - resolution: "promise-all-reject-late@npm:1.0.1" - checksum: d7d61ac412352e2c8c3463caa5b1c3ca0f0cc3db15a09f180a3da1446e33d544c4261fc716f772b95e4c27d559cfd2388540f44104feb356584f9c73cfb9ffcb - languageName: node - linkType: hard - -"promise-call-limit@npm:^1.0.1": - version: 1.0.1 - resolution: "promise-call-limit@npm:1.0.1" - checksum: e69aed17f5f34bbd7aecff28faedb456e3500a08af31ee759ef75f2d8c2219d7c0e59f153f4d8c339056de8c304e0dd4acc500c339e7ea1e9c0e7bb1444367c8 + checksum: 88f8e67020c0af07d09ab8f15caaa2a3d0810b01d903d0977d82947d3b0100a539db77bcccfde0bf2449a85060475f7fb05b64e7c34951c8a54b84240ae7ae81 languageName: node linkType: hard @@ -13567,8 +9910,8 @@ __metadata: linkType: hard "protobufjs@npm:^6.10.2": - version: 6.11.2 - resolution: "protobufjs@npm:6.11.2" + version: 6.11.3 + resolution: "protobufjs@npm:6.11.3" dependencies: "@protobufjs/aspromise": ^1.1.2 "@protobufjs/base64": ^1.1.2 @@ -13586,7 +9929,7 @@ __metadata: bin: pbjs: bin/pbjs pbts: bin/pbts - checksum: 80e9d9610c3eb66f9eae4e44a1ae30381cedb721b7d5f635d781fe4c507e2c77bb7c879addcd1dda79733d3ae589d9e66fd18d42baf99b35df7382a0f9920795 + checksum: 4a6ce1964167e4c45c53fd8a312d7646415c777dd31b4ba346719947b88e61654912326101f927da387d6b6473ab52a7ea4f54d6f15d63b31130ce28e2e15070 languageName: node linkType: hard @@ -13607,17 +9950,10 @@ __metadata: languageName: node linkType: hard -"pseudomap@npm:^1.0.2": - version: 1.0.2 - resolution: "pseudomap@npm:1.0.2" - checksum: 856c0aae0ff2ad60881168334448e898ad7a0e45fe7386d114b150084254c01e200c957cf378378025df4e052c7890c5bd933939b0e0d2ecfcc1dc2f0b2991f5 - languageName: node - linkType: hard - "psl@npm:^1.1.33": - version: 1.8.0 - resolution: "psl@npm:1.8.0" - checksum: 6150048ed2da3f919478bee8a82f3828303bc0fc730fb015a48f83c9977682c7b28c60ab01425a72d82a2891a1681627aa530a991d50c086b48a3be27744bde7 + version: 1.9.0 + resolution: "psl@npm:1.9.0" + checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d languageName: node linkType: hard @@ -13638,20 +9974,6 @@ __metadata: languageName: node linkType: hard -"punycode@npm:1.3.2": - version: 1.3.2 - resolution: "punycode@npm:1.3.2" - checksum: b8807fd594b1db33335692d1f03e8beeddde6fda7fbb4a2e32925d88d20a3aa4cd8dcc0c109ccaccbd2ba761c208dfaaada83007087ea8bfb0129c9ef1b99ed6 - languageName: node - linkType: hard - -"punycode@npm:^1.3.2": - version: 1.4.1 - resolution: "punycode@npm:1.4.1" - checksum: fa6e698cb53db45e4628559e557ddaf554103d2a96a1d62892c8f4032cd3bc8871796cae9eabc1bc700e2b6677611521ce5bb1d9a27700086039965d0cf34518 - languageName: node - linkType: hard - "punycode@npm:^2.1.0, punycode@npm:^2.1.1": version: 2.1.1 resolution: "punycode@npm:2.1.1" @@ -13659,37 +9981,7 @@ __metadata: languageName: node linkType: hard -"pupa@npm:^2.1.1": - version: 2.1.1 - resolution: "pupa@npm:2.1.1" - dependencies: - escape-goat: ^2.0.0 - checksum: 49529e50372ffdb0cccf0efa0f3b3cb0a2c77805d0d9cc2725bd2a0f6bb414631e61c93a38561b26be1259550b7bb6c2cb92315aa09c8bf93f3bdcb49f2b2fb7 - languageName: node - linkType: hard - -"qqjs@npm:^0.3.10, qqjs@npm:^0.3.11": - version: 0.3.11 - resolution: "qqjs@npm:0.3.11" - dependencies: - chalk: ^2.4.1 - debug: ^4.1.1 - execa: ^0.10.0 - fs-extra: ^6.0.1 - get-stream: ^5.1.0 - glob: ^7.1.2 - globby: ^10.0.1 - http-call: ^5.1.2 - load-json-file: ^6.2.0 - pkg-dir: ^4.2.0 - tar-fs: ^2.0.0 - tmp: ^0.1.0 - write-json-file: ^4.1.1 - checksum: 7962df855b7a0405550ae39beb5c133574a11db475635d4fb6311c469d83cf9cae03efa4c8a0e02b82a4cae9d7bec072383354249f12ab136dc8590e57a40dbd - languageName: node - linkType: hard - -"qs@npm:6.10.3, qs@npm:^6.10.3": +"qs@npm:6.10.3": version: 6.10.3 resolution: "qs@npm:6.10.3" dependencies: @@ -13705,14 +9997,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.9.7": - version: 6.9.7 - resolution: "qs@npm:6.9.7" - checksum: 5bbd263332ccf320a1f36d04a2019a5834dc20bcb736431eaccde2a39dcba03fb26d2fd00174f5d7bc26aaad1cad86124b18440883ac042ea2a0fca6170c1bf1 - languageName: node - linkType: hard - -"qs@npm:^6.9.4": +"qs@npm:^6.10.3, qs@npm:^6.9.4": version: 6.11.0 resolution: "qs@npm:6.11.0" dependencies: @@ -13721,10 +10006,10 @@ __metadata: languageName: node linkType: hard -"querystring@npm:0.2.0": - version: 0.2.0 - resolution: "querystring@npm:0.2.0" - checksum: 8258d6734f19be27e93f601758858c299bdebe71147909e367101ba459b95446fbe5b975bf9beb76390156a592b6f4ac3a68b6087cea165c259705b8b4e56a69 +"querystringify@npm:^2.1.1": + version: 2.2.0 + resolution: "querystringify@npm:2.2.0" + checksum: 5641ea231bad7ef6d64d9998faca95611ed4b11c2591a8cae741e178a974f6a8e0ebde008475259abe1621cb15e692404e6b6626e927f7b849d5c09392604b15 languageName: node linkType: hard @@ -13742,13 +10027,6 @@ __metadata: languageName: node linkType: hard -"ramda@npm:^0.27.1": - version: 0.27.2 - resolution: "ramda@npm:0.27.2" - checksum: 28d6735dd1eea1a796c56cf6111f3673c6105bbd736e521cdd7826c46a18eeff337c2dba4668f6eed990d539b9961fd6db19aa46ccc1530ba67a396c0a9f580d - languageName: node - linkType: hard - "randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" @@ -13765,18 +10043,6 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.4.3": - version: 2.4.3 - resolution: "raw-body@npm:2.4.3" - dependencies: - bytes: 3.1.2 - http-errors: 1.8.1 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - checksum: d2961fa3c71c9c22dc2c3fd60ff377bf36dfed7d7a748f2b25d585934a3e9df565bb9aa5bc2e3a716ea941f4bc2a6ddc795c8b0cf7219fb071029b59b1985394 - languageName: node - linkType: hard - "raw-body@npm:2.5.1": version: 2.5.1 resolution: "raw-body@npm:2.5.1" @@ -13789,20 +10055,6 @@ __metadata: languageName: node linkType: hard -"rc@npm:^1.2.8": - version: 1.2.8 - resolution: "rc@npm:1.2.8" - dependencies: - deep-extend: ^0.6.0 - ini: ~1.3.0 - minimist: ^1.2.0 - strip-json-comments: ~2.0.1 - bin: - rc: ./cli.js - checksum: 2e26e052f8be2abd64e6d1dabfbd7be03f80ec18ccbc49562d31f617d0015fbdbcf0f9eed30346ea6ab789e0fdfe4337f033f8016efdbee0df5354751842080e - languageName: node - linkType: hard - "react-is@npm:^16.13.1, react-is@npm:^16.7.0": version: 16.13.1 resolution: "react-is@npm:16.13.1" @@ -13826,70 +10078,7 @@ __metadata: languageName: node linkType: hard -"read-cmd-shim@npm:^3.0.0": - version: 3.0.0 - resolution: "read-cmd-shim@npm:3.0.0" - checksum: b518c6026f3320e30b692044f6ff5c4dc80f9c71261296da8994101b569b26b12b8e5df397bba2d4691dd3a3a2f770a1eca7be18a69ec202fac6dcfadc5016fd - languageName: node - linkType: hard - -"read-package-json-fast@npm:^2.0.1, read-package-json-fast@npm:^2.0.2, read-package-json-fast@npm:^2.0.3": - version: 2.0.3 - resolution: "read-package-json-fast@npm:2.0.3" - dependencies: - json-parse-even-better-errors: ^2.3.0 - npm-normalize-package-bin: ^1.0.1 - checksum: fca37b3b2160b9dda7c5588b767f6a2b8ce68d03a044000e568208e20bea0cf6dd2de17b90740ce8da8b42ea79c0b3859649dadf29510bbe77224ea65326a903 - languageName: node - linkType: hard - -"read-pkg-up@npm:^7.0.1": - version: 7.0.1 - resolution: "read-pkg-up@npm:7.0.1" - dependencies: - find-up: ^4.1.0 - read-pkg: ^5.2.0 - type-fest: ^0.8.1 - checksum: e4e93ce70e5905b490ca8f883eb9e48b5d3cebc6cd4527c25a0d8f3ae2903bd4121c5ab9c5a3e217ada0141098eeb661313c86fa008524b089b8ed0b7f165e44 - languageName: node - linkType: hard - -"read-pkg@npm:^5.2.0": - version: 5.2.0 - resolution: "read-pkg@npm:5.2.0" - dependencies: - "@types/normalize-package-data": ^2.4.0 - normalize-package-data: ^2.5.0 - parse-json: ^5.0.0 - type-fest: ^0.6.0 - checksum: eb696e60528b29aebe10e499ba93f44991908c57d70f2d26f369e46b8b9afc208ef11b4ba64f67630f31df8b6872129e0a8933c8c53b7b4daf0eace536901222 - languageName: node - linkType: hard - -"readable-stream@npm:1.1.x": - version: 1.1.14 - resolution: "readable-stream@npm:1.1.14" - dependencies: - core-util-is: ~1.0.0 - inherits: ~2.0.1 - isarray: 0.0.1 - string_decoder: ~0.10.x - checksum: 17dfeae3e909945a4a1abc5613ea92d03269ef54c49288599507fc98ff4615988a1c39a999dcf9aacba70233d9b7040bc11a5f2bfc947e262dedcc0a8b32b5a0 - languageName: node - linkType: hard - -"readable-stream@npm:3, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0": - version: 3.6.0 - resolution: "readable-stream@npm:3.6.0" - dependencies: - inherits: ^2.0.3 - string_decoder: ^1.1.1 - util-deprecate: ^1.0.1 - checksum: d4ea81502d3799439bb955a3a5d1d808592cf3133350ed352aeaa499647858b27b1c4013984900238b0873ec8d0d8defce72469fb7a83e61d53f5ad61cb80dc8 - languageName: node - linkType: hard - -"readable-stream@npm:^2.0.2, readable-stream@npm:^2.2.2, readable-stream@npm:^2.3.5": +"readable-stream@npm:^2.2.2": version: 2.3.7 resolution: "readable-stream@npm:2.3.7" dependencies: @@ -13904,15 +10093,14 @@ __metadata: languageName: node linkType: hard -"readdir-scoped-modules@npm:^1.1.0": - version: 1.1.0 - resolution: "readdir-scoped-modules@npm:1.1.0" +"readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0": + version: 3.6.0 + resolution: "readable-stream@npm:3.6.0" dependencies: - debuglog: ^1.0.1 - dezalgo: ^1.0.0 - graceful-fs: ^4.1.2 - once: ^1.3.0 - checksum: 6d9f334e40dfd0f5e4a8aab5e67eb460c95c85083c690431f87ab2c9135191170e70c2db6d71afcafb78e073d23eb95dcb3fc33ef91308f6ebfe3197be35e608 + inherits: ^2.0.3 + string_decoder: ^1.1.1 + util-deprecate: ^1.0.1 + checksum: d4ea81502d3799439bb955a3a5d1d808592cf3133350ed352aeaa499647858b27b1c4013984900238b0873ec8d0d8defce72469fb7a83e61d53f5ad61cb80dc8 languageName: node linkType: hard @@ -13934,24 +10122,6 @@ __metadata: languageName: node linkType: hard -"rechoir@npm:^0.6.2": - version: 0.6.2 - resolution: "rechoir@npm:0.6.2" - dependencies: - resolve: ^1.1.6 - checksum: fe76bf9c21875ac16e235defedd7cbd34f333c02a92546142b7911a0f7c7059d2e16f441fe6fb9ae203f459c05a31b2bcf26202896d89e390eda7514d5d2702b - languageName: node - linkType: hard - -"redeyed@npm:~2.1.0": - version: 2.1.1 - resolution: "redeyed@npm:2.1.1" - dependencies: - esprima: ~4.0.0 - checksum: 39a1426e377727cfb47a0e24e95c1cf78d969fbc388dc1e0fa1e2ef8a8756450cefb8b0c2598f63b85f1a331986fca7604c0db798427a5775a1dbdb9c1291979 - languageName: node - linkType: hard - "reflect-metadata@npm:^0.1.13": version: 0.1.13 resolution: "reflect-metadata@npm:0.1.13" @@ -13991,16 +10161,7 @@ __metadata: languageName: node linkType: hard -"regexp-tree@npm:^0.1.23, regexp-tree@npm:~0.1.1": - version: 0.1.24 - resolution: "regexp-tree@npm:0.1.24" - bin: - regexp-tree: bin/regexp-tree - checksum: 5807013289d9205288d665e0f8d8cff94843dfd55fdedd1833eb9d9bbd07188a37dfa02942ec5cdc671180037f715148fac1ba6f18fd6be4268e5a8feb49d340 - languageName: node - linkType: hard - -"regexp.prototype.flags@npm:^1.4.1": +"regexp.prototype.flags@npm:^1.4.3": version: 1.4.3 resolution: "regexp.prototype.flags@npm:1.4.3" dependencies: @@ -14011,16 +10172,16 @@ __metadata: languageName: node linkType: hard -"regexpp@npm:^3.0.0, regexpp@npm:^3.1.0, regexpp@npm:^3.2.0": +"regexpp@npm:^3.2.0": version: 3.2.0 resolution: "regexpp@npm:3.2.0" checksum: a78dc5c7158ad9ddcfe01aa9144f46e192ddbfa7b263895a70a5c6c73edd9ce85faf7c0430e59ac38839e1734e275b9c3de5c57ee3ab6edc0e0b1bdebefccef8 languageName: node linkType: hard -"regexpu-core@npm:^5.0.1": - version: 5.0.1 - resolution: "regexpu-core@npm:5.0.1" +"regexpu-core@npm:^5.1.0": + version: 5.1.0 + resolution: "regexpu-core@npm:5.1.0" dependencies: regenerate: ^1.4.2 regenerate-unicode-properties: ^10.0.1 @@ -14028,25 +10189,7 @@ __metadata: regjsparser: ^0.8.2 unicode-match-property-ecmascript: ^2.0.0 unicode-match-property-value-ecmascript: ^2.0.0 - checksum: 6151a9700dad512fadb5564ad23246d54c880eb9417efa5e5c3658b910c1ff894d622dfd159af2ed527ffd44751bfe98682ae06c717155c254d8e2b4bab62785 - languageName: node - linkType: hard - -"registry-auth-token@npm:^4.0.0": - version: 4.2.1 - resolution: "registry-auth-token@npm:4.2.1" - dependencies: - rc: ^1.2.8 - checksum: aa72060b573a50607cfd2dee16d0e51e13ca58b6a80442e74545325dc24d2c38896e6bad229bdcc1fc9759fa81b4066be8693d4d6f45927318e7c793a93e9cd0 - languageName: node - linkType: hard - -"registry-url@npm:^5.0.0": - version: 5.1.0 - resolution: "registry-url@npm:5.1.0" - dependencies: - rc: ^1.2.8 - checksum: bcea86c84a0dbb66467b53187fadebfea79017cddfb4a45cf27530d7275e49082fe9f44301976eb0164c438e395684bcf3dae4819b36ff9d1640d8cc60c73df9 + checksum: 7b4eb8d182d9d10537a220a93138df5bc7eaf4ed53e36b95e8427d33ed8a2b081468f1a15d3e5fcee66517e1df7f5ca180b999e046d060badd97150f2ffe87b2 languageName: node linkType: hard @@ -14068,20 +10211,6 @@ __metadata: languageName: node linkType: hard -"remove-trailing-separator@npm:^1.0.1": - version: 1.1.0 - resolution: "remove-trailing-separator@npm:1.1.0" - checksum: d3c20b5a2d987db13e1cca9385d56ecfa1641bae143b620835ac02a6b70ab88f68f117a0021838db826c57b31373d609d52e4f31aca75fc490c862732d595419 - languageName: node - linkType: hard - -"replace-ext@npm:^1.0.0": - version: 1.0.1 - resolution: "replace-ext@npm:1.0.1" - checksum: 4994ea1aaa3d32d152a8d98ff638988812c4fa35ba55485630008fe6f49e3384a8a710878e6fd7304b42b38d1b64c1cd070e78ece411f327735581a79dd88571 - languageName: node - linkType: hard - "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -14096,6 +10225,13 @@ __metadata: languageName: node linkType: hard +"requires-port@npm:^1.0.0": + version: 1.0.0 + resolution: "requires-port@npm:1.0.0" + checksum: eee0e303adffb69be55d1a214e415cf42b7441ae858c76dfc5353148644f6fd6e698926fc4643f510d5c126d12a705e7c8ed7e38061113bdf37547ab356797ff + languageName: node + linkType: hard + "resolve-cwd@npm:^3.0.0": version: 3.0.0 resolution: "resolve-cwd@npm:3.0.0" @@ -14126,38 +10262,29 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.1.6, resolve@npm:^1.10.0, resolve@npm:^1.10.1, resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.22.0": - version: 1.22.0 - resolution: "resolve@npm:1.22.0" +"resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.22.0": + version: 1.22.1 + resolution: "resolve@npm:1.22.1" dependencies: - is-core-module: ^2.8.1 + is-core-module: ^2.9.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: a2d14cc437b3a23996f8c7367eee5c7cf8149c586b07ca2ae00e96581ce59455555a1190be9aa92154785cf9f2042646c200d0e00e0bbd2b8a995a93a0ed3e4e + checksum: 07af5fc1e81aa1d866cbc9e9460fbb67318a10fa3c4deadc35c3ad8a898ee9a71a86a65e4755ac3195e0ea0cfbe201eb323ebe655ce90526fd61917313a34e4e languageName: node linkType: hard -"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.10.1#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.0#~builtin": - version: 1.22.0 - resolution: "resolve@patch:resolve@npm%3A1.22.0#~builtin::version=1.22.0&hash=07638b" +"resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.0#~builtin": + version: 1.22.1 + resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b" dependencies: - is-core-module: ^2.8.1 + is-core-module: ^2.9.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: c79ecaea36c872ee4a79e3db0d3d4160b593f2ca16e031d8283735acd01715a203607e9ded3f91f68899c2937fa0d49390cddbe0fb2852629212f3cda283f4a7 - languageName: node - linkType: hard - -"responselike@npm:^1.0.2": - version: 1.0.2 - resolution: "responselike@npm:1.0.2" - dependencies: - lowercase-keys: ^1.0.0 - checksum: 2e9e70f1dcca3da621a80ce71f2f9a9cad12c047145c6ece20df22f0743f051cf7c73505e109814915f23f9e34fb0d358e22827723ee3d56b623533cab8eafcd + checksum: 5656f4d0bedcf8eb52685c1abdf8fbe73a1603bb1160a24d716e27a57f6cecbe2432ff9c89c2bd57542c3a7b9d14b1882b73bfe2e9d7849c9a4c0b8b39f02b8b languageName: node linkType: hard @@ -14185,10 +10312,10 @@ __metadata: languageName: node linkType: hard -"retry@npm:0.13.1": - version: 0.13.1 - resolution: "retry@npm:0.13.1" - checksum: 47c4d5be674f7c13eee4cfe927345023972197dbbdfba5d3af7e461d13b44de1bfd663bfc80d2f601f8ef3fc8164c16dd99655a221921954a65d044a2fc1233b +"retry-as-promised@npm:^6.1.0": + version: 6.1.0 + resolution: "retry-as-promised@npm:6.1.0" + checksum: cde3ad5c827d3f51b9161b9453dfd5eb8b8b6c22b6b405f7294eaa1939ef1966f8bd4c8a228ce2d66a24959d1dcc48b113c4c810ecdaddec2968b6d20576329d languageName: node linkType: hard @@ -14213,7 +10340,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:3.0.2, rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -14224,18 +10351,17 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^2.6.3": - version: 2.7.1 - resolution: "rimraf@npm:2.7.1" +"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": + version: 2.0.2 + resolution: "ripemd160@npm:2.0.2" dependencies: - glob: ^7.1.3 - bin: - rimraf: ./bin.js - checksum: cdc7f6eacb17927f2a075117a823e1c5951792c6498ebcce81ca8203454a811d4cf8900314154d3259bb8f0b42ab17f67396a8694a54cae3283326e57ad250cd + hash-base: ^3.0.0 + inherits: ^2.0.1 + checksum: 006accc40578ee2beae382757c4ce2908a826b27e2b079efdcd2959ee544ddf210b7b5d7d5e80467807604244e7388427330f5c6d4cd61e6edaddc5773ccc393 languageName: node linkType: hard -"rlp@npm:^2.2.3": +"rlp@npm:^2.2.3, rlp@npm:^2.2.4": version: 2.2.7 resolution: "rlp@npm:2.2.7" dependencies: @@ -14247,16 +10373,9 @@ __metadata: linkType: hard "rotating-file-stream@npm:^3.0.2": - version: 3.0.3 - resolution: "rotating-file-stream@npm:3.0.3" - checksum: 5bf41b553fc0470783248cfc64c7bab8c1e172f5ed5880fee4bae827b82083f6e18b7adb4b5fbc1042227df40539497e478e6805c62febfa03989f6b20516cb8 - languageName: node - linkType: hard - -"run-async@npm:^2.0.0, run-async@npm:^2.4.0": - version: 2.4.1 - resolution: "run-async@npm:2.4.1" - checksum: a2c88aa15df176f091a2878eb840e68d0bdee319d8d97bbb89112223259cebecb94bc0defd735662b83c2f7a30bed8cddb7d1674eb48ae7322dc602b22d03797 + version: 3.0.4 + resolution: "rotating-file-stream@npm:3.0.4" + checksum: 2f2cd4ec781239eb4e3d0a8ae76193e0b41fa0cda19513ae54d814fa66448bf973a2e0230371c083e6326d3deeef4818f5aea73fba685bd0e98df743ad78a86a languageName: node linkType: hard @@ -14269,7 +10388,7 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:6.6.7, rxjs@npm:^6.6.0, rxjs@npm:^6.6.2, rxjs@npm:^6.6.3": +"rxjs@npm:6.6.7": version: 6.6.7 resolution: "rxjs@npm:6.6.7" dependencies: @@ -14278,16 +10397,7 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^7.2.0, rxjs@npm:^7.5.2, rxjs@npm:^7.5.5": - version: 7.5.5 - resolution: "rxjs@npm:7.5.5" - dependencies: - tslib: ^2.1.0 - checksum: e034f60805210cce756dd2f49664a8108780b117cf5d0e2281506e9e6387f7b4f1532d974a8c8b09314fa7a16dd2f6cff3462072a5789672b5dcb45c4173f3c6 - languageName: node - linkType: hard - -"rxjs@npm:^7.5.6": +"rxjs@npm:^7.5.2, rxjs@npm:^7.5.5, rxjs@npm:^7.5.6": version: 7.5.6 resolution: "rxjs@npm:7.5.6" dependencies: @@ -14296,7 +10406,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -14310,15 +10420,6 @@ __metadata: languageName: node linkType: hard -"safe-regex@npm:^2.1.1": - version: 2.1.1 - resolution: "safe-regex@npm:2.1.1" - dependencies: - regexp-tree: ~0.1.1 - checksum: 5d734e2193c63ef0cb00f60c0244e0f8a30ecb31923633cd34636808d6a7c4c206d650017953ae1db8bc33967c2f06af33488dea6f038f4e38212beb7bed77b4 - languageName: node - linkType: hard - "safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" @@ -14326,20 +10427,6 @@ __metadata: languageName: node linkType: hard -"sax@npm:1.2.1": - version: 1.2.1 - resolution: "sax@npm:1.2.1" - checksum: 8dca7d5e1cd7d612f98ac50bdf0b9f63fbc964b85f0c4e2eb271f8b9b47fd3bf344c4d6a592e69ecf726d1485ca62cd8a52e603bbc332d18a66af25a9a1045ad - languageName: node - linkType: hard - -"sax@npm:>=0.6.0": - version: 1.2.4 - resolution: "sax@npm:1.2.4" - checksum: d3df7d32b897a2c2f28e941f732c71ba90e27c24f62ee918bd4d9a8cfb3553f2f81e5493c7f0be94a11c1911b643a9108f231dd6f60df3fa9586b5d2e3e9e1fe - languageName: node - linkType: hard - "saxes@npm:^5.0.1": version: 5.0.1 resolution: "saxes@npm:5.0.1" @@ -14349,21 +10436,22 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^3.1.0, schema-utils@npm:^3.1.1": - version: 3.1.1 - resolution: "schema-utils@npm:3.1.1" - dependencies: - "@types/json-schema": ^7.0.8 - ajv: ^6.12.5 - ajv-keywords: ^3.5.2 - checksum: fb73f3d759d43ba033c877628fe9751620a26879f6301d3dbeeb48cf2a65baec5cdf99da65d1bf3b4ff5444b2e59cbe4f81c2456b5e0d2ba7d7fd4aed5da29ce +"scrypt-js@npm:3.0.1, scrypt-js@npm:^3.0.0": + version: 3.0.1 + resolution: "scrypt-js@npm:3.0.1" + checksum: b7c7d1a68d6ca946f2fbb0778e0c4ec63c65501b54023b2af7d7e9f48fdb6c6580d6f7675cd53bda5944c5ebc057560d5a6365079752546865defb3b79dea454 languageName: node linkType: hard -"scoped-regex@npm:^2.0.0": - version: 2.1.0 - resolution: "scoped-regex@npm:2.1.0" - checksum: 4e820444cb79727bb302d94dafe07999cce18b6026e4866583466821b3d246403034bc46085e1f4b63ec99491b637540a7c74fb2a66c5c4287700ec357d8af86 +"secp256k1@npm:^4.0.1": + version: 4.0.3 + resolution: "secp256k1@npm:4.0.3" + dependencies: + elliptic: ^6.5.4 + node-addon-api: ^2.0.0 + node-gyp: latest + node-gyp-build: ^4.2.0 + checksum: 21e219adc0024fbd75021001358780a3cc6ac21273c3fcaef46943af73969729709b03f1df7c012a0baab0830fb9a06ccc6b42f8d50050c665cb98078eab477b languageName: node linkType: hard @@ -14374,16 +10462,18 @@ __metadata: languageName: node linkType: hard -"semver-diff@npm:^3.1.1": - version: 3.1.1 - resolution: "semver-diff@npm:3.1.1" +"semver@npm:7.x, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7": + version: 7.3.7 + resolution: "semver@npm:7.3.7" dependencies: - semver: ^6.3.0 - checksum: 8bbe5a5d7add2d5e51b72314a9215cd294d71f41cdc2bf6bd59ee76411f3610b576172896f1d191d0d7294cb9f2f847438d2ee158adacc0c224dca79052812fe + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: 2fa3e877568cd6ce769c75c211beaed1f9fce80b28338cadd9d0b6c40f2e2862bafd62c19a6cff42f3d54292b7c623277bcab8816a2b5521cf15210d43e75232 languageName: node linkType: hard -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.1": +"semver@npm:^5.7.1": version: 5.7.1 resolution: "semver@npm:5.7.1" bin: @@ -14392,53 +10482,42 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.0.0": - version: 7.0.0 - resolution: "semver@npm:7.0.0" +"semver@npm:^6.0.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0": + version: 6.3.0 + resolution: "semver@npm:6.3.0" bin: - semver: bin/semver.js - checksum: 272c11bf8d083274ef79fe40a81c55c184dff84dd58e3c325299d0927ba48cece1f020793d138382b85f89bab5002a35a5ba59a3a68a7eebbb597eb733838778 + semver: ./bin/semver.js + checksum: 1b26ecf6db9e8292dd90df4e781d91875c0dcc1b1909e70f5d12959a23c7eebb8f01ea581c00783bbee72ceeaad9505797c381756326073850dc36ed284b21b9 languageName: node linkType: hard -"semver@npm:7.x, semver@npm:^7.1.1, semver@npm:^7.1.3, semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7": - version: 7.3.7 - resolution: "semver@npm:7.3.7" - dependencies: - lru-cache: ^6.0.0 +"semver@npm:~7.0.0": + version: 7.0.0 + resolution: "semver@npm:7.0.0" bin: semver: bin/semver.js - checksum: 2fa3e877568cd6ce769c75c211beaed1f9fce80b28338cadd9d0b6c40f2e2862bafd62c19a6cff42f3d54292b7c623277bcab8816a2b5521cf15210d43e75232 - languageName: node - linkType: hard - -"semver@npm:^6.0.0, semver@npm:^6.1.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.2.0, semver@npm:^6.3.0": - version: 6.3.0 - resolution: "semver@npm:6.3.0" - bin: - semver: ./bin/semver.js - checksum: 1b26ecf6db9e8292dd90df4e781d91875c0dcc1b1909e70f5d12959a23c7eebb8f01ea581c00783bbee72ceeaad9505797c381756326073850dc36ed284b21b9 + checksum: 272c11bf8d083274ef79fe40a81c55c184dff84dd58e3c325299d0927ba48cece1f020793d138382b85f89bab5002a35a5ba59a3a68a7eebbb597eb733838778 languageName: node linkType: hard -"send@npm:0.17.2": - version: 0.17.2 - resolution: "send@npm:0.17.2" +"send@npm:0.18.0": + version: 0.18.0 + resolution: "send@npm:0.18.0" dependencies: debug: 2.6.9 - depd: ~1.1.2 - destroy: ~1.0.4 + depd: 2.0.0 + destroy: 1.2.0 encodeurl: ~1.0.2 escape-html: ~1.0.3 etag: ~1.8.1 fresh: 0.5.2 - http-errors: 1.8.1 + http-errors: 2.0.0 mime: 1.6.0 ms: 2.1.3 - on-finished: ~2.3.0 + on-finished: 2.4.1 range-parser: ~1.2.1 - statuses: ~1.5.0 - checksum: c28f36deb4ccba9b8d6e6a1e472b8e7c40a1f51575bdf8f67303568cc9e71131faa3adc36fdb72611616ccad1584358bbe4c3ebf419e663ecc5de868ad3d3f03 + statuses: 2.0.1 + checksum: 74fc07ebb58566b87b078ec63e5a3e41ecd987e4272ba67b7467e86c6ad51bc6b0b0154133b6d8b08a2ddda360464f71382f7ef864700f34844a76c8027817a8 languageName: node linkType: hard @@ -14449,7 +10528,7 @@ __metadata: languageName: node linkType: hard -"sequelize@npm:6.19.0, sequelize@npm:^6.15.0": +"sequelize@npm:6.19.0": version: 6.19.0 resolution: "sequelize@npm:6.19.0" dependencies: @@ -14490,9 +10569,9 @@ __metadata: languageName: node linkType: hard -"sequelize@npm:^6.6.2": - version: 6.20.1 - resolution: "sequelize@npm:6.20.1" +"sequelize@npm:^6.15.0, sequelize@npm:^6.6.2": + version: 6.21.6 + resolution: "sequelize@npm:6.21.6" dependencies: "@types/debug": ^4.1.7 "@types/validator": ^13.7.1 @@ -14503,7 +10582,7 @@ __metadata: moment: ^2.29.1 moment-timezone: ^0.5.34 pg-connection-string: ^2.5.0 - retry-as-promised: ^5.0.0 + retry-as-promised: ^6.1.0 semver: ^7.3.5 sequelize-pool: ^7.1.0 toposort-class: ^1.0.1 @@ -14527,28 +10606,19 @@ __metadata: optional: true tedious: optional: true - checksum: 08a6f9e3fb9d31d87399b378802cc5a0531f93cfb5ac18e0b11dc0942cac4a886bbba2dbe5aa33dd3d7ba060d32891876ba0de5c03ebfb4f6459ce84f430be79 - languageName: node - linkType: hard - -"serialize-javascript@npm:^6.0.0": - version: 6.0.0 - resolution: "serialize-javascript@npm:6.0.0" - dependencies: - randombytes: ^2.1.0 - checksum: 56f90b562a1bdc92e55afb3e657c6397c01a902c588c0fe3d4c490efdcc97dcd2a3074ba12df9e94630f33a5ce5b76a74784a7041294628a6f4306e0ec84bf93 + checksum: 0e2c9e1141200464cf4a959396ea554668f1c4444afdfa16b81b253c6dd61da7dba635b1547d6833b4575ecda9395ea50b58e052fd6e05e5afff5f6d682355e4 languageName: node linkType: hard -"serve-static@npm:1.14.2": - version: 1.14.2 - resolution: "serve-static@npm:1.14.2" +"serve-static@npm:1.15.0": + version: 1.15.0 + resolution: "serve-static@npm:1.15.0" dependencies: encodeurl: ~1.0.2 escape-html: ~1.0.3 parseurl: ~1.3.3 - send: 0.17.2 - checksum: d97f3183b1dfcd8ce9c0e37e18e87fd31147ed6c8ee0b2c3a089d795e44ee851ca5061db01574f806d54f4e4b70bc694d9ca64578653514e04a28cbc97a1de05 + send: 0.18.0 + checksum: af57fc13be40d90a12562e98c0b7855cf6e8bd4c107fe9a45c212bf023058d54a1871b1c89511c3958f70626fff47faeb795f5d83f8cf88514dbaeb2b724464d languageName: node linkType: hard @@ -14559,6 +10629,13 @@ __metadata: languageName: node linkType: hard +"setimmediate@npm:^1.0.5": + version: 1.0.5 + resolution: "setimmediate@npm:1.0.5" + checksum: c9a6f2c5b51a2dabdc0247db9c46460152ffc62ee139f3157440bd48e7c59425093f42719ac1d7931f054f153e2d26cf37dfeb8da17a794a58198a2705e527fd + languageName: node + linkType: hard + "setprototypeof@npm:1.2.0": version: 1.2.0 resolution: "setprototypeof@npm:1.2.0" @@ -14566,7 +10643,7 @@ __metadata: languageName: node linkType: hard -"sha.js@npm:^2.4.11": +"sha.js@npm:^2.4.0, sha.js@npm:^2.4.11, sha.js@npm:^2.4.8": version: 2.4.11 resolution: "sha.js@npm:2.4.11" dependencies: @@ -14578,24 +10655,6 @@ __metadata: languageName: node linkType: hard -"shallow-clone@npm:^3.0.0": - version: 3.0.1 - resolution: "shallow-clone@npm:3.0.1" - dependencies: - kind-of: ^6.0.2 - checksum: 39b3dd9630a774aba288a680e7d2901f5c0eae7b8387fc5c8ea559918b29b3da144b7bdb990d7ccd9e11be05508ac9e459ce51d01fd65e583282f6ffafcba2e7 - languageName: node - linkType: hard - -"shebang-command@npm:^1.2.0": - version: 1.2.0 - resolution: "shebang-command@npm:1.2.0" - dependencies: - shebang-regex: ^1.0.0 - checksum: 9eed1750301e622961ba5d588af2212505e96770ec376a37ab678f965795e995ade7ed44910f5d3d3cb5e10165a1847f52d3348c64e146b8be922f7707958908 - languageName: node - linkType: hard - "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -14605,13 +10664,6 @@ __metadata: languageName: node linkType: hard -"shebang-regex@npm:^1.0.0": - version: 1.0.0 - resolution: "shebang-regex@npm:1.0.0" - checksum: 404c5a752cd40f94591dfd9346da40a735a05139dac890ffc229afba610854d8799aaa52f87f7e0c94c5007f2c6af55bdcaeb584b56691926c5eaf41dc8f1372 - languageName: node - linkType: hard - "shebang-regex@npm:^3.0.0": version: 3.0.0 resolution: "shebang-regex@npm:3.0.0" @@ -14619,19 +10671,6 @@ __metadata: languageName: node linkType: hard -"shelljs@npm:0.8.5, shelljs@npm:^0.8.5": - version: 0.8.5 - resolution: "shelljs@npm:0.8.5" - dependencies: - glob: ^7.0.0 - interpret: ^1.0.0 - rechoir: ^0.6.2 - bin: - shjs: bin/shjs - checksum: 7babc46f732a98f4c054ec1f048b55b9149b98aa2da32f6cf9844c434b43c6251efebd6eec120937bd0999e13811ebd45efe17410edb3ca938f82f9381302748 - languageName: node - linkType: hard - "side-channel@npm:^1.0.4": version: 1.0.4 resolution: "side-channel@npm:1.0.4" @@ -14643,21 +10682,19 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 languageName: node linkType: hard -"simple-git@npm:^3.12.0": - version: 3.12.0 - resolution: "simple-git@npm:3.12.0" +"simple-update-notifier@npm:^1.0.7": + version: 1.0.7 + resolution: "simple-update-notifier@npm:1.0.7" dependencies: - "@kwsites/file-exists": ^1.1.1 - "@kwsites/promise-deferred": ^1.1.1 - debug: ^4.3.4 - checksum: a862851030a3f2100f33cafe68de255ba13a8ddef30cbb17a9b8d9a74cc903c7c39ab8b4afde9f6c362a9f4bb65b09989356f6c58171c190611d3916a4802a1e + semver: ~7.0.0 + checksum: aaadc1f158ad5101b363d1c7aed1f30fc1cac59a760aa31702633e0e6fe423348f07d0e78185aef0aad29130a7b7f0f188c21c7bc7353f897a0ea3682e051a70 languageName: node linkType: hard @@ -14714,24 +10751,24 @@ __metadata: languageName: node linkType: hard -"socks-proxy-agent@npm:^6.0.0, socks-proxy-agent@npm:^6.1.1": - version: 6.2.0 - resolution: "socks-proxy-agent@npm:6.2.0" +"socks-proxy-agent@npm:^7.0.0": + version: 7.0.0 + resolution: "socks-proxy-agent@npm:7.0.0" dependencies: agent-base: ^6.0.2 debug: ^4.3.3 socks: ^2.6.2 - checksum: 6723fd64fb50334e2b340fd0a80fd8488ffc5bc43d85b7cf1d25612044f814dd7d6ea417fd47602159941236f7f4bd15669fa5d7e1f852598a31288e1a43967b + checksum: 720554370154cbc979e2e9ce6a6ec6ced205d02757d8f5d93fe95adae454fc187a5cbfc6b022afab850a5ce9b4c7d73e0f98e381879cf45f66317a4895953846 languageName: node linkType: hard "socks@npm:^2.6.2": - version: 2.6.2 - resolution: "socks@npm:2.6.2" + version: 2.7.0 + resolution: "socks@npm:2.7.0" dependencies: - ip: ^1.1.5 + ip: ^2.0.0 smart-buffer: ^4.2.0 - checksum: dd9194293059d737759d5c69273850ad4149f448426249325c4bea0e340d1cf3d266c3b022694b0dcf5d31f759de23657244c481fc1e8322add80b7985c36b5e + checksum: 0b5d94e2b3c11e7937b40fc5dac1e80d8b92a330e68c51f1d271ce6980c70adca42a3f8cd47c4a5769956bada074823b53374f2dc5f2ea5c2121b222dec6eadf languageName: node linkType: hard @@ -14754,16 +10791,7 @@ __metadata: languageName: node linkType: hard -"sort-keys@npm:^4.0.0, sort-keys@npm:^4.2.0": - version: 4.2.0 - resolution: "sort-keys@npm:4.2.0" - dependencies: - is-plain-obj: ^2.0.0 - checksum: 1535ffd5a789259fc55107d5c3cec09b3e47803a9407fcaae37e1b9e0b813762c47dfee35b6e71e20ca7a69798d0a4791b2058a07f6cab5ef17b2dae83cedbda - languageName: node - linkType: hard - -"source-map-support@npm:0.5.21, source-map-support@npm:^0.5.6, source-map-support@npm:~0.5.20": +"source-map-support@npm:^0.5.6": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" dependencies: @@ -14773,7 +10801,7 @@ __metadata: languageName: node linkType: hard -"source-map@npm:0.7.3, source-map@npm:^0.7.3": +"source-map@npm:0.7.3": version: 0.7.3 resolution: "source-map@npm:0.7.3" checksum: cd24efb3b8fa69b64bf28e3c1b1a500de77e84260c5b7f2b873f88284df17974157cc88d386ee9b6d081f08fdd8242f3fc05c953685a6ad81aad94c7393dedea @@ -14787,12 +10815,10 @@ __metadata: languageName: node linkType: hard -"source-map@npm:~0.8.0-beta.0": - version: 0.8.0-beta.0 - resolution: "source-map@npm:0.8.0-beta.0" - dependencies: - whatwg-url: ^7.0.0 - checksum: e94169be6461ab0ac0913313ad1719a14c60d402bd22b0ad96f4a6cffd79130d91ab5df0a5336a326b04d2df131c1409f563c9dc0d21a6ca6239a44b6c8dbd92 +"source-map@npm:^0.7.3": + version: 0.7.4 + resolution: "source-map@npm:0.7.4" + checksum: 01cc5a74b1f0e1d626a58d36ad6898ea820567e87f18dfc9d24a9843a351aaa2ec09b87422589906d6ff1deed29693e176194dc88bcae7c9a852dc74b311dbf5 languageName: node linkType: hard @@ -14803,47 +10829,6 @@ __metadata: languageName: node linkType: hard -"spawn-command@npm:^0.0.2-1": - version: 0.0.2 - resolution: "spawn-command@npm:0.0.2" - checksum: e35c5d28177b4d461d33c88cc11f6f3a5079e2b132c11e1746453bbb7a0c0b8a634f07541a2a234fa4758239d88203b758def509161b651e81958894c0b4b64b - languageName: node - linkType: hard - -"spdx-correct@npm:^3.0.0": - version: 3.1.1 - resolution: "spdx-correct@npm:3.1.1" - dependencies: - spdx-expression-parse: ^3.0.0 - spdx-license-ids: ^3.0.0 - checksum: 77ce438344a34f9930feffa61be0eddcda5b55fc592906ef75621d4b52c07400a97084d8701557b13f7d2aae0cb64f808431f469e566ef3fe0a3a131dcb775a6 - languageName: node - linkType: hard - -"spdx-exceptions@npm:^2.1.0": - version: 2.3.0 - resolution: "spdx-exceptions@npm:2.3.0" - checksum: cb69a26fa3b46305637123cd37c85f75610e8c477b6476fa7354eb67c08128d159f1d36715f19be6f9daf4b680337deb8c65acdcae7f2608ba51931540687ac0 - languageName: node - linkType: hard - -"spdx-expression-parse@npm:^3.0.0": - version: 3.0.1 - resolution: "spdx-expression-parse@npm:3.0.1" - dependencies: - spdx-exceptions: ^2.1.0 - spdx-license-ids: ^3.0.0 - checksum: a1c6e104a2cbada7a593eaa9f430bd5e148ef5290d4c0409899855ce8b1c39652bcc88a725259491a82601159d6dc790bedefc9016c7472f7de8de7361f8ccde - languageName: node - linkType: hard - -"spdx-license-ids@npm:^3.0.0": - version: 3.0.11 - resolution: "spdx-license-ids@npm:3.0.11" - checksum: 1da1acb090257773e60b022094050e810ae9fec874dc1461f65dc0400cd42dd830ab2df6e64fb49c2db3dce386dd0362110780e1b154db7c0bb413488836aaeb - languageName: node - linkType: hard - "split2@npm:^4.1.0": version: 4.1.0 resolution: "split2@npm:4.1.0" @@ -14858,21 +10843,12 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^8.0.0, ssri@npm:^8.0.1": - version: 8.0.1 - resolution: "ssri@npm:8.0.1" - dependencies: - minipass: ^3.1.1 - checksum: bc447f5af814fa9713aa201ec2522208ae0f4d8f3bda7a1f445a797c7b929a02720436ff7c478fb5edc4045adb02b1b88d2341b436a80798734e2494f1067b36 - languageName: node - linkType: hard - "ssri@npm:^9.0.0": - version: 9.0.0 - resolution: "ssri@npm:9.0.0" + version: 9.0.1 + resolution: "ssri@npm:9.0.1" dependencies: minipass: ^3.1.1 - checksum: bf33174232d07cc64e77ab1c51b55d28352273380c503d35642a19627e88a2c5f160039bb0a28608a353485075dda084dbf0390c7070f9f284559eb71d01b84b + checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb languageName: node linkType: hard @@ -14892,13 +10868,6 @@ __metadata: languageName: node linkType: hard -"statuses@npm:>= 1.5.0 < 2, statuses@npm:~1.5.0": - version: 1.5.0 - resolution: "statuses@npm:1.5.0" - checksum: c469b9519de16a4bb19600205cffb39ee471a5f17b82589757ca7bd40a8d92ebb6ed9f98b5a540c5d302ccbc78f15dc03cc0280dd6e00df1335568a5d5758a5c - languageName: node - linkType: hard - "stream-to-it@npm:^0.2.2": version: 0.2.4 resolution: "stream-to-it@npm:0.2.4" @@ -14908,10 +10877,10 @@ __metadata: languageName: node linkType: hard -"streamsearch@npm:0.1.2": - version: 0.1.2 - resolution: "streamsearch@npm:0.1.2" - checksum: d2db57cbfbf7947ab9c75a7b4c80a8ef8d24850cf0a1a24258bb6956c97317ce1eab7dbcbf9c5aba3e6198611af1053b02411057bbedb99bf9c64b8275248997 +"streamsearch@npm:^1.1.0": + version: 1.1.0 + resolution: "streamsearch@npm:1.1.0" + checksum: 1cce16cea8405d7a233d32ca5e00a00169cc0e19fbc02aa839959985f267335d435c07f96e5e0edd0eadc6d39c98d5435fb5bbbdefc62c41834eadc5622ad942 languageName: node linkType: hard @@ -14932,18 +10901,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.1": - version: 1.0.2 - resolution: "string-width@npm:1.0.2" - dependencies: - code-point-at: ^1.0.0 - is-fullwidth-code-point: ^1.0.0 - strip-ansi: ^3.0.0 - checksum: 5c79439e95bc3bd7233a332c5f5926ab2ee90b23816ed4faa380ce3b2576d7800b0a5bb15ae88ed28737acc7ea06a518c2eef39142dd727adad0e45c776cd37e - languageName: node - linkType: hard - -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.0.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.2, string-width@npm:^4.2.3": +"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -14954,16 +10912,6 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^2.0.0": - version: 2.1.1 - resolution: "string-width@npm:2.1.1" - dependencies: - is-fullwidth-code-point: ^2.0.0 - strip-ansi: ^4.0.0 - checksum: d6173abe088c615c8dffaf3861dc5d5906ed3dc2d6fd67ff2bd2e2b5dce7fd683c5240699cf0b1b8aa679a3b3bd6b28b5053c824cb89b813d7f6541d8f89064a - languageName: node - linkType: hard - "string-width@npm:^5.0.0": version: 5.1.2 resolution: "string-width@npm:5.1.2" @@ -15006,13 +10954,6 @@ __metadata: languageName: node linkType: hard -"string_decoder@npm:~0.10.x": - version: 0.10.31 - resolution: "string_decoder@npm:0.10.31" - checksum: fe00f8e303647e5db919948ccb5ce0da7dea209ab54702894dd0c664edd98e5d4df4b80d6fabf7b9e92b237359d21136c95bf068b2f7760b772ca974ba970202 - languageName: node - linkType: hard - "string_decoder@npm:~1.1.1": version: 1.1.1 resolution: "string_decoder@npm:1.1.1" @@ -15022,24 +10963,6 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^3.0.0, strip-ansi@npm:^3.0.1": - version: 3.0.1 - resolution: "strip-ansi@npm:3.0.1" - dependencies: - ansi-regex: ^2.0.0 - checksum: 9b974de611ce5075c70629c00fa98c46144043db92ae17748fb780f706f7a789e9989fd10597b7c2053ae8d1513fd707816a91f1879b2f71e6ac0b6a863db465 - languageName: node - linkType: hard - -"strip-ansi@npm:^4.0.0": - version: 4.0.0 - resolution: "strip-ansi@npm:4.0.0" - dependencies: - ansi-regex: ^3.0.0 - checksum: d9186e6c0cf78f25274f6750ee5e4a5725fb91b70fdd79aa5fe648eab092a0ec5b9621b22d69d4534a56319f75d8944efbd84e3afa8d4ad1b9a9491f12c84eca - languageName: node - linkType: hard - "strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" @@ -15058,34 +10981,6 @@ __metadata: languageName: node linkType: hard -"strip-bom-buf@npm:^1.0.0": - version: 1.0.0 - resolution: "strip-bom-buf@npm:1.0.0" - dependencies: - is-utf8: ^0.2.1 - checksum: 246665fa1c50eb0852ed174fdbd7da34edb444165e7dda2cd58e66b49a2900707d9f8d3f94bcc8542fe1f46ae7b4274a3411b8ab9e43cd1dcf1b77416e324cfb - languageName: node - linkType: hard - -"strip-bom-stream@npm:^2.0.0": - version: 2.0.0 - resolution: "strip-bom-stream@npm:2.0.0" - dependencies: - first-chunk-stream: ^2.0.0 - strip-bom: ^2.0.0 - checksum: 3e2ff494d9181537ceee35c7bb662fee9dfcebba0779f004e7c1455278f2616c0915b66d8d5432a6cb7e23c792c199717b4661a12e8fa2728a18961dd0203a2e - languageName: node - linkType: hard - -"strip-bom@npm:^2.0.0": - version: 2.0.0 - resolution: "strip-bom@npm:2.0.0" - dependencies: - is-utf8: ^0.2.0 - checksum: 08efb746bc67b10814cd03d79eb31bac633393a782e3f35efbc1b61b5165d3806d03332a97f362822cf0d4dd14ba2e12707fcff44fe1c870c48a063a0c9e4944 - languageName: node - linkType: hard - "strip-bom@npm:^3.0.0": version: 3.0.0 resolution: "strip-bom@npm:3.0.0" @@ -15100,13 +10995,6 @@ __metadata: languageName: node linkType: hard -"strip-eof@npm:^1.0.0": - version: 1.0.0 - resolution: "strip-eof@npm:1.0.0" - checksum: 40bc8ddd7e072f8ba0c2d6d05267b4e0a4800898c3435b5fb5f5a21e6e47dfaff18467e7aa0d1844bb5d6274c3097246595841fbfeb317e541974ee992cac506 - languageName: node - linkType: hard - "strip-final-newline@npm:^2.0.0": version: 2.0.0 resolution: "strip-final-newline@npm:2.0.0" @@ -15114,6 +11002,15 @@ __metadata: languageName: node linkType: hard +"strip-hex-prefix@npm:1.0.0": + version: 1.0.0 + resolution: "strip-hex-prefix@npm:1.0.0" + dependencies: + is-hex-prefixed: 1.0.0 + checksum: 4cafe7caee1d281d3694d14920fd5d3c11adf09371cef7e2ccedd5b83efd9e9bd2219b5d6ce6e809df6e0f437dc9d30db1192116580875698aad164a6d6b285b + languageName: node + linkType: hard + "strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -15121,13 +11018,6 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:~2.0.1": - version: 2.0.1 - resolution: "strip-json-comments@npm:2.0.1" - checksum: 1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 - languageName: node - linkType: hard - "subql-mono@workspace:.": version: 0.0.0-use.local resolution: "subql-mono@workspace:." @@ -15135,6 +11025,8 @@ __metadata: "@actions/core": ^1.6.0 "@babel/preset-env": ^7.16.11 "@octokit/request": ^5.6.3 + "@subql/node-core": ^0.1.1 + "@subql/utils": ^1.1.0 "@types/node": ^14.18.10 "@typescript-eslint/eslint-plugin": ^5.10.2 "@typescript-eslint/parser": ^5.10.2 @@ -15145,6 +11037,7 @@ __metadata: eslint-plugin-import: ^2.25.4 eslint-plugin-prettier: ^4.0.0 eslint-plugin-sort-destructure-keys: ^1.4.0 + ethers: ^5.7.1 husky: ^7.0.4 jest: ^27.4.7 lint-staged: ^12.3.3 @@ -15152,44 +11045,17 @@ __metadata: prettier: ^2.5.1 pretty-quick: ^3.1.3 regenerator-runtime: ^0.13.9 + sequelize: 6.19.0 ts-jest: ^27.1.3 ts-loader: ^9.2.6 ts-node: ^10.4.0 tsconfig-paths: ^3.12.0 typescript: ^4.4.4 + web3-providers-http: ^1.7.5 + web3-providers-ws: ^1.7.5 languageName: unknown linkType: soft -"subscriptions-transport-ws@npm:^0.11.0": - version: 0.11.0 - resolution: "subscriptions-transport-ws@npm:0.11.0" - dependencies: - backo2: ^1.0.2 - eventemitter3: ^3.1.0 - iterall: ^1.2.1 - symbol-observable: ^1.0.4 - ws: ^5.2.0 || ^6.0.0 || ^7.0.0 - peerDependencies: - graphql: ^15.7.2 || ^16.0.0 - checksum: cc2e98d5c9d89c44d2e15eca188781c6ebae13d1661c42a99cee9d2897aebe2a22bc118eefff83244a79c88ee4ea24d46973ebf26ae7cb47ac1857fb8ee2c947 - languageName: node - linkType: hard - -"subscriptions-transport-ws@npm:^0.9.18": - version: 0.9.19 - resolution: "subscriptions-transport-ws@npm:0.9.19" - dependencies: - backo2: ^1.0.2 - eventemitter3: ^3.1.0 - iterall: ^1.2.1 - symbol-observable: ^1.0.4 - ws: ^5.2.0 || ^6.0.0 || ^7.0.0 - peerDependencies: - graphql: ">=0.10.0" - checksum: 6979b36e03c0a48e33836cb412941e41bae8743767dff2aa453159cfffa983b879cc80cd4e744e82afbf11062c66899c37f5dca0281253ee240098ada0078533 - languageName: node - linkType: hard - "superagent@npm:^6.1.0": version: 6.1.0 resolution: "superagent@npm:6.1.0" @@ -15209,9 +11075,9 @@ __metadata: languageName: node linkType: hard -"superagent@npm:^7.1.3": - version: 7.1.3 - resolution: "superagent@npm:7.1.3" +"superagent@npm:^8.0.0": + version: 8.0.0 + resolution: "superagent@npm:8.0.0" dependencies: component-emitter: ^1.3.0 cookiejar: ^2.1.3 @@ -15220,28 +11086,21 @@ __metadata: form-data: ^4.0.0 formidable: ^2.0.1 methods: ^1.1.2 - mime: ^2.5.0 + mime: 2.6.0 qs: ^6.10.3 readable-stream: ^3.6.0 semver: ^7.3.7 - checksum: 436045d555d35c282de7bcba85102b1421470bdc80781c9a0b7ab7c639675b4eca026a71301974935f3de0d33782a0392274e24f3915335b81a78a04b48eeee5 + checksum: 14343e59327eafd85fa230acb876017079d5efcecc72a56566abc0f965220bb460af2e070dddecd9e2856410b2d2b318d81d9cc1d342aa5922da93c29a295dd7 languageName: node linkType: hard "supertest@npm:^6.2.2": - version: 6.2.3 - resolution: "supertest@npm:6.2.3" + version: 6.2.4 + resolution: "supertest@npm:6.2.4" dependencies: methods: ^1.1.2 - superagent: ^7.1.3 - checksum: c1bed86c31723a4bc461153a58176fd80d675deb7d23ab7bd170213040673b35c38e3cbeab9a4eb8a325cf736176c08c6f6522e42f0293314f183e192a6681fa - languageName: node - linkType: hard - -"supports-color@npm:^2.0.0": - version: 2.0.0 - resolution: "supports-color@npm:2.0.0" - checksum: 602538c5812b9006404370b5a4b885d3e2a1f6567d314f8b4a41974ffe7d08e525bf92ae0f9c7030e3b4c78e4e34ace55d6a67a74f1571bc205959f5972f88f0 + superagent: ^8.0.0 + checksum: f2ddc4f3ba467a5c4036dd4aad41351e4b60eb13c39ecf5233ccd2ebb425504073b2b7036c973a70c7047f5c6bc1b9fef096b7bbff114d357cbe80654441db23 languageName: node linkType: hard @@ -15263,7 +11122,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.0.0, supports-color@npm:^8.1.0, supports-color@npm:^8.1.1": +"supports-color@npm:^8.0.0": version: 8.1.1 resolution: "supports-color@npm:8.1.1" dependencies: @@ -15272,20 +11131,20 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^9.2.1": - version: 9.2.2 - resolution: "supports-color@npm:9.2.2" - checksum: 976d84877402fc38c1d43b1fde20b0a8dc0283273f21cfebe4ff7507d27543cdfbeec7db108a96b82d694465f06d64e8577562b05d0520b41710088e0a33cc50 +"supports-color@npm:^9.2.2": + version: 9.2.3 + resolution: "supports-color@npm:9.2.3" + checksum: 47d598b70d2bac3cbce98950344134de17c2935f45e8ad6256cde78ebe5da440e240d9fa17c1146bd84b1c36f865239fef6c563d70068a8d901ca5a6c56960af languageName: node linkType: hard -"supports-hyperlinks@npm:^2.0.0, supports-hyperlinks@npm:^2.1.0, supports-hyperlinks@npm:^2.2.0": - version: 2.2.0 - resolution: "supports-hyperlinks@npm:2.2.0" +"supports-hyperlinks@npm:^2.0.0": + version: 2.3.0 + resolution: "supports-hyperlinks@npm:2.3.0" dependencies: has-flag: ^4.0.0 supports-color: ^7.0.0 - checksum: aef04fb41f4a67f1bc128f7c3e88a81b6cf2794c800fccf137006efe5bafde281da3e42e72bf9206c2fcf42e6438f37e3a820a389214d0a88613ca1f2d36076a + checksum: 9ee0de3c8ce919d453511b2b1588a8205bd429d98af94a01df87411391010fe22ca463f268c84b2ce2abad019dfff8452aa02806eeb5c905a8d7ad5c4f4c52b8 languageName: node linkType: hard @@ -15296,20 +11155,13 @@ __metadata: languageName: node linkType: hard -"symbol-observable@npm:4.0.0, symbol-observable@npm:^4.0.0": +"symbol-observable@npm:^4.0.0": version: 4.0.0 resolution: "symbol-observable@npm:4.0.0" checksum: 212c7edce6186634d671336a88c0e0bbd626c2ab51ed57498dc90698cce541839a261b969c2a1e8dd43762133d47672e8b62e0b1ce9cf4157934ba45fd172ba8 languageName: node linkType: hard -"symbol-observable@npm:^1.0.4": - version: 1.2.0 - resolution: "symbol-observable@npm:1.2.0" - checksum: 48ffbc22e3d75f9853b3ff2ae94a44d84f386415110aea5effc24d84c502e03a4a6b7a8f75ebaf7b585780bda34eb5d6da3121f826a6f93398429d30032971b6 - languageName: node - linkType: hard - "symbol-tree@npm:^3.2.4": version: 3.2.4 resolution: "symbol-tree@npm:3.2.4" @@ -15317,49 +11169,14 @@ __metadata: languageName: node linkType: hard -"taketalk@npm:^1.0.0": - version: 1.0.0 - resolution: "taketalk@npm:1.0.0" - dependencies: - get-stdin: ^4.0.1 - minimist: ^1.1.0 - checksum: b9a6ae2d6e41573a18958b7ac76ab89a6f703a3abfb24fc1613171bece8b6bb76e68fa39da6077ed6cac22d0d39530e40e9078aea93f3cf9285f48b05e046a2b - languageName: node - linkType: hard - -"tapable@npm:^2.1.1, tapable@npm:^2.2.0, tapable@npm:^2.2.1": +"tapable@npm:^2.2.0": version: 2.2.1 resolution: "tapable@npm:2.2.1" checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 languageName: node linkType: hard -"tar-fs@npm:^2.0.0": - version: 2.1.1 - resolution: "tar-fs@npm:2.1.1" - dependencies: - chownr: ^1.1.1 - mkdirp-classic: ^0.5.2 - pump: ^3.0.0 - tar-stream: ^2.1.4 - checksum: f5b9a70059f5b2969e65f037b4e4da2daf0fa762d3d232ffd96e819e3f94665dbbbe62f76f084f1acb4dbdcce16c6e4dac08d12ffc6d24b8d76720f4d9cf032d - languageName: node - linkType: hard - -"tar-stream@npm:^2.1.4": - version: 2.2.0 - resolution: "tar-stream@npm:2.2.0" - dependencies: - bl: ^4.0.3 - end-of-stream: ^1.4.1 - fs-constants: ^1.0.0 - inherits: ^2.0.3 - readable-stream: ^3.1.1 - checksum: 699831a8b97666ef50021c767f84924cfee21c142c2eb0e79c63254e140e6408d6d55a065a2992548e72b06de39237ef2b802b99e3ece93ca3904a37622a66f3 - languageName: node - linkType: hard - -"tar@npm:^6.0.2, tar@npm:^6.1.0, tar@npm:^6.1.11, tar@npm:^6.1.2": +"tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.1.11 resolution: "tar@npm:6.1.11" dependencies: @@ -15374,11 +11191,11 @@ __metadata: linkType: hard "tdigest@npm:^0.1.1": - version: 0.1.1 - resolution: "tdigest@npm:0.1.1" + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" dependencies: - bintrees: 1.0.1 - checksum: 4d05fd70fb0aa70aa101d01557722b7ef9a91b2ebf8dfc274ca9852220397a74e4ed6e59c55335b4b1dd0ac5e1b65d25b8d32ae01278fc3b783c40f6d84303e2 + bintrees: 1.0.2 + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 languageName: node linkType: hard @@ -15392,42 +11209,6 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.1.3": - version: 5.3.1 - resolution: "terser-webpack-plugin@npm:5.3.1" - dependencies: - jest-worker: ^27.4.5 - schema-utils: ^3.1.1 - serialize-javascript: ^6.0.0 - source-map: ^0.6.1 - terser: ^5.7.2 - peerDependencies: - webpack: ^5.1.0 - peerDependenciesMeta: - "@swc/core": - optional: true - esbuild: - optional: true - uglify-js: - optional: true - checksum: 1b808fd4f58ce0b532baacc50b9a850fc69ce0077a0e9e5076d4156c52fab3d40b02d5d9148a3eba64630cf7f40057de54f6a5a87fac1849b1f11d6bfdb42072 - languageName: node - linkType: hard - -"terser@npm:^5.7.2": - version: 5.13.1 - resolution: "terser@npm:5.13.1" - dependencies: - acorn: ^8.5.0 - commander: ^2.20.0 - source-map: ~0.8.0-beta.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: 0b1f5043cf5c3973005fe2ae4ff3be82511c336a6430599dacd4e2acf77c974d4474b0f1eec4823977c1f33823147e736ff712ca8e098bee3db25946480fa29d - languageName: node - linkType: hard - "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -15446,13 +11227,6 @@ __metadata: languageName: node linkType: hard -"textextensions@npm:^5.12.0, textextensions@npm:^5.13.0": - version: 5.15.0 - resolution: "textextensions@npm:5.15.0" - checksum: aa172e941e81b44e0d35fa217f758a0d8ba0342dac31539914225a2382b5792ef58bff3ec9009b9c85b0c0605f5a79a906bd97827a2e591d647137fcdbf867d3 - languageName: node - linkType: hard - "throat@npm:^6.0.1": version: 6.0.1 resolution: "throat@npm:6.0.1" @@ -15460,16 +11234,7 @@ __metadata: languageName: node linkType: hard -"through2@npm:^4.0.2": - version: 4.0.2 - resolution: "through2@npm:4.0.2" - dependencies: - readable-stream: 3 - checksum: ac7430bd54ccb7920fd094b1c7ff3e1ad6edd94202e5528331253e5fde0cc56ceaa690e8df9895de2e073148c52dfbe6c4db74cacae812477a35660090960cc0 - languageName: node - linkType: hard - -"through@npm:^2.3.6, through@npm:^2.3.8": +"through@npm:^2.3.8": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -15486,24 +11251,6 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.0.33": - version: 0.0.33 - resolution: "tmp@npm:0.0.33" - dependencies: - os-tmpdir: ~1.0.2 - checksum: 902d7aceb74453ea02abbf58c203f4a8fc1cead89b60b31e354f74ed5b3fb09ea817f94fb310f884a5d16987dd9fa5a735412a7c2dd088dd3d415aa819ae3a28 - languageName: node - linkType: hard - -"tmp@npm:^0.1.0": - version: 0.1.0 - resolution: "tmp@npm:0.1.0" - dependencies: - rimraf: ^2.6.3 - checksum: 6bab8431de9d245d4264bd8cd6bb216f9d22f179f935dada92a11d1315572c8eb7c3334201e00594b4708608bd536fad3a63bfb037e7804d827d66aa53a1afcd - languageName: node - linkType: hard - "tmpl@npm:1.0.5": version: 1.0.5 resolution: "tmpl@npm:1.0.5" @@ -15511,13 +11258,6 @@ __metadata: languageName: node linkType: hard -"to-arraybuffer@npm:^1.0.1": - version: 1.0.1 - resolution: "to-arraybuffer@npm:1.0.1" - checksum: 31433c10b388722729f5da04c6b2a06f40dc84f797bb802a5a171ced1e599454099c6c5bc5118f4b9105e7d049d3ad9d0f71182b77650e4fdb04539695489941 - languageName: node - linkType: hard - "to-fast-properties@npm:^2.0.0": version: 2.0.0 resolution: "to-fast-properties@npm:2.0.0" @@ -15525,13 +11265,6 @@ __metadata: languageName: node linkType: hard -"to-readable-stream@npm:^1.0.0": - version: 1.0.0 - resolution: "to-readable-stream@npm:1.0.0" - checksum: 2bd7778490b6214a2c40276065dd88949f4cf7037ce3964c76838b8cb212893aeb9cceaaf4352a4c486e3336214c350270f3263e1ce7a0c38863a715a4d9aeb5 - languageName: node - linkType: hard - "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -15567,22 +11300,14 @@ __metadata: linkType: hard "tough-cookie@npm:^4.0.0": - version: 4.0.0 - resolution: "tough-cookie@npm:4.0.0" + version: 4.1.2 + resolution: "tough-cookie@npm:4.1.2" dependencies: psl: ^1.1.33 punycode: ^2.1.1 - universalify: ^0.1.2 - checksum: 0891b37eb7d17faa3479d47f0dce2e3007f2583094ad272f2670d120fbcc3df3b0b0a631ba96ecad49f9e2297d93ff8995ce0d3292d08dd7eabe162f5b224d69 - languageName: node - linkType: hard - -"tr46@npm:^1.0.1": - version: 1.0.1 - resolution: "tr46@npm:1.0.1" - dependencies: - punycode: ^2.1.0 - checksum: 96d4ed46bc161db75dbf9247a236ea0bfcaf5758baae6749e92afab0bc5a09cb59af21788ede7e55080f2bf02dce3e4a8f2a484cc45164e29f4b5e68f7cbcc1a + universalify: ^0.2.0 + url-parse: ^1.5.3 + checksum: a7359e9a3e875121a84d6ba40cc184dec5784af84f67f3a56d1d2ae39b87c0e004e6ba7c7331f9622a7d2c88609032473488b28fe9f59a1fec115674589de39a languageName: node linkType: hard @@ -15602,22 +11327,6 @@ __metadata: languageName: node linkType: hard -"tree-kill@npm:1.2.2, tree-kill@npm:^1.2.2": - version: 1.2.2 - resolution: "tree-kill@npm:1.2.2" - bin: - tree-kill: cli.js - checksum: 49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7 - languageName: node - linkType: hard - -"treeverse@npm:^1.0.4": - version: 1.0.4 - resolution: "treeverse@npm:1.0.4" - checksum: 712640acd811060ff552a3c761f700d18d22a4da544d31b4e290817ac4bbbfcfe33b58f85e7a5787e6ff7351d3a9100670721a289ca14eb87b36ad8a0c20ebd8 - languageName: node - linkType: hard - "ts-invariant@npm:^0.9.4": version: 0.9.4 resolution: "ts-invariant@npm:0.9.4" @@ -15628,8 +11337,8 @@ __metadata: linkType: hard "ts-jest@npm:^27.1.3": - version: 27.1.4 - resolution: "ts-jest@npm:27.1.4" + version: 27.1.5 + resolution: "ts-jest@npm:27.1.5" dependencies: bs-logger: 0.x fast-json-stable-stringify: 2.x @@ -15656,13 +11365,13 @@ __metadata: optional: true bin: ts-jest: cli.js - checksum: d2cc2719ed2884a880ab50d2c14c311834be9c88bc79d0064fa0189afce5c296d7676314d26cc3f7e82ddd52df272c2d4137a832c89616f30cbe8f43e30f9a29 + checksum: 3ef51c538b82f49b3f529331c1a017871a2f90e7a9a6e69333304755036d121818c6b120e2ce32dd161ff8bb2487efec0c790753ecd39b46a9ed1ce0d241464c languageName: node linkType: hard "ts-loader@npm:^9.2.6": - version: 9.3.0 - resolution: "ts-loader@npm:9.3.0" + version: 9.3.1 + resolution: "ts-loader@npm:9.3.1" dependencies: chalk: ^4.1.0 enhanced-resolve: ^5.0.0 @@ -15671,15 +11380,15 @@ __metadata: peerDependencies: typescript: "*" webpack: ^5.0.0 - checksum: 90755ac5850890ff433f2f8c7186d57ae4e172d389342d874b50ab233675f06c47c69043c517e2a2eeaf2251637ecfac607ac6190c89340f246ceff8c7f4af7a + checksum: 462a8ac315017cf4961dafd2be29d5abe7c3af63c4515e325269f79b9d0212b35c59184d7fd01fc378749c88454752e1599301d2190eb6844ea5fe332de5f695 languageName: node linkType: hard "ts-node@npm:^10.4.0": - version: 10.7.0 - resolution: "ts-node@npm:10.7.0" + version: 10.9.1 + resolution: "ts-node@npm:10.9.1" dependencies: - "@cspotcode/source-map-support": 0.7.0 + "@cspotcode/source-map-support": ^0.8.0 "@tsconfig/node10": ^1.0.7 "@tsconfig/node12": ^1.0.7 "@tsconfig/node14": ^1.0.0 @@ -15690,7 +11399,7 @@ __metadata: create-require: ^1.1.0 diff: ^4.0.1 make-error: ^1.1.1 - v8-compile-cache-lib: ^3.0.0 + v8-compile-cache-lib: ^3.0.1 yn: 3.1.1 peerDependencies: "@swc/core": ">=1.2.50" @@ -15709,22 +11418,11 @@ __metadata: ts-node-script: dist/bin-script.js ts-node-transpile-only: dist/bin-transpile.js ts-script: dist/bin-script-deprecated.js - checksum: 2a379e43f7478d0b79e1e63af91fe222d83857727957df4bd3bdf3c0a884de5097b12feb9bbf530074526b8874c0338b0e6328cf334f3a5e2c49c71e837273f7 - languageName: node - linkType: hard - -"tsconfig-paths-webpack-plugin@npm:3.5.2": - version: 3.5.2 - resolution: "tsconfig-paths-webpack-plugin@npm:3.5.2" - dependencies: - chalk: ^4.1.0 - enhanced-resolve: ^5.7.0 - tsconfig-paths: ^3.9.0 - checksum: e7872f45b10684204d4a6cbc7989073d885c99e0c9eb5222de6b2b83d2e1594bccb647f52d2f8e00c53da5b9a3084e47a2de44f41c6f7a607ec2b17330a8d9e9 + checksum: 090adff1302ab20bd3486e6b4799e90f97726ed39e02b39e566f8ab674fd5bd5f727f43615debbfc580d33c6d9d1c6b1b3ce7d8e3cca3e20530a145ffa232c35 languageName: node linkType: hard -"tsconfig-paths@npm:3.14.1, tsconfig-paths@npm:^3.12.0, tsconfig-paths@npm:^3.14.1, tsconfig-paths@npm:^3.9.0": +"tsconfig-paths@npm:^3.12.0, tsconfig-paths@npm:^3.14.1": version: 3.14.1 resolution: "tsconfig-paths@npm:3.14.1" dependencies: @@ -15736,14 +11434,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:2.3.1": - version: 2.3.1 - resolution: "tslib@npm:2.3.1" - checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9 - languageName: node - linkType: hard - -"tslib@npm:2.4.0, tslib@npm:^2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:~2.4.0": +"tslib@npm:2.4.0, tslib@npm:^2.1.0, tslib@npm:^2.3.0": version: 2.4.0 resolution: "tslib@npm:2.4.0" checksum: 8c4aa6a3c5a754bf76aefc38026134180c053b7bd2f81338cb5e5ebf96fefa0f417bff221592bf801077f5bf990562f6264fecbc42cd3309b33872cb6fc3b113 @@ -15768,16 +11459,7 @@ __metadata: languageName: node linkType: hard -"tunnel-agent@npm:^0.6.0": - version: 0.6.0 - resolution: "tunnel-agent@npm:0.6.0" - dependencies: - safe-buffer: ^5.0.1 - checksum: 05f6510358f8afc62a057b8b692f05d70c1782b70db86d6a1e0d5e28a32389e52fa6e7707b6c5ecccacc031462e4bc35af85ecfe4bbc341767917b7cf6965711 - languageName: node - linkType: hard - -"tunnel@npm:0.0.6": +"tunnel@npm:^0.0.6": version: 0.0.6 resolution: "tunnel@npm:0.0.6" checksum: c362948df9ad34b649b5585e54ce2838fa583aa3037091aaed66793c65b423a264e5229f0d7e9a95513a795ac2bd4cb72cda7e89a74313f182c1e9ae0b0994fa @@ -15830,20 +11512,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.6.0": - version: 0.6.0 - resolution: "type-fest@npm:0.6.0" - checksum: b2188e6e4b21557f6e92960ec496d28a51d68658018cba8b597bd3ef757721d1db309f120ae987abeeda874511d14b776157ff809f23c6d1ce8f83b9b2b7d60f - languageName: node - linkType: hard - -"type-fest@npm:^0.8.1": - version: 0.8.1 - resolution: "type-fest@npm:0.8.1" - checksum: d61c4b2eba24009033ae4500d7d818a94fd6d1b481a8111612ee141400d5f1db46f199c014766b9fa9b31a6a7374d96fc748c6d688a78a3ce5a33123839becb7 - languageName: node - linkType: hard - "type-is@npm:^1.6.4, type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -15861,10 +11529,10 @@ __metadata: languageName: node linkType: hard -"type@npm:^2.5.0": - version: 2.6.0 - resolution: "type@npm:2.6.0" - checksum: 80da01fcc0f6ed5a253dc326530e134000a8f66ea44b6d9687cde2f894f0d0b2486595b0cd040a64f7f79dc3120784236f8c9ef667a8aef03984e049b447cfb4 +"type@npm:^2.7.2": + version: 2.7.2 + resolution: "type@npm:2.7.2" + checksum: 0f42379a8adb67fe529add238a3e3d16699d95b42d01adfe7b9a7c5da297f5c1ba93de39265ba30ffeb37dfd0afb3fb66ae09f58d6515da442219c086219f6f4 languageName: node linkType: hard @@ -15877,59 +11545,39 @@ __metadata: languageName: node linkType: hard -"typedarray@npm:^0.0.6": - version: 0.0.6 - resolution: "typedarray@npm:0.0.6" - checksum: 33b39f3d0e8463985eeaeeacc3cb2e28bc3dfaf2a5ed219628c0b629d5d7b810b0eb2165f9f607c34871d5daa92ba1dc69f49051cf7d578b4cbd26c340b9d1b1 - languageName: node - linkType: hard - -"typescript@npm:4.6.2": - version: 4.6.2 - resolution: "typescript@npm:4.6.2" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 8a44ed7e6f6c4cb1ebe8cf236ecda2fb119d84dcf0fbd77e707b2dfea1bbcfc4e366493a143513ce7f57203c75da9d4e20af6fe46de89749366351046be7577c - languageName: node - linkType: hard - -"typescript@npm:^4.4.4": - version: 4.6.4 - resolution: "typescript@npm:4.6.4" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: e7bfcc39cd4571a63a54e5ea21f16b8445268b9900bf55aee0e02ad981be576acc140eba24f1af5e3c1457767c96cea6d12861768fb386cf3ffb34013718631a +"typedarray@npm:^0.0.6": + version: 0.0.6 + resolution: "typedarray@npm:0.0.6" + checksum: 33b39f3d0e8463985eeaeeacc3cb2e28bc3dfaf2a5ed219628c0b629d5d7b810b0eb2165f9f607c34871d5daa92ba1dc69f49051cf7d578b4cbd26c340b9d1b1 languageName: node linkType: hard -"typescript@patch:typescript@4.6.2#~builtin": - version: 4.6.2 - resolution: "typescript@patch:typescript@npm%3A4.6.2#~builtin::version=4.6.2&hash=493e53" +"typescript@npm:^4.4.4": + version: 4.8.3 + resolution: "typescript@npm:4.8.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: efb83260a22ee49d4c8bdc59b3cefe54fdf51d6f563f5c3a35aa3d5e46fb12f3f1d33a36d6f9f64171e567ead1847e99cb612d0a9a74e7d44e16cad9d0bbc937 + checksum: 8286a5edcaf3d68e65c451aa1e7150ad1cf53ee0813c07ec35b7abdfdb10f355ecaa13c6a226a694ae7a67785fd7eeebf89f845da0b4f7e4a35561ddc459aba0 languageName: node linkType: hard "typescript@patch:typescript@^4.4.4#~builtin": - version: 4.6.4 - resolution: "typescript@patch:typescript@npm%3A4.6.4#~builtin::version=4.6.4&hash=493e53" + version: 4.8.3 + resolution: "typescript@patch:typescript@npm%3A4.8.3#~builtin::version=4.8.3&hash=493e53" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 8cff08bf66d9ecfbf9fcc5edde04a5a7923e6cac3b21d99b4e9a06973bf5bd7f9a83ec7eed24129c1b9e13fd861de8c1070110d4b9ce9f18ab57c6999e9c9a6f + checksum: 0404a09c625df01934ef774b45ce1ca57ccae41cd625fcdbb82056715320d9329e70d9d75c2c732ec6ef947444ca978c189a332b71fa21f5c1437d5a83e24906 languageName: node linkType: hard "uint8arrays@npm:^3.0.0": - version: 3.0.0 - resolution: "uint8arrays@npm:3.0.0" + version: 3.1.0 + resolution: "uint8arrays@npm:3.1.0" dependencies: multiformats: ^9.4.2 - checksum: 58470e687140e64a7fa08ab66b64777b75f105bf78180324448dc798436beacf0bd322cd2b58d20ca4cfa2e091f58e4b52d008e95f21d0ade16c1102b5d23ad3 + checksum: 77fe0c8644417a849f5cfc0e5a5308c65e3b779a56f816dd27b8f60f7fac1ac7626f57c9abacec77d147beb5da8401b86438b1591d93cae7f7511a3211cc01b3 languageName: node linkType: hard @@ -15983,30 +11631,21 @@ __metadata: languageName: node linkType: hard -"unique-filename@npm:^1.1.1": - version: 1.1.1 - resolution: "unique-filename@npm:1.1.1" +"unique-filename@npm:^2.0.0": + version: 2.0.1 + resolution: "unique-filename@npm:2.0.1" dependencies: - unique-slug: ^2.0.0 - checksum: cf4998c9228cc7647ba7814e255dec51be43673903897b1786eff2ac2d670f54d4d733357eb08dea969aa5e6875d0e1bd391d668fbdb5a179744e7c7551a6f80 + unique-slug: ^3.0.0 + checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f languageName: node linkType: hard -"unique-slug@npm:^2.0.0": - version: 2.0.2 - resolution: "unique-slug@npm:2.0.2" +"unique-slug@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-slug@npm:3.0.0" dependencies: imurmurhash: ^0.1.4 - checksum: 5b6876a645da08d505dedb970d1571f6cebdf87044cb6b740c8dbb24f0d6e1dc8bdbf46825fd09f994d7cf50760e6f6e063cfa197d51c5902c00a861702eb75a - languageName: node - linkType: hard - -"unique-string@npm:^2.0.0": - version: 2.0.0 - resolution: "unique-string@npm:2.0.0" - dependencies: - crypto-random-string: ^2.0.0 - checksum: ef68f639136bcfe040cf7e3cd7a8dff076a665288122855148a6f7134092e6ed33bf83a7f3a9185e46c98dddc445a0da6ac25612afa1a7c38b8b654d6c02498e + checksum: 49f8d915ba7f0101801b922062ee46b7953256c93ceca74303bd8e6413ae10aa7e8216556b54dc5382895e8221d04f1efaf75f945c2e4a515b4139f77aa6640c languageName: node linkType: hard @@ -16017,10 +11656,10 @@ __metadata: languageName: node linkType: hard -"universalify@npm:^0.1.0, universalify@npm:^0.1.2": - version: 0.1.2 - resolution: "universalify@npm:0.1.2" - checksum: 40cdc60f6e61070fe658ca36016a8f4ec216b29bf04a55dce14e3710cc84c7448538ef4dad3728d0bfe29975ccd7bfb5f414c45e7b78883567fb31b246f02dff +"universalify@npm:^0.2.0": + version: 0.2.0 + resolution: "universalify@npm:0.2.0" + checksum: e86134cb12919d177c2353196a4cc09981524ee87abf621f7bc8d249dbbbebaec5e7d1314b96061497981350df786e4c5128dbf442eba104d6e765bc260678b5 languageName: node linkType: hard @@ -16038,32 +11677,17 @@ __metadata: languageName: node linkType: hard -"untildify@npm:^4.0.0": - version: 4.0.0 - resolution: "untildify@npm:4.0.0" - checksum: 39ced9c418a74f73f0a56e1ba4634b4d959422dff61f4c72a8e39f60b99380c1b45ed776fbaa0a4101b157e4310d873ad7d114e8534ca02609b4916bb4187fb9 - languageName: node - linkType: hard - -"update-notifier@npm:^5.1.0": - version: 5.1.0 - resolution: "update-notifier@npm:5.1.0" +"update-browserslist-db@npm:^1.0.5": + version: 1.0.9 + resolution: "update-browserslist-db@npm:1.0.9" dependencies: - boxen: ^5.0.0 - chalk: ^4.1.0 - configstore: ^5.0.1 - has-yarn: ^2.1.0 - import-lazy: ^2.1.0 - is-ci: ^2.0.0 - is-installed-globally: ^0.4.0 - is-npm: ^5.0.0 - is-yarn-global: ^0.3.0 - latest-version: ^5.1.0 - pupa: ^2.1.1 - semver: ^7.3.4 - semver-diff: ^3.1.1 - xdg-basedir: ^4.0.0 - checksum: 461e5e5b002419296d3868ee2abe0f9ab3e1846d9db642936d0c46f838872ec56069eddfe662c45ce1af0a8d6d5026353728de2e0a95ab2e3546a22ea077caf1 + escalade: ^3.1.1 + picocolors: ^1.0.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + browserslist-lint: cli.js + checksum: f625899b236f6a4d7f62b56be1b8da230c5563d1fef84d3ef148f2e1a3f11a5a4b3be4fd7e3703e51274c116194017775b10afb4de09eb2c0d09d36b90f1f578 languageName: node linkType: hard @@ -16076,22 +11700,13 @@ __metadata: languageName: node linkType: hard -"url-parse-lax@npm:^3.0.0": - version: 3.0.0 - resolution: "url-parse-lax@npm:3.0.0" - dependencies: - prepend-http: ^2.0.0 - checksum: 1040e357750451173132228036aff1fd04abbd43eac1fb3e4fca7495a078bcb8d33cb765fe71ad7e473d9c94d98fd67adca63bd2716c815a2da066198dd37217 - languageName: node - linkType: hard - -"url@npm:0.10.3": - version: 0.10.3 - resolution: "url@npm:0.10.3" +"url-parse@npm:^1.5.3": + version: 1.5.10 + resolution: "url-parse@npm:1.5.10" dependencies: - punycode: 1.3.2 - querystring: 0.2.0 - checksum: 7b83ddb106c27bf9bde8629ccbe8d26e9db789c8cda5aa7db72ca2c6f9b8a88a5adf206f3e10db78e6e2d042b327c45db34c7010c1bf0d9908936a17a2b57d05 + querystringify: ^2.1.1 + requires-port: ^1.0.0 + checksum: fbdba6b1d83336aca2216bbdc38ba658d9cfb8fc7f665eb8b17852de638ff7d1a162c198a8e4ed66001ddbf6c9888d41e4798912c62b4fd777a31657989f7bdf languageName: node linkType: hard @@ -16105,6 +11720,13 @@ __metadata: languageName: node linkType: hard +"utf8@npm:3.0.0": + version: 3.0.0 + resolution: "utf8@npm:3.0.0" + checksum: cb89a69ad9ab393e3eae9b25305b3ff08bebca9adc839191a34f90777eb2942f86a96369d2839925fea58f8f722f7e27031d697f10f5f39690f8c5047303e62d + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -16119,16 +11741,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:3.3.2": - version: 3.3.2 - resolution: "uuid@npm:3.3.2" - bin: - uuid: ./bin/uuid - checksum: 8793629d2799f500aeea9fcd0aec6c4e9fbcc4d62ed42159ad96be345c3fffac1bbf61a23e18e2782600884fee05e6d4012ce4b70d0037c8e987533ae6a77870 - languageName: node - linkType: hard - -"uuid@npm:8.3.2, uuid@npm:^8.0.0, uuid@npm:^8.3.2": +"uuid@npm:8.3.2, uuid@npm:^8.3.2": version: 8.3.2 resolution: "uuid@npm:8.3.2" bin: @@ -16137,20 +11750,13 @@ __metadata: languageName: node linkType: hard -"v8-compile-cache-lib@npm:^3.0.0": +"v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0 languageName: node linkType: hard -"v8-compile-cache@npm:^2.0.3": - version: 2.3.0 - resolution: "v8-compile-cache@npm:2.3.0" - checksum: adb0a271eaa2297f2f4c536acbfee872d0dd26ec2d76f66921aa7fc437319132773483344207bdbeee169225f4739016d8d2dbf0553913a52bb34da6d0334f8e - languageName: node - linkType: hard - "v8-to-istanbul@npm:^8.1.0": version: 8.1.1 resolution: "v8-to-istanbul@npm:8.1.1" @@ -16162,25 +11768,6 @@ __metadata: languageName: node linkType: hard -"validate-npm-package-license@npm:^3.0.1": - version: 3.0.4 - resolution: "validate-npm-package-license@npm:3.0.4" - dependencies: - spdx-correct: ^3.0.0 - spdx-expression-parse: ^3.0.0 - checksum: 35703ac889d419cf2aceef63daeadbe4e77227c39ab6287eeb6c1b36a746b364f50ba22e88591f5d017bc54685d8137bc2d328d0a896e4d3fd22093c0f32a9ad - languageName: node - linkType: hard - -"validate-npm-package-name@npm:^3.0.0": - version: 3.0.0 - resolution: "validate-npm-package-name@npm:3.0.0" - dependencies: - builtins: ^1.0.3 - checksum: ce4c68207abfb22c05eedb09ff97adbcedc80304a235a0844f5344f1fd5086aa80e4dbec5684d6094e26e35065277b765c1caef68bcea66b9056761eddb22967 - languageName: node - linkType: hard - "validator@npm:^13.7.0": version: 13.7.0 resolution: "validator@npm:13.7.0" @@ -16188,13 +11775,6 @@ __metadata: languageName: node linkType: hard -"value-or-promise@npm:1.0.11": - version: 1.0.11 - resolution: "value-or-promise@npm:1.0.11" - checksum: 13f8f2ef620118c73b4d1beee8ce6045d7182bbf15090ecfbcafb677ec43698506a5e9ace6bea5ea35c32bc612c9b1f824bb59b6581cdfb5c919052745c277d5 - languageName: node - linkType: hard - "varint@npm:^6.0.0": version: 6.0.0 resolution: "varint@npm:6.0.0" @@ -16209,33 +11789,6 @@ __metadata: languageName: node linkType: hard -"vinyl-file@npm:^3.0.0": - version: 3.0.0 - resolution: "vinyl-file@npm:3.0.0" - dependencies: - graceful-fs: ^4.1.2 - pify: ^2.3.0 - strip-bom-buf: ^1.0.0 - strip-bom-stream: ^2.0.0 - vinyl: ^2.0.1 - checksum: e187a74d41f45d22e8faa17b5552a795aca7c4084034dd9683086ace3752651f164c42aee1961081005f8299388b0a62ad1e3eea991a8d3747db58502f900ff4 - languageName: node - linkType: hard - -"vinyl@npm:^2.0.1": - version: 2.2.1 - resolution: "vinyl@npm:2.2.1" - dependencies: - clone: ^2.1.1 - clone-buffer: ^1.0.0 - clone-stats: ^1.0.0 - cloneable-readable: ^1.0.0 - remove-trailing-separator: ^1.0.1 - replace-ext: ^1.0.0 - checksum: 1f663973f1362f2d074b554f79ff7673187667082373b3d3e628beb1fc2a7ff33024f10b492fbd8db421a09ea3b7b22c3d3de4a0f0e73ead7b4685af570b906f - languageName: node - linkType: hard - "vlq@npm:^2.0.4": version: 2.0.4 resolution: "vlq@npm:2.0.4" @@ -16244,14 +11797,14 @@ __metadata: linkType: hard "vm2@npm:^3.9.9": - version: 3.9.9 - resolution: "vm2@npm:3.9.9" + version: 3.9.11 + resolution: "vm2@npm:3.9.11" dependencies: acorn: ^8.7.0 acorn-walk: ^8.2.0 bin: vm2: bin/vm2 - checksum: ea4859565668918b53cf8c087bc18e2a9506f9f4ef919528707a6fecf50a110a2a8c48bc0c7a754c9d12b97cd16775f005b2b941e99d3a52aadfaac5ce77e04d + checksum: aab39e6e4b59146d24abacd79f490e854a6e058a8b23d93d2be5aca7720778e2605d2cc028ccc4a5f50d3d91b0c38be9a6247a80d2da1a6de09425cc437770b4 languageName: node linkType: hard @@ -16273,13 +11826,6 @@ __metadata: languageName: node linkType: hard -"walk-up-path@npm:^1.0.0": - version: 1.0.0 - resolution: "walk-up-path@npm:1.0.0" - checksum: b8019ac4fb9ba1576839ec66d2217f62ab773c1cc4c704bfd1c79b1359fef5366f1382d3ab230a66a14c3adb1bf0fe102d1fdaa3437881e69154dfd1432abd32 - languageName: node - linkType: hard - "walker@npm:^1.0.7": version: 1.0.8 resolution: "walker@npm:1.0.8" @@ -16289,16 +11835,6 @@ __metadata: languageName: node linkType: hard -"watchpack@npm:^2.3.1": - version: 2.3.1 - resolution: "watchpack@npm:2.3.1" - dependencies: - glob-to-regexp: ^0.4.1 - graceful-fs: ^4.1.2 - checksum: 70a34f92842d94b5d842980f866d568d7a467de667c96ae5759c759f46587e49265863171f4650bdbafc5f3870a28f2b4453e9e847098ec4b718b38926d47d22 - languageName: node - linkType: hard - "wcwidth@npm:^1.0.1": version: 1.0.1 resolution: "wcwidth@npm:1.0.1" @@ -16308,133 +11844,86 @@ __metadata: languageName: node linkType: hard -"webidl-conversions@npm:^3.0.0": - version: 3.0.1 - resolution: "webidl-conversions@npm:3.0.1" - checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c - languageName: node - linkType: hard - -"webidl-conversions@npm:^4.0.2": - version: 4.0.2 - resolution: "webidl-conversions@npm:4.0.2" - checksum: c93d8dfe908a0140a4ae9c0ebc87a33805b416a33ee638a605b551523eec94a9632165e54632f6d57a39c5f948c4bab10e0e066525e9a4b87a79f0d04fbca374 +"web3-core-helpers@npm:1.7.5": + version: 1.7.5 + resolution: "web3-core-helpers@npm:1.7.5" + dependencies: + web3-eth-iban: 1.7.5 + web3-utils: 1.7.5 + checksum: b7eafe44f7225961e76edefd53083df6b7e2621bc4fda6e44e08e64889f6a092b0da1c9a6a649fa4682c6f485a94b328b30f2cff26e9bd46513bfcfea0650696 languageName: node linkType: hard -"webidl-conversions@npm:^5.0.0": - version: 5.0.0 - resolution: "webidl-conversions@npm:5.0.0" - checksum: ccf1ec2ca7c0b5671e5440ace4a66806ae09c49016ab821481bec0c05b1b82695082dc0a27d1fe9d804d475a408ba0c691e6803fd21be608e710955d4589cd69 +"web3-eth-iban@npm:1.7.5": + version: 1.7.5 + resolution: "web3-eth-iban@npm:1.7.5" + dependencies: + bn.js: ^5.2.1 + web3-utils: 1.7.5 + checksum: 342605eb0c597ffbcc1b41e61723f4893634df795bd0611d0db56ded734b9a87711bf43d2e98b2abe95d144ccfb9325f0423c757ab6b54a34ab0e129da7096f0 languageName: node linkType: hard -"webidl-conversions@npm:^6.1.0": - version: 6.1.0 - resolution: "webidl-conversions@npm:6.1.0" - checksum: 1f526507aa491f972a0c1409d07f8444e1d28778dfa269a9971f2e157182f3d496dc33296e4ed45b157fdb3bf535bb90c90bf10c50dcf1dd6caacb2a34cc84fb +"web3-providers-http@npm:^1.7.5": + version: 1.7.5 + resolution: "web3-providers-http@npm:1.7.5" + dependencies: + abortcontroller-polyfill: ^1.7.3 + cross-fetch: ^3.1.4 + es6-promise: ^4.2.8 + web3-core-helpers: 1.7.5 + checksum: 4132197e69855467414caddc9db45f6ea4160f319fbb155a0017ba65f0c90ec813720d1a1abb1c3ce3d36da68a4d19d19f9017f6c624be42775006803991801d languageName: node linkType: hard -"webpack-merge@npm:^5.8.0": - version: 5.8.0 - resolution: "webpack-merge@npm:5.8.0" +"web3-providers-ws@npm:^1.7.5": + version: 1.7.5 + resolution: "web3-providers-ws@npm:1.7.5" dependencies: - clone-deep: ^4.0.1 - wildcard: ^2.0.0 - checksum: 88786ab91013f1bd2a683834ff381be81c245a4b0f63304a5103e90f6653f44dab496a0768287f8531761f8ad957d1f9f3ccb2cb55df0de1bd9ee343e079da26 + eventemitter3: 4.0.4 + web3-core-helpers: 1.7.5 + websocket: ^1.0.32 + checksum: 92d1e98776e4e773dad6818e7e53c851251d4f74b58ac362d7d884cf67bb778df7065ae329a32284effa04eb4109fa34c1c5cb670d64a806130a1960e121773a languageName: node linkType: hard -"webpack-node-externals@npm:3.0.0": - version: 3.0.0 - resolution: "webpack-node-externals@npm:3.0.0" - checksum: 355080c35c821115b97dda8c93d9d0565a90a6012a532324eb0d6a64f8f0d609431fd29504fc7ce414755841ac14f601f3eef99472c2c5dc00233b504ebe73f2 +"web3-utils@npm:1.7.5": + version: 1.7.5 + resolution: "web3-utils@npm:1.7.5" + dependencies: + bn.js: ^5.2.1 + ethereum-bloom-filters: ^1.0.6 + ethereumjs-util: ^7.1.0 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: ^2.1.0 + utf8: 3.0.0 + checksum: 7eaffb2e59922c7c0c7c3c3e20f700036c89274495c6f664bb3db67cc37d543138596dd86dcc24f3c430ed27f2c6a12b682792a2d922b020c102de6f7873bacb languageName: node linkType: hard -"webpack-sources@npm:^3.2.3": - version: 3.2.3 - resolution: "webpack-sources@npm:3.2.3" - checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c languageName: node linkType: hard -"webpack@npm:5.71.0": - version: 5.71.0 - resolution: "webpack@npm:5.71.0" - dependencies: - "@types/eslint-scope": ^3.7.3 - "@types/estree": ^0.0.51 - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/wasm-edit": 1.11.1 - "@webassemblyjs/wasm-parser": 1.11.1 - acorn: ^8.4.1 - acorn-import-assertions: ^1.7.6 - browserslist: ^4.14.5 - chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.9.2 - es-module-lexer: ^0.9.0 - eslint-scope: 5.1.1 - events: ^3.2.0 - glob-to-regexp: ^0.4.1 - graceful-fs: ^4.2.9 - json-parse-better-errors: ^1.0.2 - loader-runner: ^4.2.0 - mime-types: ^2.1.27 - neo-async: ^2.6.2 - schema-utils: ^3.1.0 - tapable: ^2.1.1 - terser-webpack-plugin: ^5.1.3 - watchpack: ^2.3.1 - webpack-sources: ^3.2.3 - peerDependenciesMeta: - webpack-cli: - optional: true - bin: - webpack: bin/webpack.js - checksum: 84b273a15180d45dafe4fc4a3ccccba2f72210f327a1af39713b3ef78148768afb0e18fa0cddaea4af5dd54ace199fbbdfcef9aec8da7e9c248f8b1b7cc413e1 +"webidl-conversions@npm:^5.0.0": + version: 5.0.0 + resolution: "webidl-conversions@npm:5.0.0" + checksum: ccf1ec2ca7c0b5671e5440ace4a66806ae09c49016ab821481bec0c05b1b82695082dc0a27d1fe9d804d475a408ba0c691e6803fd21be608e710955d4589cd69 languageName: node linkType: hard -"webpack@npm:^5.68.0": - version: 5.72.0 - resolution: "webpack@npm:5.72.0" - dependencies: - "@types/eslint-scope": ^3.7.3 - "@types/estree": ^0.0.51 - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/wasm-edit": 1.11.1 - "@webassemblyjs/wasm-parser": 1.11.1 - acorn: ^8.4.1 - acorn-import-assertions: ^1.7.6 - browserslist: ^4.14.5 - chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.9.2 - es-module-lexer: ^0.9.0 - eslint-scope: 5.1.1 - events: ^3.2.0 - glob-to-regexp: ^0.4.1 - graceful-fs: ^4.2.9 - json-parse-better-errors: ^1.0.2 - loader-runner: ^4.2.0 - mime-types: ^2.1.27 - neo-async: ^2.6.2 - schema-utils: ^3.1.0 - tapable: ^2.1.1 - terser-webpack-plugin: ^5.1.3 - watchpack: ^2.3.1 - webpack-sources: ^3.2.3 - peerDependenciesMeta: - webpack-cli: - optional: true - bin: - webpack: bin/webpack.js - checksum: 8365f1466d0f7adbf80ebc9b780f263a28eeeabcd5fb515249bfd9a56ab7fe8d29ea53df3d9364d0732ab39ae774445eb28abce694ed375b13882a6b2fe93ffc +"webidl-conversions@npm:^6.1.0": + version: 6.1.0 + resolution: "webidl-conversions@npm:6.1.0" + checksum: 1f526507aa491f972a0c1409d07f8444e1d28778dfa269a9971f2e157182f3d496dc33296e4ed45b157fdb3bf535bb90c90bf10c50dcf1dd6caacb2a34cc84fb languageName: node linkType: hard -"websocket@npm:^1.0.34": +"websocket@npm:^1.0.32, websocket@npm:^1.0.34": version: 1.0.34 resolution: "websocket@npm:1.0.34" dependencies: @@ -16464,13 +11953,6 @@ __metadata: languageName: node linkType: hard -"whatwg-mimetype@npm:^3.0.0": - version: 3.0.0 - resolution: "whatwg-mimetype@npm:3.0.0" - checksum: ce08bbb36b6aaf64f3a84da89707e3e6a31e5ab1c1a2379fd68df79ba712a4ab090904f0b50e6693b0dafc8e6343a6157e40bf18fdffd26e513cf95ee2a59824 - languageName: node - linkType: hard - "whatwg-url@npm:^5.0.0": version: 5.0.0 resolution: "whatwg-url@npm:5.0.0" @@ -16481,17 +11963,6 @@ __metadata: languageName: node linkType: hard -"whatwg-url@npm:^7.0.0": - version: 7.1.0 - resolution: "whatwg-url@npm:7.1.0" - dependencies: - lodash.sortby: ^4.7.0 - tr46: ^1.0.1 - webidl-conversions: ^4.0.2 - checksum: fecb07c87290b47d2ec2fb6d6ca26daad3c9e211e0e531dd7566e7ff95b5b3525a57d4f32640ad4adf057717e0c215731db842ad761e61d947e81010e05cf5fd - languageName: node - linkType: hard - "whatwg-url@npm:^8.0.0, whatwg-url@npm:^8.5.0": version: 8.7.0 resolution: "whatwg-url@npm:8.7.0" @@ -16516,27 +11987,6 @@ __metadata: languageName: node linkType: hard -"which-pm@npm:2.0.0": - version: 2.0.0 - resolution: "which-pm@npm:2.0.0" - dependencies: - load-yaml-file: ^0.2.0 - path-exists: ^4.0.0 - checksum: e556635eaf237b3a101043a21c2890af045db40eac4df3575161d4fb834c2aa65456f81c60d8ea4db2d51fe5ac549d989eeabd17278767c2e4179361338ac5ce - languageName: node - linkType: hard - -"which@npm:^1.2.9": - version: 1.3.1 - resolution: "which@npm:1.3.1" - dependencies: - isexe: ^2.0.0 - bin: - which: ./bin/which - checksum: f2e185c6242244b8426c9df1510e86629192d93c1a986a7d2a591f2c24869e7ffd03d6dac07ca863b2e4c06f59a4cc9916c585b72ee9fa1aa609d0124df15e04 - languageName: node - linkType: hard - "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -16548,7 +11998,7 @@ __metadata: languageName: node linkType: hard -"wide-align@npm:^1.1.2, wide-align@npm:^1.1.5": +"wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" dependencies: @@ -16557,31 +12007,6 @@ __metadata: languageName: node linkType: hard -"widest-line@npm:^3.1.0": - version: 3.1.0 - resolution: "widest-line@npm:3.1.0" - dependencies: - string-width: ^4.0.0 - checksum: 03db6c9d0af9329c37d74378ff1d91972b12553c7d72a6f4e8525fe61563fa7adb0b9d6e8d546b7e059688712ea874edd5ded475999abdeedf708de9849310e0 - languageName: node - linkType: hard - -"wildcard@npm:^2.0.0": - version: 2.0.0 - resolution: "wildcard@npm:2.0.0" - checksum: 1f4fe4c03dfc492777c60f795bbba597ac78794f1b650d68f398fbee9adb765367c516ebd4220889b6a81e9626e7228bbe0d66237abb311573c2ee1f4902a5ad - languageName: node - linkType: hard - -"windows-release@npm:^4.0.0": - version: 4.0.0 - resolution: "windows-release@npm:4.0.0" - dependencies: - execa: ^4.0.2 - checksum: 77c87d332d9e8ad94a72844c0bee169babd63ab06636521fc6ffacb2f1fb2ec3f38b81bc3fcb53ec76b57c1add33348c16660a38ac6aed381190d9c2b95c39e6 - languageName: node - linkType: hard - "wkx@npm:^0.5.0": version: 0.5.0 resolution: "wkx@npm:0.5.0" @@ -16598,16 +12023,6 @@ __metadata: languageName: node linkType: hard -"wrap-ansi@npm:^2.0.0": - version: 2.1.0 - resolution: "wrap-ansi@npm:2.1.0" - dependencies: - string-width: ^1.0.1 - strip-ansi: ^3.0.1 - checksum: 2dacd4b3636f7a53ee13d4d0fe7fa2ed9ad81e9967e17231924ea88a286ec4619a78288de8d41881ee483f4449ab2c0287cde8154ba1bd0126c10271101b2ee3 - languageName: node - linkType: hard - "wrap-ansi@npm:^6.2.0": version: 6.2.0 resolution: "wrap-ansi@npm:6.2.0" @@ -16649,33 +12064,24 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.0": - version: 4.0.1 - resolution: "write-file-atomic@npm:4.0.1" - dependencies: - imurmurhash: ^0.1.4 - signal-exit: ^3.0.7 - checksum: 8f780232533ca6223c63c9b9c01c4386ca8c625ebe5017a9ed17d037aec19462ae17109e0aa155bff5966ee4ae7a27b67a99f55caf3f32ffd84155e9da3929fc - languageName: node - linkType: hard - -"write-json-file@npm:^4.1.1": - version: 4.3.0 - resolution: "write-json-file@npm:4.3.0" - dependencies: - detect-indent: ^6.0.0 - graceful-fs: ^4.1.15 - is-plain-obj: ^2.0.0 - make-dir: ^3.0.0 - sort-keys: ^4.0.0 - write-file-atomic: ^3.0.0 - checksum: 33908c591923dc273e6574e7c0e2df157acfcf498e3a87c5615ced006a465c4058877df6abce6fc1acd2844fa3cf4518ace4a34d5d82ab28bcf896317ba1db6f +"ws@npm:7.4.6": + version: 7.4.6 + resolution: "ws@npm:7.4.6" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 3a990b32ed08c72070d5e8913e14dfcd831919205be52a3ff0b4cdd998c8d554f167c9df3841605cde8b11d607768cacab3e823c58c96a5c08c987e093eb767a languageName: node linkType: hard -"ws@npm:^5.2.0 || ^6.0.0 || ^7.0.0, ws@npm:^7.4.2, ws@npm:^7.4.6": - version: 7.5.7 - resolution: "ws@npm:7.5.7" +"ws@npm:^7.4.6": + version: 7.5.9 + resolution: "ws@npm:7.5.9" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ^5.0.2 @@ -16684,7 +12090,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 5c1f669a166fb57560b4e07f201375137fa31d9186afde78b1508926345ce546332f109081574ddc4e38cc474c5406b5fc71c18d71eb75f6e2d2245576976cba + checksum: c3c100a181b731f40b7f2fddf004aa023f79d64f489706a28bc23ff88e87f6a64b3c6651fbec3a84a53960b75159574d7a7385709847a62ddb7ad6af76f49138 languageName: node linkType: hard @@ -16703,13 +12109,6 @@ __metadata: languageName: node linkType: hard -"xdg-basedir@npm:^4.0.0": - version: 4.0.0 - resolution: "xdg-basedir@npm:4.0.0" - checksum: 0073d5b59a37224ed3a5ac0dd2ec1d36f09c49f0afd769008a6e9cd3cd666bd6317bd1c7ce2eab47e1de285a286bad11a9b038196413cd753b79770361855f3c - languageName: node - linkType: hard - "xml-name-validator@npm:^3.0.0": version: 3.0.0 resolution: "xml-name-validator@npm:3.0.0" @@ -16717,23 +12116,6 @@ __metadata: languageName: node linkType: hard -"xml2js@npm:0.4.19": - version: 0.4.19 - resolution: "xml2js@npm:0.4.19" - dependencies: - sax: ">=0.6.0" - xmlbuilder: ~9.0.1 - checksum: ca8b2fee430d450a18947786bfd7cd1a353ee00fc6fd550acbc8a8e65f1b4df5e9786fcb2990c1a5514ecd554d445fb74e1d716b3a4fcfffc10554aeb5db482b - languageName: node - linkType: hard - -"xmlbuilder@npm:~9.0.1": - version: 9.0.7 - resolution: "xmlbuilder@npm:9.0.7" - checksum: 8193bb323806a002764f013bea0c6e9ff2dc26fd29109408761b16b59a8ad2214c2abe8e691755fd8b525586e3a0e1efeb92335947d7b0899032b779f1705a53 - languageName: node - linkType: hard - "xmlchars@npm:^2.2.0": version: 2.2.0 resolution: "xmlchars@npm:2.2.0" @@ -16741,18 +12123,6 @@ __metadata: languageName: node linkType: hard -"xss@npm:^1.0.8": - version: 1.0.11 - resolution: "xss@npm:1.0.11" - dependencies: - commander: ^2.20.3 - cssfilter: 0.0.10 - bin: - xss: bin/xss - checksum: 86104fe3c0e4e32912835b369a95d47aff140f996a0f3bd2833750c974c56359e91e87faf779077608f8baaec643662e6222f9f348be52f74b17432eeee6bfdf - languageName: node - linkType: hard - "xtend@npm:^4.0.0, xtend@npm:^4.0.2, xtend@npm:~4.0.0": version: 4.0.2 resolution: "xtend@npm:4.0.2" @@ -16774,20 +12144,6 @@ __metadata: languageName: node linkType: hard -"yallist@npm:^2.1.2": - version: 2.1.2 - resolution: "yallist@npm:2.1.2" - checksum: 9ba99409209f485b6fcb970330908a6d41fa1c933f75e08250316cce19383179a6b70a7e0721b89672ebb6199cc377bf3e432f55100da6a7d6e11902b0a642cb - languageName: node - linkType: hard - -"yallist@npm:^3.0.2": - version: 3.1.1 - resolution: "yallist@npm:3.1.1" - checksum: 48f7bb00dc19fc635a13a39fe547f527b10c9290e7b3e836b9a8f1ca04d4d342e85714416b3c2ab74949c9c66f9cebb0473e6bc353b79035356103b47641285d - languageName: node - linkType: hard - "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0" @@ -16795,17 +12151,7 @@ __metadata: languageName: node linkType: hard -"yaml-loader@npm:^0.6.0": - version: 0.6.0 - resolution: "yaml-loader@npm:0.6.0" - dependencies: - loader-utils: ^1.4.0 - yaml: ^1.8.3 - checksum: de6f070aafaf10ee65aac721fbbacadfec0468801e07457ed81bb725e6336e2bd6c1402fa233a16d6ad72e4373680147b3e37d569d9a1e98d3fcd3a2cd64de8e - languageName: node - linkType: hard - -"yaml@npm:^1.10.0, yaml@npm:^1.10.2, yaml@npm:^1.8.3": +"yaml@npm:^1.10.2": version: 1.10.2 resolution: "yaml@npm:1.10.2" checksum: ce4ada136e8a78a0b08dc10b4b900936912d15de59905b2bf415b4d33c63df1d555d23acb2a41b23cf9fb5da41c256441afca3d6509de7247daa062fd2c5ea5f @@ -16834,80 +12180,6 @@ __metadata: languageName: node linkType: hard -"yeoman-environment@npm:^3.9.1": - version: 3.9.1 - resolution: "yeoman-environment@npm:3.9.1" - dependencies: - "@npmcli/arborist": ^4.0.4 - are-we-there-yet: ^2.0.0 - arrify: ^2.0.1 - binaryextensions: ^4.15.0 - chalk: ^4.1.0 - cli-table: ^0.3.1 - commander: 7.1.0 - dateformat: ^4.5.0 - debug: ^4.1.1 - diff: ^5.0.0 - error: ^10.4.0 - escape-string-regexp: ^4.0.0 - execa: ^5.0.0 - find-up: ^5.0.0 - globby: ^11.0.1 - grouped-queue: ^2.0.0 - inquirer: ^8.0.0 - is-scoped: ^2.1.0 - lodash: ^4.17.10 - log-symbols: ^4.0.0 - mem-fs: ^1.2.0 || ^2.0.0 - mem-fs-editor: ^8.1.2 || ^9.0.0 - minimatch: ^3.0.4 - npmlog: ^5.0.1 - p-queue: ^6.6.2 - p-transform: ^1.3.0 - pacote: ^12.0.2 - preferred-pm: ^3.0.3 - pretty-bytes: ^5.3.0 - semver: ^7.1.3 - slash: ^3.0.0 - strip-ansi: ^6.0.0 - text-table: ^0.2.0 - textextensions: ^5.12.0 - untildify: ^4.0.0 - peerDependencies: - mem-fs: ^1.2.0 || ^2.0.0 - mem-fs-editor: ^8.1.2 || ^9.0.0 - bin: - yoe: cli/index.js - checksum: 60a19b9962184857c52003004ff600a1c99ebb19821f8d3e3a9be8dd87e72083118daa36f44f8171c0ad32a865ef975592fd26cf6edc5294c09d645a6bc7f680 - languageName: node - linkType: hard - -"yeoman-generator@npm:^5.6.1": - version: 5.6.1 - resolution: "yeoman-generator@npm:5.6.1" - dependencies: - chalk: ^4.1.0 - dargs: ^7.0.0 - debug: ^4.1.1 - execa: ^4.1.0 - github-username: ^6.0.0 - lodash: ^4.17.11 - minimist: ^1.2.5 - read-pkg-up: ^7.0.1 - run-async: ^2.0.0 - semver: ^7.2.1 - shelljs: ^0.8.5 - sort-keys: ^4.2.0 - text-table: ^0.2.0 - peerDependencies: - yeoman-environment: ^3.2.0 - peerDependenciesMeta: - yeoman-environment: - optional: true - checksum: ef036210b6fb16f32d2615cd7c5d60a3ed17d1be5402ad997eee91ac709880802ad4026c1486bfff1ef891d284c1bbb15ab45caf8e287e175204d204f8d03474 - languageName: node - linkType: hard - "yn@npm:3.1.1": version: 3.1.1 resolution: "yn@npm:3.1.1" @@ -16922,31 +12194,12 @@ __metadata: languageName: node linkType: hard -"yosay@npm:^2.0.2": - version: 2.0.2 - resolution: "yosay@npm:2.0.2" - dependencies: - ansi-regex: ^2.0.0 - ansi-styles: ^3.0.0 - chalk: ^1.0.0 - cli-boxes: ^1.0.0 - pad-component: 0.0.1 - string-width: ^2.0.0 - strip-ansi: ^3.0.0 - taketalk: ^1.0.0 - wrap-ansi: ^2.0.0 - bin: - yosay: cli.js - checksum: 7e0220ef1321a9f0db4632fb564ff0bad66523bd22bb5cd6435886145bba284a4c1f651f51d629f4a904c79b0bbf13940fee1e127746f9f20b3e5eae8336c6cb - languageName: node - linkType: hard - "zen-observable-ts@npm:^1.2.0": - version: 1.2.3 - resolution: "zen-observable-ts@npm:1.2.3" + version: 1.2.5 + resolution: "zen-observable-ts@npm:1.2.5" dependencies: zen-observable: 0.8.15 - checksum: 0548b555c67671f1240fb416755d2c27abf095b74a9e25c1abf23b2e15de40e6b076c678a162021358fe62914864eb9f0a57cd65e203d66c4988a08b220e6172 + checksum: 3b707b7a0239a9bc40f73ba71b27733a689a957c1f364fabb9fa9cbd7d04b7c2faf0d517bf17004e3ed3f4330ac613e84c0d32313e450ddaa046f3350af44541 languageName: node linkType: hard