diff --git a/.eslintrc.js b/.eslintrc.js index 2763e81261..b869ef3042 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,8 +1,8 @@ module.exports = { parser: '@typescript-eslint/parser', // Specifies the ESLint parser + plugins: ['@typescript-eslint/eslint-plugin'], extends: [ 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin - 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. ], parserOptions: { diff --git a/.travis.yml b/.travis.yml index 67142554ac..12cec0b390 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ dist: bionic language: node_js node_js: - - 10 - 12 + - lts/* + - node services: - docker env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a80c1afa9..608808543c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [2.0.0] - 01-Mar-2022 + +**Milestone**: Symbol Mainnet +Package | Version | Link +---|---|--- +SDK Core| v2.0.0 | [symbol-sdk](https://www.npmjs.com/package/symbol-sdk) +Catbuffer | v1.0.1 | [catbuffer-typescript](https://www.npmjs.com/package/catbuffer-typescript) +Client Library | v1.0.3 | [symbol-openapi-typescript-fetch-client](https://www.npmjs.com/package/symbol-openapi-typescript-fetch-client) + +- **[BREAKING CHANGE]** The type of `value` field in `AccountMetadataTransaction`, `MosaicMetadataTransaction`, `NamespaceMetadataTransaction` classes is changed from `string` to `Uint8Array`. +- fix: Fixed metadata value non-ascii utf8 encoding issue [#834](https://github.com/symbol/symbol-sdk-typescript-javascript/issues/834) +- fix: Upgraded Node to 12.22.1. +- fix: Upgraded typescript to 4.5.4. +- fix: Upgraded RXJS to 7.4.0. + ## [1.0.3] - 16-Nov-2021 **Milestone**: Symbol Mainnet diff --git a/e2e/infrastructure/AccountHttp.spec.ts b/e2e/infrastructure/AccountHttp.spec.ts index 4eb2168e96..9828815994 100644 --- a/e2e/infrastructure/AccountHttp.spec.ts +++ b/e2e/infrastructure/AccountHttp.spec.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { AccountRepository, MultisigRepository, NamespaceRepository, Order, RepositoryCallError } from '../../src/infrastructure'; import { AccountPaginationStreamer } from '../../src/infrastructure/paginationStreamer'; @@ -164,24 +165,24 @@ describe('AccountHttp', () => { describe('getAccountInfo', () => { it('should return account data given a NEM Address', async () => { - const accountInfo = await accountRepository.getAccountInfo(accountAddress).toPromise(); + const accountInfo = await firstValueFrom(accountRepository.getAccountInfo(accountAddress)); expect(accountInfo.publicKey).to.be.equal(accountPublicKey); - const merkleInfo = await accountRepository.getAccountInfoMerkle(accountInfo.address).toPromise(); + const merkleInfo = await firstValueFrom(accountRepository.getAccountInfoMerkle(accountInfo.address)); expect(merkleInfo.raw).to.not.be.undefined; }); }); describe('getAccountsInfo', () => { it('should return account data given a NEM Address', async () => { - const accountsInfo = await accountRepository.getAccountsInfo([accountAddress]).toPromise(); + const accountsInfo = await firstValueFrom(accountRepository.getAccountsInfo([accountAddress])); expect(accountsInfo[0].publicKey).to.be.equal(accountPublicKey); }); }); describe('searchAccount', () => { it('should return account info', async () => { - const info = await accountRepository.search({}).toPromise(); + const info = await firstValueFrom(accountRepository.search({})); expect(info.data.length).to.be.greaterThan(0); }); }); @@ -189,11 +190,10 @@ describe('AccountHttp', () => { describe('searchAccount with streamer', () => { it('should return account info', async () => { const streamer = new AccountPaginationStreamer(accountRepository); - const infoStreamer = await streamer - .search({ pageSize: 20, order: Order.Asc, orderBy: AccountOrderBy.Id }) - .pipe(take(20), toArray()) - .toPromise(); - const info = await accountRepository.search({ pageSize: 20, order: Order.Asc, orderBy: AccountOrderBy.Id }).toPromise(); + const infoStreamer = await firstValueFrom( + streamer.search({ pageSize: 20, order: Order.Asc, orderBy: AccountOrderBy.Id }).pipe(take(20), toArray()), + ); + const info = await firstValueFrom(accountRepository.search({ pageSize: 20, order: Order.Asc, orderBy: AccountOrderBy.Id })); expect(infoStreamer.length).to.be.greaterThan(0); deepEqual(infoStreamer[0], info.data[0]); }); @@ -201,26 +201,23 @@ describe('AccountHttp', () => { describe('transactions', () => { it('should not return accounts when account does not exist', () => { - return accountRepository - .getAccountInfo(Account.generateNewAccount(networkType).address) - .toPromise() - .then( - () => { - return Promise.reject('should fail!'); - }, - (err) => { - const error: RepositoryCallError = JSON.parse(err.message); - expect(error.statusCode).to.be.eq(404); - expect(error.statusMessage).to.be.eq('Not Found'); - return Promise.resolve(); - }, - ); + return firstValueFrom(accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address)).then( + () => { + return Promise.reject('should fail!'); + }, + (err) => { + const error: RepositoryCallError = JSON.parse(err.message); + expect(error.statusCode).to.be.eq(404); + expect(error.statusMessage).to.be.eq('Not Found'); + return Promise.resolve(); + }, + ); }); }); describe('getAddressNames', () => { it('should call getAddressNames successfully', async () => { - const addressNames = await namespaceRepository.getAccountsNames([accountAddress]).toPromise(); + const addressNames = await firstValueFrom(namespaceRepository.getAccountsNames([accountAddress])); expect(addressNames.length).to.be.greaterThan(0); }); }); @@ -228,15 +225,17 @@ describe('AccountHttp', () => { describe('getMultisigAccountGraphInfo', () => { it('should call getMultisigAccountGraphInfo successfully', async () => { await new Promise((resolve) => setTimeout(resolve, 3000)); - const multisigAccountGraphInfo = await multisigRepository - .getMultisigAccountGraphInfo(multisigAccount.publicAccount.address) - .toPromise(); + const multisigAccountGraphInfo = await firstValueFrom( + multisigRepository.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address), + ); expect(multisigAccountGraphInfo.multisigEntries.get(0)![0].accountAddress.plain()).to.be.equal(multisigAccount.address.plain()); }); }); describe('getMultisigAccountInfo', () => { it('should call getMultisigAccountInfo successfully', async () => { - const multisigAccountInfo = await multisigRepository.getMultisigAccountInfo(multisigAccount.publicAccount.address).toPromise(); + const multisigAccountInfo = await firstValueFrom( + multisigRepository.getMultisigAccountInfo(multisigAccount.publicAccount.address), + ); expect(multisigAccountInfo.accountAddress.plain()).to.be.equal(multisigAccount.address.plain()); }); }); diff --git a/e2e/infrastructure/BlockHttp.spec.ts b/e2e/infrastructure/BlockHttp.spec.ts index abf08094b6..dfd6edd3a0 100644 --- a/e2e/infrastructure/BlockHttp.spec.ts +++ b/e2e/infrastructure/BlockHttp.spec.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { mergeMap, take, toArray } from 'rxjs/operators'; import { Order } from '../../src/infrastructure'; import { BlockRepository } from '../../src/infrastructure/BlockRepository'; @@ -84,7 +85,7 @@ describe('BlockHttp', () => { describe('getBlockByHeight', () => { it('should return block info given height', async () => { - const blockInfo = await blockRepository.getBlockByHeight(UInt64.fromUint(1)).toPromise(); + const blockInfo = await firstValueFrom(blockRepository.getBlockByHeight(UInt64.fromUint(1))); expect(blockInfo.height.lower).to.be.equal(1); expect(blockInfo.height.higher).to.be.equal(0); expect(blockInfo.timestamp.lower).to.be.equal(0); @@ -96,7 +97,7 @@ describe('BlockHttp', () => { describe('searchBlock', () => { it('should return block info given height and limit', async () => { - const blocksInfo = await blockRepository.search({}).toPromise(); + const blocksInfo = await firstValueFrom(blockRepository.search({})); expect(blocksInfo.data.length).to.be.greaterThan(0); }); }); @@ -104,8 +105,8 @@ describe('BlockHttp', () => { describe('searchBlock with streamer', () => { it('should return block info given height and limit', async () => { const streamer = new BlockPaginationStreamer(blockRepository); - const blockInfoStreamer = await streamer.search({ pageSize: 20 }).pipe(take(20), toArray()).toPromise(); - const blocksInfo = await blockRepository.search({ pageSize: 20 }).toPromise(); + const blockInfoStreamer = await firstValueFrom(streamer.search({ pageSize: 20 }).pipe(take(20), toArray())); + const blocksInfo = await firstValueFrom(blockRepository.search({ pageSize: 20 })); expect(blockInfoStreamer.length).to.be.greaterThan(0); deepEqual(blockInfoStreamer, blocksInfo.data); }); @@ -113,27 +114,26 @@ describe('BlockHttp', () => { describe('getMerkleReceipts', () => { it('should return Merkle Receipts', async () => { - const merkleReceipts = await receiptRepository - .searchReceipts({ height: chainHeight }) - .pipe( + const merkleReceipts = await firstValueFrom( + receiptRepository.searchReceipts({ height: chainHeight }).pipe( mergeMap((_) => { return blockRepository.getMerkleReceipts(chainHeight, (_.data[0] as TransactionStatement).generateHash()); }), - ) - .toPromise(); + ), + ); expect(merkleReceipts.merklePath).not.to.be.null; }); }); describe('getMerkleTransaction', () => { it('should return Merkle Transaction', async () => { - const merkleTransactionss = await blockRepository.getMerkleTransaction(chainHeight, transactionHash).toPromise(); + const merkleTransactionss = await firstValueFrom(blockRepository.getMerkleTransaction(chainHeight, transactionHash)); expect(merkleTransactionss.merklePath).not.to.be.null; }); }); describe('getBlockReceipts', () => { it('should return block receipts', async () => { - const statement = await receiptRepository.searchReceipts({ height: chainHeight }).toPromise(); + const statement = await firstValueFrom(receiptRepository.searchReceipts({ height: chainHeight })); expect(statement.data.length).to.be.greaterThan(0); }); }); @@ -141,11 +141,10 @@ describe('BlockHttp', () => { describe('searchReceipt with streamer', () => { it('should return receipt info', async () => { const streamer = ReceiptPaginationStreamer.transactionStatements(receiptRepository); - const infoStreamer = await streamer - .search({ pageSize: 20, height: chainHeight, order: Order.Asc }) - .pipe(take(20), toArray()) - .toPromise(); - const info = await receiptRepository.searchReceipts({ pageSize: 20, height: chainHeight, order: Order.Asc }).toPromise(); + const infoStreamer = await firstValueFrom( + streamer.search({ pageSize: 20, height: chainHeight, order: Order.Asc }).pipe(take(20), toArray()), + ); + const info = await firstValueFrom(receiptRepository.searchReceipts({ pageSize: 20, height: chainHeight, order: Order.Asc })); expect(infoStreamer.length).to.be.greaterThan(0); deepEqual(infoStreamer[0], info.data[0]); }); diff --git a/e2e/infrastructure/ChainHttp.spec.ts b/e2e/infrastructure/ChainHttp.spec.ts index 2dc96c4221..4258a18e16 100644 --- a/e2e/infrastructure/ChainHttp.spec.ts +++ b/e2e/infrastructure/ChainHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { ChainRepository } from '../../src/infrastructure/ChainRepository'; import { IntegrationTestHelper } from './IntegrationTestHelper'; @@ -34,7 +35,7 @@ describe('ChainHttp', () => { describe('getChainInfo', () => { it('should return blockchain score', async () => { - const info = await chainRepository.getChainInfo().toPromise(); + const info = await firstValueFrom(chainRepository.getChainInfo()); expect(info.scoreLow).to.not.be.equal(undefined); expect(info.scoreHigh.lower).to.be.equal(0); expect(info.scoreHigh.higher).to.be.equal(0); diff --git a/e2e/infrastructure/FinalizationHttp.spec.ts b/e2e/infrastructure/FinalizationHttp.spec.ts index 1076bcd08b..b12ade0a52 100644 --- a/e2e/infrastructure/FinalizationHttp.spec.ts +++ b/e2e/infrastructure/FinalizationHttp.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { FinalizationRepository } from '../../src/infrastructure/FinalizationRepository'; import { UInt64 } from '../../src/model/UInt64'; import { IntegrationTestHelper } from './IntegrationTestHelper'; @@ -34,7 +35,7 @@ describe('FinalizationHttp', () => { describe('getFinalizationProofAtEpoch', () => { it('should return finalization proof at epoch', async () => { - const dto = await finalizationRepository.getFinalizationProofAtEpoch(1).toPromise(); + const dto = await firstValueFrom(finalizationRepository.getFinalizationProofAtEpoch(1)); expect(dto).not.to.be.null; expect(dto.height).to.deep.eq(UInt64.fromUint(1)); expect(dto.version).to.eq(1); @@ -46,7 +47,7 @@ describe('FinalizationHttp', () => { describe('getNetworkName', () => { it('should return finalization proof at height', async () => { - const dto = await finalizationRepository.getFinalizationProofAtHeight(UInt64.fromUint(1)).toPromise(); + const dto = await firstValueFrom(finalizationRepository.getFinalizationProofAtHeight(UInt64.fromUint(1))); expect(dto).not.to.be.null; expect(dto.height).to.deep.eq(UInt64.fromUint(1)); expect(dto.version).to.eq(1); diff --git a/e2e/infrastructure/HashLockHttp.spec.ts b/e2e/infrastructure/HashLockHttp.spec.ts index 6b33dfe7bf..45da818b0f 100644 --- a/e2e/infrastructure/HashLockHttp.spec.ts +++ b/e2e/infrastructure/HashLockHttp.spec.ts @@ -17,6 +17,7 @@ import { ChronoUnit } from '@js-joda/core'; import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { HashLockPaginationStreamer, Order } from '../../src/infrastructure'; import { HashLockRepository } from '../../src/infrastructure/HashLockRepository'; @@ -154,14 +155,14 @@ describe('HashLockHttp', () => { describe('searchHashLock', () => { it('should return hash lock page info', async () => { await new Promise((resolve) => setTimeout(resolve, 3000)); - const page = await hashLockRepo.search({ address: account.address }).toPromise(); + const page = await firstValueFrom(hashLockRepo.search({ address: account.address })); const info = page.data[0]; hash = info.hash; expect(page.data.length).to.be.greaterThan(0); - const infoFromId = await hashLockRepo.getHashLock(hash).toPromise(); + const infoFromId = await firstValueFrom(hashLockRepo.getHashLock(hash)); expect(infoFromId).deep.eq(info); - const merkleInfo = await hashLockRepo.getHashLockMerkle(hash).toPromise(); + const merkleInfo = await firstValueFrom(hashLockRepo.getHashLockMerkle(hash)); expect(merkleInfo.raw).to.not.be.undefined; }); }); @@ -169,11 +170,10 @@ describe('HashLockHttp', () => { describe('searchHashLock with streamer', () => { it('should return hash lock page info', async () => { const streamer = new HashLockPaginationStreamer(hashLockRepo); - const infoStreamer = await streamer - .search({ address: account.address, pageSize: 20, order: Order.Asc }) - .pipe(take(20), toArray()) - .toPromise(); - const info = await hashLockRepo.search({ address: account.address, pageSize: 20, order: Order.Asc }).toPromise(); + const infoStreamer = await firstValueFrom( + streamer.search({ address: account.address, pageSize: 20, order: Order.Asc }).pipe(take(20), toArray()), + ); + const info = await firstValueFrom(hashLockRepo.search({ address: account.address, pageSize: 20, order: Order.Asc })); expect(infoStreamer.length).to.be.greaterThan(0); deepEqual(infoStreamer[0], info.data[0]); }); @@ -181,7 +181,7 @@ describe('HashLockHttp', () => { describe('getHashLock', () => { it('should return hash lock info given hash', async () => { - const info = await hashLockRepo.getHashLock(hash).toPromise(); + const info = await firstValueFrom(hashLockRepo.getHashLock(hash)); expect(info.ownerAddress.plain()).to.be.equal(account.address.plain()); expect(info.amount.toString()).to.be.equal('10000000'); }); diff --git a/e2e/infrastructure/IntegrationTestHelper.ts b/e2e/infrastructure/IntegrationTestHelper.ts index 4a0469660e..24d25166ca 100644 --- a/e2e/infrastructure/IntegrationTestHelper.ts +++ b/e2e/infrastructure/IntegrationTestHelper.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { firstValueFrom } from 'rxjs'; import { map } from 'rxjs/operators'; import { Addresses, BootstrapService, BootstrapUtils, ConfigLoader, StartParams } from 'symbol-bootstrap'; import { IListener, RepositoryFactory, RepositoryFactoryHttp } from '../../src/infrastructure'; @@ -84,9 +85,9 @@ export class IntegrationTestHelper { this.repositoryFactory.createReceiptRepository(), ); - this.networkType = await this.repositoryFactory.getNetworkType().toPromise(); - this.generationHash = await this.repositoryFactory.getGenerationHash().toPromise(); - this.epochAdjustment = await this.repositoryFactory.getEpochAdjustment().toPromise(); + this.networkType = await firstValueFrom(this.repositoryFactory.getNetworkType()); + this.generationHash = await firstValueFrom(this.repositoryFactory.getGenerationHash()); + this.epochAdjustment = await firstValueFrom(this.repositoryFactory.getEpochAdjustment()); let index = 0; this.accounts = accounts.map((account) => Account.createFromPrivateKey(account, this.networkType)); @@ -104,7 +105,7 @@ export class IntegrationTestHelper { // What would be the best maxFee? In the future we will load the fee multiplier from rest. this.maxFee = UInt64.fromUint(1000000); - this.networkCurrency = (await this.repositoryFactory.getCurrencies().toPromise()).currency; + this.networkCurrency = (await firstValueFrom(this.repositoryFactory.getCurrencies())).currency; if (openListener) { await this.listener.open(); @@ -118,22 +119,21 @@ export class IntegrationTestHelper { announce(signedTransaction: SignedTransaction): Promise { console.log(`Announcing transaction: ${signedTransaction.type}`); - return this.transactionService - .announce(signedTransaction, this.listener) - .pipe( + return firstValueFrom( + this.transactionService.announce(signedTransaction, this.listener).pipe( map((t) => { console.log(`Transaction ${signedTransaction.type} confirmed`); return t; }), - ) - .toPromise(); + ), + ); } - public static sleep(ms: number): Promise { + public static sleep(ms: number): Promise { // Create a promise that rejects in milliseconds return new Promise((resolve) => { setTimeout(() => { - resolve(); + resolve(undefined); }, ms); }); } diff --git a/e2e/infrastructure/Listener.spec.ts b/e2e/infrastructure/Listener.spec.ts index 6767bf8c64..5a8eb4995f 100644 --- a/e2e/infrastructure/Listener.spec.ts +++ b/e2e/infrastructure/Listener.spec.ts @@ -302,7 +302,11 @@ describe('Listener', () => { .search(criteria) .pipe( mergeMap((page) => { - return transactionRepository.getTransaction(page.data[0].transactionInfo?.hash!, TransactionGroup.Partial); + const hash = page.data[0].transactionInfo?.hash; + if (!hash) { + throw new Error('Hash must be defined!'); + } + return transactionRepository.getTransaction(hash, TransactionGroup.Partial); }), ) .subscribe((transactions) => { diff --git a/e2e/infrastructure/MetadataHttp.spec.ts b/e2e/infrastructure/MetadataHttp.spec.ts index d98fee3813..62369e771e 100644 --- a/e2e/infrastructure/MetadataHttp.spec.ts +++ b/e2e/infrastructure/MetadataHttp.spec.ts @@ -16,7 +16,9 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; +import { Convert } from '../..'; import { MetadataPaginationStreamer, MetadataRepository, Order } from '../../src/infrastructure'; import { Metadata, MetadataType, UInt64 } from '../../src/model'; import { Account, Address } from '../../src/model/account'; @@ -59,10 +61,10 @@ describe('MetadataHttp', () => { }); const validateMerkle = async (info: Metadata): Promise => { - const infoFromId = await metadataRepository.getMetadata(info.metadataEntry.compositeHash).toPromise(); + const infoFromId = await firstValueFrom(metadataRepository.getMetadata(info.metadataEntry.compositeHash)); expect(infoFromId).to.be.equal(info); - const merkleInfo = await metadataRepository.getMetadataMerkle(info.metadataEntry.compositeHash).toPromise(); + const merkleInfo = await firstValueFrom(metadataRepository.getMetadataMerkle(info.metadataEntry.compositeHash)); expect(merkleInfo.raw).to.not.be.undefined; }; @@ -114,7 +116,7 @@ describe('MetadataHttp', () => { account.address, UInt64.fromUint(6), 23, - `Test account meta value`, + Convert.utf8ToUint8(`Test account meta value`), networkType, helper.maxFee, ); @@ -139,7 +141,7 @@ describe('MetadataHttp', () => { UInt64.fromUint(6), mosaicId, 22, - `Test mosaic meta value`, + Convert.utf8ToUint8(`Test mosaic meta value`), networkType, helper.maxFee, ); @@ -164,7 +166,7 @@ describe('MetadataHttp', () => { UInt64.fromUint(6), namespaceId, 25, - `Test namespace meta value`, + Convert.utf8ToUint8(`Test namespace meta value`), networkType, helper.maxFee, ); @@ -189,9 +191,9 @@ describe('MetadataHttp', () => { describe('getAccountMetadata', () => { it('should return metadata given a NEM Address', async () => { - const metadata = await metadataRepository - .search({ targetAddress: accountAddress, metadataType: MetadataType.Account, order: Order.Desc }) - .toPromise(); + const metadata = await firstValueFrom( + metadataRepository.search({ targetAddress: accountAddress, metadataType: MetadataType.Account, order: Order.Desc }), + ); expect(metadata.data.length).to.be.greaterThan(0); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -206,14 +208,14 @@ describe('MetadataHttp', () => { describe('getAccountMetadataByKey', () => { it('should return metadata given a NEM Address and metadata key', async () => { - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ targetAddress: accountAddress, scopedMetadataKey: UInt64.fromUint(6).toHex(), metadataType: MetadataType.Account, order: Order.Desc, - }) - .toPromise(); + }), + ); expect(metadata.data.length).to.be.greaterThan(0); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -228,15 +230,15 @@ describe('MetadataHttp', () => { describe('getAccountMetadataByKeyAndSender', () => { it('should return metadata given a NEM Address and metadata key and sender address', async () => { - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ targetAddress: accountAddress, scopedMetadataKey: UInt64.fromUint(6).toHex(), sourceAddress: account.address, metadataType: MetadataType.Account, order: Order.Desc, - }) - .toPromise(); + }), + ); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -251,9 +253,9 @@ describe('MetadataHttp', () => { describe('getMosaicMetadata', () => { it('should return metadata given a mosaicId', async () => { - const metadata = await metadataRepository - .search({ targetId: mosaicId, metadataType: MetadataType.Mosaic, order: Order.Desc }) - .toPromise(); + const metadata = await firstValueFrom( + metadataRepository.search({ targetId: mosaicId, metadataType: MetadataType.Mosaic, order: Order.Desc }), + ); expect(metadata.data.length).to.be.greaterThan(0); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -268,14 +270,14 @@ describe('MetadataHttp', () => { describe('getMosaicMetadataByKey', () => { it('should return metadata given a mosaicId and metadata key', async () => { - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ targetId: mosaicId, scopedMetadataKey: UInt64.fromUint(6).toHex(), metadataType: MetadataType.Mosaic, order: Order.Desc, - }) - .toPromise(); + }), + ); expect(metadata.data.length).to.be.greaterThan(0); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -290,15 +292,15 @@ describe('MetadataHttp', () => { describe('getMosaicMetadataByKeyAndSender', () => { it('should return metadata given a mosaicId and metadata key and sender public key', async () => { - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ targetId: mosaicId, scopedMetadataKey: UInt64.fromUint(6).toHex(), sourceAddress: account.address, metadataType: MetadataType.Mosaic, order: Order.Desc, - }) - .toPromise(); + }), + ); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); expect(info.metadataEntry.sourceAddress).to.be.deep.equal(account.address); @@ -313,9 +315,9 @@ describe('MetadataHttp', () => { describe('getNamespaceMetadata', () => { it('should return metadata given a namespaceId', async () => { await new Promise((resolve) => setTimeout(resolve, 3000)); - const metadata = await metadataRepository - .search({ targetId: namespaceId, metadataType: MetadataType.Namespace, order: Order.Desc }) - .toPromise(); + const metadata = await firstValueFrom( + metadataRepository.search({ targetId: namespaceId, metadataType: MetadataType.Namespace, order: Order.Desc }), + ); expect(metadata.data.length).to.be.greaterThan(0); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -330,14 +332,14 @@ describe('MetadataHttp', () => { describe('getNamespaceMetadataByKey', () => { it('should return metadata given a namespaceId and metadata key', async () => { - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ targetId: namespaceId, scopedMetadataKey: UInt64.fromUint(6).toHex(), metadataType: MetadataType.Namespace, order: Order.Desc, - }) - .toPromise(); + }), + ); expect(metadata.data.length).to.be.greaterThan(0); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); @@ -352,15 +354,15 @@ describe('MetadataHttp', () => { describe('getNamespaceMetadataByKeyAndSender', () => { it('should return metadata given a namespaceId and metadata key and sender public key', async () => { - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ targetId: namespaceId, scopedMetadataKey: UInt64.fromUint(6).toHex(), sourceAddress: account.address, metadataType: MetadataType.Namespace, order: Order.Desc, - }) - .toPromise(); + }), + ); const info = metadata.data[0]; expect(info.metadataEntry.scopedMetadataKey.toString()).to.be.equal('6'); expect(info.metadataEntry.sourceAddress).to.be.deep.equal(account.address); @@ -375,13 +377,19 @@ describe('MetadataHttp', () => { describe('getAccountMetadata with streamer', () => { it('should return metadata given a NEM Address', async () => { const streamer = new MetadataPaginationStreamer(metadataRepository); - const infoStreamer = await streamer - .search({ pageSize: 20, targetAddress: accountAddress, metadataType: MetadataType.Account, order: Order.Desc }) - .pipe(take(20), toArray()) - .toPromise(); - const info = await metadataRepository - .search({ pageSize: 20, targetAddress: accountAddress, metadataType: MetadataType.Account, order: Order.Desc }) - .toPromise(); + const infoStreamer = await firstValueFrom( + streamer + .search({ pageSize: 20, targetAddress: accountAddress, metadataType: MetadataType.Account, order: Order.Desc }) + .pipe(take(20), toArray()), + ); + const info = await firstValueFrom( + metadataRepository.search({ + pageSize: 20, + targetAddress: accountAddress, + metadataType: MetadataType.Account, + order: Order.Desc, + }), + ); expect(infoStreamer.length).to.be.greaterThan(0); deepEqual(infoStreamer[0], info.data[0]); }); diff --git a/e2e/infrastructure/MosaicHttp.spec.ts b/e2e/infrastructure/MosaicHttp.spec.ts index afa6d84000..ce6375aee2 100644 --- a/e2e/infrastructure/MosaicHttp.spec.ts +++ b/e2e/infrastructure/MosaicHttp.spec.ts @@ -15,6 +15,7 @@ */ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { MosaicRepository, NamespaceRepository, TransactionGroup } from '../../src/infrastructure'; import { MosaicPaginationStreamer } from '../../src/infrastructure/paginationStreamer'; @@ -56,7 +57,7 @@ describe('MosaicHttp', () => { }); const validateMerkle = async (info: MosaicInfo): Promise => { - const merkleInfo = await mosaicRepository.getMosaicMerkle(info.id).toPromise(); + const merkleInfo = await firstValueFrom(mosaicRepository.getMosaicMerkle(info.id)); expect(merkleInfo.raw).to.not.be.undefined; }; @@ -88,10 +89,9 @@ describe('MosaicHttp', () => { expect(mosaicDefinitionTransaction.nonce).to.deep.equal(listenedTransaction.nonce); expect(mosaicDefinitionTransaction.getMosaicNonceIntValue()).to.be.equal(listenedTransaction.getMosaicNonceIntValue()); - const savedTransaction = (await helper.repositoryFactory - .createTransactionRepository() - .getTransaction(signedTransaction.hash, TransactionGroup.Confirmed) - .toPromise()) as MosaicDefinitionTransaction; + const savedTransaction = (await firstValueFrom( + helper.repositoryFactory.createTransactionRepository().getTransaction(signedTransaction.hash, TransactionGroup.Confirmed), + )) as MosaicDefinitionTransaction; expect(mosaicDefinitionTransaction.nonce.toHex()).to.be.equal(savedTransaction.nonce.toHex()); expect(mosaicDefinitionTransaction.nonce).to.deep.equal(savedTransaction.nonce); expect(mosaicDefinitionTransaction.getMosaicNonceIntValue()).to.be.equal(savedTransaction.getMosaicNonceIntValue()); @@ -136,7 +136,7 @@ describe('MosaicHttp', () => { */ describe('getMosaic', () => { it('should return mosaic given mosaicId', async () => { - const mosaicInfo = await mosaicRepository.getMosaic(mosaicId).toPromise(); + const mosaicInfo = await firstValueFrom(mosaicRepository.getMosaic(mosaicId)); expect(mosaicInfo.startHeight.lower).not.to.be.null; expect(mosaicInfo.divisibility).to.be.equal(3); expect(mosaicInfo.isSupplyMutable()).to.be.equal(true); @@ -147,7 +147,7 @@ describe('MosaicHttp', () => { describe('getMosaics', () => { it('should return mosaics given array of mosaicIds', async () => { - const mosaicInfos = await mosaicRepository.getMosaics([mosaicId]).toPromise(); + const mosaicInfos = await firstValueFrom(mosaicRepository.getMosaics([mosaicId])); expect(mosaicInfos[0].startHeight.lower).not.to.be.null; expect(mosaicInfos[0].divisibility).to.be.equal(3); expect(mosaicInfos[0].isSupplyMutable()).to.be.equal(true); @@ -158,14 +158,14 @@ describe('MosaicHttp', () => { describe('getMosaicsNames', () => { it('should call getMosaicsNames successfully', async () => { - const mosaicNames = await namespaceRepository.getMosaicsNames([mosaicId]).toPromise(); + const mosaicNames = await firstValueFrom(namespaceRepository.getMosaicsNames([mosaicId])); expect(mosaicNames.length).to.be.greaterThan(0); }); }); describe('searchMosaics', () => { it('should call searchMosaics successfully', async () => { - const mosaics = await mosaicRepository.search({ ownerAddress: account.address }).toPromise(); + const mosaics = await firstValueFrom(mosaicRepository.search({ ownerAddress: account.address })); expect(mosaics.data.length).to.be.greaterThan(0); expect(mosaics.data.find((m) => m.id.toHex() === mosaicId.toHex()) !== undefined).to.be.true; @@ -176,11 +176,10 @@ describe('MosaicHttp', () => { describe('searchMosaics with streamer', () => { it('should call searchMosaics successfully', async () => { const streamer = new MosaicPaginationStreamer(mosaicRepository); - const mosaicsStreamer = await streamer - .search({ ownerAddress: account.address, pageSize: 100 }) - .pipe(take(100), toArray()) - .toPromise(); - const mosaics = await mosaicRepository.search({ ownerAddress: account.address, pageSize: 100 }).toPromise(); + const mosaicsStreamer = await firstValueFrom( + streamer.search({ ownerAddress: account.address, pageSize: 100 }).pipe(take(100), toArray()), + ); + const mosaics = await firstValueFrom(mosaicRepository.search({ ownerAddress: account.address, pageSize: 100 })); expect(mosaicsStreamer.length).to.be.greaterThan(0); expect(mosaicsStreamer.find((m) => m.id.toHex() === mosaicId.toHex()) !== undefined).to.be.true; deepEqual(mosaics.data, mosaicsStreamer); diff --git a/e2e/infrastructure/MultisigAccounts.spec.ts b/e2e/infrastructure/MultisigAccounts.spec.ts index a338b249f4..a9603ac8cc 100644 --- a/e2e/infrastructure/MultisigAccounts.spec.ts +++ b/e2e/infrastructure/MultisigAccounts.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { Account } from '../../src/model/account/Account'; import { NetworkType } from '../../src/model/network/NetworkType'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; @@ -78,11 +79,11 @@ describe('MultisigAccounts', () => { await new Promise((resolve) => setTimeout(resolve, 3000)); const multisigRepository = helper.repositoryFactory.createMultisigRepository(); - const infoFromId = await multisigRepository.getMultisigAccountInfo(multisigAccount.address).toPromise(); + const infoFromId = await firstValueFrom(multisigRepository.getMultisigAccountInfo(multisigAccount.address)); expect(infoFromId).to.not.be.undefined; expect(infoFromId.accountAddress).to.deep.eq(multisigAccount.address); expect(infoFromId.cosignatoryAddresses).to.deep.eq([cosignAccount1.address, cosignAccount3.address, cosignAccount2.address]); - const merkleInfo = await multisigRepository.getMultisigAccountInfoMerkle(multisigAccount.address).toPromise(); + const merkleInfo = await firstValueFrom(multisigRepository.getMultisigAccountInfoMerkle(multisigAccount.address)); expect(merkleInfo.raw).to.not.be.undefined; }); }); diff --git a/e2e/infrastructure/NamespaceHttp.spec.ts b/e2e/infrastructure/NamespaceHttp.spec.ts index 0f4b98cc8c..94a110f4d7 100644 --- a/e2e/infrastructure/NamespaceHttp.spec.ts +++ b/e2e/infrastructure/NamespaceHttp.spec.ts @@ -15,6 +15,7 @@ */ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { NamespaceRepository, Order } from '../../src/infrastructure'; import { NamespacePaginationStreamer } from '../../src/infrastructure/paginationStreamer'; @@ -46,7 +47,7 @@ describe('NamespaceHttp', () => { }); const validateMerkle = async (namespaceId: NamespaceId): Promise => { - const merkleInfo = await namespaceRepository.getNamespaceMerkle(namespaceId).toPromise(); + const merkleInfo = await firstValueFrom(namespaceRepository.getNamespaceMerkle(namespaceId)); expect(merkleInfo.raw).to.not.be.undefined; }; @@ -83,7 +84,7 @@ describe('NamespaceHttp', () => { describe('getNamespace', () => { it('should return namespace data given namepsaceId', async () => { - const namespace = await namespaceRepository.getNamespace(defaultNamespaceId).toPromise(); + const namespace = await firstValueFrom(namespaceRepository.getNamespace(defaultNamespaceId)); expect(namespace.startHeight.lower).to.be.equal(1); expect(namespace.startHeight.higher).to.be.equal(0); await validateMerkle(namespace.id); @@ -92,28 +93,28 @@ describe('NamespaceHttp', () => { describe('getNamespacesName', () => { it('should return namespace name given array of namespaceIds', async () => { - const namespaceNames = await namespaceRepository.getNamespacesNames([defaultNamespaceId]).toPromise(); + const namespaceNames = await firstValueFrom(namespaceRepository.getNamespacesNames([defaultNamespaceId])); expect(namespaceNames[0].name).to.be.equal('currency'); }); }); describe('getLinkedMosaicId', () => { it('should return mosaicId given currency namespaceId', async () => { - const mosaicId = await namespaceRepository.getLinkedMosaicId(defaultNamespaceId).toPromise(); + const mosaicId = await firstValueFrom(namespaceRepository.getLinkedMosaicId(defaultNamespaceId)); expect(mosaicId).to.not.be.null; }); }); describe('getLinkedAddress', () => { it('should return address given namespaceId', async () => { - const address = (await namespaceRepository.getLinkedAddress(namespaceId).toPromise()) as Address; + const address = (await firstValueFrom(namespaceRepository.getLinkedAddress(namespaceId))) as Address; expect(address.plain()).to.be.equal(account.address.plain()); }); }); describe('searchNamespace', () => { it('should return namespace info', async () => { - const info = await namespaceRepository.search({ ownerAddress: account.address }).toPromise(); + const info = await firstValueFrom(namespaceRepository.search({ ownerAddress: account.address })); expect(info.data.length).to.be.greaterThan(0); validateMerkle(info.data[0].id); }); @@ -122,11 +123,10 @@ describe('NamespaceHttp', () => { describe('searchNamespace with streamer', () => { it('should return namespace info', async () => { const streamer = new NamespacePaginationStreamer(namespaceRepository); - const infoStreamer = await streamer - .search({ ownerAddress: account.address, pageSize: 20, order: Order.Desc }) - .pipe(take(20), toArray()) - .toPromise(); - const info = await namespaceRepository.search({ pageSize: 20, order: Order.Desc }).toPromise(); + const infoStreamer = await firstValueFrom( + streamer.search({ ownerAddress: account.address, pageSize: 20, order: Order.Desc }).pipe(take(20), toArray()), + ); + const info = await firstValueFrom(namespaceRepository.search({ pageSize: 20, order: Order.Desc })); expect(infoStreamer.length).to.be.greaterThan(0); deepEqual(infoStreamer[0], info.data[0]); }); diff --git a/e2e/infrastructure/NetworkHttp.spec.ts b/e2e/infrastructure/NetworkHttp.spec.ts index d582e9f708..cd5ac2afa7 100644 --- a/e2e/infrastructure/NetworkHttp.spec.ts +++ b/e2e/infrastructure/NetworkHttp.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { NetworkRepository } from '../../src/infrastructure/NetworkRepository'; import { NetworkType } from '../../src/model/network/NetworkType'; import { IntegrationTestHelper } from './IntegrationTestHelper'; @@ -36,14 +37,14 @@ describe('NetworkHttp', () => { describe('getNetworkType', () => { it('should return network type', async () => { - const sentNetworkType = await networkRepository.getNetworkType().toPromise(); + const sentNetworkType = await firstValueFrom(networkRepository.getNetworkType()); expect(sentNetworkType).to.be.equal(networkType); }); }); describe('getNetworkName', () => { it('should return network name and description', async () => { - const networkName = await networkRepository.getNetworkName().toPromise(); + const networkName = await firstValueFrom(networkRepository.getNetworkName()); expect(networkName.name.toLowerCase()).to.be.not.null; expect(networkName.description.toLowerCase()).to.be.not.null; }); @@ -51,7 +52,7 @@ describe('NetworkHttp', () => { describe('getTransactionFees', () => { it('should return transaction fees', async () => { - const fees = await networkRepository.getTransactionFees().toPromise(); + const fees = await firstValueFrom(networkRepository.getTransactionFees()); expect(fees.averageFeeMultiplier).to.be.not.null; expect(fees.highestFeeMultiplier).to.be.not.null; expect(fees.lowestFeeMultiplier).to.be.not.null; @@ -60,7 +61,7 @@ describe('NetworkHttp', () => { }); describe('getRentalFees', () => { it('should return rental fees', async () => { - const fees = await networkRepository.getRentalFees().toPromise(); + const fees = await firstValueFrom(networkRepository.getRentalFees()); expect(fees.effectiveChildNamespaceRentalFee).to.be.not.null; expect(fees.effectiveMosaicRentalFee).to.be.not.null; expect(fees.effectiveRootNamespaceRentalFeePerBlock).to.be.not.null; @@ -69,7 +70,7 @@ describe('NetworkHttp', () => { describe('getNetworkProperties', () => { it('should return network configuration', async () => { - const config = await networkRepository.getNetworkProperties().toPromise(); + const config = await firstValueFrom(networkRepository.getNetworkProperties()); expect(config.network).to.be.not.null; expect(config.chain).to.be.not.null; expect(config.plugins).to.be.not.null; diff --git a/e2e/infrastructure/NodeHttp.spec.ts b/e2e/infrastructure/NodeHttp.spec.ts index bdd694ad68..e6da632d5b 100644 --- a/e2e/infrastructure/NodeHttp.spec.ts +++ b/e2e/infrastructure/NodeHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { NodeRepository } from '../../src/infrastructure/NodeRepository'; import { IntegrationTestHelper } from './IntegrationTestHelper'; @@ -34,7 +35,7 @@ describe('NodeHttp', () => { describe('getNodeInfo', () => { it('should return node info FER', async () => { - const nodeInfo = await nodeRepository.getNodeInfo().toPromise(); + const nodeInfo = await firstValueFrom(nodeRepository.getNodeInfo()); expect(nodeInfo.friendlyName).not.to.be.undefined; expect(nodeInfo.host).not.to.be.undefined; expect(nodeInfo.networkIdentifier).not.to.be.undefined; @@ -48,7 +49,7 @@ describe('NodeHttp', () => { describe('getNodePeers', () => { it('should return node peers', async () => { - const nodeInfo = await nodeRepository.getNodePeers().toPromise(); + const nodeInfo = await firstValueFrom(nodeRepository.getNodePeers()); expect(nodeInfo[0].friendlyName).not.to.be.undefined; expect(nodeInfo[0].host).not.to.be.undefined; expect(nodeInfo[0].networkIdentifier).not.to.be.undefined; @@ -61,7 +62,7 @@ describe('NodeHttp', () => { describe('getNodeTime', () => { it('should return node time', async () => { - const nodeTime = await nodeRepository.getNodeTime().toPromise(); + const nodeTime = await firstValueFrom(nodeRepository.getNodeTime()); expect(nodeTime.receiveTimeStamp).not.to.be.undefined; expect(nodeTime.sendTimeStamp).not.to.be.undefined; }); @@ -69,7 +70,7 @@ describe('NodeHttp', () => { describe('getStorageInfo', () => { it('should return storage info', async () => { - const blockchainStorageInfo = await nodeRepository.getStorageInfo().toPromise(); + const blockchainStorageInfo = await firstValueFrom(nodeRepository.getStorageInfo()); expect(blockchainStorageInfo.numBlocks).to.be.greaterThan(0); expect(blockchainStorageInfo.numTransactions).to.be.greaterThan(0); expect(blockchainStorageInfo.numAccounts).to.be.greaterThan(0); @@ -78,7 +79,7 @@ describe('NodeHttp', () => { describe('getServerInfo', () => { it('should return server info', async () => { - const serverInfo = await nodeRepository.getServerInfo().toPromise(); + const serverInfo = await firstValueFrom(nodeRepository.getServerInfo()); expect(serverInfo.restVersion).not.to.be.null; expect(serverInfo.sdkVersion).not.to.be.null; }); @@ -86,7 +87,7 @@ describe('NodeHttp', () => { describe('getNodeHealth', () => { it('should return node health', async () => { - const health = await nodeRepository.getNodeHealth().toPromise(); + const health = await firstValueFrom(nodeRepository.getNodeHealth()); expect(health.apiNode).not.to.be.null; expect(health.db).not.to.be.null; }); @@ -94,7 +95,7 @@ describe('NodeHttp', () => { describe('getUnlockedAccount', () => { it('should return unlocked account', async () => { - const unlockedAccount = await nodeRepository.getUnlockedAccount().toPromise(); + const unlockedAccount = await firstValueFrom(nodeRepository.getUnlockedAccount()); expect(unlockedAccount).not.to.be.null; expect(unlockedAccount.length).greaterThan(0); }); diff --git a/e2e/infrastructure/PersistentHarvesting.spec.ts b/e2e/infrastructure/PersistentHarvesting.spec.ts index dc1a8b05e5..037df54854 100644 --- a/e2e/infrastructure/PersistentHarvesting.spec.ts +++ b/e2e/infrastructure/PersistentHarvesting.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { firstValueFrom } from 'rxjs'; import { Account } from '../../src/model/account'; import { NetworkType } from '../../src/model/network'; import { @@ -61,7 +62,7 @@ describe('PersistentHarvesting', () => { describe('AccountKeyLinkTransaction', () => { it('standalone', async () => { - const accountInfo = await helper.repositoryFactory.createAccountRepository().getAccountInfo(account.address).toPromise(); + const accountInfo = await firstValueFrom(helper.repositoryFactory.createAccountRepository().getAccountInfo(account.address)); const publicKey = accountInfo.supplementalPublicKeys?.linked?.publicKey; if (publicKey) { if (publicKey == remoteAccount.publicKey) { @@ -85,7 +86,7 @@ describe('PersistentHarvesting', () => { describe('VrfKeyLinkTransaction', () => { it('standalone', async () => { - const accountInfo = await helper.repositoryFactory.createAccountRepository().getAccountInfo(account.address).toPromise(); + const accountInfo = await firstValueFrom(helper.repositoryFactory.createAccountRepository().getAccountInfo(account.address)); const publicKey = accountInfo.supplementalPublicKeys?.vrf?.publicKey; if (publicKey) { @@ -112,7 +113,7 @@ describe('PersistentHarvesting', () => { it('standalone', async () => { const nodePublicKey = helper.bootstrapAddresses.nodes![0].transport!.publicKey; - const accountInfo = await helper.repositoryFactory.createAccountRepository().getAccountInfo(account.address).toPromise(); + const accountInfo = await firstValueFrom(helper.repositoryFactory.createAccountRepository().getAccountInfo(account.address)); const publicKey = accountInfo.supplementalPublicKeys?.node?.publicKey; if (publicKey) { diff --git a/e2e/infrastructure/ReceiptHttp.spec.ts b/e2e/infrastructure/ReceiptHttp.spec.ts index 43b6ac8d7a..c6eb6fbbc5 100644 --- a/e2e/infrastructure/ReceiptHttp.spec.ts +++ b/e2e/infrastructure/ReceiptHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { toArray } from 'rxjs/operators'; import { ReceiptPaginationStreamer } from '../../src/infrastructure/paginationStreamer/ReceiptPaginationStreamer'; import { ReceiptRepository } from '../../src/infrastructure/ReceiptRepository'; @@ -39,10 +40,9 @@ describe('ReceiptHttp', () => { async function searchByRecipientType(receiptTypes: ReceiptType[], empty: boolean): Promise { const streamer = ReceiptPaginationStreamer.transactionStatements(receiptRepository); - const infos = await streamer - .search({ pageSize: 20, height: UInt64.fromUint(1), receiptTypes: receiptTypes }) - .pipe(toArray()) - .toPromise(); + const infos = await firstValueFrom( + streamer.search({ pageSize: 20, height: UInt64.fromUint(1), receiptTypes: receiptTypes }).pipe(toArray()), + ); infos.forEach((s) => { s.receipts.forEach((r) => { diff --git a/e2e/infrastructure/RestrictionHttp.spec.ts b/e2e/infrastructure/RestrictionHttp.spec.ts index b5cc7a1cd3..7b9ee6451a 100644 --- a/e2e/infrastructure/RestrictionHttp.spec.ts +++ b/e2e/infrastructure/RestrictionHttp.spec.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { RestrictionAccountRepository, RestrictionMosaicRepository } from '../../src/infrastructure'; import { UInt64 } from '../../src/model'; import { Account, Address } from '../../src/model/account'; @@ -196,16 +197,16 @@ describe('RestrictionHttp', () => { describe('getAccountRestrictions', () => { it('should call getAccountRestrictions successfully', async () => { - const accountRestrictions = await restrictionAccountRepository.getAccountRestrictions(accountAddress).toPromise(); + const accountRestrictions = await firstValueFrom(restrictionAccountRepository.getAccountRestrictions(accountAddress)); expect(accountRestrictions.restrictions.length).to.be.greaterThan(0); }); }); describe('search', () => { it('should call search successfully', async () => { - const mosaicRestrictionPage = await restrictionMosaicRepository - .search({ mosaicId, targetAddress: account3.address }) - .toPromise(); + const mosaicRestrictionPage = await firstValueFrom( + restrictionMosaicRepository.search({ mosaicId, targetAddress: account3.address }), + ); const info = mosaicRestrictionPage.data[0]; deepEqual(info.mosaicId.toHex(), mosaicId.toHex()); deepEqual(info.entryType, MosaicRestrictionEntryType.ADDRESS); @@ -213,10 +214,10 @@ describe('RestrictionHttp', () => { deepEqual(addressRestriction.targetAddress.plain(), account3.address.plain()); deepEqual(addressRestriction.getRestriction(UInt64.fromUint(60641))!.restrictionValue, UInt64.fromUint(2)); - const infoFromId = await restrictionMosaicRepository.getMosaicRestrictions(info.compositeHash).toPromise(); + const infoFromId = await firstValueFrom(restrictionMosaicRepository.getMosaicRestrictions(info.compositeHash)); expect(infoFromId).to.be.equal(info); - const merkleInfo = await restrictionMosaicRepository.getMosaicRestrictionsMerkle(info.compositeHash).toPromise(); + const merkleInfo = await firstValueFrom(restrictionMosaicRepository.getMosaicRestrictionsMerkle(info.compositeHash)); expect(merkleInfo.raw).to.not.be.undefined; }); }); diff --git a/e2e/infrastructure/SecretLockHttp.spec.ts b/e2e/infrastructure/SecretLockHttp.spec.ts index 338d8bbdd5..5ea4d32caf 100644 --- a/e2e/infrastructure/SecretLockHttp.spec.ts +++ b/e2e/infrastructure/SecretLockHttp.spec.ts @@ -17,6 +17,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; import { sha3_256 } from 'js-sha3'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { Crypto } from '../../src/core/crypto'; import { Order, SecretLockPaginationStreamer } from '../../src/infrastructure'; @@ -86,7 +87,7 @@ describe('SecretLockHttp', () => { it('should return hash lock info given hash', async () => { await new Promise((resolve) => setTimeout(resolve, 3000)); - const page = await secretLockRepository.search({ address: account.address, secret }).toPromise(); + const page = await firstValueFrom(secretLockRepository.search({ address: account.address, secret })); expect(page.data.length).eq(1); expect(page.pageNumber).eq(1); @@ -95,16 +96,16 @@ describe('SecretLockHttp', () => { expect(info.recipientAddress.plain()).to.be.equal(account2.address.plain()); expect(info.amount.toString()).to.be.equal('10'); - const infoFromId = await secretLockRepository.getSecretLock(info.compositeHash).toPromise(); + const infoFromId = await firstValueFrom(secretLockRepository.getSecretLock(info.compositeHash)); expect(infoFromId).deep.eq(info); - const merkleInfo = await secretLockRepository.getSecretLockMerkle(info.compositeHash).toPromise(); + const merkleInfo = await firstValueFrom(secretLockRepository.getSecretLockMerkle(info.compositeHash)); expect(merkleInfo.raw).to.not.be.undefined; }); }); describe('searchSecretLock', () => { it('should return hash lock page info', async () => { - const info = await secretLockRepository.search({ address: account.address }).toPromise(); + const info = await firstValueFrom(secretLockRepository.search({ address: account.address })); expect(info.data.length).to.be.greaterThan(0); }); }); @@ -112,18 +113,17 @@ describe('SecretLockHttp', () => { describe('searchSecretLock with streamer', () => { it('should return hash lock page info', async () => { const streamer = new SecretLockPaginationStreamer(secretLockRepository); - const infoStreamer = await streamer - .search({ address: account.address, pageSize: 20, order: Order.Asc }) - .pipe(take(20), toArray()) - .toPromise(); - const info = await secretLockRepository - .search({ + const infoStreamer = await firstValueFrom( + streamer.search({ address: account.address, pageSize: 20, order: Order.Asc }).pipe(take(20), toArray()), + ); + const info = await firstValueFrom( + secretLockRepository.search({ address: account.address, secret: undefined, pageSize: 20, order: Order.Asc, - }) - .toPromise(); + }), + ); expect(infoStreamer.length).to.be.greaterThan(0); deepEqual(infoStreamer[0], info.data[0]); }); diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index 6a563f46a2..fb0f964643 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -20,6 +20,7 @@ import * as CryptoJS from 'crypto-js'; import { sha256 } from 'js-sha256'; import { sha3_256 } from 'js-sha3'; import * as ripemd160 from 'ripemd160'; +import { firstValueFrom } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import * as secureRandom from 'secure-random'; import { Crypto } from '../../src/core/crypto'; @@ -128,9 +129,9 @@ describe('TransactionHttp', () => { describe('Get network currency mosaic id', () => { it('get mosaicId', async () => { - networkNetworkCurrencyLocalId = (await namespaceRepository - .getLinkedMosaicId(helper.networkCurrency!.namespaceId!) - .toPromise()) as MosaicId; + networkNetworkCurrencyLocalId = (await firstValueFrom( + namespaceRepository.getLinkedMosaicId(helper.networkCurrency!.namespaceId!), + )) as MosaicId; }); }); @@ -195,7 +196,7 @@ describe('TransactionHttp', () => { account.address, UInt64.fromUint(5), 10, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), networkType, helper.maxFee, ); @@ -228,7 +229,7 @@ describe('TransactionHttp', () => { UInt64.fromUint(5), mosaicId, 10, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), networkType, helper.maxFee, ); @@ -322,7 +323,7 @@ describe('TransactionHttp', () => { UInt64.fromUint(5), addressAlias, 10, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), networkType, helper.maxFee, ); @@ -1410,13 +1411,16 @@ describe('TransactionHttp', () => { describe('getTransaction', () => { it('should return transaction info given transactionHash', async () => { - const transaction = await transactionRepository.getTransaction(transactionHash, TransactionGroup.Confirmed).toPromise(); + const transaction = await firstValueFrom(transactionRepository.getTransaction(transactionHash, TransactionGroup.Confirmed)); expect(transaction.transactionInfo!.hash).to.be.equal(transactionHash); - transactionId = transaction.transactionInfo?.id!; + if (!transaction.transactionInfo?.id) { + throw new Error('transactionId must be defined'); + } + transactionId = transaction.transactionInfo?.id; }); it('should return transaction info given transactionId', async () => { - const transaction = await transactionRepository.getTransaction(transactionId, TransactionGroup.Confirmed).toPromise(); + const transaction = await firstValueFrom(transactionRepository.getTransaction(transactionId, TransactionGroup.Confirmed)); expect(transaction.transactionInfo!.hash).to.be.equal(transactionHash); expect(transaction.transactionInfo!.id).to.be.equal(transactionId); }); @@ -1424,13 +1428,17 @@ describe('TransactionHttp', () => { describe('getTransactionsById', () => { it('should return transaction info given array of transactionHash', async () => { - const transactions = await transactionRepository.getTransactionsById([transactionHash], TransactionGroup.Confirmed).toPromise(); + const transactions = await firstValueFrom( + transactionRepository.getTransactionsById([transactionHash], TransactionGroup.Confirmed), + ); expect(transactions[0].transactionInfo!.hash).to.be.equal(transactionHash); expect(transactions[0].transactionInfo!.id).to.be.equal(transactionId); }); it('should return transaction info given array of transactionId', async () => { - const transactions = await transactionRepository.getTransactionsById([transactionId], TransactionGroup.Confirmed).toPromise(); + const transactions = await firstValueFrom( + transactionRepository.getTransactionsById([transactionId], TransactionGroup.Confirmed), + ); expect(transactions[0].transactionInfo!.hash).to.be.equal(transactionHash); expect(transactions[0].transactionInfo!.id).to.be.equal(transactionId); }); @@ -1439,7 +1447,7 @@ describe('TransactionHttp', () => { describe('getTransactionStatus', () => { it('should return transaction status given transactionHash', async () => { await new Promise((resolve) => setTimeout(resolve, 2000)); - const transactionStatus = await transactionStatusRepository.getTransactionStatus(transactionHash).toPromise(); + const transactionStatus = await firstValueFrom(transactionStatusRepository.getTransactionStatus(transactionHash)); expect(transactionStatus.group).to.be.equal('confirmed'); expect(transactionStatus.height!.lower).to.be.greaterThan(0); expect(transactionStatus.height!.higher).to.be.equal(0); @@ -1448,7 +1456,7 @@ describe('TransactionHttp', () => { describe('getTransactionsStatuses', () => { it('should return transaction status given array of transactionHash', async () => { - const transactionStatuses = await transactionStatusRepository.getTransactionStatuses([transactionHash]).toPromise(); + const transactionStatuses = await firstValueFrom(transactionStatusRepository.getTransactionStatuses([transactionHash])); expect(transactionStatuses[0].group).to.be.equal('confirmed'); expect(transactionStatuses[0].height!.lower).to.be.greaterThan(0); expect(transactionStatuses[0].height!.higher).to.be.equal(0); @@ -1466,7 +1474,7 @@ describe('TransactionHttp', () => { helper.maxFee, ); const signedTransaction = transferTransaction.signWith(account, generationHash); - const transactionAnnounceResponse = await transactionRepository.announce(signedTransaction).toPromise(); + const transactionAnnounceResponse = await firstValueFrom(transactionRepository.announce(signedTransaction)); expect(transactionAnnounceResponse.message).to.be.equal('packet 9 was pushed to the network via /transactions'); }); }); @@ -1489,7 +1497,7 @@ describe('TransactionHttp', () => { helper.maxFee, ); const signedTransaction = aggregateTransaction.signWith(cosignAccount1, generationHash); - const transactionAnnounceResponse = await transactionRepository.announceAggregateBonded(signedTransaction).toPromise(); + const transactionAnnounceResponse = await firstValueFrom(transactionRepository.announceAggregateBonded(signedTransaction)); expect(transactionAnnounceResponse.message).to.be.equal('packet 256 was pushed to the network via /transactions/partial'); }); }); @@ -1497,14 +1505,14 @@ describe('TransactionHttp', () => { describe('announceAggregateBondedCosignature', () => { it('should return success when announceAggregateBondedCosignature', async () => { const payload = new CosignatureSignedTransaction('', '', ''); - const transactionAnnounceResponse = await transactionRepository.announceAggregateBondedCosignature(payload).toPromise(); + const transactionAnnounceResponse = await firstValueFrom(transactionRepository.announceAggregateBondedCosignature(payload)); expect(transactionAnnounceResponse.message).to.be.equal('packet 257 was pushed to the network via /transactions/cosignature'); }); }); describe('getTransactionEffectiveFee', () => { it('should return effective paid fee given transactionHash', async () => { - const effectiveFee = await transactionRepository.getTransactionEffectiveFee(transactionHash).toPromise(); + const effectiveFee = await firstValueFrom(transactionRepository.getTransactionEffectiveFee(transactionHash)); expect(effectiveFee).to.not.be.undefined; expect(effectiveFee).not.to.be.equal(0); }); @@ -1512,15 +1520,18 @@ describe('TransactionHttp', () => { describe('searchTransactions', () => { it('should return transaction info given address', async () => { - const transactions = await transactionRepository - .search({ group: TransactionGroup.Confirmed, address: account.address } as TransactionSearchCriteria) - .toPromise(); + const transactions = await firstValueFrom( + transactionRepository.search({ group: TransactionGroup.Confirmed, address: account.address } as TransactionSearchCriteria), + ); expect(transactions.data.length).to.be.greaterThan(0); }); it('should return transaction info given height all types', async () => { - const transactions = await transactionRepository - .search({ group: TransactionGroup.Confirmed, height: UInt64.fromUint(1) } as TransactionSearchCriteria) - .toPromise(); + const transactions = await firstValueFrom( + transactionRepository.search({ + group: TransactionGroup.Confirmed, + height: UInt64.fromUint(1), + } as TransactionSearchCriteria), + ); const mosaicDefinitions = transactions.data.filter((t) => t.type == TransactionType.MOSAIC_DEFINITION).length; const namespaceRegistration = transactions.data.filter((t) => t.type == TransactionType.NAMESPACE_REGISTRATION).length; @@ -1533,13 +1544,13 @@ describe('TransactionHttp', () => { }); it('should return transaction info given height and namesapce, mosaic types', async () => { - const transactions = await transactionRepository - .search({ + const transactions = await firstValueFrom( + transactionRepository.search({ group: TransactionGroup.Confirmed, height: UInt64.fromUint(1), type: [TransactionType.MOSAIC_DEFINITION, TransactionType.NAMESPACE_REGISTRATION], - } as TransactionSearchCriteria) - .toPromise(); + } as TransactionSearchCriteria), + ); const mosaicDefinitions = transactions.data.filter((t) => t.type == TransactionType.MOSAIC_DEFINITION).length; const namespaceRegistration = transactions.data.filter((t) => t.type == TransactionType.NAMESPACE_REGISTRATION).length; const others = transactions.data.filter( @@ -1554,13 +1565,16 @@ describe('TransactionHttp', () => { describe('searchTransactions using streamer', () => { it('should return transaction info given address', async () => { const streamer = new TransactionPaginationStreamer(transactionRepository); - const transactionsNoStreamer = await transactionRepository - .search({ group: TransactionGroup.Confirmed, address: account.address, pageSize: 10 } as TransactionSearchCriteria) - .toPromise(); - const transactions = await streamer - .search({ group: TransactionGroup.Confirmed, address: account.address, pageSize: 10 }) - .pipe(take(10), toArray()) - .toPromise(); + const transactionsNoStreamer = await firstValueFrom( + transactionRepository.search({ + group: TransactionGroup.Confirmed, + address: account.address, + pageSize: 10, + } as TransactionSearchCriteria), + ); + const transactions = await firstValueFrom( + streamer.search({ group: TransactionGroup.Confirmed, address: account.address, pageSize: 10 }).pipe(take(10), toArray()), + ); expect(transactions.length).to.be.greaterThan(0); deepEqual(transactionsNoStreamer.data, transactions); }); diff --git a/e2e/infrastructure/TransactionSearch.spec.ts b/e2e/infrastructure/TransactionSearch.spec.ts index 87ddee3005..a31810a962 100644 --- a/e2e/infrastructure/TransactionSearch.spec.ts +++ b/e2e/infrastructure/TransactionSearch.spec.ts @@ -15,7 +15,8 @@ */ import { deepEqual } from 'assert'; import { expect } from 'chai'; -import { first, take, toArray } from 'rxjs/operators'; +import { firstValueFrom } from 'rxjs'; +import { take, toArray } from 'rxjs/operators'; import { TransactionPaginationStreamer } from '../../src/infrastructure/paginationStreamer/TransactionPaginationStreamer'; import { TransactionSearchCriteria } from '../../src/infrastructure/searchCriteria/TransactionSearchCriteria'; import { TransactionGroup } from '../../src/infrastructure/TransactionGroup'; @@ -40,16 +41,19 @@ describe('TransactionSearch', () => { it('should return transaction info given address', async () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); const account = helper.account; - const transactions = await transactionRepository - .search({ group: TransactionGroup.Confirmed, address: account.address } as TransactionSearchCriteria) - .toPromise(); + const transactions = await firstValueFrom( + transactionRepository.search({ group: TransactionGroup.Confirmed, address: account.address } as TransactionSearchCriteria), + ); expect(transactions.data.length).to.be.greaterThan(0); }); it('should return transaction info given height all types', async () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); - const transactions = await transactionRepository - .search({ group: TransactionGroup.Confirmed, height: UInt64.fromUint(1) } as TransactionSearchCriteria) - .toPromise(); + const transactions = await firstValueFrom( + transactionRepository.search({ + group: TransactionGroup.Confirmed, + height: UInt64.fromUint(1), + } as TransactionSearchCriteria), + ); const mosaicDefinitions = transactions.data.filter((t) => t.type == TransactionType.MOSAIC_DEFINITION).length; const namespaceRegistration = transactions.data.filter((t) => t.type == TransactionType.NAMESPACE_REGISTRATION).length; @@ -63,13 +67,13 @@ describe('TransactionSearch', () => { it('should return transaction info given height and namesapce, mosaic types', async () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); - const transactions = await transactionRepository - .search({ + const transactions = await firstValueFrom( + transactionRepository.search({ group: TransactionGroup.Confirmed, height: UInt64.fromUint(1), type: [TransactionType.MOSAIC_DEFINITION, TransactionType.NAMESPACE_REGISTRATION], - } as TransactionSearchCriteria) - .toPromise(); + } as TransactionSearchCriteria), + ); const mosaicDefinitions = transactions.data.filter((t) => t.type == TransactionType.MOSAIC_DEFINITION).length; const namespaceRegistration = transactions.data.filter((t) => t.type == TransactionType.NAMESPACE_REGISTRATION).length; const others = transactions.data.filter( @@ -86,13 +90,16 @@ describe('TransactionSearch', () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); const streamer = new TransactionPaginationStreamer(transactionRepository); const account = helper.account; - const transactionsNoStreamer = await transactionRepository - .search({ group: TransactionGroup.Confirmed, address: account.address, pageSize: 10 } as TransactionSearchCriteria) - .toPromise(); - const transactions = await streamer - .search({ group: TransactionGroup.Confirmed, address: account.address, pageSize: 10 }) - .pipe(take(10), toArray()) - .toPromise(); + const transactionsNoStreamer = await firstValueFrom( + transactionRepository.search({ + group: TransactionGroup.Confirmed, + address: account.address, + pageSize: 10, + } as TransactionSearchCriteria), + ); + const transactions = await firstValueFrom( + streamer.search({ group: TransactionGroup.Confirmed, address: account.address, pageSize: 10 }).pipe(take(10), toArray()), + ); expect(transactions.length).to.be.greaterThan(0); deepEqual(transactionsNoStreamer.data, transactions); }); @@ -101,14 +108,13 @@ describe('TransactionSearch', () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); const streamer = new TransactionPaginationStreamer(transactionRepository); - const transferTransaction = (await streamer - .search({ + const transferTransaction = (await firstValueFrom( + streamer.search({ embedded: true, group: TransactionGroup.Confirmed, type: [TransactionType.TRANSFER], - }) - .pipe(first()) - .toPromise()) as TransferTransaction; + }), + )) as TransferTransaction; const mosaicId = transferTransaction.mosaics[0].id; const criteria: TransactionSearchCriteria = { @@ -118,7 +124,7 @@ describe('TransactionSearch', () => { transferMosaicId: mosaicId as MosaicId, }; - const transactions = await streamer.search(criteria).pipe(toArray()).toPromise(); + const transactions = await firstValueFrom(streamer.search(criteria).pipe(toArray())); expect(transactions.length).to.be.greaterThan(0); transactions.forEach((t) => { @@ -131,14 +137,13 @@ describe('TransactionSearch', () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); const streamer = new TransactionPaginationStreamer(transactionRepository); - const transferTransaction = (await streamer - .search({ + const transferTransaction = (await firstValueFrom( + streamer.search({ embedded: true, group: TransactionGroup.Confirmed, type: [TransactionType.TRANSFER], - }) - .pipe(first()) - .toPromise()) as TransferTransaction; + }), + )) as TransferTransaction; const mosaic = transferTransaction.mosaics[0]; const mosaicId = mosaic.id; @@ -151,7 +156,7 @@ describe('TransactionSearch', () => { transferMosaicId: mosaicId as MosaicId, }; - const transactions = await streamer.search(criteria).pipe(toArray()).toPromise(); + const transactions = await firstValueFrom(streamer.search(criteria).pipe(toArray())); expect(transactions.length).to.be.greaterThan(0); transactions.forEach((t) => { @@ -165,14 +170,13 @@ describe('TransactionSearch', () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); const streamer = new TransactionPaginationStreamer(transactionRepository); - const transferTransaction = (await streamer - .search({ + const transferTransaction = (await firstValueFrom( + streamer.search({ embedded: true, group: TransactionGroup.Confirmed, type: [TransactionType.TRANSFER], - }) - .pipe(first()) - .toPromise()) as TransferTransaction; + }), + )) as TransferTransaction; const mosaic = transferTransaction.mosaics[0]; const mosaicId = mosaic.id; @@ -184,7 +188,7 @@ describe('TransactionSearch', () => { transferMosaicId: mosaicId as MosaicId, }; - const transactions = await streamer.search(criteria).pipe(toArray()).toPromise(); + const transactions = await firstValueFrom(streamer.search(criteria).pipe(toArray())); expect(transactions.length).to.be.greaterThan(0); transactions.forEach((t) => { @@ -198,14 +202,13 @@ describe('TransactionSearch', () => { const transactionRepository = helper.repositoryFactory.createTransactionRepository(); const streamer = new TransactionPaginationStreamer(transactionRepository); - const transferTransaction = (await streamer - .search({ + const transferTransaction = (await firstValueFrom( + streamer.search({ embedded: true, group: TransactionGroup.Confirmed, type: [TransactionType.TRANSFER], - }) - .pipe(first()) - .toPromise()) as TransferTransaction; + }), + )) as TransferTransaction; const mosaic = transferTransaction.mosaics[0]; const mosaicId = mosaic.id; @@ -217,7 +220,7 @@ describe('TransactionSearch', () => { transferMosaicId: mosaicId as MosaicId, }; - const transactions = await streamer.search(criteria).pipe(toArray()).toPromise(); + const transactions = await firstValueFrom(streamer.search(criteria).pipe(toArray())); expect(transactions.length).to.be.greaterThan(0); transactions.forEach((t) => { diff --git a/e2e/infrastructure/UnresolvedMapping.spec.ts b/e2e/infrastructure/UnresolvedMapping.spec.ts index 5a9f4bd9b2..f4c06cbb13 100644 --- a/e2e/infrastructure/UnresolvedMapping.spec.ts +++ b/e2e/infrastructure/UnresolvedMapping.spec.ts @@ -14,7 +14,6 @@ * limitations under the License. */ import { expect } from 'chai'; -import { Convert } from '../../src/core/format'; import { Account } from '../../src/model/account'; import { PlainMessage } from '../../src/model/message/PlainMessage'; import { MosaicFlags, MosaicId, MosaicNonce } from '../../src/model/mosaic'; @@ -165,7 +164,7 @@ describe('Unresolved Mapping', () => { UInt64.fromUint(5), namespaceIdMosaic, 10, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), networkType, helper.maxFee, ); diff --git a/e2e/service/AccountService.spec.ts b/e2e/service/AccountService.spec.ts index 658b826cfb..5a902000a7 100644 --- a/e2e/service/AccountService.spec.ts +++ b/e2e/service/AccountService.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { Account } from '../../src/model/account/Account'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; import { NetworkType } from '../../src/model/network/NetworkType'; @@ -73,7 +74,7 @@ describe('AccountService', () => { */ describe('call accountInfoWithResolvedMosaic', () => { it('accountInfoWithResolvedMosaic', async () => { - const info = await accountService.accountInfoWithResolvedMosaic([account.address]).toPromise(); + const info = await firstValueFrom(accountService.accountInfoWithResolvedMosaic([account.address])); expect(info).to.not.be.undefined; expect(info[0].resolvedMosaics).to.not.be.undefined; expect(info[0].resolvedMosaics?.length).to.be.greaterThan(0); @@ -82,7 +83,7 @@ describe('AccountService', () => { describe('call accountNamespacesWithName', () => { it('accountNamespacesWithName', async () => { - const info = await accountService.accountNamespacesWithName(account.address).toPromise(); + const info = await firstValueFrom(accountService.accountNamespacesWithName(account.address)); expect(info).to.not.be.undefined; expect(info.find((i) => i.id.equals(namespaceId))).to.not.be.undefined; expect(info.find((i) => i.id.equals(namespaceId))?.namespaceName).to.be.equal(name); diff --git a/e2e/service/BlockService.spec.ts b/e2e/service/BlockService.spec.ts index 18e5faaf0e..1c7c34557b 100644 --- a/e2e/service/BlockService.spec.ts +++ b/e2e/service/BlockService.spec.ts @@ -15,6 +15,7 @@ */ import { assert, expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { BlockRepository } from '../../src/infrastructure/BlockRepository'; import { ReceiptRepository } from '../../src/infrastructure/ReceiptRepository'; import { TransactionGroup } from '../../src/infrastructure/TransactionGroup'; @@ -89,10 +90,12 @@ describe('BlockService', () => { describe('Validate transactions', () => { it('call block service', async () => { - const transaction = await transactionRepository.getTransaction(transactionHash, TransactionGroup.Confirmed).toPromise(); + const transaction = await firstValueFrom(transactionRepository.getTransaction(transactionHash, TransactionGroup.Confirmed)); const transactionInfo = transaction.transactionInfo; if (transactionInfo && transactionInfo.height !== undefined) { - const validationResult = await blockService.validateTransactionInBlock(transactionHash, transactionInfo.height).toPromise(); + const validationResult = await firstValueFrom( + blockService.validateTransactionInBlock(transactionHash, transactionInfo.height), + ); expect(validationResult).to.be.true; } else { assert(false, `Transaction (hash: ${transactionHash}) not found`); @@ -102,17 +105,19 @@ describe('BlockService', () => { describe('Validate receipt', () => { it('call block service', async () => { - const statements = await receiptRepository.searchReceipts({ height: UInt64.fromUint(1) }).toPromise(); + const statements = await firstValueFrom(receiptRepository.searchReceipts({ height: UInt64.fromUint(1) })); const statement = statements.data[0] as TransactionStatement; - const validationResult = await blockService.validateStatementInBlock(statement.generateHash(), UInt64.fromUint(1)).toPromise(); + const validationResult = await firstValueFrom( + blockService.validateStatementInBlock(statement.generateHash(), UInt64.fromUint(1)), + ); expect(validationResult).to.be.true; }); }); describe('Calculate merkler transaction root hash', () => { it('Calculate merkler transaction root hash', async () => { - const calculated = await blockService.calculateTransactionsMerkleRootHash(UInt64.fromUint(1)).toPromise(); - const block = await blockRepository.getBlockByHeight(UInt64.fromUint(1)).toPromise(); + const calculated = await firstValueFrom(blockService.calculateTransactionsMerkleRootHash(UInt64.fromUint(1))); + const block = await firstValueFrom(blockRepository.getBlockByHeight(UInt64.fromUint(1))); const rootHash = block.blockTransactionsHash; expect(rootHash).to.be.equal(calculated); }); diff --git a/e2e/service/CurrencyService.spec.ts b/e2e/service/CurrencyService.spec.ts index d412dafd91..e0c26a06e3 100644 --- a/e2e/service/CurrencyService.spec.ts +++ b/e2e/service/CurrencyService.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { Currency, MosaicFlags, MosaicId, MosaicNonce } from '../../src/model/mosaic'; import { Deadline } from '../../src/model/transaction/Deadline'; import { MosaicDefinitionTransaction } from '../../src/model/transaction/MosaicDefinitionTransaction'; @@ -37,7 +38,7 @@ describe('CurrencyService', () => { describe('Load network currencies', () => { it('Load symbol network currencies', async () => { const networkCurrencyService = new CurrencyService(helper.repositoryFactory); - const currencies = await networkCurrencyService.getNetworkCurrencies().toPromise(); + const currencies = await firstValueFrom(networkCurrencyService.getNetworkCurrencies()); expect(currencies.currency.unresolvedMosaicId).to.be.deep.eq(currencies.currency.mosaicId); expect(currencies.currency.namespaceId).to.be.deep.eq(NetworkCurrencyLocal.namespaceId); expect(currencies.currency.unresolvedMosaicId).to.be.deep.eq(NetworkCurrencyLocal.unresolvedMosaicId); @@ -65,7 +66,7 @@ describe('CurrencyService', () => { await helper.announce(mosaicDefinitionTransaction.signWith(account, helper.generationHash)); await IntegrationTestHelper.sleep(100); - const currencies = await networkCurrencyService.getCurrencies([mosaicId]).toPromise(); + const currencies = await firstValueFrom(networkCurrencyService.getCurrencies([mosaicId])); expect(currencies.length).eq(1); expect(currencies[0]).to.deep.eq({ unresolvedMosaicId: mosaicId, diff --git a/e2e/service/MetadataTransactionService.spec.ts b/e2e/service/MetadataTransactionService.spec.ts index 6f223b8822..3e48814c45 100644 --- a/e2e/service/MetadataTransactionService.spec.ts +++ b/e2e/service/MetadataTransactionService.spec.ts @@ -1,4 +1,5 @@ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { Convert } from '../../src/core/format'; import { MetadataRepository } from '../../src/infrastructure/MetadataRepository'; import { Account } from '../../src/model/account/Account'; @@ -94,7 +95,7 @@ describe('MetadataTransactionService', () => { key, mosaicId, newValue.length, - newValue, + Convert.utf8ToUint8(newValue), networkType, helper.maxFee, ); @@ -120,7 +121,7 @@ describe('MetadataTransactionService', () => { key, namespaceId, newValue.length, - newValue, + Convert.utf8ToUint8(newValue), networkType, ); @@ -146,8 +147,8 @@ describe('MetadataTransactionService', () => { const metaDataService = new MetadataTransactionService(metadataRepository); const deadline = Deadline.create(helper.epochAdjustment); - const transaction = await metaDataService - .createAccountMetadataTransaction( + const transaction = await firstValueFrom( + metaDataService.createAccountMetadataTransaction( deadline, networkType, targetAccount.address, @@ -155,8 +156,8 @@ describe('MetadataTransactionService', () => { newValue, targetAccount.address, helper.maxFee, - ) - .toPromise(); + ), + ); expect(transaction.type).to.be.equal(TransactionType.ACCOUNT_METADATA); expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex()); @@ -168,8 +169,8 @@ describe('MetadataTransactionService', () => { const metaDataService = new MetadataTransactionService(metadataRepository); const updateValue = newValue + 'delta'; const deadline = Deadline.create(helper.epochAdjustment); - const transaction = await metaDataService - .createMosaicMetadataTransaction( + const transaction = await firstValueFrom( + metaDataService.createMosaicMetadataTransaction( deadline, networkType, targetAccount.address, @@ -178,8 +179,8 @@ describe('MetadataTransactionService', () => { updateValue, targetAccount.address, helper.maxFee, - ) - .toPromise(); + ), + ); expect(transaction.type).to.be.equal(TransactionType.MOSAIC_METADATA); expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex()); expect(transaction.valueSizeDelta).to.be.equal(5); @@ -196,8 +197,8 @@ describe('MetadataTransactionService', () => { const deadline = Deadline.create(helper.epochAdjustment); const updateValue = newValue + 'delta'; - const transaction = await metaDataService - .createNamespaceMetadataTransaction( + const transaction = await firstValueFrom( + metaDataService.createNamespaceMetadataTransaction( deadline, networkType, targetAccount.address, @@ -206,8 +207,8 @@ describe('MetadataTransactionService', () => { updateValue, targetAccount.address, helper.maxFee, - ) - .toPromise(); + ), + ); expect(transaction.type).to.be.equal(TransactionType.NAMESPACE_METADATA); expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex()); @@ -224,8 +225,8 @@ describe('MetadataTransactionService', () => { it('should create MosaicMetadataTransaction and announce', async () => { const deadline = Deadline.create(helper.epochAdjustment); const metaDataService = new MetadataTransactionService(metadataRepository); - const transaction = await metaDataService - .createMosaicMetadataTransaction( + const transaction = await firstValueFrom( + metaDataService.createMosaicMetadataTransaction( deadline, networkType, targetAccount.address, @@ -234,8 +235,8 @@ describe('MetadataTransactionService', () => { newValue + 'delta', targetAccount.address, helper.maxFee, - ) - .toPromise(); + ), + ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(helper.epochAdjustment), [transaction.toAggregate(targetAccount.publicAccount)], @@ -253,8 +254,8 @@ describe('MetadataTransactionService', () => { await new Promise((resolve) => setTimeout(resolve, 3000)); const deadline = Deadline.create(helper.epochAdjustment); const metaDataService = new MetadataTransactionService(metadataRepository); - const transaction = await metaDataService - .createMosaicMetadataTransaction( + const transaction = await firstValueFrom( + metaDataService.createMosaicMetadataTransaction( deadline, networkType, targetAccount.address, @@ -263,8 +264,8 @@ describe('MetadataTransactionService', () => { newValue + 'delta' + 'extra delta', targetAccount.address, helper.maxFee, - ) - .toPromise(); + ), + ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(helper.epochAdjustment), [transaction.toAggregate(targetAccount.publicAccount)], @@ -282,8 +283,8 @@ describe('MetadataTransactionService', () => { await new Promise((resolve) => setTimeout(resolve, 3000)); const deadline = Deadline.create(helper.epochAdjustment); const metaDataService = new MetadataTransactionService(metadataRepository); - const transaction = await metaDataService - .createMosaicMetadataTransaction( + const transaction = await firstValueFrom( + metaDataService.createMosaicMetadataTransaction( deadline, networkType, targetAccount.address, @@ -292,8 +293,8 @@ describe('MetadataTransactionService', () => { newValue, targetAccount.address, helper.maxFee, - ) - .toPromise(); + ), + ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(helper.epochAdjustment), [transaction.toAggregate(targetAccount.publicAccount)], diff --git a/e2e/service/MosaicRestrictionTransactionService.spec.ts b/e2e/service/MosaicRestrictionTransactionService.spec.ts index d8da4aafb1..650fe5dcc7 100644 --- a/e2e/service/MosaicRestrictionTransactionService.spec.ts +++ b/e2e/service/MosaicRestrictionTransactionService.spec.ts @@ -1,4 +1,5 @@ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { KeyGenerator } from '../../src/core/format'; import { NamespaceRepository, RestrictionMosaicRepository } from '../../src/infrastructure'; import { UInt64 } from '../../src/model'; @@ -191,8 +192,8 @@ describe('MosaicRestrictionTransactionService', () => { const service = new MosaicRestrictionTransactionService(restrictionRepository, namespaceRepository); const deadline = Deadline.create(helper.epochAdjustment); - return service - .createMosaicGlobalRestrictionTransaction( + return firstValueFrom( + service.createMosaicGlobalRestrictionTransaction( deadline, networkType, mosaicId, @@ -201,16 +202,15 @@ describe('MosaicRestrictionTransactionService', () => { MosaicRestrictionType.GE, undefined, helper.maxFee, - ) - .toPromise() - .then((transaction: MosaicGlobalRestrictionTransaction) => { - expect(transaction.type).to.be.equal(TransactionType.MOSAIC_GLOBAL_RESTRICTION); - expect(transaction.previousRestrictionValue.toString()).to.be.equal('0'); - expect(transaction.previousRestrictionType).to.be.equal(MosaicRestrictionType.GE); - expect(transaction.newRestrictionValue.toString()).to.be.equal('1'); - expect(transaction.newRestrictionType).to.be.equal(MosaicRestrictionType.GE); - expect(transaction.restrictionKey.toHex()).to.be.equal(key.toHex()); - }); + ), + ).then((transaction: MosaicGlobalRestrictionTransaction) => { + expect(transaction.type).to.be.equal(TransactionType.MOSAIC_GLOBAL_RESTRICTION); + expect(transaction.previousRestrictionValue.toString()).to.be.equal('0'); + expect(transaction.previousRestrictionType).to.be.equal(MosaicRestrictionType.GE); + expect(transaction.newRestrictionValue.toString()).to.be.equal('1'); + expect(transaction.newRestrictionType).to.be.equal(MosaicRestrictionType.GE); + expect(transaction.restrictionKey.toHex()).to.be.equal(key.toHex()); + }); }); }); @@ -219,8 +219,8 @@ describe('MosaicRestrictionTransactionService', () => { await new Promise((resolve) => setTimeout(resolve, 3000)); const deadline = Deadline.create(helper.epochAdjustment); const service = new MosaicRestrictionTransactionService(restrictionRepository, namespaceRepository); - const transaction = (await service - .createMosaicGlobalRestrictionTransaction( + const transaction = (await firstValueFrom( + service.createMosaicGlobalRestrictionTransaction( deadline, networkType, namespaceIdMosaic, @@ -229,8 +229,8 @@ describe('MosaicRestrictionTransactionService', () => { MosaicRestrictionType.GE, undefined, helper.maxFee, - ) - .toPromise()) as MosaicGlobalRestrictionTransaction; + ), + )) as MosaicGlobalRestrictionTransaction; expect(transaction.type).to.be.equal(TransactionType.MOSAIC_GLOBAL_RESTRICTION); expect(transaction.previousRestrictionValue.toString()).to.be.equal('0'); expect(transaction.previousRestrictionType).to.be.equal(MosaicRestrictionType.GE); diff --git a/e2e/service/MosaicService.spec.ts b/e2e/service/MosaicService.spec.ts index 549632beaf..7bdff3f2c1 100644 --- a/e2e/service/MosaicService.spec.ts +++ b/e2e/service/MosaicService.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { firstValueFrom } from 'rxjs'; import { AccountRepository, MosaicRepository } from '../../src/infrastructure'; import { Address } from '../../src/model/account'; import { MosaicService } from '../../src/service'; @@ -39,13 +40,10 @@ describe('MosaicService', () => { it('should return the mosaic list skipping the expired mosaics', () => { const mosaicService = new MosaicService(accountRepository, mosaicRepository); - return mosaicService - .mosaicsAmountViewFromAddress(accountAddress) - .toPromise() - .then((amountViews) => { - return amountViews.map((v) => { - return { mosaicId: v.fullName(), amount: v.relativeAmount() }; - }); + return firstValueFrom(mosaicService.mosaicsAmountViewFromAddress(accountAddress)).then((amountViews) => { + return amountViews.map((v) => { + return { mosaicId: v.fullName(), amount: v.relativeAmount() }; }); + }); }); }); diff --git a/e2e/service/StateProofService.spec.ts b/e2e/service/StateProofService.spec.ts index aa23ff87cc..2c23749745 100644 --- a/e2e/service/StateProofService.spec.ts +++ b/e2e/service/StateProofService.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { Observable } from 'rxjs'; +import { firstValueFrom, Observable } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { Order, RepositoryFactoryHttp, SearchCriteria, SearcherRepository } from '../../src/infrastructure'; import { NamespaceRegistrationType } from '../../src/model/namespace'; @@ -39,12 +39,12 @@ async function test( criteria: C = { order, pageSize: stateCounts } as C, ): Promise { const streamer = repository.streamer(); - const infos = await streamer.search(criteria).pipe(take(stateCounts), toArray()).toPromise(); + const infos = await firstValueFrom(streamer.search(criteria).pipe(take(stateCounts), toArray())); const promises = infos.map(async (info) => { const idText = getId(info); const stateUrl = `${url}/${path}/${idText}`; try { - const merkle = await merkleMethod(info).toPromise(); + const merkle = await firstValueFrom(merkleMethod(info)); expect(merkle).to.not.undefined; if (merkle.valid) console.log(stateUrl + ' ' + merkle.valid + ' ' + merkle.stateHash); else { diff --git a/e2e/service/TransactionPaginationStreamer.spec.ts b/e2e/service/TransactionPaginationStreamer.spec.ts index 6fda4ebea3..f2bbc9b792 100644 --- a/e2e/service/TransactionPaginationStreamer.spec.ts +++ b/e2e/service/TransactionPaginationStreamer.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { firstValueFrom } from 'rxjs'; import { map, mergeMap, toArray } from 'rxjs/operators'; import { TransactionPaginationStreamer } from '../../src/infrastructure/paginationStreamer/TransactionPaginationStreamer'; import { RepositoryFactory } from '../../src/infrastructure/RepositoryFactory'; @@ -65,7 +66,7 @@ describe('TransactionPaginationStreamer', () => { ); }), ); - return observableOfResults.pipe(toArray()).toPromise(); + return firstValueFrom(observableOfResults.pipe(toArray())); }; describe('Get Transactions', () => { diff --git a/e2e/service/TransactionService.spec.ts b/e2e/service/TransactionService.spec.ts index 74d99d3e90..a0c1edea73 100644 --- a/e2e/service/TransactionService.spec.ts +++ b/e2e/service/TransactionService.spec.ts @@ -15,7 +15,7 @@ */ import { assert, expect } from 'chai'; -import { Convert } from '../../src/core/format'; +import { firstValueFrom } from 'rxjs'; import { TransactionRepository } from '../../src/infrastructure/TransactionRepository'; import { Account, Address } from '../../src/model/account'; import { PlainMessage } from '../../src/model/message/PlainMessage'; @@ -135,7 +135,7 @@ describe('TransactionService', () => { UInt64.fromUint(5), mosaicAlias, 10, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), networkType, helper.maxFee, ); @@ -375,48 +375,42 @@ describe('TransactionService', () => { describe('should return resolved transaction', () => { it('call transaction service', () => { - return transactionService - .resolveAliases(transactionHashes) - .toPromise() - .then((transactions) => { - expect(transactions.length).to.be.equal(8); - transactions.map((tx) => { - if (tx instanceof TransferTransaction) { - expect((tx.recipientAddress as Address).plain()).to.be.equal(account.address.plain()); - expect(tx.mosaics.find((m) => m.id.toHex() === mosaicId.toHex())).not.to.equal(undefined); - } else if (tx instanceof AggregateTransaction) { - expect(tx.innerTransactions.length).to.be.equal(6); - // Assert Transfer - expect(((tx.innerTransactions[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - account.address.plain(), - ); - expect( - (tx.innerTransactions[0] as TransferTransaction).mosaics.find((m) => m.id.toHex() === mosaicId.toHex()), - ).not.to.equal(undefined); - // Assert MosaicMeta - expect((tx.innerTransactions[4] as MosaicMetadataTransaction).targetMosaicId.toHex() === newMosaicId.toHex()).to - .be.true; - } - return tx; - }); + return firstValueFrom(transactionService.resolveAliases(transactionHashes)).then((transactions) => { + expect(transactions.length).to.be.equal(8); + transactions.map((tx) => { + if (tx instanceof TransferTransaction) { + expect((tx.recipientAddress as Address).plain()).to.be.equal(account.address.plain()); + expect(tx.mosaics.find((m) => m.id.toHex() === mosaicId.toHex())).not.to.equal(undefined); + } else if (tx instanceof AggregateTransaction) { + expect(tx.innerTransactions.length).to.be.equal(6); + // Assert Transfer + expect(((tx.innerTransactions[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( + account.address.plain(), + ); + expect( + (tx.innerTransactions[0] as TransferTransaction).mosaics.find((m) => m.id.toHex() === mosaicId.toHex()), + ).not.to.equal(undefined); + // Assert MosaicMeta + expect((tx.innerTransactions[4] as MosaicMetadataTransaction).targetMosaicId.toHex() === newMosaicId.toHex()).to.be + .true; + } + return tx; }); + }); }); }); describe('Test resolve alias with multiple transaction in single block', () => { it('call transaction service', () => { - return transactionService - .resolveAliases(transactionHashesMultiple) - .toPromise() - .then((tx) => { - expect(tx.length).to.be.equal(3); - expect((tx[0] as TransferTransaction).mosaics[0].id.toHex()).to.be.equal(mosaicId.toHex()); - expect((tx[1] as TransferTransaction).mosaics[0].id.toHex()).to.be.equal(mosaicId.toHex()); - expect( - ((tx[2] as AggregateTransaction).innerTransactions[4] as MosaicMetadataTransaction).targetMosaicId.toHex(), - ).to.be.equal(newMosaicId.toHex()); - return tx; - }); + return firstValueFrom(transactionService.resolveAliases(transactionHashesMultiple)).then((tx) => { + expect(tx.length).to.be.equal(3); + expect((tx[0] as TransferTransaction).mosaics[0].id.toHex()).to.be.equal(mosaicId.toHex()); + expect((tx[1] as TransferTransaction).mosaics[0].id.toHex()).to.be.equal(mosaicId.toHex()); + expect( + ((tx[2] as AggregateTransaction).innerTransactions[4] as MosaicMetadataTransaction).targetMosaicId.toHex(), + ).to.be.equal(newMosaicId.toHex()); + return tx; + }); }); }); }); diff --git a/e2e/service/TransactionService_AggregateBonded.spec.ts b/e2e/service/TransactionService_AggregateBonded.spec.ts index 58adec9047..fae3c92ce9 100644 --- a/e2e/service/TransactionService_AggregateBonded.spec.ts +++ b/e2e/service/TransactionService_AggregateBonded.spec.ts @@ -16,6 +16,7 @@ import { ChronoUnit } from '@js-joda/core'; import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { Account, Address } from '../../src/model/account'; import { PlainMessage } from '../../src/model/message/PlainMessage'; import { NetworkType } from '../../src/model/network/NetworkType'; @@ -130,14 +131,11 @@ describe('TransactionService - AggregateBonded', () => { helper.maxFee, ); const signedTransaction = transferTransaction.signWith(account, generationHash); - return transactionService - .announce(signedTransaction, helper.listener) - .toPromise() - .then((tx: TransferTransaction) => { - expect(tx.signer!.publicKey).to.be.equal(account.publicKey); - expect((tx.recipientAddress as Address).equals(account2.address)).to.be.true; - expect(tx.message.payload).to.be.equal('test-message'); - }); + return firstValueFrom(transactionService.announce(signedTransaction, helper.listener)).then((tx: TransferTransaction) => { + expect(tx.signer!.publicKey).to.be.equal(account.publicKey); + expect((tx.recipientAddress as Address).equals(account2.address)).to.be.true; + expect(tx.message.payload).to.be.equal('test-message'); + }); }); }); @@ -153,9 +151,13 @@ describe('TransactionService - AggregateBonded', () => { helper.maxFee, ); const signedLockFundsTransaction = lockFundsTransaction.signWith(account, generationHash); - const tx = await transactionService - .announceHashLockAggregateBonded(signedLockFundsTransaction, signedAggregatedTransaction, helper.listener) - .toPromise(); + const tx = await firstValueFrom( + transactionService.announceHashLockAggregateBonded( + signedLockFundsTransaction, + signedAggregatedTransaction, + helper.listener, + ), + ); expect(tx.signer!.publicKey).to.be.equal(account.publicKey); expect(tx.type).to.be.equal(TransactionType.AGGREGATE_BONDED); }); @@ -173,11 +175,11 @@ describe('TransactionService - AggregateBonded', () => { helper.maxFee, ); const signedLockFundsTransaction = lockFundsTransaction.signWith(account, generationHash); - const signedLockFundsTransactionResponse = await transactionService - .announce(signedLockFundsTransaction, helper.listener) - .toPromise(); + const signedLockFundsTransactionResponse = await firstValueFrom( + transactionService.announce(signedLockFundsTransaction, helper.listener), + ); expect(signedLockFundsTransactionResponse.transactionInfo!.hash).to.be.equal(signedLockFundsTransaction.hash); - const tx = await transactionService.announceAggregateBonded(signedAggregatedTransaction, helper.listener).toPromise(); + const tx = await firstValueFrom(transactionService.announceAggregateBonded(signedAggregatedTransaction, helper.listener)); expect(tx.signer!.publicKey).to.be.equal(account.publicKey); expect(tx.type).to.be.equal(TransactionType.AGGREGATE_BONDED); }); diff --git a/package-lock.json b/package-lock.json index f24c196ec1..78ae33aa79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "symbol-sdk", - "version": "1.0.4", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "symbol-sdk", - "version": "1.0.3", + "version": "2.0.0", "license": "Apache-2.0", "dependencies": { "@js-joda/core": "^3.2.0", @@ -20,8 +20,7 @@ "merkletreejs": "^0.2.9", "node-fetch": "^2.6.0", "ripemd160": "^2.0.2", - "rxjs": "^6.6.7", - "rxjs-compat": "^6.6.3", + "rxjs": "^7.4.0", "symbol-openapi-typescript-fetch-client": "^1.0.3", "tweetnacl": "^1.0.3", "utf8": "^2.1.2", @@ -31,20 +30,20 @@ "@types/chai": "^4.2.12", "@types/lodash": "^4.14.161", "@types/long": "^4.0.1", - "@types/mocha": "^2.2.48", + "@types/mocha": "^9.0.0", "@types/ripemd160": "^2.0.0", "@types/utf8": "^2.1.6", "@types/ws": "^3.2.1", - "@typescript-eslint/eslint-plugin": "^2.34.0", - "@typescript-eslint/parser": "^2.34.0", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "assert": "^1.5.0", "chai": "^4.2.0", "coveralls": "^3.1.0", "create-ts-index": "^1.13.6", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.12.0", - "eslint-plugin-prettier": "^3.1.4", - "mocha": "^8.1.3", + "eslint": "^8.0.1", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "mocha": "^9.1.3", "node-forge": ">=0.10.0", "nyc": "^15.1.0", "pre-commit": "^1.2.2", @@ -55,9 +54,12 @@ "symbol-bootstrap": "^1.0.9", "ts-mockito": "^2.6.1", "ts-node": "^8.10.2", - "typedoc": "^0.20.36", - "typescript": "^3.9.7", + "typedoc": "^0.22.10", + "typescript": "^4.5.4", "typescript-require": "^0.2.10" + }, + "engines": { + "node": ">=12.22.1" } }, "../symbol-openapi-generator/build/symbol-openapi-typescript-fetch-client": { @@ -315,6 +317,108 @@ "kuler": "^2.0.0" } }, + "node_modules/@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -886,22 +990,10 @@ "integrity": "sha512-aN5IAC8QNtSUdQzxu7lGBgYAOuU1tmRU4c9dIq5OKGf/SBVjXo+ffM2wEjudAWbgpOhy60nLoAGH1xm8fpCKFQ==", "dev": true }, - "node_modules/@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "node_modules/@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, "node_modules/@types/json-schema": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", - "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "node_modules/@types/lodash": { @@ -917,9 +1009,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "2.2.48", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", - "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", "dev": true }, "node_modules/@types/node": { @@ -953,85 +1045,228 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz", - "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz", + "integrity": "sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "2.34.0", + "@typescript-eslint/experimental-utils": "5.7.0", + "@typescript-eslint/scope-manager": "5.7.0", + "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "tsutils": "^3.17.1" + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", - "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "ms": "2.1.2" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", + "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=6" + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.7.0.tgz", + "integrity": "sha512-u57eZ5FbEpzN5kSjmVrSesovWslH2ZyNPnaXQMXWgH57d5+EVHEt76W75vVuI9qKZ5BMDKNfRN+pxcPEjQjb2A==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" } }, "node_modules/@typescript-eslint/parser": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz", - "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.7.0.tgz", + "integrity": "sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", + "debug": "^4.3.2" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz", + "integrity": "sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA==", "dev": true, "dependencies": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.34.0", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-visitor-keys": "^1.1.0" + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.7.0.tgz", + "integrity": "sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA==", + "dev": true, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz", + "integrity": "sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" }, @@ -1039,6 +1274,23 @@ "node": ">=10" } }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz", + "integrity": "sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.7.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -1046,9 +1298,9 @@ "dev": true }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1152,6 +1404,19 @@ "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", "dev": true }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", @@ -1228,15 +1493,6 @@ "node": "*" } }, - "node_modules/astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -1294,6 +1550,15 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -1310,6 +1575,18 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1430,6 +1707,27 @@ "node": "*" } }, + "node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -1785,12 +2083,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -1844,31 +2136,196 @@ } }, "node_modules/create-ts-index": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/create-ts-index/-/create-ts-index-1.13.6.tgz", - "integrity": "sha512-vBcuficF62laj/wZv01D4YBz1TXTtEM8hsUq7J1k1uyPUHYq3YTWTVQlmlp+Y311KdM6HhPQeC2aHktvQR8u3w==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/create-ts-index/-/create-ts-index-1.13.7.tgz", + "integrity": "sha512-a1Wo99YXhpejXCu3L6FlB8VvUgNeGGMqDv0N6apMbMLH5E6Fdy4HJxHoX2dW+co0S1Z8r+BCUkLAbWfyMEdcUw==", "dev": true, "dependencies": { - "chalk": "^2.4.1", - "commander": "^2.19.0", - "dayjs": "^1.8.14", - "debug": "^4.1.1", + "chalk": "^4.1.2", + "dayjs": "^1.10.7", + "debug": "^4.3.3", "deepmerge": "^4.2.2", - "fast-glob": "^3.2.2", - "glob": "^7.1.3", - "json5": "^2.1.3", - "merge": "^1.2.1", + "fast-glob": "^3.2.7", + "fp-ts": "^2.11.5", + "glob": "^7.2.0", + "json5": "^2.2.0", + "merge": "^2.1.1", "minimatch": "^3.0.4", - "my-easy-fp": "^0.5.1", - "tslib": "^1.10.0", - "yargs": "^15.3.1" + "my-easy-fp": "^0.9.0", + "tslib": "^2.3.1", + "yargs": "^17.3.0" }, "bin": { "cti": "dist/cti.js" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", + "node_modules/create-ts-index/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/create-ts-index/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-ts-index/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/create-ts-index/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-ts-index/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/create-ts-index/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-ts-index/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-ts-index/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-ts-index/node_modules/tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "dev": true + }, + "node_modules/create-ts-index/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/create-ts-index/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/create-ts-index/node_modules/yargs": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.0.tgz", + "integrity": "sha512-GQl1pWyDoGptFPJx9b9L6kmR33TGusZvXIZUT+BOz9f7X2L94oeAskFYLEg/FkhV06zZPBYLvLZRWeYId29lew==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/create-ts-index/node_modules/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, @@ -1920,9 +2377,9 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -2066,6 +2523,18 @@ "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", "dev": true }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -2097,46 +2566,47 @@ } }, "node_modules/eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.2.0", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -2144,43 +2614,52 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-prettier": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", - "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", "dev": true, - "dependencies": { - "get-stdin": "^6.0.0" - }, "bin": { - "eslint-config-prettier-check": "bin/cli.js" + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" } }, "node_modules/eslint-plugin-prettier": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", - "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0" }, "engines": { "node": ">=6.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "engines": { @@ -2188,164 +2667,214 @@ } }, "node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=6" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" } }, - "node_modules/eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "node_modules/eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", "dev": true, "engines": { - "node": ">=6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4.8" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/eslint/node_modules/cross-spawn/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, - "node_modules/eslint/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=6.0" + "node": ">=10" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/eslint/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint/node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { - "node": ">=6.5.0" + "node": ">=4.0" } }, - "node_modules/eslint/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "node_modules/eslint/node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "dependencies": { - "shebang-regex": "^1.0.0" + "type-fest": "^0.20.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", + "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", "dev": true, "dependencies": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^8.6.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" }, "engines": { - "node": ">=6.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/esprima": { @@ -2395,9 +2924,9 @@ } }, "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" @@ -2472,80 +3001,21 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "engines": { "node": ">=8" } }, - "node_modules/fast-glob/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/fast-glob/node_modules/micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -2601,15 +3071,27 @@ } }, "node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { - "flat-cache": "^2.0.1" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=4" + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/find-cache-dir": { @@ -2636,35 +3118,22 @@ } }, "node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", "dev": true }, "node_modules/fn.name": { @@ -2709,6 +3178,12 @@ "node": ">= 0.12" } }, + "node_modules/fp-ts": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.11.5.tgz", + "integrity": "sha512-OqlwJq1BdpB83BZXTqI+dNcA6uYk6qk4u9Cgnt64Y+XS7dwdbp/mobx8S2KXf2AXH+scNmA/UVK3SEFHR3vHZA==", + "dev": true + }, "node_modules/fromentries": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", @@ -2751,6 +3226,20 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -2807,15 +3296,6 @@ "node": ">=8.0.0" } }, - "node_modules/get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -2867,9 +3347,9 @@ } }, "node_modules/globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "dependencies": { "array-union": "^2.1.0", @@ -2881,6 +3361,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globby/node_modules/ignore": { @@ -3199,6 +3682,18 @@ "node": ">=8" } }, + "node_modules/inquirer/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, "node_modules/inquirer/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3231,7 +3726,19 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/is-core-module": { @@ -3264,15 +3771,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3285,6 +3783,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -3315,6 +3822,18 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -3532,9 +4051,9 @@ } }, "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, "node_modules/json-schema-traverse": { @@ -3556,9 +4075,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "dev": true, "dependencies": { "minimist": "^1.2.5" @@ -3570,6 +4089,12 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, "node_modules/jsonfile": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", @@ -3581,18 +4106,18 @@ } }, "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, - "engines": [ - "node >=0.6.0" - ], "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" } }, "node_modules/kuler": { @@ -3611,13 +4136,13 @@ } }, "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -3653,6 +4178,12 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/lodash.template": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", @@ -3682,34 +4213,40 @@ } }, "node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -3717,6 +4254,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/log-symbols/node_modules/color-convert": { @@ -3813,15 +4353,15 @@ "dev": true }, "node_modules/marked": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.5.tgz", - "integrity": "sha512-yfCEUXmKhBPLOzEC7c+tc4XZdIeTdGoRCZakFMkCxodr7wDXqoapIME4wjcpBPJLNyUnKJ3e8rb8wlAgnLnaDw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", + "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", "dev": true, "bin": { "marked": "bin/marked" }, "engines": { - "node": ">= 8.16.2" + "node": ">= 12" } }, "node_modules/memorystream": { @@ -3834,9 +4374,9 @@ } }, "node_modules/merge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", - "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz", + "integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==", "dev": true }, "node_modules/merge2": { @@ -3881,6 +4421,19 @@ "node": ">=4" } }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -3929,46 +4482,33 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.1.5", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -3978,7 +4518,7 @@ "mocha": "bin/mocha" }, "engines": { - "node": ">= 10.12.0" + "node": ">= 12.0.0" }, "funding": { "type": "opencollective", @@ -4000,67 +4540,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/mocha/node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/mocha/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/mocha/node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.1" - } - }, "node_modules/mocha/node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -4102,18 +4587,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/mocha/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -4127,24 +4600,10 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/mocha/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -4156,18 +4615,9 @@ }, "engines": { "node": "*" - } - }, - "node_modules/mocha/node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mocha/node_modules/is-fullwidth-code-point": { @@ -4179,19 +4629,10 @@ "node": ">=8" } }, - "node_modules/mocha/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/mocha/node_modules/js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { "argparse": "^2.0.1" @@ -4218,15 +4659,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/mocha/node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/mocha/node_modules/p-limit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", @@ -4260,18 +4692,6 @@ "node": ">=8" } }, - "node_modules/mocha/node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/mocha/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -4301,18 +4721,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/mocha/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/mocha/node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4403,9 +4811,9 @@ "dev": true }, "node_modules/my-easy-fp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/my-easy-fp/-/my-easy-fp-0.5.1.tgz", - "integrity": "sha512-musRCJYBnEDDzod5ugUykOqHoZYudhtC90J536tFrMqXfjpBzb0PRzLkadM2chgNFsCebzm9GtC+qjQ7xKgpGg==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/my-easy-fp/-/my-easy-fp-0.9.0.tgz", + "integrity": "sha512-uqUYAMPNiRBIzmy6vust9I62HnKIdhHdalDS7kMfMoEv9BYVln0G7DCCZFdV/XiwZno6AFeHyQMSPFqgOntArQ==", "dev": true, "dependencies": { "debug": "^4.1.1", @@ -4413,9 +4821,9 @@ } }, "node_modules/nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -4486,6 +4894,15 @@ "node": ">=8" } }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", @@ -4615,42 +5032,18 @@ "node": ">=6" } }, - "node_modules/onigasm": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", - "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", - "dev": true, - "dependencies": { - "lru-cache": "^5.1.1" - } - }, - "node_modules/onigasm/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/onigasm/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" }, "engines": { "node": ">= 0.8.0" @@ -4851,12 +5244,15 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true, "engines": { "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pkg-dir": { @@ -4966,9 +5362,9 @@ "dev": true }, "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "engines": { "node": ">= 0.8.0" @@ -5085,6 +5481,18 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -5264,20 +5672,23 @@ "dev": true }, "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz", + "integrity": "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==", "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" + "tslib": "~2.1.0" } }, "node_modules/rxjs-compat": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.6.3.tgz", - "integrity": "sha512-y+wUqq7bS2dG+7rH2fNMoxsDiJ32RQzFxZQE/JdtpnmEZmwLQrb1tCiItyHxdXJHXjmHnnzFscn3b6PEmORGKw==" + "integrity": "sha512-y+wUqq7bS2dG+7rH2fNMoxsDiJ32RQzFxZQE/JdtpnmEZmwLQrb1tCiItyHxdXJHXjmHnnzFscn3b6PEmORGKw==", + "dev": true + }, + "node_modules/rxjs/node_modules/tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, "node_modules/safe-buffer": { "version": "5.1.1", @@ -5306,9 +5717,9 @@ } }, "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -5359,13 +5770,14 @@ } }, "node_modules/shiki": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.3.tgz", - "integrity": "sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==", + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.15.tgz", + "integrity": "sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==", "dev": true, "dependencies": { - "onigasm": "^2.2.5", - "vscode-textmate": "^5.2.0" + "jsonc-parser": "^3.0.0", + "vscode-oniguruma": "^1.6.1", + "vscode-textmate": "5.2.0" } }, "node_modules/shx": { @@ -5412,21 +5824,7 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/source-map": { @@ -5555,40 +5953,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -5706,6 +6070,18 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/symbol-bootstrap/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, "node_modules/symbol-bootstrap/node_modules/semver": { "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", @@ -5766,68 +6142,24 @@ "integrity": "sha512-r/z3UKG3YCCdsTEHRXGe3IQxA8OaBRBE31e9du2LOaLStGxYCmxUjfRtJ/DyKfgpS55fJPl3w/VFMnsfwIHmkA==", "dev": true }, - "node_modules/symbol-sdk/node_modules/symbol-openapi-typescript-fetch-client": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/symbol-openapi-typescript-fetch-client/-/symbol-openapi-typescript-fetch-client-0.11.2.tgz", - "integrity": "sha512-A1MAN8/UWlaCEibBf6zxkduZwDNSvWwLPp6JB0GeYI/FAOrw/9nLyuS/NJQ3siGAUclnuejH1wG7KdUg0/4RSw==", - "dev": true - }, - "node_modules/table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "node_modules/symbol-sdk/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, "dependencies": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "tslib": "^1.9.0" }, "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/table/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true, - "engines": { - "node": ">=6" + "npm": ">=2.0.0" } }, - "node_modules/table/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "node_modules/symbol-sdk/node_modules/symbol-openapi-typescript-fetch-client": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/symbol-openapi-typescript-fetch-client/-/symbol-openapi-typescript-fetch-client-0.11.2.tgz", + "integrity": "sha512-A1MAN8/UWlaCEibBf6zxkduZwDNSvWwLPp6JB0GeYI/FAOrw/9nLyuS/NJQ3siGAUclnuejH1wG7KdUg0/4RSw==", "dev": true }, - "node_modules/table/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/table/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -5881,6 +6213,18 @@ "node": ">=4" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -5942,18 +6286,22 @@ "node_modules/tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true }, "node_modules/tsutils": { - "version": "3.17.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", - "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "dependencies": { "tslib": "^1.8.1" }, "engines": { "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, "node_modules/tunnel-agent": { @@ -5974,12 +6322,12 @@ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" @@ -6019,43 +6367,31 @@ } }, "node_modules/typedoc": { - "version": "0.20.36", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.36.tgz", - "integrity": "sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==", + "version": "0.22.10", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", + "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", "dev": true, "dependencies": { - "colors": "^1.4.0", - "fs-extra": "^9.1.0", - "handlebars": "^4.7.7", - "lodash": "^4.17.21", + "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^2.0.3", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shelljs": "^0.8.4", - "shiki": "^0.9.3", - "typedoc-default-themes": "^0.12.10" + "marked": "^3.0.8", + "minimatch": "^3.0.4", + "shiki": "^0.9.12" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 10.8.0" - } - }, - "node_modules/typedoc-default-themes": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", - "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", - "dev": true, - "engines": { - "node": ">= 8" + "node": ">= 12.10.0" + }, + "peerDependencies": { + "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" } }, "node_modules/typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6176,10 +6512,16 @@ "extsprintf": "^1.2.0" } }, + "node_modules/vscode-oniguruma": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", + "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", + "dev": true + }, "node_modules/vscode-textmate": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.4.0.tgz", - "integrity": "sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", "dev": true }, "node_modules/which": { @@ -6200,15 +6542,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -6307,9 +6640,9 @@ "dev": true }, "node_modules/workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", "dev": true }, "node_modules/wrap-ansi": { @@ -6379,18 +6712,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "node_modules/write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "dependencies": { - "mkdirp": "^0.5.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", @@ -6797,6 +7118,81 @@ "kuler": "^2.0.0" } }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -7243,22 +7639,10 @@ "integrity": "sha512-aN5IAC8QNtSUdQzxu7lGBgYAOuU1tmRU4c9dIq5OKGf/SBVjXo+ffM2wEjudAWbgpOhy60nLoAGH1xm8fpCKFQ==", "dev": true }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, "@types/json-schema": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", - "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "@types/lodash": { @@ -7274,9 +7658,9 @@ "dev": true }, "@types/mocha": { - "version": "2.2.48", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", - "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", "dev": true }, "@types/node": { @@ -7310,75 +7694,145 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz", - "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz", + "integrity": "sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.34.0", + "@typescript-eslint/experimental-utils": "5.7.0", + "@typescript-eslint/scope-manager": "5.7.0", + "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "tsutils": "^3.17.1" + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ignore": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", + "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "@typescript-eslint/experimental-utils": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", - "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.7.0.tgz", + "integrity": "sha512-u57eZ5FbEpzN5kSjmVrSesovWslH2ZyNPnaXQMXWgH57d5+EVHEt76W75vVuI9qKZ5BMDKNfRN+pxcPEjQjb2A==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.7.0.tgz", + "integrity": "sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g==", "dev": true, "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", + "debug": "^4.3.2" }, "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" + "ms": "2.1.2" } } } }, - "@typescript-eslint/parser": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz", - "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==", + "@typescript-eslint/scope-manager": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz", + "integrity": "sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA==", "dev": true, "requires": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.34.0", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-visitor-keys": "^1.1.0" + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0" } }, + "@typescript-eslint/types": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.7.0.tgz", + "integrity": "sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA==", + "dev": true + }, "@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz", + "integrity": "sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg==", "dev": true, "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } } } }, + "@typescript-eslint/visitor-keys": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz", + "integrity": "sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.7.0", + "eslint-visitor-keys": "^3.0.0" + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -7386,9 +7840,9 @@ "dev": true }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", "dev": true }, "acorn-jsx": { @@ -7464,6 +7918,16 @@ "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", "dev": true }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", @@ -7528,12 +7992,6 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, "async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -7587,6 +8045,12 @@ } } }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -7603,6 +8067,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -7702,6 +8175,22 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -7992,13 +8481,7 @@ "dev": true, "requires": { "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + } }, "commondir": { "version": "1.0.1", @@ -8044,24 +8527,144 @@ } }, "create-ts-index": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/create-ts-index/-/create-ts-index-1.13.6.tgz", - "integrity": "sha512-vBcuficF62laj/wZv01D4YBz1TXTtEM8hsUq7J1k1uyPUHYq3YTWTVQlmlp+Y311KdM6HhPQeC2aHktvQR8u3w==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/create-ts-index/-/create-ts-index-1.13.7.tgz", + "integrity": "sha512-a1Wo99YXhpejXCu3L6FlB8VvUgNeGGMqDv0N6apMbMLH5E6Fdy4HJxHoX2dW+co0S1Z8r+BCUkLAbWfyMEdcUw==", "dev": true, "requires": { - "chalk": "^2.4.1", - "commander": "^2.19.0", - "dayjs": "^1.8.14", - "debug": "^4.1.1", + "chalk": "^4.1.2", + "dayjs": "^1.10.7", + "debug": "^4.3.3", "deepmerge": "^4.2.2", - "fast-glob": "^3.2.2", - "glob": "^7.1.3", - "json5": "^2.1.3", - "merge": "^1.2.1", + "fast-glob": "^3.2.7", + "fp-ts": "^2.11.5", + "glob": "^7.2.0", + "json5": "^2.2.0", + "merge": "^2.1.1", "minimatch": "^3.0.4", - "my-easy-fp": "^0.5.1", - "tslib": "^1.10.0", - "yargs": "^15.3.1" + "my-easy-fp": "^0.9.0", + "tslib": "^2.3.1", + "yargs": "^17.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.0.tgz", + "integrity": "sha512-GQl1pWyDoGptFPJx9b9L6kmR33TGusZvXIZUT+BOz9f7X2L94oeAskFYLEg/FkhV06zZPBYLvLZRWeYId29lew==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", + "dev": true + } } }, "cross-spawn": { @@ -8107,9 +8710,9 @@ "dev": true }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { "ms": "2.1.2" @@ -8219,6 +8822,15 @@ "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", "dev": true }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -8244,191 +8856,218 @@ "dev": true }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.2.0", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "ms": "2.1.2" + "color-name": "~1.1.4" } }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" } }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "argparse": "^2.0.1" } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "has-flag": "^4.0.0" } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true } } }, "eslint-config-prettier": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", - "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", "dev": true, - "requires": { - "get-stdin": "^6.0.0" - } + "requires": {} }, "eslint-plugin-prettier": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", - "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" } }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", "dev": true }, "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", + "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", "dev": true, "requires": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^8.6.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" } }, "esprima": { @@ -8464,9 +9103,9 @@ }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } @@ -8525,62 +9164,16 @@ "dev": true }, "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", "dev": true, "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } + "@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" } }, "fast-json-stable-stringify": { @@ -8632,12 +9225,21 @@ } }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "flat-cache": "^2.0.1" + "to-regex-range": "^5.0.1" } }, "find-cache-dir": { @@ -8658,31 +9260,19 @@ "dev": true }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } + "flatted": "^3.1.0", + "rimraf": "^3.0.2" } }, "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", "dev": true }, "fn.name": { @@ -8718,6 +9308,12 @@ "mime-types": "^2.1.12" } }, + "fp-ts": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.11.5.tgz", + "integrity": "sha512-OqlwJq1BdpB83BZXTqI+dNcA6uYk6qk4u9Cgnt64Y+XS7dwdbp/mobx8S2KXf2AXH+scNmA/UVK3SEFHR3vHZA==", + "dev": true + }, "fromentries": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", @@ -8756,6 +9352,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -8797,12 +9400,6 @@ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -8842,9 +9439,9 @@ "dev": true }, "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -9090,6 +9687,15 @@ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -9118,6 +9724,15 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-core-module": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", @@ -9139,12 +9754,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -9154,6 +9763,12 @@ "is-extglob": "^2.1.1" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -9178,6 +9793,12 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -9356,9 +9977,9 @@ "dev": true }, "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, "json-schema-traverse": { @@ -9380,14 +10001,20 @@ "dev": true }, "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "dev": true, "requires": { "minimist": "^1.2.5" } }, + "jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, "jsonfile": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", @@ -9399,14 +10026,14 @@ } }, "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" } }, @@ -9423,13 +10050,13 @@ "dev": true }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "locate-path": { @@ -9459,6 +10086,12 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.template": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", @@ -9485,28 +10118,28 @@ "dev": true }, "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "dependencies": { "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -9598,9 +10231,9 @@ "dev": true }, "marked": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.5.tgz", - "integrity": "sha512-yfCEUXmKhBPLOzEC7c+tc4XZdIeTdGoRCZakFMkCxodr7wDXqoapIME4wjcpBPJLNyUnKJ3e8rb8wlAgnLnaDw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", + "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", "dev": true }, "memorystream": { @@ -9610,9 +10243,9 @@ "dev": true }, "merge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", - "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz", + "integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==", "dev": true }, "merge2": { @@ -9650,6 +10283,16 @@ } } }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -9686,43 +10329,33 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.1.5", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -9737,53 +10370,12 @@ "color-convert": "^2.0.1" } }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - } - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -9816,15 +10408,6 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -9835,17 +10418,10 @@ "path-exists": "^4.0.0" } }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -9856,31 +10432,16 @@ "path-is-absolute": "^1.0.0" } }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" @@ -9901,12 +10462,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, "p-limit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", @@ -9931,15 +10486,6 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -9960,15 +10506,6 @@ "has-flag": "^4.0.0" } }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -10037,9 +10574,9 @@ "dev": true }, "my-easy-fp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/my-easy-fp/-/my-easy-fp-0.5.1.tgz", - "integrity": "sha512-musRCJYBnEDDzod5ugUykOqHoZYudhtC90J536tFrMqXfjpBzb0PRzLkadM2chgNFsCebzm9GtC+qjQ7xKgpGg==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/my-easy-fp/-/my-easy-fp-0.9.0.tgz", + "integrity": "sha512-uqUYAMPNiRBIzmy6vust9I62HnKIdhHdalDS7kMfMoEv9BYVln0G7DCCZFdV/XiwZno6AFeHyQMSPFqgOntArQ==", "dev": true, "requires": { "debug": "^4.1.1", @@ -10047,9 +10584,9 @@ } }, "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", "dev": true }, "natural-compare": { @@ -10102,6 +10639,12 @@ "process-on-spawn": "^1.0.0" } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", @@ -10209,44 +10752,18 @@ "mimic-fn": "^2.1.0" } }, - "onigasm": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", - "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", - "dev": true, - "requires": { - "lru-cache": "^5.1.1" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, "os-shim": { @@ -10398,9 +10915,9 @@ "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "pkg-dir": { @@ -10495,9 +11012,9 @@ } }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prettier": { @@ -10590,6 +11107,15 @@ "util-deprecate": "~1.0.1" } }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -10737,17 +11263,25 @@ "dev": true }, "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz", + "integrity": "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==", "requires": { - "tslib": "^1.9.0" + "tslib": "~2.1.0" + }, + "dependencies": { + "tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + } } }, "rxjs-compat": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.6.3.tgz", - "integrity": "sha512-y+wUqq7bS2dG+7rH2fNMoxsDiJ32RQzFxZQE/JdtpnmEZmwLQrb1tCiItyHxdXJHXjmHnnzFscn3b6PEmORGKw==" + "integrity": "sha512-y+wUqq7bS2dG+7rH2fNMoxsDiJ32RQzFxZQE/JdtpnmEZmwLQrb1tCiItyHxdXJHXjmHnnzFscn3b6PEmORGKw==", + "dev": true }, "safe-buffer": { "version": "5.1.1", @@ -10773,9 +11307,9 @@ "dev": true }, "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -10814,13 +11348,14 @@ } }, "shiki": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.3.tgz", - "integrity": "sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==", + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.15.tgz", + "integrity": "sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==", "dev": true, "requires": { - "onigasm": "^2.2.5", - "vscode-textmate": "^5.2.0" + "jsonc-parser": "^3.0.0", + "vscode-oniguruma": "^1.6.1", + "vscode-textmate": "5.2.0" } }, "shx": { @@ -10863,17 +11398,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -10979,33 +11503,6 @@ "safe-buffer": "~5.1.0" } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -11097,6 +11594,15 @@ "esprima": "^4.0.0" } }, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "semver": { "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", @@ -11153,6 +11659,15 @@ "integrity": "sha512-r/z3UKG3YCCdsTEHRXGe3IQxA8OaBRBE31e9du2LOaLStGxYCmxUjfRtJ/DyKfgpS55fJPl3w/VFMnsfwIHmkA==", "dev": true }, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "symbol-openapi-typescript-fetch-client": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/symbol-openapi-typescript-fetch-client/-/symbol-openapi-typescript-fetch-client-0.11.2.tgz", @@ -11161,52 +11676,6 @@ } } }, - "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -11251,6 +11720,15 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -11297,12 +11775,13 @@ "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true }, "tsutils": { - "version": "3.17.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", - "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -11323,12 +11802,12 @@ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -11359,34 +11838,22 @@ } }, "typedoc": { - "version": "0.20.36", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.36.tgz", - "integrity": "sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==", + "version": "0.22.10", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", + "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", "dev": true, "requires": { - "colors": "^1.4.0", - "fs-extra": "^9.1.0", - "handlebars": "^4.7.7", - "lodash": "^4.17.21", + "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^2.0.3", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shelljs": "^0.8.4", - "shiki": "^0.9.3", - "typedoc-default-themes": "^0.12.10" + "marked": "^3.0.8", + "minimatch": "^3.0.4", + "shiki": "^0.9.12" } }, - "typedoc-default-themes": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", - "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", - "dev": true - }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true }, "typescript-require": { @@ -11479,10 +11946,16 @@ "extsprintf": "^1.2.0" } }, + "vscode-oniguruma": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", + "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", + "dev": true + }, "vscode-textmate": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.4.0.tgz", - "integrity": "sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", "dev": true }, "which": { @@ -11500,15 +11973,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -11590,9 +12054,9 @@ "dev": true }, "workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", "dev": true }, "wrap-ansi": { @@ -11649,15 +12113,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", diff --git a/package.json b/package.json index ee71f23d5d..d19c6ad937 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "symbol-sdk", - "version": "1.0.4", + "version": "2.0.0", "description": "Reactive symbol sdk for typescript and javascript", "scripts": { "pretest": "npm run build", @@ -60,24 +60,27 @@ "homepage": "https://github.com/nemtech/symbol-sdk-typescript-javascript#readme", "main": "dist/index.js", "typings": "dist/index.d.ts", + "engines": { + "node": ">=12.22.1" + }, "devDependencies": { "@types/chai": "^4.2.12", "@types/lodash": "^4.14.161", "@types/long": "^4.0.1", - "@types/mocha": "^2.2.48", + "@types/mocha": "^9.0.0", "@types/ripemd160": "^2.0.0", "@types/utf8": "^2.1.6", "@types/ws": "^3.2.1", - "@typescript-eslint/eslint-plugin": "^2.34.0", - "@typescript-eslint/parser": "^2.34.0", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "assert": "^1.5.0", "chai": "^4.2.0", "coveralls": "^3.1.0", "create-ts-index": "^1.13.6", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.12.0", - "eslint-plugin-prettier": "^3.1.4", - "mocha": "^8.1.3", + "eslint": "^8.0.1", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "mocha": "^9.1.3", "node-forge": ">=0.10.0", "nyc": "^15.1.0", "pre-commit": "^1.2.2", @@ -88,8 +91,8 @@ "symbol-bootstrap": "^1.0.9", "ts-mockito": "^2.6.1", "ts-node": "^8.10.2", - "typedoc": "^0.20.36", - "typescript": "^3.9.7", + "typedoc": "^0.22.10", + "typescript": "^4.5.4", "typescript-require": "^0.2.10" }, "dependencies": { @@ -104,8 +107,7 @@ "merkletreejs": "^0.2.9", "node-fetch": "^2.6.0", "ripemd160": "^2.0.2", - "rxjs": "^6.6.7", - "rxjs-compat": "^6.6.3", + "rxjs": "^7.4.0", "symbol-openapi-typescript-fetch-client": "^1.0.3", "tweetnacl": "^1.0.3", "utf8": "^2.1.2", diff --git a/src/core/crypto/Utilities.ts b/src/core/crypto/Utilities.ts index 11eab51562..64f95695f3 100644 --- a/src/core/crypto/Utilities.ts +++ b/src/core/crypto/Utilities.ts @@ -15,7 +15,6 @@ */ import * as CryptoJS from 'crypto-js'; -import { WordArray } from 'crypto-js'; import * as hkdf from 'futoin-hkdf'; import { sha512 } from 'js-sha512'; import { RawArray as array } from '../format'; @@ -34,7 +33,7 @@ export const Half_Hash_Size = Hash_Size / 2; * * @return {WordArray} */ -export const ua2words = (ua, uaLength): WordArray => { +export const ua2words = (ua, uaLength): any => { const temp: number[] = []; for (let i = 0; i < uaLength; i += 4) { const x = ua[i] * 0x1000000 + (ua[i + 1] || 0) * 0x10000 + (ua[i + 2] || 0) * 0x100 + (ua[i + 3] || 0); diff --git a/src/core/format/Convert.ts b/src/core/format/Convert.ts index a7301859b4..7845335b87 100644 --- a/src/core/format/Convert.ts +++ b/src/core/format/Convert.ts @@ -26,7 +26,7 @@ export class Convert { public static toByte = (char1: string, char2: string): number => { const byte = utilities.tryParseByte(char1, char2); if (undefined === byte) { - throw Error(`unrecognized hex char`); + throw Error(`unrecognized hex char, char1:${char1}, char2:${char2}`); } return byte; }; @@ -148,33 +148,6 @@ export class Convert { return input & 0xff; }; - /** - * Converts a raw javascript string into a string of single byte characters using utf8 encoding. - * This makes it easier to perform other encoding operations on the string. - * @param {string} input - A raw string - * @return {string} - UTF-8 string - */ - public static rstr2utf8 = (input: string): string => { - let output = ''; - - for (let n = 0; n < input.length; n++) { - const c = input.charCodeAt(n); - - if (128 > c) { - output += String.fromCharCode(c); - } else if (127 < c && 2048 > c) { - output += String.fromCharCode((c >> 6) | 192); - output += String.fromCharCode((c & 63) | 128); - } else { - output += String.fromCharCode((c >> 12) | 224); - output += String.fromCharCode(((c >> 6) & 63) | 128); - output += String.fromCharCode((c & 63) | 128); - } - } - - return output; - }; - /** * Convert UTF-8 to hex * @param {string} input - An UTF-8 string @@ -190,7 +163,7 @@ export class Convert { * @return {Uint8Array} */ public static utf8ToUint8 = (input: string): Uint8Array => { - const hex = Convert.utf8ToHex(Convert.rstr2utf8(input)); + const hex = Convert.utf8ToHex(input); return Convert.hexToUint8(hex); }; diff --git a/src/infrastructure/paginationStreamer/PaginationStreamer.ts b/src/infrastructure/paginationStreamer/PaginationStreamer.ts index c1531318e6..267a1e34ae 100644 --- a/src/infrastructure/paginationStreamer/PaginationStreamer.ts +++ b/src/infrastructure/paginationStreamer/PaginationStreamer.ts @@ -14,9 +14,7 @@ * limitations under the License. */ -import { concat, Observable } from 'rxjs'; -import { defer } from 'rxjs/internal/observable/defer'; -import { from } from 'rxjs/internal/observable/from'; +import { concat, defer, from, Observable } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; import { SearchCriteria } from '../searchCriteria/SearchCriteria'; import { Searcher } from './Searcher'; diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index d40b6ee725..310f265052 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Convert as convert } from '../../core/format'; +import { Convert } from '../..'; import { UnresolvedMapping } from '../../core/utils'; import { MessageFactory, MosaicSupplyRevocationTransaction, UInt64 } from '../../model'; import { Address, PublicAccount } from '../../model/account'; @@ -125,12 +125,11 @@ const extractTransactionMeta = (meta: any, id: string): TransactionInfo | Aggreg /** * @internal * @param transactionDTO - * @param transactionInfo * @param isEmbedded * @returns {any} * @constructor */ -const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo, isEmbedded: boolean): Transaction => { +const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Transaction => { const type: TransactionType = transactionDTO.type; const version: number = transactionDTO.version; const signature = Transaction.resolveSignature(transactionDTO.signature, false); @@ -394,7 +393,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo, isE extractRecipient(transactionDTO.targetAddress), UInt64.fromHex(transactionDTO.scopedMetadataKey), transactionDTO.valueSizeDelta, - convert.decodeHex(transactionDTO.value), + Convert.hexToUint8(transactionDTO.value), signature, signer, transactionInfo, @@ -409,7 +408,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo, isE UInt64.fromHex(transactionDTO.scopedMetadataKey), UnresolvedMapping.toUnresolvedMosaic(transactionDTO.targetMosaicId), transactionDTO.valueSizeDelta, - convert.decodeHex(transactionDTO.value), + Convert.hexToUint8(transactionDTO.value), signature, signer, transactionInfo, @@ -424,7 +423,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo, isE UInt64.fromHex(transactionDTO.scopedMetadataKey), NamespaceId.createFromEncoded(transactionDTO.targetNamespaceId), transactionDTO.valueSizeDelta, - convert.decodeHex(transactionDTO.value), + Convert.hexToUint8(transactionDTO.value), signature, signer, transactionInfo, @@ -489,7 +488,7 @@ export const CreateTransactionFromDTO = (transactionDTO): Transaction => { innerTransactionDTO.transaction.maxFee = transactionDTO.transaction.maxFee; innerTransactionDTO.transaction.deadline = transactionDTO.transaction.deadline; innerTransactionDTO.transaction.signature = transactionDTO.transaction.signature; - return CreateStandaloneTransactionFromDTO(innerTransactionDTO.transaction, aggregateTransactionInfo, true); + return CreateStandaloneTransactionFromDTO(innerTransactionDTO.transaction, aggregateTransactionInfo); }) : []; return new AggregateTransaction( @@ -518,7 +517,6 @@ export const CreateTransactionFromDTO = (transactionDTO): Transaction => { return CreateStandaloneTransactionFromDTO( transactionDTO.transaction, extractTransactionMeta(transactionDTO.meta, transactionDTO.id), - false, ); } }; diff --git a/src/infrastructure/transaction/SerializeTransactionToJSON.ts b/src/infrastructure/transaction/SerializeTransactionToJSON.ts index a727702b48..4f3e45b2c2 100644 --- a/src/infrastructure/transaction/SerializeTransactionToJSON.ts +++ b/src/infrastructure/transaction/SerializeTransactionToJSON.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Convert } from '../../core/format'; +import { Convert } from '../..'; import { AccountAddressRestrictionTransaction, AccountKeyLinkTransaction, @@ -246,7 +246,7 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { scopedMetadataKey: accountMetadataTx.scopedMetadataKey.toHex(), valueSizeDelta: accountMetadataTx.valueSizeDelta, valueSize: accountMetadataTx.value.length, - value: Convert.utf8ToHex(accountMetadataTx.value), + value: Convert.uint8ToHex(accountMetadataTx.value), }; } else if (transaction.type === TransactionType.MOSAIC_METADATA) { const mosaicMetadataTx = transaction as MosaicMetadataTransaction; @@ -256,7 +256,7 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { valueSizeDelta: mosaicMetadataTx.valueSizeDelta, targetMosaicId: mosaicMetadataTx.targetMosaicId.id.toHex(), valueSize: mosaicMetadataTx.value.length, - value: Convert.utf8ToHex(mosaicMetadataTx.value), + value: Convert.uint8ToHex(mosaicMetadataTx.value), }; } else if (transaction.type === TransactionType.NAMESPACE_METADATA) { const namespaceMetaTx = transaction as NamespaceMetadataTransaction; @@ -266,7 +266,7 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { valueSizeDelta: namespaceMetaTx.valueSizeDelta, targetNamespaceId: namespaceMetaTx.targetNamespaceId.id.toHex(), valueSize: namespaceMetaTx.value.length, - value: Convert.utf8ToHex(namespaceMetaTx.value), + value: Convert.uint8ToHex(namespaceMetaTx.value), }; } else if (transaction.type === TransactionType.VRF_KEY_LINK) { const vrfKeyLinkTx = transaction as VrfKeyLinkTransaction; diff --git a/src/model/transaction/AccountMetadataTransaction.ts b/src/model/transaction/AccountMetadataTransaction.ts index 38c82d9406..721a57df9c 100644 --- a/src/model/transaction/AccountMetadataTransaction.ts +++ b/src/model/transaction/AccountMetadataTransaction.ts @@ -46,8 +46,7 @@ export class AccountMetadataTransaction extends Transaction { * @param targetAddress - target account address. * @param scopedMetadataKey - Metadata key scoped to source, target and type. * @param valueSizeDelta - Change in value size in bytes. - * @param value - String value with UTF-8 encoding - * Difference between the previous value and new value. + * @param value - Difference between the previous value and new value. * You can calculate value as xor(previous-value, new-value). * If there is no previous value, use directly the new value. * @param maxFee - (Optional) Max fee defined by the sender @@ -60,7 +59,7 @@ export class AccountMetadataTransaction extends Transaction { targetAddress: UnresolvedAddress, scopedMetadataKey: UInt64, valueSizeDelta: number, - value: string, + value: Uint8Array, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0]), signature?: string, @@ -111,10 +110,10 @@ export class AccountMetadataTransaction extends Transaction { */ public readonly valueSizeDelta: number, /** - * String value with UTF-8 encoding. + * xor of previous and the new value * Difference between the previous value and new value. */ - public readonly value: string, + public readonly value: Uint8Array, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo, @@ -142,7 +141,7 @@ export class AccountMetadataTransaction extends Transaction { UnresolvedMapping.toUnresolvedAddress(Convert.uint8ToHex(builder.getTargetAddress().unresolvedAddress)), new UInt64(builder.getScopedMetadataKey()), builder.getValueSizeDelta(), - Convert.uint8ToUtf8(builder.getValue()), + builder.getValue(), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AccountMetadataTransactionBuilder).fee.amount), signature, @@ -167,7 +166,7 @@ export class AccountMetadataTransaction extends Transaction { new UnresolvedAddressDto(this.targetAddress.encodeUnresolvedAddress(this.networkType)), this.scopedMetadataKey.toDTO(), this.valueSizeDelta, - Convert.utf8ToUint8(this.value), + this.value, ); return transactionBuilder; } @@ -185,7 +184,7 @@ export class AccountMetadataTransaction extends Transaction { new UnresolvedAddressDto(this.targetAddress.encodeUnresolvedAddress(this.networkType)), this.scopedMetadataKey.toDTO(), this.valueSizeDelta, - Convert.utf8ToUint8(this.value), + this.value, ); } diff --git a/src/model/transaction/MosaicMetadataTransaction.ts b/src/model/transaction/MosaicMetadataTransaction.ts index 3dbfa849da..34eb50eefb 100644 --- a/src/model/transaction/MosaicMetadataTransaction.ts +++ b/src/model/transaction/MosaicMetadataTransaction.ts @@ -51,8 +51,7 @@ export class MosaicMetadataTransaction extends Transaction { * @param scopedMetadataKey - Metadata key scoped to source, target and type. * @param targetMosaicId - Target unresolved mosaic identifier. * @param valueSizeDelta - Change in value size in bytes. - * @param value - String value with UTF-8 encoding - * Difference between the previous value and new value. + * @param value - Difference between the previous value and new value. * You can calculate value as xor(previous-value, new-value). * If there is no previous value, use directly the new value. * @param maxFee - (Optional) Max fee defined by the sender @@ -66,7 +65,7 @@ export class MosaicMetadataTransaction extends Transaction { scopedMetadataKey: UInt64, targetMosaicId: UnresolvedMosaicId, valueSizeDelta: number, - value: string, + value: Uint8Array, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0]), signature?: string, @@ -123,10 +122,10 @@ export class MosaicMetadataTransaction extends Transaction { */ public readonly valueSizeDelta: number, /** - * String value with UTF-8 encoding. + * xor of previous and the new value * Difference between the previous value and new value. */ - public readonly value: string, + public readonly value: Uint8Array, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo, @@ -155,7 +154,7 @@ export class MosaicMetadataTransaction extends Transaction { new UInt64(builder.getScopedMetadataKey()), UnresolvedMapping.toUnresolvedMosaic(new UInt64(builder.getTargetMosaicId().unresolvedMosaicId).toHex()), builder.getValueSizeDelta(), - Convert.uint8ToUtf8(builder.getValue()), + builder.getValue(), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicMetadataTransactionBuilder).fee.amount), signature, @@ -181,7 +180,7 @@ export class MosaicMetadataTransaction extends Transaction { this.scopedMetadataKey.toDTO(), new UnresolvedMosaicIdDto(this.targetMosaicId.id.toDTO()), this.valueSizeDelta, - Convert.utf8ToUint8(this.value), + this.value, ); return transactionBuilder; } @@ -200,7 +199,7 @@ export class MosaicMetadataTransaction extends Transaction { this.scopedMetadataKey.toDTO(), new UnresolvedMosaicIdDto(this.targetMosaicId.id.toDTO()), this.valueSizeDelta, - Convert.utf8ToUint8(this.value), + this.value, ); } diff --git a/src/model/transaction/NamespaceMetadataTransaction.ts b/src/model/transaction/NamespaceMetadataTransaction.ts index 0d7bb05256..bf5c480e82 100644 --- a/src/model/transaction/NamespaceMetadataTransaction.ts +++ b/src/model/transaction/NamespaceMetadataTransaction.ts @@ -48,8 +48,7 @@ export class NamespaceMetadataTransaction extends Transaction { * @param scopedMetadataKey - Metadata key scoped to source, target and type. * @param targetNamespaceId - Target namespace identifier. * @param valueSizeDelta - Change in value size in bytes. - * @param value - String value with UTF-8 encoding - * Difference between the previous value and new value. + * @param value - Difference between the previous value and new value. * You can calculate value as xor(previous-value, new-value). * If there is no previous value, use directly the new value. * @param maxFee - (Optional) Max fee defined by the sender @@ -63,7 +62,7 @@ export class NamespaceMetadataTransaction extends Transaction { scopedMetadataKey: UInt64, targetNamespaceId: NamespaceId, valueSizeDelta: number, - value: string, + value: Uint8Array, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0]), signature?: string, @@ -120,10 +119,10 @@ export class NamespaceMetadataTransaction extends Transaction { */ public readonly valueSizeDelta: number, /** - * String value with UTF-8 encoding. + * xor of previous and the new value * Difference between the previous value and new value. */ - public readonly value: string, + public readonly value: Uint8Array, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo, @@ -152,7 +151,7 @@ export class NamespaceMetadataTransaction extends Transaction { new UInt64(builder.getScopedMetadataKey()), new NamespaceId(builder.getTargetNamespaceId().namespaceId), builder.getValueSizeDelta(), - Convert.uint8ToUtf8(builder.getValue()), + builder.getValue(), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as NamespaceMetadataTransactionBuilder).fee.amount), signature, @@ -178,7 +177,7 @@ export class NamespaceMetadataTransaction extends Transaction { this.scopedMetadataKey.toDTO(), this.targetNamespaceId.toBuilder(), this.valueSizeDelta, - Convert.utf8ToUint8(this.value), + this.value, ); return transactionBuilder; } @@ -197,7 +196,7 @@ export class NamespaceMetadataTransaction extends Transaction { this.scopedMetadataKey.toDTO(), this.targetNamespaceId.toBuilder(), this.valueSizeDelta, - Convert.utf8ToUint8(this.value), + this.value, ); } diff --git a/src/service/CurrencyService.ts b/src/service/CurrencyService.ts index 86cb9d9a34..59fa6b9aed 100644 --- a/src/service/CurrencyService.ts +++ b/src/service/CurrencyService.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { forkJoin, Observable } from 'rxjs'; -import { flatMap, map } from 'rxjs/internal/operators'; +import { firstValueFrom, forkJoin, Observable } from 'rxjs'; +import { map, mergeMap } from 'rxjs/operators'; import { DtoMapping } from '../core/utils/DtoMapping'; import { RepositoryFactory } from '../infrastructure/RepositoryFactory'; import { Currency, MosaicId, MosaicInfo, MosaicNames, NetworkCurrencies } from '../model/mosaic'; @@ -36,7 +36,7 @@ export class CurrencyService implements ICurrencyService { .createNetworkRepository() .getNetworkProperties() .pipe( - flatMap((properties) => { + mergeMap((properties) => { if (!properties.chain.currencyMosaicId) { throw new Error('currencyMosaicId could not be loaded from network properties!!'); } @@ -64,8 +64,8 @@ export class CurrencyService implements ICurrencyService { // get mosaicInfo and mosaic names from the network, // build network currency models return forkJoin({ - mosaicsInfo: mosaicHttp.getMosaics(mosaicIds).toPromise(), - mosaicNames: namespaceHttp.getMosaicsNames(mosaicIds).toPromise(), + mosaicsInfo: firstValueFrom(mosaicHttp.getMosaics(mosaicIds)), + mosaicNames: firstValueFrom(namespaceHttp.getMosaicsNames(mosaicIds)), }).pipe( map(({ mosaicsInfo, mosaicNames }) => mosaicsInfo.map((mosaicInfo) => { diff --git a/src/service/DeadlineService.ts b/src/service/DeadlineService.ts index c4e9e82d3e..f7c2c1a635 100644 --- a/src/service/DeadlineService.ts +++ b/src/service/DeadlineService.ts @@ -15,6 +15,7 @@ */ import { ChronoUnit, Duration, Instant } from '@js-joda/core'; +import { firstValueFrom } from 'rxjs'; import { RepositoryFactory } from '../infrastructure'; import { Deadline, defaultChronoUnit, defaultDeadline } from '../model/transaction'; @@ -51,7 +52,7 @@ export class DeadlineService { * @param chronoUnit the unit of the value. */ public async createDeadlineUsingServerTime(deadline = defaultDeadline, chronoUnit: ChronoUnit = defaultChronoUnit): Promise { - const serverTime = (await this.repositoryFactory.createNodeRepository().getNodeTime().toPromise()).receiveTimeStamp.compact(); + const serverTime = (await firstValueFrom(this.repositoryFactory.createNodeRepository().getNodeTime())).receiveTimeStamp.compact(); return Deadline.createFromAdjustedValue(Duration.ofMillis(serverTime).plus(deadline, chronoUnit).toMillis()); } @@ -83,8 +84,8 @@ export class DeadlineService { * @param repositoryFactory the repository factory to call the rest servers. */ public static async create(repositoryFactory: RepositoryFactory): Promise { - const epochAdjustment = await repositoryFactory.getEpochAdjustment().toPromise(); - const serverTime = (await repositoryFactory.createNodeRepository().getNodeTime().toPromise()).receiveTimeStamp.compact(); + const epochAdjustment = await firstValueFrom(repositoryFactory.getEpochAdjustment()); + const serverTime = (await firstValueFrom(repositoryFactory.createNodeRepository().getNodeTime())).receiveTimeStamp.compact(); return new DeadlineService(repositoryFactory, epochAdjustment, serverTime); } } diff --git a/src/service/MetadataTransactionService.ts b/src/service/MetadataTransactionService.ts index dd74e63c1a..e965a07c4f 100644 --- a/src/service/MetadataTransactionService.ts +++ b/src/service/MetadataTransactionService.ts @@ -69,12 +69,14 @@ export class MetadataTransactionService { const metadata = metadatas.data[0]; const currentValueByte = Convert.utf8ToUint8(metadata.metadataEntry.value); const newValueBytes = Convert.utf8ToUint8(value); + const xoredBytes = Convert.hexToUint8(Convert.xor(currentValueByte, newValueBytes)); + return AccountMetadataTransaction.create( deadline, targetAddress, key, newValueBytes.length - currentValueByte.length, - Convert.decodeHex(Convert.xor(currentValueByte, newValueBytes)), + xoredBytes, networkType, maxFee, ); @@ -85,7 +87,7 @@ export class MetadataTransactionService { targetAddress, key, newValueBytes.length, - value, + Convert.utf8ToUint8(value), networkType, maxFee, ); @@ -126,13 +128,15 @@ export class MetadataTransactionService { const metadata = metadatas.data[0]; const currentValueByte = Convert.utf8ToUint8(metadata.metadataEntry.value); const newValueBytes = Convert.utf8ToUint8(value); + const xoredBytes = Convert.hexToUint8(Convert.xor(currentValueByte, newValueBytes)); + return MosaicMetadataTransaction.create( deadline, targetAddress, key, mosaicId, newValueBytes.length - currentValueByte.length, - Convert.decodeHex(Convert.xor(currentValueByte, newValueBytes)), + xoredBytes, networkType, maxFee, ); @@ -144,7 +148,7 @@ export class MetadataTransactionService { key, mosaicId, newValueBytes.length, - value, + Convert.utf8ToUint8(value), networkType, maxFee, ); @@ -190,13 +194,14 @@ export class MetadataTransactionService { const metadata = metadatas.data[0]; const currentValueByte = Convert.utf8ToUint8(metadata.metadataEntry.value); const newValueBytes = Convert.utf8ToUint8(value); + const xoredBytes = Convert.hexToUint8(Convert.xor(currentValueByte, newValueBytes)); return NamespaceMetadataTransaction.create( deadline, targetAddress, key, namespaceId, newValueBytes.length - currentValueByte.length, - Convert.decodeHex(Convert.xor(currentValueByte, newValueBytes)), + xoredBytes, networkType, maxFee, ); @@ -208,7 +213,7 @@ export class MetadataTransactionService { key, namespaceId, newValueBytes.length, - value, + Convert.utf8ToUint8(value), networkType, maxFee, ); diff --git a/src/service/MosaicService.ts b/src/service/MosaicService.ts index 711db32c39..ac39b5e24c 100644 --- a/src/service/MosaicService.ts +++ b/src/service/MosaicService.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Observable, of as observableOf } from 'rxjs'; +import { Observable, of } from 'rxjs'; import { map, mergeMap, toArray } from 'rxjs/operators'; import { AccountRepository } from '../infrastructure/AccountRepository'; import { MosaicRepository } from '../infrastructure/MosaicRepository'; @@ -42,7 +42,7 @@ export class MosaicService { * @returns {Observable} */ mosaicsView(mosaicIds: MosaicId[]): Observable { - return observableOf(mosaicIds).pipe( + return of(mosaicIds).pipe( mergeMap(() => this.mosaicRepository.getMosaics(mosaicIds).pipe( mergeMap((info) => info), @@ -84,7 +84,7 @@ export class MosaicService { * @returns {Observable} */ mosaicsAmountViewFromAddress(address: Address): Observable { - return observableOf(address).pipe( + return of(address).pipe( mergeMap((_) => this.accountRepository.getAccountInfo(_)), mergeMap((_) => this.mosaicsAmountView(_.mosaics)), ); diff --git a/test/core/format/Convert.spec.ts b/test/core/format/Convert.spec.ts index d4a78650d5..9ed2986ea4 100644 --- a/test/core/format/Convert.spec.ts +++ b/test/core/format/Convert.spec.ts @@ -407,7 +407,7 @@ describe('convert', () => { }); }); - describe('utf8ToUni8', () => { + describe('utf8ToUint8', () => { it('should convert numeric string to Uint8Array', () => { const actual = '123456789'; // Act: @@ -428,6 +428,16 @@ describe('convert', () => { expect(uint.length).to.be.equal(actual.length); expect(convert.uint8ToHex(uint)).to.be.equal('74657374'); }); + + it('should convert non-ascii utf8 string to Uint8Array', () => { + const actual = '存在'; + // Act: + const uint = convert.utf8ToUint8(actual); + + // Assert: + expect(uint.length).to.be.equal(6); + expect(convert.uint8ToHex(uint)).to.be.equal('E5AD98E59CA8'); + }); }); describe('uint8ToUtf8', () => { @@ -450,6 +460,16 @@ describe('convert', () => { // Assert: expect(result).to.be.equal(expected); }); + + it('should convert Uint8Array to non-ascii utf8 string ', () => { + const expected = '存在'; + const actual = convert.utf8ToUint8(expected); + // Act: + const result = convert.uint8ToUtf8(actual); + + // Assert: + expect(result).to.be.equal(expected); + }); }); describe('numberToUint8Array', () => { diff --git a/test/core/utils/TransactionMapping.spec.ts b/test/core/utils/TransactionMapping.spec.ts index 5759b3b7fb..bab0e28281 100644 --- a/test/core/utils/TransactionMapping.spec.ts +++ b/test/core/utils/TransactionMapping.spec.ts @@ -523,7 +523,7 @@ describe('TransactionMapping - createFromPayload', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), TestNetworkType, ); const mosaicMetadataTransaction = MosaicMetadataTransaction.create( @@ -532,7 +532,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), TestNetworkType, ); const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( @@ -541,7 +541,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), TestNetworkType, ); @@ -872,7 +872,7 @@ describe('TransactionMapping - createFromPayload', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), TestNetworkType, ); @@ -899,7 +899,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), TestNetworkType, ); @@ -927,7 +927,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), TestNetworkType, ); @@ -1552,7 +1552,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => account.address, UInt64.fromUint(1000), 1, - 'Test Value', + Convert.utf8ToUint8('Test Value'), TestNetworkType, ); @@ -1566,7 +1566,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.targetAddress.equals(account.address)).to.be.true; expect(transaction.scopedMetadataKey.toHex()).to.be.equal(UInt64.fromUint(1000).toHex()); expect(transaction.valueSizeDelta).to.be.equal(1); - expect(transaction.value).to.be.equal('Test Value'); + expect(Convert.uint8ToHex(transaction.value)).to.be.equal(Convert.utf8ToHex('Test Value')); }); it('should create MosaicMetadataTransaction', () => { @@ -1576,7 +1576,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - 'Test Value', + Convert.utf8ToUint8('Test Value'), TestNetworkType, ); @@ -1591,7 +1591,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.scopedMetadataKey.toHex()).to.be.equal(UInt64.fromUint(1000).toHex()); expect(transaction.valueSizeDelta).to.be.equal(1); expect(transaction.targetMosaicId.toHex()).to.be.equal(new MosaicId([2262289484, 3405110546]).toHex()); - expect(transaction.value).to.be.equal('Test Value'); + expect(Convert.uint8ToHex(transaction.value)).to.be.equal(Convert.utf8ToHex('Test Value')); }); it('should create NamespaceMetadataTransaction', () => { @@ -1601,7 +1601,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - 'Test Value', + Convert.utf8ToUint8('Test Value'), TestNetworkType, ); @@ -1616,7 +1616,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.scopedMetadataKey.toString()).to.be.equal(UInt64.fromUint(1000).toString()); expect(transaction.valueSizeDelta).to.be.equal(1); expect(transaction.targetNamespaceId.toHex()).to.be.equal(new NamespaceId([2262289484, 3405110546]).toHex()); - expect(transaction.value).to.be.equal('Test Value'); + expect(Convert.uint8ToHex(transaction.value)).to.be.equal(Convert.utf8ToHex('Test Value')); }); it('should create from payload with persistent delegate message', () => { diff --git a/test/core/utils/TransactionMappingWithSignatures.spec.ts b/test/core/utils/TransactionMappingWithSignatures.spec.ts index 918a78f522..53de459c48 100644 --- a/test/core/utils/TransactionMappingWithSignatures.spec.ts +++ b/test/core/utils/TransactionMappingWithSignatures.spec.ts @@ -534,7 +534,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), NetworkType.TEST_NET, ); const mosaicMetadataTransaction = MosaicMetadataTransaction.create( @@ -543,7 +543,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), NetworkType.TEST_NET, ); const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( @@ -552,7 +552,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), NetworkType.TEST_NET, ); @@ -969,7 +969,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), NetworkType.TEST_NET, undefined, testSignature, @@ -1002,7 +1002,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), NetworkType.TEST_NET, undefined, testSignature, @@ -1037,7 +1037,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + new Uint8Array(10), NetworkType.TEST_NET, undefined, testSignature, diff --git a/test/infrastructure/AccountHttp.spec.ts b/test/infrastructure/AccountHttp.spec.ts index 9eecd7020b..a71e9b6353 100644 --- a/test/infrastructure/AccountHttp.spec.ts +++ b/test/infrastructure/AccountHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { AccountDTO, AccountIds, @@ -116,7 +117,7 @@ describe('AccountHttp', () => { it('getAccountInfo', async () => { when(accountRoutesApi.getAccountInfo(address.plain())).thenReturn(Promise.resolve(accountInfoDto)); - const accountInfo = await accountRepository.getAccountInfo(address).toPromise(); + const accountInfo = await firstValueFrom(accountRepository.getAccountInfo(address)); assertAccountInfo(accountInfo); }); @@ -124,7 +125,7 @@ describe('AccountHttp', () => { const accountIds = {} as AccountIds; accountIds.addresses = [address.plain()]; when(accountRoutesApi.getAccountsInfo(deepEqual(accountIds))).thenReturn(Promise.resolve([accountInfoDto])); - const accountInfos = await accountRepository.getAccountsInfo([address]).toPromise(); + const accountInfos = await firstValueFrom(accountRepository.getAccountsInfo([address])); assertAccountInfo(accountInfos[0]); }); @@ -139,7 +140,7 @@ describe('AccountHttp', () => { when(accountRoutesApi.searchAccounts(undefined, undefined, undefined, undefined, undefined, mosaic.id)).thenReturn( Promise.resolve(body), ); - const infos = await accountRepository.search({ mosaicId: new MosaicId(mosaic.id) }).toPromise(); + const infos = await firstValueFrom(accountRepository.search({ mosaicId: new MosaicId(mosaic.id) })); assertAccountInfo(infos.data[0]); }); @@ -150,20 +151,14 @@ describe('AccountHttp', () => { it('getAccountInfo - Error', async () => { when(accountRoutesApi.getAccountInfo(address.plain())).thenReject(new Error('Mocked Error')); - await accountRepository - .getAccountInfo(address) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(accountRepository.getAccountInfo(address)).catch((error) => expect(error).not.to.be.undefined); }); it('getAccountsInfo - Error', async () => { const accountIds = {} as AccountIds; accountIds.addresses = [address.plain()]; when(accountRoutesApi.getAccountsInfo(deepEqual(accountIds))).thenReject(new Error('Mocked Error')); - await accountRepository - .getAccountsInfo([address]) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(accountRepository.getAccountsInfo([address])).catch((error) => expect(error).not.to.be.undefined); }); it('getAccountInfoMerkle', async () => { @@ -179,7 +174,7 @@ describe('AccountHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(accountRoutesApi.getAccountInfoMerkle(deepEqual(address.plain()))).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await accountRepository.getAccountInfoMerkle(address).toPromise(); + const merkle = await firstValueFrom(accountRepository.getAccountInfoMerkle(address)); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/BlockHttp.spec.ts b/test/infrastructure/BlockHttp.spec.ts index ad9ed602c6..bb7032309c 100644 --- a/test/infrastructure/BlockHttp.spec.ts +++ b/test/infrastructure/BlockHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { BlockDTO, BlockInfoDTO, @@ -144,13 +145,13 @@ describe('BlockHttp', () => { it('getBlockInfo', async () => { when(blockRoutesApi.getBlockByHeight('1')).thenReturn(Promise.resolve(blockInfoDto)); - const blockInfo = await blockRepository.getBlockByHeight(UInt64.fromUint(1)).toPromise(); + const blockInfo = await firstValueFrom(blockRepository.getBlockByHeight(UInt64.fromUint(1))); assertBlockInfo(blockInfo); }); it('getImportanceBlockInfo', async () => { when(blockRoutesApi.getBlockByHeight('1')).thenReturn(Promise.resolve(importanceBlockInfoDto)); - const blockInfo = await blockRepository.getBlockByHeight(UInt64.fromUint(1)).toPromise(); + const blockInfo = await firstValueFrom(blockRepository.getBlockByHeight(UInt64.fromUint(1))); assertBlockInfo(blockInfo, true); }); @@ -173,7 +174,7 @@ describe('BlockHttp', () => { undefined, ), ).thenReturn(Promise.resolve(body)); - const blockInfos = await blockRepository.search({ signerPublicKey: blockDTO.signerPublicKey }).toPromise(); + const blockInfos = await firstValueFrom(blockRepository.search({ signerPublicKey: blockDTO.signerPublicKey })); assertBlockInfo(blockInfos.data[0]); }); @@ -185,7 +186,7 @@ describe('BlockHttp', () => { merkleProofInfoDTO.merklePath = [merklePathItemDTO]; when(blockRoutesApi.getMerkleTransaction('2', 'abc')).thenReturn(Promise.resolve(merkleProofInfoDTO)); - const merkleProofInfo = await blockRepository.getMerkleTransaction(UInt64.fromUint(2), 'abc').toPromise(); + const merkleProofInfo = await firstValueFrom(blockRepository.getMerkleTransaction(UInt64.fromUint(2), 'abc')); expect(merkleProofInfo).to.be.not.null; expect(merkleProofInfo.merklePath).to.deep.equals([new MerklePathItem(MerklePosition.Left, 'bbb')]); }); @@ -199,7 +200,7 @@ describe('BlockHttp', () => { when(blockRoutesApi.getMerkleReceipts('1', 'Hash')).thenReturn(Promise.resolve(merkleProofInfoDto)); - const proof = await blockRepository.getMerkleReceipts(UInt64.fromUint(1), 'Hash').toPromise(); + const proof = await firstValueFrom(blockRepository.getMerkleReceipts(UInt64.fromUint(1), 'Hash')); expect(proof).to.be.not.null; expect(proof.merklePath!.length).to.be.greaterThan(0); expect(proof.merklePath![0].hash).to.be.equal('merkleHash'); @@ -208,10 +209,9 @@ describe('BlockHttp', () => { it('getMerkleReceipts - Error', async () => { when(blockRoutesApi.getMerkleReceipts('1', 'Hash')).thenReject(new Error('Mocked Error')); - await blockRepository - .getMerkleReceipts(UInt64.fromUint(1), 'Hash') - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(blockRepository.getMerkleReceipts(UInt64.fromUint(1), 'Hash')).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('wrong block type - Error', async () => { @@ -222,10 +222,7 @@ describe('BlockHttp', () => { }, }); when(blockRoutesApi.getBlockByHeight('1')).thenReturn(Promise.resolve(wrongBlock)); - await blockRepository - .getBlockByHeight(UInt64.fromUint(1)) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(blockRepository.getBlockByHeight(UInt64.fromUint(1))).catch((error) => expect(error).not.to.be.undefined); }); it('streamer', async () => { diff --git a/test/infrastructure/ChainHttp.spec.ts b/test/infrastructure/ChainHttp.spec.ts index 28dc8d918d..1001176c0e 100644 --- a/test/infrastructure/ChainHttp.spec.ts +++ b/test/infrastructure/ChainHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { ChainInfoDTO, ChainRoutesApi, FinalizedBlockDTO } from 'symbol-openapi-typescript-fetch-client'; import { instance, mock, reset, when } from 'ts-mockito'; import { DtoMapping } from '../../src/core/utils/DtoMapping'; @@ -46,7 +47,7 @@ describe('ChainHttp', () => { finalizedBlockDto.height = '1'; chainInfoDTO.latestFinalizedBlock = finalizedBlockDto; when(chainRoutesApi.getChainInfo()).thenReturn(Promise.resolve(chainInfoDTO)); - const info = await chainRepository.getChainInfo().toPromise(); + const info = await firstValueFrom(chainRepository.getChainInfo()); expect(info).to.be.not.null; expect(info.height.toString()).to.be.equals(chainInfoDTO.height); expect(info.scoreLow.toString()).to.be.equals(chainInfoDTO.scoreLow); diff --git a/test/infrastructure/FinalizationHttp.spec.ts b/test/infrastructure/FinalizationHttp.spec.ts index 20da18bee2..dcc4395ca1 100644 --- a/test/infrastructure/FinalizationHttp.spec.ts +++ b/test/infrastructure/FinalizationHttp.spec.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { BmTreeSignature, FinalizationProofDTO, @@ -80,29 +81,25 @@ describe('FinalizationHttp', () => { it('getFinalizationProofAtEpoch', async () => { when(finalizationRoutesApi.getFinalizationProofAtEpoch(1)).thenReturn(Promise.resolve(dto)); - const model = await finalizationRepository.getFinalizationProofAtEpoch(1).toPromise(); + const model = await firstValueFrom(finalizationRepository.getFinalizationProofAtEpoch(1)); assertDto(model); }); it('getFinalizationProofAtHeight', async () => { when(finalizationRoutesApi.getFinalizationProofAtHeight('1')).thenReturn(Promise.resolve(dto)); - const model = await finalizationRepository.getFinalizationProofAtHeight(UInt64.fromUint(1)).toPromise(); + const model = await firstValueFrom(finalizationRepository.getFinalizationProofAtHeight(UInt64.fromUint(1))); assertDto(model); }); it('getFinalizationProofAtEpoch - Error', async () => { when(finalizationRoutesApi.getFinalizationProofAtEpoch(1)).thenReject(new Error('Mocked Error')); - await finalizationRepository - .getFinalizationProofAtEpoch(1) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(finalizationRepository.getFinalizationProofAtEpoch(1)).catch((error) => expect(error).not.to.be.undefined); }); it('getFinalizationProofAtHeight - Error', async () => { when(finalizationRoutesApi.getFinalizationProofAtHeight('1')).thenReject(new Error('Mocked Error')); - await finalizationRepository - .getFinalizationProofAtHeight(UInt64.fromUint(1)) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(finalizationRepository.getFinalizationProofAtHeight(UInt64.fromUint(1))).catch( + (error) => expect(error).not.to.be.undefined, + ); }); }); diff --git a/test/infrastructure/HashLockHttp.spec.ts b/test/infrastructure/HashLockHttp.spec.ts index 6e4918e281..868a34e04a 100644 --- a/test/infrastructure/HashLockHttp.spec.ts +++ b/test/infrastructure/HashLockHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { HashLockEntryDTO, HashLockInfoDTO, @@ -71,7 +72,7 @@ describe('HashLockHttp', () => { it('getHashLockInfo', async () => { when(hashLockRoutesApi.getHashLock(lockDto.hash)).thenReturn(Promise.resolve(dto)); - const hashInfo = await hashLockRepository.getHashLock(lockDto.hash).toPromise(); + const hashInfo = await firstValueFrom(hashLockRepository.getHashLock(lockDto.hash)); assertHashInfo(hashInfo); }); @@ -86,16 +87,13 @@ describe('HashLockHttp', () => { when(hashLockRoutesApi.searchHashLock(address.plain(), undefined, undefined, undefined, undefined)).thenReturn( Promise.resolve(body), ); - const infos = await hashLockRepository.search({ address }).toPromise(); + const infos = await firstValueFrom(hashLockRepository.search({ address })); assertHashInfo(infos.data[0]); }); it('getHashLockInfo - Error', async () => { when(hashLockRoutesApi.getHashLock(lockDto.hash)).thenReject(new Error('Mocked Error')); - await hashLockRepository - .getHashLock(lockDto.hash) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(hashLockRepository.getHashLock(lockDto.hash)).catch((error) => expect(error).not.to.be.undefined); }); it('streamer', async () => { @@ -116,7 +114,7 @@ describe('HashLockHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(hashLockRoutesApi.getHashLockMerkle('hash')).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await hashLockRepository.getHashLockMerkle('hash').toPromise(); + const merkle = await firstValueFrom(hashLockRepository.getHashLockMerkle('hash')); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/MetadataHttp.spec.ts b/test/infrastructure/MetadataHttp.spec.ts index c1b74da0c2..7df97aa343 100644 --- a/test/infrastructure/MetadataHttp.spec.ts +++ b/test/infrastructure/MetadataHttp.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { MerkleStateInfoDTO, MerkleTreeLeafDTO, @@ -155,7 +156,7 @@ describe('MetadataHttp', () => { Order.Asc, ), ).thenReturn(Promise.resolve(metadataPage)); - const metadatas = await metadataRepository.search({ targetAddress: address, pageNumber: 1, order: Order.Asc }).toPromise(); + const metadatas = await firstValueFrom(metadataRepository.search({ targetAddress: address, pageNumber: 1, order: Order.Asc })); expect(metadatas.data.length).to.be.equals(3); assertMetadataInfo(metadatas.data[0], metadataDTOMosaic); assertMetadataInfo(metadatas.data[1], metadataDTOAddress); @@ -176,7 +177,7 @@ describe('MetadataHttp', () => { undefined, ), ).thenReturn(Promise.resolve(metadataPage)); - const metadatas = await metadataRepository.search({ targetAddress: address, scopedMetadataKey: 'aaa' }).toPromise(); + const metadatas = await firstValueFrom(metadataRepository.search({ targetAddress: address, scopedMetadataKey: 'aaa' })); assertMetadataInfo(metadatas.data[0], metadataDTOMosaic); assertMetadataInfo(metadatas.data[1], metadataDTOAddress); assertMetadataInfo(metadatas.data[2], metadataDTONamespace); @@ -196,14 +197,14 @@ describe('MetadataHttp', () => { undefined, ), ).thenReturn(Promise.resolve(metadataPageMosaic)); - const metadata = await metadataRepository - .search({ + const metadata = await firstValueFrom( + metadataRepository.search({ sourceAddress: address, scopedMetadataKey: 'aaa', targetAddress: address, metadataType: MetadataType.Account, - }) - .toPromise(); + }), + ); assertMetadataInfo(metadata.data[0], metadataDTOMosaic); }); @@ -221,14 +222,14 @@ describe('MetadataHttp', () => { Order.Desc, ), ).thenReturn(Promise.resolve(metadataPage)); - const metadatas = await metadataRepository - .search({ + const metadatas = await firstValueFrom( + metadataRepository.search({ targetId: mosaicId, metadataType: MetadataType.Mosaic, pageSize: 2, order: Order.Desc, - }) - .toPromise(); + }), + ); expect(metadatas.data.length).to.be.equals(3); assertMetadataInfo(metadatas.data[0], metadataDTOMosaic); assertMetadataInfo(metadatas.data[1], metadataDTOAddress); @@ -249,9 +250,9 @@ describe('MetadataHttp', () => { undefined, ), ).thenReturn(Promise.resolve(metadataPage)); - const metadatas = await metadataRepository - .search({ targetId: mosaicId, scopedMetadataKey: 'aaa', metadataType: MetadataType.Mosaic }) - .toPromise(); + const metadatas = await firstValueFrom( + metadataRepository.search({ targetId: mosaicId, scopedMetadataKey: 'aaa', metadataType: MetadataType.Mosaic }), + ); assertMetadataInfo(metadatas.data[0], metadataDTOMosaic); assertMetadataInfo(metadatas.data[1], metadataDTOAddress); assertMetadataInfo(metadatas.data[2], metadataDTONamespace); @@ -271,9 +272,14 @@ describe('MetadataHttp', () => { undefined, ), ).thenReturn(Promise.resolve(metadataPageMosaic)); - const metadata = await metadataRepository - .search({ targetId: mosaicId, scopedMetadataKey: 'aaa', sourceAddress: address, metadataType: MetadataType.Mosaic }) - .toPromise(); + const metadata = await firstValueFrom( + metadataRepository.search({ + targetId: mosaicId, + scopedMetadataKey: 'aaa', + sourceAddress: address, + metadataType: MetadataType.Mosaic, + }), + ); assertMetadataInfo(metadata.data[0], metadataDTOMosaic); }); @@ -291,14 +297,14 @@ describe('MetadataHttp', () => { Order.Desc, ), ).thenReturn(Promise.resolve(metadataPage)); - const metadatas = await metadataRepository - .search({ + const metadatas = await firstValueFrom( + metadataRepository.search({ targetId: namespaceId, metadataType: MetadataType.Namespace, pageSize: 2, order: Order.Desc, - }) - .toPromise(); + }), + ); expect(metadatas.data.length).to.be.equals(3); assertMetadataInfo(metadatas.data[0], metadataDTOMosaic); assertMetadataInfo(metadatas.data[1], metadataDTOAddress); @@ -319,9 +325,9 @@ describe('MetadataHttp', () => { undefined, ), ).thenReturn(Promise.resolve(metadataPage)); - const metadatas = await metadataRepository - .search({ targetId: namespaceId, scopedMetadataKey: 'bbb', metadataType: MetadataType.Namespace }) - .toPromise(); + const metadatas = await firstValueFrom( + metadataRepository.search({ targetId: namespaceId, scopedMetadataKey: 'bbb', metadataType: MetadataType.Namespace }), + ); assertMetadataInfo(metadatas.data[0], metadataDTOMosaic); assertMetadataInfo(metadatas.data[1], metadataDTOAddress); assertMetadataInfo(metadatas.data[2], metadataDTONamespace); @@ -341,9 +347,14 @@ describe('MetadataHttp', () => { undefined, ), ).thenReturn(Promise.resolve(metadataPageNamespace)); - const metadata = await metadataRepository - .search({ sourceAddress: address, targetId: namespaceId, scopedMetadataKey: 'cccc', metadataType: MetadataType.Namespace }) - .toPromise(); + const metadata = await firstValueFrom( + metadataRepository.search({ + sourceAddress: address, + targetId: namespaceId, + scopedMetadataKey: 'cccc', + metadataType: MetadataType.Namespace, + }), + ); assertMetadataInfo(metadata.data[0], metadataDTONamespace); }); @@ -451,7 +462,7 @@ describe('MetadataHttp', () => { it('Namespace getMetadata', async () => { Object.assign(metadataPageNamespace, { data: [] }); when(metadataRoutesApi.getMetadata('hash123')).thenReturn(Promise.resolve(metadataDTONamespace)); - const metadata = await metadataRepository.getMetadata('hash123').toPromise(); + const metadata = await firstValueFrom(metadataRepository.getMetadata('hash123')); assertMetadataInfo(metadata, metadataDTONamespace); }); @@ -470,8 +481,8 @@ describe('MetadataHttp', () => { ), ).thenReturn(Promise.reject(notFoundResponse)); const metadataTransactionService = new MetadataTransactionService(metadataRepository); - await metadataTransactionService - .createAccountMetadataTransaction( + await firstValueFrom( + metadataTransactionService.createAccountMetadataTransaction( Deadline.create(epochAdjustment), NetworkType.TEST_NET, address, @@ -479,9 +490,8 @@ describe('MetadataHttp', () => { 'test', address, UInt64.fromUint(2000), - ) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + ), + ).catch((error) => expect(error).not.to.be.undefined); }); it('Mosaic meta no previous value', async () => { @@ -499,8 +509,8 @@ describe('MetadataHttp', () => { ), ).thenReturn(Promise.reject(notFoundResponse)); const metadataTransactionService = new MetadataTransactionService(metadataRepository); - await metadataTransactionService - .createMosaicMetadataTransaction( + await firstValueFrom( + metadataTransactionService.createMosaicMetadataTransaction( Deadline.create(epochAdjustment), NetworkType.TEST_NET, address, @@ -509,9 +519,8 @@ describe('MetadataHttp', () => { 'test', address, UInt64.fromUint(2000), - ) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + ), + ).catch((error) => expect(error).not.to.be.undefined); }); it('Namespace meta no previous value', async () => { @@ -529,8 +538,8 @@ describe('MetadataHttp', () => { ), ).thenReturn(Promise.reject(notFoundResponse)); const metadataTransactionService = new MetadataTransactionService(metadataRepository); - await metadataTransactionService - .createNamespaceMetadataTransaction( + await firstValueFrom( + metadataTransactionService.createNamespaceMetadataTransaction( Deadline.create(epochAdjustment), NetworkType.TEST_NET, address, @@ -539,9 +548,8 @@ describe('MetadataHttp', () => { 'test', address, UInt64.fromUint(2000), - ) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + ), + ).catch((error) => expect(error).not.to.be.undefined); }); it('streamer', async () => { @@ -562,7 +570,7 @@ describe('MetadataHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(metadataRoutesApi.getMetadataMerkle('hash')).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await metadataRepository.getMetadataMerkle('hash').toPromise(); + const merkle = await firstValueFrom(metadataRepository.getMetadataMerkle('hash')); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/MosaicHttp.spec.ts b/test/infrastructure/MosaicHttp.spec.ts index db3c91cfd4..d29bb1aa11 100644 --- a/test/infrastructure/MosaicHttp.spec.ts +++ b/test/infrastructure/MosaicHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { MerkleTreeLeafDTO, Mosaic, @@ -86,7 +87,7 @@ describe('MosaicHttp', () => { it('getMosaic', async () => { when(mosaicRoutesApi.getMosaic(mosaicId.toHex())).thenReturn(Promise.resolve(mosaicInfoDto)); - const mosaicInfo = await mosaicRepository.getMosaic(mosaicId).toPromise(); + const mosaicInfo = await firstValueFrom(mosaicRepository.getMosaic(mosaicId)); assertMosaicInfo(mosaicInfo); }); @@ -94,7 +95,7 @@ describe('MosaicHttp', () => { const mosaicIds = {} as MosaicIds; mosaicIds.mosaicIds = [mosaicId.toHex()]; when(mosaicRoutesApi.getMosaics(deepEqual(mosaicIds))).thenReturn(Promise.resolve([mosaicInfoDto])); - const mosaicInfos = await mosaicRepository.getMosaics([mosaicId]).toPromise(); + const mosaicInfos = await firstValueFrom(mosaicRepository.getMosaics([mosaicId])); assertMosaicInfo(mosaicInfos[0]); }); @@ -110,36 +111,27 @@ describe('MosaicHttp', () => { when(mosaicRoutesApi.searchMosaics(deepEqual(address.plain()), undefined, undefined, undefined, undefined)).thenReturn( Promise.resolve(body), ); - const mosaicsInfo = await mosaicRepository.search({ ownerAddress: address }).toPromise(); + const mosaicsInfo = await firstValueFrom(mosaicRepository.search({ ownerAddress: address })); assertMosaicInfo(mosaicsInfo.data[0]); }); it('getMosaic - Error', async () => { when(mosaicRoutesApi.getMosaic(mosaicId.toHex())).thenReject(new Error('Mocked Error')); - await mosaicRepository - .getMosaic(mosaicId) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(mosaicRepository.getMosaic(mosaicId)).catch((error) => expect(error).not.to.be.undefined); }); it('getMosaics - Error', async () => { const mosaicIds = {} as MosaicIds; mosaicIds.mosaicIds = [mosaicId.toHex()]; when(mosaicRoutesApi.getMosaics(deepEqual(mosaicIds))).thenReject(new Error('Mocked Error')); - await mosaicRepository - .getMosaics([mosaicId]) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(mosaicRepository.getMosaics([mosaicId])).catch((error) => expect(error).not.to.be.undefined); }); it('searchMosaics - Error', async () => { when(mosaicRoutesApi.searchMosaics(deepEqual(address.plain()), undefined, undefined, undefined, undefined)).thenThrow( new Error('Mocked Error'), ); - await mosaicRepository - .search({ ownerAddress: address }) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(mosaicRepository.search({ ownerAddress: address })).catch((error) => expect(error).not.to.be.undefined); }); it('streamer', async () => { @@ -160,7 +152,7 @@ describe('MosaicHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(mosaicRoutesApi.getMosaicMerkle(mosaicId.toHex())).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await mosaicRepository.getMosaicMerkle(mosaicId).toPromise(); + const merkle = await firstValueFrom(mosaicRepository.getMosaicMerkle(mosaicId)); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/MultisigHttp.spec.ts b/test/infrastructure/MultisigHttp.spec.ts index 6f405fbe1f..d9cf60d38b 100644 --- a/test/infrastructure/MultisigHttp.spec.ts +++ b/test/infrastructure/MultisigHttp.spec.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { MultisigAccountGraphInfoDTO, MultisigAccountInfoDTO, @@ -75,7 +76,7 @@ describe('MultisigHttp', () => { it('getMultisigAccountInfo', async () => { when(multisigRoutesApi.getAccountMultisig(address.plain())).thenReturn(Promise.resolve(accountInfoDto)); - const accountInfo = await accountRepository.getMultisigAccountInfo(address).toPromise(); + const accountInfo = await firstValueFrom(accountRepository.getMultisigAccountInfo(address)); assertMultisigInfo(accountInfo); }); @@ -88,7 +89,7 @@ describe('MultisigHttp', () => { body2.level = 20; body2.multisigEntries = [accountInfoDto, accountInfoDto]; when(multisigRoutesApi.getAccountMultisigGraph(address.plain())).thenReturn(Promise.resolve([body, body2])); - const graphInfo = await accountRepository.getMultisigAccountGraphInfo(address).toPromise(); + const graphInfo = await firstValueFrom(accountRepository.getMultisigAccountGraphInfo(address)); expect(graphInfo.multisigEntries.size).to.be.eq(2); const list10: MultisigAccountInfo[] = graphInfo.multisigEntries.get(10) as MultisigAccountInfo[]; expect(list10.length).to.be.eq(3); diff --git a/test/infrastructure/NamespaceHttp.spec.ts b/test/infrastructure/NamespaceHttp.spec.ts index 1f4b9a238d..d378f0c2ed 100644 --- a/test/infrastructure/NamespaceHttp.spec.ts +++ b/test/infrastructure/NamespaceHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { AccountNamesDTO, AccountsNamesDTO, @@ -129,7 +130,7 @@ describe('NamespaceHttp', () => { when(namespaceRoutesApi.getAccountsNames(deepEqual({ addresses: [address.plain()] }))).thenReturn( Promise.resolve(accountsNamesDto), ); - const accountNames = await namespaceRepository.getAccountsNames([address]).toPromise(); + const accountNames = await firstValueFrom(namespaceRepository.getAccountsNames([address])); expect(accountNames.length).to.be.greaterThan(0); expect(accountNames[0].address.plain()).to.be.equal(address.plain()); expect(accountNames[0].names.map((n) => n.name).join(',')).to.be.equal(['name1', 'name2'].join(',')); @@ -143,7 +144,7 @@ describe('NamespaceHttp', () => { mosaicsNamesDto.mosaicNames = [mosaicNamesDto]; when(namespaceRoutesApi.getMosaicsNames(deepEqual({ mosaicIds: [mosaicId.toHex()] }))).thenReturn(Promise.resolve(mosaicsNamesDto)); - const names = await namespaceRepository.getMosaicsNames([mosaicId]).toPromise(); + const names = await firstValueFrom(namespaceRepository.getMosaicsNames([mosaicId])); expect(names.length).to.be.greaterThan(0); expect(names[0].mosaicId.toHex()).to.be.equal(mosaicId.toHex()); expect(names[0].names.map((n) => n.name).join(',')).to.be.equal(['name1', 'name2'].join(',')); @@ -151,7 +152,7 @@ describe('NamespaceHttp', () => { it('getNamespace', async () => { when(namespaceRoutesApi.getNamespace(deepEqual(namespaceId.toHex()))).thenReturn(Promise.resolve(namespaceInfoDto)); - const namespace = await namespaceRepository.getNamespace(namespaceId).toPromise(); + const namespace = await firstValueFrom(namespaceRepository.getNamespace(namespaceId)); assertNamespaceInfo(namespace); }); @@ -168,7 +169,7 @@ describe('NamespaceHttp', () => { when(namespaceRoutesApi.getNamespacesNames(deepEqual({ namespaceIds: [namespaceId.toHex()] }))).thenReturn( Promise.resolve([namespaceNameParent, namespaceNameChild]), ); - const namespace = await namespaceRepository.getNamespacesNames([namespaceId]).toPromise(); + const namespace = await firstValueFrom(namespaceRepository.getNamespacesNames([namespaceId])); expect(namespace.length).to.be.equal(2); expect(namespace[0].name).to.be.equal('parent'); expect(namespace[0].namespaceId.toHex()).to.be.equal(namespaceId.toHex()); @@ -180,32 +181,26 @@ describe('NamespaceHttp', () => { it('getLinkedAddress', async () => { when(namespaceRoutesApi.getNamespace(deepEqual(namespaceId.toHex()))).thenReturn(Promise.resolve(namespaceInfoDto)); - const namespaces = await namespaceRepository.getLinkedAddress(namespaceId).toPromise(); + const namespaces = await firstValueFrom(namespaceRepository.getLinkedAddress(namespaceId)); expect(namespaces?.plain()).to.be.equal(address.plain()); }); it('getLinkedMosaicId', async () => { when(namespaceRoutesApi.getNamespace(deepEqual(namespaceId.toHex()))).thenReturn(Promise.resolve(namespaceInfoDtoMosaic)); - const namespaces = await namespaceRepository.getLinkedMosaicId(namespaceId).toPromise(); + const namespaces = await firstValueFrom(namespaceRepository.getLinkedMosaicId(namespaceId)); expect(namespaces?.toHex()).to.be.equal(mosaicId.toHex()); }); it('getLinkedMosaicId - Error', async () => { when(namespaceRoutesApi.getNamespace(deepEqual(namespaceId.toHex()))).thenReturn(Promise.resolve(namespaceInfoDto)); - await namespaceRepository - .getLinkedMosaicId(namespaceId) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(namespaceRepository.getLinkedMosaicId(namespaceId)).catch((error) => expect(error).not.to.be.undefined); }); it('getLinkedAddress - Error', async () => { when(namespaceRoutesApi.getNamespace(deepEqual(namespaceId.toHex()))).thenReturn(Promise.resolve(namespaceInfoDtoMosaic)); - await namespaceRepository - .getLinkedAddress(namespaceId) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(namespaceRepository.getLinkedAddress(namespaceId)).catch((error) => expect(error).not.to.be.undefined); }); it('searchNameapsces', async () => { @@ -228,7 +223,7 @@ describe('NamespaceHttp', () => { undefined, ), ).thenReturn(Promise.resolve(body)); - const infos = await namespaceRepository.search({ ownerAddress: address }).toPromise(); + const infos = await firstValueFrom(namespaceRepository.search({ ownerAddress: address })); assertNamespaceInfo(infos.data[0]); }); @@ -250,7 +245,7 @@ describe('NamespaceHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(namespaceRoutesApi.getNamespaceMerkle(namespaceId.toHex())).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await namespaceRepository.getNamespaceMerkle(namespaceId).toPromise(); + const merkle = await firstValueFrom(namespaceRepository.getNamespaceMerkle(namespaceId)); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/NetworkHttp.spec.ts b/test/infrastructure/NetworkHttp.spec.ts index 3d9ad681e3..72263ecbca 100644 --- a/test/infrastructure/NetworkHttp.spec.ts +++ b/test/infrastructure/NetworkHttp.spec.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { NetworkConfigurationDTO, NetworkRoutesApi, @@ -60,7 +61,7 @@ describe('NetworkHttp', () => { when(networkRoutesApi.getTransactionFees()).thenReturn(Promise.resolve(body)); - const networkFees = await networkRepository.getTransactionFees().toPromise(); + const networkFees = await firstValueFrom(networkRepository.getTransactionFees()); expect(networkFees).to.be.not.null; expect(networkFees.averageFeeMultiplier).to.be.equals(1); expect(networkFees.highestFeeMultiplier).to.be.equals(2); @@ -78,7 +79,7 @@ describe('NetworkHttp', () => { when(networkRoutesApi.getRentalFees()).thenReturn(Promise.resolve(body)); - const rentalFees = await networkRepository.getRentalFees().toPromise(); + const rentalFees = await firstValueFrom(networkRepository.getRentalFees()); expect(rentalFees).to.be.not.null; expect(rentalFees.effectiveChildNamespaceRentalFee.toString()).to.be.equals('1'); expect(rentalFees.effectiveMosaicRentalFee.toString()).to.be.equals('2'); @@ -99,7 +100,7 @@ describe('NetworkHttp', () => { when(nodeRoutesApi.getNodeInfo()).thenReturn(Promise.resolve(body)); - const networkType = await networkRepository.getNetworkType().toPromise(); + const networkType = await firstValueFrom(networkRepository.getNetworkType()); expect(networkType).to.be.equals(NetworkType.TEST_NET); }); @@ -111,7 +112,7 @@ describe('NetworkHttp', () => { when(networkRoutesApi.getNetworkType()).thenReturn(Promise.resolve(body)); - const networkName = await networkRepository.getNetworkName().toPromise(); + const networkName = await firstValueFrom(networkRepository.getNetworkName()); expect(networkName.description).to.be.equals(body.description); expect(networkName.name).to.be.equals(body.name); }); @@ -216,7 +217,7 @@ describe('NetworkHttp', () => { when(networkRoutesApi.getNetworkProperties()).thenReturn(Promise.resolve(body)); - const networkProperties = await networkRepository.getNetworkProperties().toPromise(); + const networkProperties = await firstValueFrom(networkRepository.getNetworkProperties()); deepEqual(networkProperties.network, body.network); deepEqual(networkProperties.chain, body.chain); deepEqual(networkProperties.plugins, body.plugins); @@ -225,7 +226,7 @@ describe('NetworkHttp', () => { it('getNetworkProperties - using rest json payload', async () => { const body = testResources.getDummyNetworkProperties(); when(networkRoutesApi.getNetworkProperties()).thenReturn(Promise.resolve(body)); - const networkProperties = await networkRepository.getNetworkProperties().toPromise(); + const networkProperties = await firstValueFrom(networkRepository.getNetworkProperties()); deepEqual(networkProperties.network, body.network); deepEqual(networkProperties.chain, body.chain); deepEqual(networkProperties.plugins, body.plugins); diff --git a/test/infrastructure/NodeHttp.spec.ts b/test/infrastructure/NodeHttp.spec.ts index 5b36b066f2..885fe4b655 100644 --- a/test/infrastructure/NodeHttp.spec.ts +++ b/test/infrastructure/NodeHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { CommunicationTimestampsDTO, NodeHealthDTO, @@ -52,7 +53,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodeHealth()).thenReturn(Promise.resolve(body)); - const nodeHealth = await nodeRepository.getNodeHealth().toPromise(); + const nodeHealth = await firstValueFrom(nodeRepository.getNodeHealth()); expect(nodeHealth).to.be.not.null; expect(nodeHealth.apiNode).to.be.equals(NodeStatusEnum.Down); expect(nodeHealth.db).to.be.equals(NodeStatusEnum.Up); @@ -66,7 +67,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getServerInfo()).thenReturn(Promise.resolve(body)); - const serverInfo = await nodeRepository.getServerInfo().toPromise(); + const serverInfo = await firstValueFrom(nodeRepository.getServerInfo()); expect(serverInfo).to.be.not.null; expect(serverInfo.restVersion).to.be.equals(body.serverInfo.restVersion); expect(serverInfo.sdkVersion).to.be.equals(body.serverInfo.sdkVersion); @@ -87,7 +88,7 @@ describe('NodeHttp', () => { }; when(nodeRoutesApi.getServerInfo()).thenReturn(Promise.resolve(body)); - const serverInfo = await nodeRepository.getServerInfo().toPromise(); + const serverInfo = await firstValueFrom(nodeRepository.getServerInfo()); expect(serverInfo).to.be.not.null; expect(serverInfo.restVersion).to.be.equals(body.serverInfo.restVersion); expect(serverInfo.deployment).to.be.deep.equals(body.serverInfo.deployment); @@ -106,7 +107,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodeInfo()).thenReturn(Promise.resolve(body)); - const nodeInfo = await nodeRepository.getNodeInfo().toPromise(); + const nodeInfo = await firstValueFrom(nodeRepository.getNodeInfo()); expect(nodeInfo).to.be.not.null; expect(nodeInfo.friendlyName).to.be.equal(body.friendlyName); expect(nodeInfo.host).to.be.equal(body.host); @@ -137,7 +138,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodeInfo()).thenReturn(Promise.resolve(body)); - const nodeInfo = await nodeRepository.getNodeInfo().toPromise(); + const nodeInfo = await firstValueFrom(nodeRepository.getNodeInfo()); expect(nodeInfo).to.be.not.null; expect(nodeInfo.friendlyName).to.be.equal(body.friendlyName); expect(nodeInfo.host).to.be.equal(body.host); @@ -171,7 +172,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodePeers()).thenReturn(Promise.resolve([body])); - const nodeInfoList = await nodeRepository.getNodePeers().toPromise(); + const nodeInfoList = await firstValueFrom(nodeRepository.getNodePeers()); const nodeInfo = nodeInfoList[0]; expect(nodeInfo).to.be.not.null; expect(nodeInfo.friendlyName).to.be.equal(body.friendlyName); @@ -198,7 +199,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodeTime()).thenReturn(Promise.resolve(body)); - const nodeTime = await nodeRepository.getNodeTime().toPromise(); + const nodeTime = await firstValueFrom(nodeRepository.getNodeTime()); expect(nodeTime).to.be.not.null; if (nodeTime.receiveTimeStamp && nodeTime.sendTimeStamp) { expect(nodeTime.receiveTimeStamp.toDTO()).to.deep.equals([1111, 0]); @@ -214,7 +215,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodeTime()).thenReturn(Promise.resolve(body)); try { - await nodeRepository.getNodeTime().toPromise(); + await firstValueFrom(nodeRepository.getNodeTime()); } catch (e) { expect(e.message).to.deep.equals('Node time not available'); } @@ -225,7 +226,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getUnlockedAccount()).thenReturn(Promise.resolve(body)); - const unlockedAccount = await nodeRepository.getUnlockedAccount().toPromise(); + const unlockedAccount = await firstValueFrom(nodeRepository.getUnlockedAccount()); expect(unlockedAccount).to.be.not.null; expect(unlockedAccount[0]).to.be.equal('key1'); expect(unlockedAccount[1]).to.be.equal('key2'); @@ -239,7 +240,7 @@ describe('NodeHttp', () => { when(nodeRoutesApi.getNodeStorage()).thenReturn(Promise.resolve(body)); - const storageInfo = await nodeRepository.getStorageInfo().toPromise(); + const storageInfo = await firstValueFrom(nodeRepository.getStorageInfo()); expect(storageInfo).to.deep.equals(body); }); @@ -250,7 +251,7 @@ describe('NodeHttp', () => { }), ); try { - await nodeRepository.getStorageInfo().toPromise(); + await firstValueFrom(nodeRepository.getStorageInfo()); } catch (e) { expect(e.message).to.deep.equals('{"statusCode":500,"statusMessage":"Some Error","body":"The Body"}'); } @@ -263,7 +264,7 @@ describe('NodeHttp', () => { }), ); try { - await nodeRepository.getStorageInfo().toPromise(); + await firstValueFrom(nodeRepository.getStorageInfo()); } catch (e) { expect(e.message).to.deep.equals( '{"statusCode":500,"statusMessage":"Some Error","body":"{\\"someResponse\\":\\"the body\\"}"}', @@ -288,7 +289,7 @@ describe('NodeHttp', () => { Promise.reject({ status: 500, statusText: 'Some Error', text: () => Promise.resolve('Some body text') }), ); try { - await nodeRepository.getStorageInfo().toPromise(); + await firstValueFrom(nodeRepository.getStorageInfo()); } catch (e) { expect(e.message).to.deep.equals('{"statusCode":500,"statusMessage":"Some Error","body":"Some body text"}'); } diff --git a/test/infrastructure/ReceiptHttp.spec.ts b/test/infrastructure/ReceiptHttp.spec.ts index 0523e381b0..139b029840 100644 --- a/test/infrastructure/ReceiptHttp.spec.ts +++ b/test/infrastructure/ReceiptHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { BalanceChangeReceiptDTO, Pagination, @@ -83,11 +84,11 @@ describe('ReceiptHttp', () => { Promise.resolve(resolutionPage), ); - const statement = await receiptRepository - .searchMosaicResolutionStatements({ + const statement = await firstValueFrom( + receiptRepository.searchMosaicResolutionStatements({ height: UInt64.fromUint(1), - }) - .toPromise(); + }), + ); expect(statement).to.be.not.null; expect(statement.data[0].height.toString()).to.be.equal('1'); expect(statement.data[0].resolutionType.valueOf()).to.be.equal(ResolutionType.Mosaic); @@ -122,11 +123,11 @@ describe('ReceiptHttp', () => { Promise.resolve(resolutionPage), ); - const statement = await receiptRepository - .searchAddressResolutionStatements({ + const statement = await firstValueFrom( + receiptRepository.searchAddressResolutionStatements({ height: UInt64.fromUint(1), - }) - .toPromise(); + }), + ); expect(statement).to.be.not.null; expect(statement.data[0].height.toString()).to.be.equal('1'); expect(statement.data[0].resolutionType.valueOf()).to.be.equal(ResolutionType.Address); @@ -176,11 +177,11 @@ describe('ReceiptHttp', () => { ), ).thenReturn(Promise.resolve(resolutionPage)); - const statement = await receiptRepository - .searchReceipts({ + const statement = await firstValueFrom( + receiptRepository.searchReceipts({ height: UInt64.fromUint(1), - }) - .toPromise(); + }), + ); expect(statement).to.be.not.null; expect(statement.data[0].height.toString()).to.be.equal('1'); expect((statement.data[0].receipts[0] as BalanceChangeReceipt).amount.toString()).to.be.equal('100'); @@ -203,29 +204,26 @@ describe('ReceiptHttp', () => { undefined, ), ).thenReject(new Error('Mocked Error')); - await receiptRepository - .searchReceipts({ height: UInt64.fromUint(1) }) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(receiptRepository.searchReceipts({ height: UInt64.fromUint(1) })).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('searchResolutionMosaic - Error', async () => { when(receiptRoutesApi.searchMosaicResolutionStatements('1', undefined, undefined, undefined, undefined)).thenReject( new Error('Mocked Error'), ); - await receiptRepository - .searchMosaicResolutionStatements({ height: UInt64.fromUint(1) }) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(receiptRepository.searchMosaicResolutionStatements({ height: UInt64.fromUint(1) })).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('searchResolutionAddress - Error', async () => { when(receiptRoutesApi.searchAddressResolutionStatements('1', undefined, undefined, undefined, undefined)).thenReject( new Error('Mocked Error'), ); - await receiptRepository - .searchAddressResolutionStatements({ height: UInt64.fromUint(1) }) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(receiptRepository.searchAddressResolutionStatements({ height: UInt64.fromUint(1) })).catch( + (error) => expect(error).not.to.be.undefined, + ); }); }); diff --git a/test/infrastructure/RepositoryFactory.spec.ts b/test/infrastructure/RepositoryFactory.spec.ts index 1a11c075e4..df10881048 100644 --- a/test/infrastructure/RepositoryFactory.spec.ts +++ b/test/infrastructure/RepositoryFactory.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { expect } from 'chai'; -import { of as observableOf, of } from 'rxjs'; +import { firstValueFrom, of as observableOf, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { NetworkConfigurationDTO, NodeRoutesApi } from 'symbol-openapi-typescript-fetch-client'; import { instance, mock, when } from 'ts-mockito'; @@ -86,7 +86,7 @@ describe('RepositoryFactory', () => { try { const nodeRepository = repositoryFactory.createNodeRepository(); (nodeRepository as any).nodeRoutesApi = instance(nodeRoutesApi); - await nodeRepository.getNodeHealth().toPromise(); + await firstValueFrom(nodeRepository.getNodeHealth()); expect(true).to.be.false; } catch (e) { expect(e.message).eq('{"statusCode":666,"statusMessage":"Some status text error","body":"This is the body"}'); @@ -395,7 +395,7 @@ describe('RepositoryFactory', () => { it('Fail remote call ', async () => { const factory = new RepositoryFactoryHttp('http://localhost:2000'); try { - await factory.getGenerationHash().toPromise(); + await firstValueFrom(factory.getGenerationHash()); expect(true).eq(false); } catch (e) { expect(e.message).contains('request to http://localhost:2000'); @@ -405,15 +405,10 @@ describe('RepositoryFactory', () => { it('Fail remote call invalid transaction', async () => { const factory = new RepositoryFactoryHttp('http://localhost:3000'); try { - await factory.createTransactionRepository().getTransaction('abc', TransactionGroup.Confirmed).toPromise(); + await firstValueFrom(factory.createTransactionRepository().getTransaction('abc', TransactionGroup.Confirmed)); expect(true).eq(false); } catch (e) { - if ( - await factory - .getGenerationHash() - .pipe(catchError(() => of(false))) - .toPromise() - ) { + if (await firstValueFrom(factory.getGenerationHash().pipe(catchError(() => of(false))))) { expect(e.message).contains('"statusCode":500,"statusMessage":"Internal Server Error"'); } else { expect(e.message).contains('request to http://localhost:3000'); @@ -424,7 +419,7 @@ describe('RepositoryFactory', () => { it('Fail remote getCurrencies ', async () => { const factory = new RepositoryFactoryHttp('http://localhost:2000'); try { - await factory.getCurrencies().toPromise(); + await firstValueFrom(factory.getCurrencies()); expect(true).eq(false); } catch (e) { expect(e.message).contains('request to http://localhost:2000'); @@ -433,15 +428,7 @@ describe('RepositoryFactory', () => { it('getCurrencies', async () => { const factory = new RepositoryFactoryHttp('http://localhost:2000', { networkCurrencies: NetworkCurrencies.PUBLIC }); - const networkCurrencies = await factory.getCurrencies().toPromise(); + const networkCurrencies = await firstValueFrom(factory.getCurrencies()); expect(networkCurrencies).eq(NetworkCurrencies.PUBLIC); }); - - // it('howToUse', async () => { - // const factory = new RepositoryFactoryHttp('http://localhost:3000'); - // const networkCurrencies = await factory.getCurrencies().toPromise(); - // const namespaceName: string = networkCurrencies.currency!.namespaceId!.fullName!; - // const mosaic: Mosaic = networkCurrencies.currency.createRelative(1000); - // // a mosaic ready to use for transactions - // }); }); diff --git a/test/infrastructure/RestrictionAccountHttp.spec.ts b/test/infrastructure/RestrictionAccountHttp.spec.ts index b705553fbd..681932b778 100644 --- a/test/infrastructure/RestrictionAccountHttp.spec.ts +++ b/test/infrastructure/RestrictionAccountHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { AccountRestrictionDTO, AccountRestrictionFlagsEnum, @@ -64,7 +65,7 @@ describe('RestrictionAccountHttp', () => { it('getAccountRestrictions', async () => { when(restrictionAccountRoutesApi.getAccountRestrictions(deepEqual(address.plain()))).thenReturn(Promise.resolve(restrictionInfo)); - const restrictions = (await restrictionAccountRepository.getAccountRestrictions(address).toPromise()).restrictions; + const restrictions = (await firstValueFrom(restrictionAccountRepository.getAccountRestrictions(address))).restrictions; expect(restrictions).to.be.not.null; expect(restrictions.length).to.be.greaterThan(0); expect(restrictions[0].restrictionFlags).to.be.equals(AddressRestrictionFlag.AllowIncomingAddress); @@ -73,10 +74,9 @@ describe('RestrictionAccountHttp', () => { it('getAccountRestrictions - Error', async () => { when(restrictionAccountRoutesApi.getAccountRestrictions(deepEqual(address.plain()))).thenReject(new Error('Mocked Error')); - await restrictionAccountRepository - .getAccountRestrictions(address) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(restrictionAccountRepository.getAccountRestrictions(address)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('streamer', async () => { @@ -97,7 +97,7 @@ describe('RestrictionAccountHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(restrictionAccountRoutesApi.getAccountRestrictionsMerkle(address.plain())).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await restrictionAccountRepository.getAccountRestrictionsMerkle(address).toPromise(); + const merkle = await firstValueFrom(restrictionAccountRepository.getAccountRestrictionsMerkle(address)); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/RestrictionMosaicHttp.spec.ts b/test/infrastructure/RestrictionMosaicHttp.spec.ts index 050ddb9111..3a0e58e97f 100644 --- a/test/infrastructure/RestrictionMosaicHttp.spec.ts +++ b/test/infrastructure/RestrictionMosaicHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { MerkleStateInfoDTO, MerkleTreeLeafDTO, @@ -112,7 +113,7 @@ describe('RestrictionMosaicHttp', () => { ), ).thenReturn(Promise.resolve(body)); - const page = await restrictionMosaicRepository.search({ mosaicId: mosaicId }).toPromise(); + const page = await firstValueFrom(restrictionMosaicRepository.search({ mosaicId: mosaicId })); expect(page).to.be.not.null; expect(page.data.length).to.be.equal(2); expect(page.data[1].compositeHash).to.be.equal('hash'); @@ -139,10 +140,9 @@ describe('RestrictionMosaicHttp', () => { undefined, ), ).thenReject(new Error('Mocked Error')); - await restrictionMosaicRepository - .search({ mosaicId: mosaicId }) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(restrictionMosaicRepository.search({ mosaicId: mosaicId })).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('streamer', async () => { @@ -163,7 +163,7 @@ describe('RestrictionMosaicHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(restrictionMosaicRoutesApi.getMosaicRestrictionsMerkle('hash')).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await restrictionMosaicRepository.getMosaicRestrictionsMerkle('hash').toPromise(); + const merkle = await firstValueFrom(restrictionMosaicRepository.getMosaicRestrictionsMerkle('hash')); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/SecretLockHttp.spec.ts b/test/infrastructure/SecretLockHttp.spec.ts index d59a6ae343..fd8e3072cb 100644 --- a/test/infrastructure/SecretLockHttp.spec.ts +++ b/test/infrastructure/SecretLockHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; import * as http from 'http'; +import { firstValueFrom } from 'rxjs'; import { LockHashAlgorithmEnum, MerkleTreeLeafDTO, @@ -87,7 +88,7 @@ describe('SecretLockHttp', () => { when(secretLockRoutesApi.searchSecretLock(address.plain(), lockDto.secret, undefined, undefined, undefined, undefined)).thenReturn( Promise.resolve(body), ); - const infos = await secretLockRepository.search({ address, secret: lockDto.secret }).toPromise(); + const infos = await firstValueFrom(secretLockRepository.search({ address, secret: lockDto.secret })); assertHashInfo(infos.data[0]); }); @@ -109,7 +110,7 @@ describe('SecretLockHttp', () => { merkleStateInfoDTO.tree = [merkleLeafDTO]; when(secretLockRoutesApi.getSecretLockMerkle('hash')).thenReturn(Promise.resolve(merkleStateInfoDTO)); - const merkle = await secretLockRepository.getSecretLockMerkle('hash').toPromise(); + const merkle = await firstValueFrom(secretLockRepository.getSecretLockMerkle('hash')); expect(merkle.raw).to.be.equal(merkleStateInfoDTO.raw); expect(merkle.tree.leaf).not.to.be.undefined; }); diff --git a/test/infrastructure/SerializeTransactionToJSON.spec.ts b/test/infrastructure/SerializeTransactionToJSON.spec.ts index 12c5c32a2b..2ca53bb084 100644 --- a/test/infrastructure/SerializeTransactionToJSON.spec.ts +++ b/test/infrastructure/SerializeTransactionToJSON.spec.ts @@ -19,7 +19,16 @@ import { sha3_256 } from 'js-sha3'; import { Crypto } from '../../src/core/crypto'; import { Convert as convert, Convert } from '../../src/core/format'; import { TransactionMapping } from '../../src/core/utils'; -import { Mosaic, MosaicSupplyRevocationTransaction, Transaction, TransactionVersion, UInt64 } from '../../src/model'; +import { + AccountMetadataTransaction, + Mosaic, + MosaicMetadataTransaction, + MosaicSupplyRevocationTransaction, + NamespaceMetadataTransaction, + Transaction, + TransactionVersion, + UInt64, +} from '../../src/model'; import { Account, Address } from '../../src/model/account'; import { LockHashAlgorithm } from '../../src/model/lock'; import { PlainMessage } from '../../src/model/message'; @@ -443,4 +452,86 @@ describe('SerializeTransactionToJSON', () => { expect(json.transaction.endEpoch).to.be.equal(3); expect(json.transaction.linkAction).to.be.equal(LinkAction.Link); }); + + describe('Metadata Transactions', () => { + const baseMetadataTxTest = (expectedValue: Uint8Array, metadataTransaction: Transaction) => { + // act + const json = validateToFromJson(metadataTransaction); + + // assert + expect(json.transaction.scopedMetadataKey).to.be.equal('00000000000003E8'); + expect(json.transaction.valueSize).to.be.equal(expectedValue.length); + expect(json.transaction.valueSizeDelta).to.be.equal(expectedValue.length); + expect(json.transaction.version).to.be.equal(1); + + return json; + }; + + it('should create AccountMetadataTransaction', () => { + // arrange + const value = Convert.utf8ToUint8('This is the message for this account! 汉字89664'); + const accountMetadataTransaction = AccountMetadataTransaction.create( + Deadline.create(epochAdjustment), + account.address, + UInt64.fromUint(1000), + value.length, + value, + NetworkType.TEST_NET, + ); + + // act & assert + const json = baseMetadataTxTest(value, accountMetadataTransaction); + + // assert more + expect(json.transaction.value).to.be.equal( + '5468697320697320746865206D65737361676520666F722074686973206163636F756E742120E6B189E5AD973839363634', + ); + }); + + it('should create MosaicMetadataTransaction', () => { + // arrange + const value = Convert.utf8ToUint8('This is the message for this mosaic! 汉字89664'); + const mosaicMetadataTransaction = MosaicMetadataTransaction.create( + Deadline.create(epochAdjustment), + account.address, + UInt64.fromUint(1000), + new MosaicId([2262289484, 3405110546]), + value.length, + value, + NetworkType.TEST_NET, + ); + + // act & assert + const json = baseMetadataTxTest(value, mosaicMetadataTransaction); + + // assert more + expect(json.transaction.targetMosaicId).to.be.equal('CAF5DD1286D7CC4C'); + expect(json.transaction.value).to.be.equal( + '5468697320697320746865206D65737361676520666F722074686973206D6F736169632120E6B189E5AD973839363634', + ); + }); + + it('should create NamespaceMetadataTransaction', () => { + // arrange + const value = Convert.utf8ToUint8('This is the message for this namespace! 汉字89664'); + const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( + Deadline.create(epochAdjustment), + account.address, + UInt64.fromUint(1000), + new NamespaceId([929036875, 2226345261]), + value.length, + value, + NetworkType.TEST_NET, + ); + + // act & assert + const json = baseMetadataTxTest(value, namespaceMetadataTransaction); + + // assert more + expect(json.transaction.targetNamespaceId).to.be.equal('84B3552D375FFA4B'); + expect(json.transaction.value).to.be.equal( + '5468697320697320746865206D65737361676520666F722074686973206E616D6573706163652120E6B189E5AD973839363634', + ); + }); + }); }); diff --git a/test/infrastructure/TransactionHttp.spec.ts b/test/infrastructure/TransactionHttp.spec.ts index be7b8c0264..c2186076f6 100644 --- a/test/infrastructure/TransactionHttp.spec.ts +++ b/test/infrastructure/TransactionHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { BlockDTO, BlockInfoDTO, @@ -85,7 +86,7 @@ describe('TransactionHttp', () => { const signedTx = account.sign(aggTx, generationHash); const trnsHttp = new TransactionHttp(NIS2_URL, 1573430400); expect(() => { - trnsHttp.announceAggregateBonded(signedTx).toPromise().then(); + firstValueFrom(trnsHttp.announceAggregateBonded(signedTx)).then(); }).to.throw(Error, 'Only Transaction Type 0x4241 is allowed for announce aggregate bonded'); }); @@ -178,7 +179,7 @@ describe('TransactionHttp', () => { ), ).thenReturn(Promise.resolve(page)); - let transactions = await transactionHttp.search({ group: TransactionGroup.Confirmed, address: account.address }).toPromise(); + let transactions = await firstValueFrom(transactionHttp.search({ group: TransactionGroup.Confirmed, address: account.address })); expect(transactions.data.length).to.be.equal(1); expect(transactions.data[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); @@ -189,7 +190,7 @@ describe('TransactionHttp', () => { expect(transactions.pageNumber).to.be.equal(1); expect(transactions.pageSize).to.be.equal(1); - transactions = await transactionHttp.search({ group: TransactionGroup.Unconfirmed, address: account.address }).toPromise(); + transactions = await firstValueFrom(transactionHttp.search({ group: TransactionGroup.Unconfirmed, address: account.address })); expect(transactions.data.length).to.be.equal(1); expect(transactions.data[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); @@ -200,7 +201,7 @@ describe('TransactionHttp', () => { expect(transactions.pageNumber).to.be.equal(1); expect(transactions.pageSize).to.be.equal(1); - transactions = await transactionHttp.search({ group: TransactionGroup.Partial, address: account.address }).toPromise(); + transactions = await firstValueFrom(transactionHttp.search({ group: TransactionGroup.Partial, address: account.address })); expect(transactions.data.length).to.be.equal(1); expect(transactions.data[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); @@ -238,21 +239,21 @@ describe('TransactionHttp', () => { when(transactionRoutesApi.getPartialTransaction(generationHash)).thenReturn(Promise.resolve(transactionInfoDto)); when(transactionRoutesApi.getUnconfirmedTransaction(generationHash)).thenReturn(Promise.resolve(transactionInfoDto)); - let transaction = await transactionHttp.getTransaction(generationHash, TransactionGroup.Confirmed).toPromise(); + let transaction = await firstValueFrom(transactionHttp.getTransaction(generationHash, TransactionGroup.Confirmed)); expect(transaction.type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transaction as TransferTransaction).recipientAddress as Address).plain()).to.be.equal(TestAddress.plain()); expect(transaction.transactionInfo?.id).to.be.equal('id'); expect(transaction.transactionInfo?.hash).to.be.equal('hash'); - transaction = await transactionHttp.getTransaction(generationHash, TransactionGroup.Partial).toPromise(); + transaction = await firstValueFrom(transactionHttp.getTransaction(generationHash, TransactionGroup.Partial)); expect(transaction.type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transaction as TransferTransaction).recipientAddress as Address).plain()).to.be.equal(TestAddress.plain()); expect(transaction.transactionInfo?.id).to.be.equal('id'); expect(transaction.transactionInfo?.hash).to.be.equal('hash'); - transaction = await transactionHttp.getTransaction(generationHash, TransactionGroup.Unconfirmed).toPromise(); + transaction = await firstValueFrom(transactionHttp.getTransaction(generationHash, TransactionGroup.Unconfirmed)); expect(transaction.type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transaction as TransferTransaction).recipientAddress as Address).plain()).to.be.equal(TestAddress.plain()); @@ -285,21 +286,23 @@ describe('TransactionHttp', () => { Promise.resolve([transactionInfoDto]), ); - const transactionConfirmed = await transactionHttp.getTransactionsById([generationHash], TransactionGroup.Confirmed).toPromise(); + const transactionConfirmed = await firstValueFrom( + transactionHttp.getTransactionsById([generationHash], TransactionGroup.Confirmed), + ); when(transactionRoutesApi.getUnconfirmedTransactions(deepEqual({ transactionIds: [generationHash] }))).thenReturn( Promise.resolve([transactionInfoDto]), ); - const transactionUnconfirmed = await transactionHttp - .getTransactionsById([generationHash], TransactionGroup.Unconfirmed) - .toPromise(); + const transactionUnconfirmed = await firstValueFrom( + transactionHttp.getTransactionsById([generationHash], TransactionGroup.Unconfirmed), + ); when(transactionRoutesApi.getPartialTransactions(deepEqual({ transactionIds: [generationHash] }))).thenReturn( Promise.resolve([transactionInfoDto]), ); - const transactionPartial = await transactionHttp.getTransactionsById([generationHash], TransactionGroup.Partial).toPromise(); + const transactionPartial = await firstValueFrom(transactionHttp.getTransactionsById([generationHash], TransactionGroup.Partial)); expect(transactionConfirmed.length).to.be.equal(1); expect(transactionConfirmed[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); @@ -372,7 +375,7 @@ describe('TransactionHttp', () => { when(transactionRoutesApi.getConfirmedTransaction(generationHash)).thenReturn(Promise.resolve(transactionInfoDto)); when(blockRoutesApi.getBlockByHeight(deepEqual(UInt64.fromUint(1).toString()))).thenReturn(Promise.resolve(blockInfoDto)); - const fees = await transactionHttp.getTransactionEffectiveFee(generationHash).toPromise(); + const fees = await firstValueFrom(transactionHttp.getTransactionEffectiveFee(generationHash)); expect(fees).to.be.equal(480); }); @@ -389,7 +392,7 @@ describe('TransactionHttp', () => { const signedTx = account.sign(tx, generationHash); when(transactionRoutesApi.announceTransaction(deepEqual(signedTx))).thenReturn(Promise.resolve(response)); - const announceResult = await transactionHttp.announce(signedTx).toPromise(); + const announceResult = await firstValueFrom(transactionHttp.announce(signedTx)); expect(announceResult.message).to.be.equal(response.message); }); @@ -415,7 +418,7 @@ describe('TransactionHttp', () => { const signedTx = account.sign(aggTx, generationHash); when(transactionRoutesApi.announcePartialTransaction(deepEqual(signedTx))).thenReturn(Promise.resolve(response)); - const announceResult = await transactionHttp.announceAggregateBonded(signedTx).toPromise(); + const announceResult = await firstValueFrom(transactionHttp.announceAggregateBonded(signedTx)); expect(announceResult.message).to.be.equal(response.message); }); @@ -426,62 +429,56 @@ describe('TransactionHttp', () => { const cosignTx = new CosignatureSignedTransaction('parentHash', 'signature', 'signerPubKey'); when(transactionRoutesApi.announceCosignatureTransaction(deepEqual(cosignature))).thenReturn(Promise.resolve(response)); - const announceResult = await transactionHttp.announceAggregateBondedCosignature(cosignTx).toPromise(); + const announceResult = await firstValueFrom(transactionHttp.announceAggregateBondedCosignature(cosignTx)); expect(announceResult.message).to.be.equal(response.message); }); it('getTransaction - Error', async () => { when(transactionRoutesApi.getConfirmedTransaction(generationHash)).thenReject(new Error('Mocked Error')); - await transactionHttp - .getTransaction(generationHash, TransactionGroup.Confirmed) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.getTransaction(generationHash, TransactionGroup.Confirmed)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('getTransactionById - Error', async () => { when(transactionRoutesApi.getConfirmedTransactions(deepEqual({ transactionIds: [generationHash] }))).thenReject( new Error('Mocked Error'), ); - await transactionHttp - .getTransactionsById([generationHash], TransactionGroup.Confirmed) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.getTransactionsById([generationHash], TransactionGroup.Confirmed)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('announceAggregateBonded - Error', async () => { const cosignTx = new CosignatureSignedTransaction('parentHash', 'signature', 'signerPubKey'); when(transactionRoutesApi.announceCosignatureTransaction(deepEqual(cosignature))).thenReject(new Error('Mocked Error')); - await transactionHttp - .announceAggregateBondedCosignature(cosignTx) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.announceAggregateBondedCosignature(cosignTx)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('announceAggregateBonded Cosignatures - Error', async () => { const cosignTx = new CosignatureSignedTransaction('parentHash', 'signature', 'signerPubKey'); when(transactionRoutesApi.announceCosignatureTransaction(deepEqual(cosignature))).thenReject(new Error('Mocked Error')); - await transactionHttp - .announceAggregateBondedCosignature(cosignTx) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.announceAggregateBondedCosignature(cosignTx)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('Test getEffectiveFees method', async () => { when(transactionRoutesApi.getConfirmedTransaction(generationHash)).thenReject(new Error('Mocked Error')); - await transactionHttp - .getTransactionEffectiveFee(generationHash) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.getTransactionEffectiveFee(generationHash)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('getEffectiveFees - Error', async () => { when(blockRoutesApi.getBlockByHeight(deepEqual(UInt64.fromUint(1).toString()))).thenReject(new Error('Mocked Error')); - await transactionHttp - .getTransactionEffectiveFee(generationHash) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.getTransactionEffectiveFee(generationHash)).catch( + (error) => expect(error).not.to.be.undefined, + ); }); it('announce - Error', async () => { @@ -496,10 +493,7 @@ describe('TransactionHttp', () => { const signedTx = account.sign(tx, generationHash); when(transactionRoutesApi.announceTransaction(deepEqual(signedTx))).thenReject(new Error('Mocked Error')); - await transactionHttp - .announce(signedTx) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionHttp.announce(signedTx)).catch((error) => expect(error).not.to.be.undefined); }); it('announce - Error', async () => { @@ -523,7 +517,7 @@ describe('TransactionHttp', () => { when(transactionRoutesApi.announceTransaction(deepEqual(signedTx))).thenReturn(Promise.resolve(response)); try { - await transactionHttp.announce(signedTx).toPromise(); + await firstValueFrom(transactionHttp.announce(signedTx)); } catch (error) { expect(error).not.to.be.undefined; } diff --git a/test/infrastructure/TransactionStatusHttp.spec.ts b/test/infrastructure/TransactionStatusHttp.spec.ts index 74168e84c9..f8fe420a46 100644 --- a/test/infrastructure/TransactionStatusHttp.spec.ts +++ b/test/infrastructure/TransactionStatusHttp.spec.ts @@ -15,6 +15,7 @@ */ import { expect } from 'chai'; +import { firstValueFrom } from 'rxjs'; import { TransactionGroupEnum, TransactionStatusDTO, @@ -47,7 +48,7 @@ describe('TransactionStatusHttp', () => { when(transactionStatusRoutesApi.getTransactionStatus(deepEqual(hash))).thenReturn(Promise.resolve(transactionStatusDTO)); - const transactionStatus = await transactionStatusHttp.getTransactionStatus(hash).toPromise(); + const transactionStatus = await firstValueFrom(transactionStatusHttp.getTransactionStatus(hash)); expect(transactionStatus.deadline.toString()).to.be.equal('1234'); expect(transactionStatus.hash).to.be.equal(hash); @@ -67,7 +68,7 @@ describe('TransactionStatusHttp', () => { Promise.resolve([transactionStatusDTO]), ); - const transactionStatuses = await transactionStatusHttp.getTransactionStatuses([hash]).toPromise(); + const transactionStatuses = await firstValueFrom(transactionStatusHttp.getTransactionStatuses([hash])); expect(transactionStatuses.length).to.be.equal(1); const transactionStatus = transactionStatuses[0]; @@ -79,17 +80,11 @@ describe('TransactionStatusHttp', () => { it('getTransactionStatus - Error', async () => { when(transactionStatusRoutesApi.getTransactionStatus('abc')).thenReject(new Error('Mocked Error')); - await transactionStatusHttp - .getTransactionStatus('abc') - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionStatusHttp.getTransactionStatus('abc')).catch((error) => expect(error).not.to.be.undefined); }); it('getTransactionStatuss - Error', async () => { when(transactionStatusRoutesApi.getTransactionStatuses(deepEqual({ hashes: ['abc'] }))).thenReject(new Error('Mocked Error')); - await transactionStatusHttp - .getTransactionStatuses(['abc']) - .toPromise() - .catch((error) => expect(error).not.to.be.undefined); + await firstValueFrom(transactionStatusHttp.getTransactionStatuses(['abc'])).catch((error) => expect(error).not.to.be.undefined); }); }); diff --git a/test/infrastructure/streamer/PaginationStreamerTestHelper.ts b/test/infrastructure/streamer/PaginationStreamerTestHelper.ts index d48d6af6e0..cb53c89577 100644 --- a/test/infrastructure/streamer/PaginationStreamerTestHelper.ts +++ b/test/infrastructure/streamer/PaginationStreamerTestHelper.ts @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { Observable, of } from 'rxjs'; +import { firstValueFrom, Observable, of } from 'rxjs'; import { take, toArray } from 'rxjs/operators'; import { deepEqual, instance, verify, when } from 'ts-mockito'; import { Page } from '../../../src/infrastructure/Page'; @@ -55,7 +55,7 @@ export class PaginationStreamerTestHelper { if (limit) { search = search.pipe(take(limit)); } - const returnedInfos = await search.pipe(toArray()).toPromise(); + const returnedInfos = await firstValueFrom(search.pipe(toArray())); expect(returnedInfos).to.be.eql(infos.slice(0, !limit ? infos.length : limit)); const totalPagesRead = limit == null ? pages.length : Math.ceil(limit / pageSize); verify(this.repository.search(deepEqual(this.criteria))).times(totalPagesRead); diff --git a/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts b/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts index 9f52514a67..2a669c4f52 100644 --- a/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts +++ b/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts @@ -17,7 +17,14 @@ import { LocalDateTime } from '@js-joda/core'; import { deepEqual } from 'assert'; import { TransactionTypeDto } from 'catbuffer-typescript'; import { expect } from 'chai'; -import { NamespaceRegistrationTypeEnum, TransactionInfoDTO, TransferTransactionDTO } from 'symbol-openapi-typescript-fetch-client'; +import { + NamespaceRegistrationTypeEnum, + NetworkTypeEnum, + TransactionInfoDTO, + TransactionTypeEnum, + TransferTransactionDTO, +} from 'symbol-openapi-typescript-fetch-client'; +import { MosaicId, NamespaceId } from '../../..'; import { CreateTransactionFromDTO } from '../../../src/infrastructure/transaction'; import { Address } from '../../../src/model/account'; import { TransferTransaction } from '../../../src/model/transaction'; @@ -32,7 +39,7 @@ describe('CreateTransactionFromDTO', () => { '7442156D839A3AC900BC0299E8701ECDABA674DCF91283223450953B005DE72C538EA54236F5E089530074CE78067CD3325CF53750B9118154C08B20A5CDC00D', signerPublicKey: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863', version: 1, - network: 144, + network: NetworkTypeEnum.NUMBER_104, type: 16724, maxFee: '0', deadline: '1000', @@ -703,4 +710,171 @@ describe('CreateTransactionFromDTO', () => { ); }); }); + + describe('Metadata Transactions', () => { + // standalone tx constants + const testTxSignature = + '7442156D839A3AC900BC0299E8701ECDABA674DCF91283223450953B005DE72C538EA54236F5E089530074CE78067CD3325CF53750B9118154C08B20A5CDC00D'; + const testTxSignerPublicKey = '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863'; + const testTxDeadline = '71756535303'; + const testTxHeight = '1'; + const testTxHash = '533243B8575C4058F894C453160AFF055A4A905978AC331460F44104D831E4AC'; + const testTxMerkleComponentHash = '533243B8575C4058F894C453160AFF055A4A905978AC331460F44104D831E4AC'; + const testTxId = '5CD2B76B2B3F0F0001751380'; + const testTxIndex = 0; + const testTxSize = 100; + const testTxMaxFee = '0'; + + // aggregate tx constants + const testAggTxId = '5A0069D83F17CF0001777E55'; + const testAggTxHash = '671653C94E2254F2A23EFEDB15D67C38332AED1FBD24B063C0A8E675582B6A96'; + const testAggTxHeight = '1860'; + const testAggTxIndex = 0; + const testAggMerkleComponentHash = '81E5E7AE49998802DABC816EC10158D3A7879702FF29084C2C992CD1289877A7'; + const testAggTxSize = 100; + const testAggTxCosigSignature = + '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07'; + const testAggCosigSignerPublicKey = 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630'; + const testAggTxDeadline = '1000'; + const testAggTxMaxFee = '0'; + const testAggTxSignature = + '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606'; + const testAggTxSignerPublicKey = '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D'; + + // metadata tx constants + const testTargetAddress = 'TATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA37JGO5Q'; + const testScopedMedataKey = '00000000000003E8'; + + const prepBaseTxDto = (txType: TransactionTypeEnum) => ({ + signerPublicKey: testTxSignerPublicKey, + version: 1, + network: NetworkTypeEnum.NUMBER_152, + type: txType, + maxFee: testTxMaxFee, + deadline: testTxDeadline, + }); + + const prepAggregateTxDto = (innerTransaction) => ({ + id: testAggTxId, + meta: { + hash: testAggTxHash, + height: testAggTxHeight, + index: testAggTxIndex, + merkleComponentHash: testAggMerkleComponentHash, + }, + transaction: { + size: testAggTxSize, + cosignatures: [ + { + version: '0', + signature: testAggTxCosigSignature, + signerPublicKey: testAggCosigSignerPublicKey, + }, + ], + deadline: testAggTxDeadline, + maxFee: testAggTxMaxFee, + signature: testAggTxSignature, + signerPublicKey: testAggTxSignerPublicKey, + transactions: [ + { + id: testTxId, + meta: { + aggregateHash: testAggTxHash, + aggregateId: testAggTxId, + height: testAggTxHeight, + index: testAggTxIndex, + }, + transaction: innerTransaction, + }, + ], + type: 16705, + version: 1, + network: NetworkTypeEnum.NUMBER_152, + }, + }); + + const prepStandaloneTxDto = (transactionDto) => ({ + id: testTxId, + meta: { + height: testTxHeight, + hash: testTxHash, + merkleComponentHash: testTxMerkleComponentHash, + index: testTxIndex, + }, + transaction: transactionDto, + }); + + const prepTransactionDto = (txDetails) => ({ + size: testTxSize, + signature: testTxSignature, + ...txDetails, + }); + + const testStandaloneAndAggregate = (baseMetadataTxDto, txType) => { + it('standalone', () => { + // arrange + const metadataTransactionDto: TransactionInfoDTO = prepStandaloneTxDto(prepTransactionDto(baseMetadataTxDto)); + + // act + const metadataTransaction = CreateTransactionFromDTO(metadataTransactionDto); + + // assert + expect(metadataTransaction.type).eq(txType); + expect(metadataTransaction.size).eq(testTxSize); + ValidateTransaction.validateStandaloneTx(metadataTransaction, metadataTransactionDto); + }); + + it('aggregate', () => { + // arrange + const aggregateMetadataTransactionDto = prepAggregateTxDto(baseMetadataTxDto); + + // act + const aggregateMetadataTransaction = CreateTransactionFromDTO(aggregateMetadataTransactionDto); + + // assert + expect(aggregateMetadataTransaction.size).eq(testAggTxSize); + ValidateTransaction.validateAggregateTx(aggregateMetadataTransaction, aggregateMetadataTransactionDto); + }); + }; + + describe('AccountMetadataTransaction', () => { + const baseAccountMetadataTxDto = { + ...prepBaseTxDto(TransactionTypeEnum.NUMBER_16708), + targetAddress: testTargetAddress, + scopedMetadataKey: testScopedMedataKey, + valueSizeDelta: 49, + valueSize: 49, + value: '5468697320697320746865206D65737361676520666F722074686973206163636F756E742120E6B189E5AD973839363634', + }; + testStandaloneAndAggregate(baseAccountMetadataTxDto, TransactionTypeDto.ACCOUNT_METADATA); + }); + + describe('MosaicMetadataTransaction', () => { + const baseMosaicMetadataTxDto = { + ...prepBaseTxDto(TransactionTypeEnum.NUMBER_16964), + targetAddress: testTargetAddress, + scopedMetadataKey: testScopedMedataKey, + targetMosaicId: new MosaicId([2262289484, 3405110546]).toHex(), + valueSizeDelta: 48, + valueSize: 48, + value: '5468697320697320746865206D65737361676520666F722074686973206D6F736169632120E6B189E5AD973839363634', + }; + testStandaloneAndAggregate(baseMosaicMetadataTxDto, TransactionTypeDto.MOSAIC_METADATA); + }); + + describe('NamespaceMetadataTransaction', () => { + const baseNamespaceMetadataTxDto = { + ...prepBaseTxDto(TransactionTypeEnum.NUMBER_17220), + targetAddress: testTargetAddress, + scopedMetadataKey: testScopedMedataKey, + targetNamespaceId: new NamespaceId([929036875, 2226345261]).toHex(), + valueSizeDelta: 51, + valueSize: 51, + value: '5468697320697320746865206D65737361676520666F722074686973206E616D6573706163652120E6B189E5AD973839363634', + }; + testStandaloneAndAggregate(baseNamespaceMetadataTxDto, TransactionTypeDto.NAMESPACE_METADATA); + }); + }); }); diff --git a/test/infrastructure/transaction/ValidateTransaction.ts b/test/infrastructure/transaction/ValidateTransaction.ts index f9c73bfc50..eff560c7c6 100644 --- a/test/infrastructure/transaction/ValidateTransaction.ts +++ b/test/infrastructure/transaction/ValidateTransaction.ts @@ -16,6 +16,7 @@ import { deepEqual } from 'assert'; import { expect } from 'chai'; +import { Convert } from '../../..'; import { Address } from '../../../src/model/account/Address'; import { MosaicId } from '../../../src/model/mosaic/MosaicId'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; @@ -50,6 +51,12 @@ const ValidateTransaction = { ValidateTransaction.validateMosaicSupplyRevocationTx(transaction, transactionDTO); } else if (transaction.type === TransactionType.MULTISIG_ACCOUNT_MODIFICATION) { ValidateTransaction.validateMultisigModificationTx(transaction, transactionDTO); + } else if (transaction.type === TransactionType.ACCOUNT_METADATA) { + ValidateTransaction.validateMetadataTx(transaction, transactionDTO); + } else if (transaction.type === TransactionType.MOSAIC_METADATA) { + ValidateTransaction.validateMosaicMetadataTx(transaction, transactionDTO); + } else if (transaction.type === TransactionType.NAMESPACE_METADATA) { + ValidateTransaction.validateNamespaceMetadataTx(transaction, transactionDTO); } }, validateAggregateTx: (aggregateTransaction: any, aggregateTransactionDTO: any): void => { @@ -122,6 +129,26 @@ const ValidateTransaction = { deepEqual(transferTransaction.recipientAddress, Address.createFromEncoded(transferTransactionDTO.transaction.recipientAddress)); expect(transferTransaction.message.payload).to.be.equal('test-message'); }, + validateMetadataTx: (metadataTransaction: any, metadataTransactionDTO: any): void => { + expect(metadataTransaction.targetAddress.plain()).to.be.equal(metadataTransactionDTO.transaction.targetAddress); + expect(metadataTransaction.metadataType).to.be.equal(metadataTransactionDTO.transaction.metadataType); + deepEqual(metadataTransaction.scopedMetadataKey, UInt64.fromHex(metadataTransactionDTO.transaction.scopedMetadataKey)); + expect(metadataTransaction.valueSizeDelta).to.be.equal(metadataTransactionDTO.transaction.valueSizeDelta); + deepEqual(metadataTransaction.value, Convert.hexToUint8(metadataTransactionDTO.transaction.value)); + }, + validateAccountMetadataTx: (accountMetadataTransaction: any, accountMetadataTransactionDTO: any): void => { + ValidateTransaction.validateMetadataTx(accountMetadataTransaction, accountMetadataTransactionDTO); + }, + validateMosaicMetadataTx: (mosaicMetadataTransaction: any, mosaicMetadataTransactionDTO: any): void => { + ValidateTransaction.validateMetadataTx(mosaicMetadataTransaction, mosaicMetadataTransactionDTO); + expect(mosaicMetadataTransaction.targetMosaicId.toHex()).to.be.equal(mosaicMetadataTransactionDTO.transaction.targetMosaicId); + }, + validateNamespaceMetadataTx: (namespaceMetadataTransaction: any, namespaceMetadataTransactionDTO: any): void => { + ValidateTransaction.validateMetadataTx(namespaceMetadataTransaction, namespaceMetadataTransactionDTO); + expect(namespaceMetadataTransaction.targetNamespaceId.toHex()).to.be.equal( + namespaceMetadataTransactionDTO.transaction.targetNamespaceId, + ); + }, }; export default ValidateTransaction; diff --git a/test/model/transaction/AccountMetadataTransaction.spec.ts b/test/model/transaction/AccountMetadataTransaction.spec.ts index 6004e3fa17..25ffb4d290 100644 --- a/test/model/transaction/AccountMetadataTransaction.spec.ts +++ b/test/model/transaction/AccountMetadataTransaction.spec.ts @@ -28,12 +28,15 @@ import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount, TestNetworkType } from '../../conf/conf.spec'; describe('AccountMetadataTransaction', () => { - let account: Account; + let account: Account, emptyValue: Uint8Array; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); + beforeEach(() => { + emptyValue = new Uint8Array(10); + }); it('should default maxFee field be set to 0', () => { const accountMetadataTransaction = AccountMetadataTransaction.create( @@ -41,7 +44,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -55,7 +58,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, new UInt64([1, 0]), ); @@ -70,7 +73,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -88,7 +91,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -105,7 +108,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -122,7 +125,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -141,7 +144,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -157,7 +160,7 @@ describe('AccountMetadataTransaction', () => { account.address, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -179,7 +182,7 @@ describe('AccountMetadataTransaction', () => { alias, UInt64.fromUint(1000), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); diff --git a/test/model/transaction/MosaicMetadataTransaction.spec.ts b/test/model/transaction/MosaicMetadataTransaction.spec.ts index 844d897d98..9f56348c31 100644 --- a/test/model/transaction/MosaicMetadataTransaction.spec.ts +++ b/test/model/transaction/MosaicMetadataTransaction.spec.ts @@ -34,7 +34,7 @@ import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount, TestNetworkType } from '../../conf/conf.spec'; describe('MosaicMetadataTransaction', () => { - let account: Account; + let account: Account, emptyValue: Uint8Array; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; let statement: Statement; const unresolvedMosaicId = new NamespaceId('mosaic'); @@ -52,6 +52,9 @@ describe('MosaicMetadataTransaction', () => { ], ); }); + beforeEach(() => { + emptyValue = new Uint8Array(10); + }); it('should default maxFee field be set to 0', () => { const mosaicMetadataTransaction = MosaicMetadataTransaction.create( @@ -60,7 +63,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -75,7 +78,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, new UInt64([1, 0]), ); @@ -91,7 +94,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -110,7 +113,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), namespacId, 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -129,7 +132,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); expect(mosaicMetadataTransaction.size).to.be.equal(182); @@ -143,7 +146,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); expect(mosaicMetadataTransaction.size).to.be.equal(182); @@ -159,7 +162,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ).setMaxFee(2); expect(mosaicMetadataTransaction.maxFee.compact()).to.be.equal(364); @@ -178,7 +181,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), unresolvedMosaicId, 10, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, '', account.publicAccount, new TransactionInfo(UInt64.fromUint(2), 0, ''), @@ -197,7 +200,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -217,7 +220,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); let canNotify = tx.shouldNotifyAccount(account.address); @@ -239,7 +242,7 @@ describe('MosaicMetadataTransaction', () => { UInt64.fromUint(1000), new MosaicId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); let canNotify = tx.shouldNotifyAccount(alias); diff --git a/test/model/transaction/NamespaceMetadataTransaction.spec.ts b/test/model/transaction/NamespaceMetadataTransaction.spec.ts index 4c03629014..530a8994bd 100644 --- a/test/model/transaction/NamespaceMetadataTransaction.spec.ts +++ b/test/model/transaction/NamespaceMetadataTransaction.spec.ts @@ -25,12 +25,15 @@ import { Deadline, NamespaceMetadataTransaction, TransactionType } from '../../. import { TestingAccount, TestNetworkType } from '../../conf/conf.spec'; describe('NamespaceMetadataTransaction', () => { - let account: Account; + let account: Account, emptyValue: Uint8Array; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); + beforeEach(() => { + emptyValue = new Uint8Array(10); + }); it('should default maxFee field be set to 0', () => { const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( @@ -39,7 +42,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -54,7 +57,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, new UInt64([1, 0]), ); @@ -70,7 +73,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -89,7 +92,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); expect(namespaceMetadataTransaction.size).to.be.equal(182); @@ -103,7 +106,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); expect(namespaceMetadataTransaction.size).to.be.equal(182); @@ -119,7 +122,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ).setMaxFee(2); expect(namespaceMetadataTransaction.maxFee.compact()).to.be.equal(364); @@ -135,7 +138,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); @@ -155,7 +158,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); const resolved = namespaceMetadataTransaction.resolveAliases(); @@ -171,7 +174,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); let canNotify = tx.shouldNotifyAccount(account.address); @@ -193,7 +196,7 @@ describe('NamespaceMetadataTransaction', () => { UInt64.fromUint(1000), new NamespaceId([2262289484, 3405110546]), 1, - Convert.uint8ToUtf8(new Uint8Array(10)), + emptyValue, TestNetworkType, ); let canNotify = tx.shouldNotifyAccount(alias); diff --git a/test/service/AccountService.spec.ts b/test/service/AccountService.spec.ts index 8566027548..47052e2a77 100644 --- a/test/service/AccountService.spec.ts +++ b/test/service/AccountService.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { of as observableOf } from 'rxjs'; +import { firstValueFrom, of as observableOf } from 'rxjs'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { AccountRepository } from '../../src/infrastructure/AccountRepository'; import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository'; @@ -169,7 +169,7 @@ describe('AccountService', () => { }); it('should return accountInfo with resolved mosaic name', async () => { - const result = await accountService.accountInfoWithResolvedMosaic([account.address]).toPromise(); + const result = await firstValueFrom(accountService.accountInfoWithResolvedMosaic([account.address])); expect(result[0].resolvedMosaics).to.not.be.undefined; expect(result[0].resolvedMosaics![0].namespaceName?.name).to.be.equal('catapult.currency'); expect(result[0].resolvedMosaics![1].namespaceName?.name).to.be.equal('symbol.xym'); @@ -178,7 +178,7 @@ describe('AccountService', () => { it('should return accountInfo with mosaicId', async () => { when(mockAccountRepository.getAccountsInfo(deepEqual([account2.address]))).thenReturn(observableOf(mockAccountInfo(true))); - const result = await accountService.accountInfoWithResolvedMosaic([account2.address]).toPromise(); + const result = await firstValueFrom(accountService.accountInfoWithResolvedMosaic([account2.address])); expect(result[0].resolvedMosaics).to.not.be.undefined; expect(result[0].resolvedMosaics![0].namespaceName?.name).to.be.equal('catapult.currency'); expect(result[0].resolvedMosaics![1].namespaceName?.name).to.be.equal('symbol.xym'); @@ -188,7 +188,7 @@ describe('AccountService', () => { }); it('should return namespaceInfo with resolved name', async () => { - const result = await accountService.accountNamespacesWithName(account.address).toPromise(); + const result = await firstValueFrom(accountService.accountNamespacesWithName(account.address)); expect(result).to.not.be.undefined; expect(result.length).to.be.greaterThan(0); expect(result![0].namespaceName).to.be.equal('catapult.currency'); @@ -198,7 +198,7 @@ describe('AccountService', () => { it('should return empty resolved namespaceInfo', async () => { when(mockAccountRepository.getAccountsInfo(deepEqual([account2.address]))).thenReturn(observableOf(mockAccountInfo(true, true))); - const result = await accountService.accountInfoWithResolvedMosaic([account2.address]).toPromise(); + const result = await firstValueFrom(accountService.accountInfoWithResolvedMosaic([account2.address])); expect(result).to.not.be.undefined; expect(result.length).to.be.greaterThan(0); expect(result![0].resolvedMosaics?.length).to.be.equal(1); diff --git a/test/service/AggregateTransactionService.spec.ts b/test/service/AggregateTransactionService.spec.ts index f3ec4c0858..0608c7684e 100644 --- a/test/service/AggregateTransactionService.spec.ts +++ b/test/service/AggregateTransactionService.spec.ts @@ -16,7 +16,7 @@ import { ChronoUnit } from '@js-joda/core'; import { expect } from 'chai'; -import { of as observableOf } from 'rxjs'; +import { firstValueFrom, of as observableOf } from 'rxjs'; import { AggregateNetworkPropertiesDTO, NetworkConfigurationDTO, PluginsPropertiesDTO } from 'symbol-openapi-typescript-fetch-client'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { MultisigRepository } from '../../src/infrastructure/MultisigRepository'; @@ -188,12 +188,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account2], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.true; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.true; + }); }); it('should return isComplete: false for aggregated complete transaction - 2 levels Multisig', () => { @@ -221,12 +218,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.false; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.false; + }); }); it('should return isComplete: false for aggregated complete transaction - 2 levels Multisig', () => { @@ -254,12 +248,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account4], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.false; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.false; + }); }); it('should return correct isComplete status for aggregated complete transaction - 2 levels Multisig, multi inner transaction', () => { @@ -295,12 +286,9 @@ describe('AggregateTransactionService', () => { [], ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account4], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.false; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.false; + }); }); it('should return correct isComplete status for aggregated complete transaction - 2 levels Multisig, multi inner transaction', () => { @@ -336,12 +324,9 @@ describe('AggregateTransactionService', () => { [], ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account4, account2], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.true; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.true; + }); }); it('should use minRemoval for multisig account validation if inner transaction is modify multisig remove', () => { @@ -367,12 +352,9 @@ describe('AggregateTransactionService', () => { [], ); const signedTransaction = aggregateTransaction.signWith(account2, generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.true; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.true; + }); }); it('should return correct isComplete status (false) for aggregated complete transaction - none multisig', () => { @@ -398,12 +380,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signWith(account1, generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.false; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.false; + }); }); it('should return correct isComplete status (true) for aggregated complete transaction - none multisig', () => { @@ -430,12 +409,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signWith(account4, generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.true; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.true; + }); }); it('should return correct isComplete status TRUE - multiple normal account', () => { @@ -476,12 +452,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account4], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.true; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.true; + }); }); it('should return correct isComplete status FALSE - multiple normal account', () => { @@ -521,12 +494,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.false; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.false; + }); }); it('should return correct isComplete status TRUE - multisig Single Level', () => { @@ -551,12 +521,9 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account2, [account3], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.true; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.true; + }); }); it('should return correct isComplete status FALSE - multisig Single Level', () => { @@ -581,38 +548,32 @@ describe('AggregateTransactionService', () => { ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account2, [], generationHash); - aggregateTransactionService - .isComplete(signedTransaction) - .toPromise() - .then((isComplete) => { - expect(isComplete).to.be.false; - }); + return firstValueFrom(aggregateTransactionService.isComplete(signedTransaction)).then((isComplete) => { + expect(isComplete).to.be.false; + }); }); it('should call getNetworkMaxCosignaturesPerAggregate and returns', async () => { when(mockNetworkRepository.getNetworkProperties()).thenReturn(observableOf(getNetworkProperties('15'))); - const max = await aggregateTransactionService.getNetworkMaxCosignaturesPerAggregate().toPromise(); + const max = await firstValueFrom(aggregateTransactionService.getNetworkMaxCosignaturesPerAggregate()); expect(max).to.be.equal(15); }); it('should call getNetworkMaxCosignaturesPerAggregate and returns with single quote', async () => { when(mockNetworkRepository.getNetworkProperties()).thenReturn(observableOf(getNetworkProperties(`1'000`))); - const max = await aggregateTransactionService.getNetworkMaxCosignaturesPerAggregate().toPromise(); + const max = await firstValueFrom(aggregateTransactionService.getNetworkMaxCosignaturesPerAggregate()); expect(max).to.be.equal(1000); }); it('should call getNetworkMaxCosignaturesPerAggregate and throw', () => { when(mockNetworkRepository.getNetworkProperties()).thenReturn(observableOf(getNetworkProperties(''))); - aggregateTransactionService - .getNetworkMaxCosignaturesPerAggregate() - .toPromise() - .catch((error) => { - expect(error).not.to.be.undefined; - }); + return firstValueFrom(aggregateTransactionService.getNetworkMaxCosignaturesPerAggregate()).catch((error) => { + expect(error).not.to.be.undefined; + }); }); it('should call getMaxCosignatures and returns', async () => { - const max = await aggregateTransactionService.getMaxCosignatures(multisig2.address).toPromise(); + const max = await firstValueFrom(aggregateTransactionService.getMaxCosignatures(multisig2.address)); expect(max).to.be.equal(4); }); @@ -620,7 +581,7 @@ describe('AggregateTransactionService', () => { when(mockedAccountRepository.getMultisigAccountGraphInfo(deepEqual(multisig2.address))).thenReturn( observableOf(givenMultisig2AccountGraphInfoDuplicated()), ); - const max = await aggregateTransactionService.getMaxCosignatures(multisig2.address).toPromise(); + const max = await firstValueFrom(aggregateTransactionService.getMaxCosignatures(multisig2.address)); expect(max).to.be.equal(4); }); }); diff --git a/test/service/BlockService.spec.ts b/test/service/BlockService.spec.ts index 8691488678..ae51ae6dc4 100644 --- a/test/service/BlockService.spec.ts +++ b/test/service/BlockService.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { of as observableOf } from 'rxjs'; +import { firstValueFrom, of as observableOf } from 'rxjs'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { BlockRepository } from '../../src/infrastructure/BlockRepository'; import { Page } from '../../src/infrastructure/Page'; @@ -174,42 +174,42 @@ describe('BlockService', () => { }); it('should validate transaction', async () => { - const result = await blockService.validateTransactionInBlock(leaf, UInt64.fromUint(1)).toPromise(); + const result = await firstValueFrom(blockService.validateTransactionInBlock(leaf, UInt64.fromUint(1))); expect(result).to.be.true; }); it('should validate transaction - wrong hash', async () => { - const result = await blockService.validateTransactionInBlock(leaf, UInt64.fromUint(2)).toPromise(); + const result = await firstValueFrom(blockService.validateTransactionInBlock(leaf, UInt64.fromUint(2))); expect(result).to.be.false; }); it('should validate transaction - emtpy path item', async () => { - const result = await blockService.validateTransactionInBlock(leaf, UInt64.fromUint(4)).toPromise(); + const result = await firstValueFrom(blockService.validateTransactionInBlock(leaf, UInt64.fromUint(4))); expect(result).to.be.false; }); it('should validate transaction - error', async () => { - const result = await blockService.validateTransactionInBlock(leaf, UInt64.fromUint(3)).toPromise(); + const result = await firstValueFrom(blockService.validateTransactionInBlock(leaf, UInt64.fromUint(3))); expect(result).to.be.false; }); it('should validate statement', async () => { - const result = await blockService.validateStatementInBlock(leaf, UInt64.fromUint(1)).toPromise(); + const result = await firstValueFrom(blockService.validateStatementInBlock(leaf, UInt64.fromUint(1))); expect(result).to.be.true; }); it('should validate statement - wrong hash', async () => { - const result = await blockService.validateStatementInBlock(leaf, UInt64.fromUint(2)).toPromise(); + const result = await firstValueFrom(blockService.validateStatementInBlock(leaf, UInt64.fromUint(2))); expect(result).to.be.false; }); it('should validate statement - error', async () => { - const result = await blockService.validateStatementInBlock(leaf, UInt64.fromUint(3)).toPromise(); + const result = await firstValueFrom(blockService.validateStatementInBlock(leaf, UInt64.fromUint(3))); expect(result).to.be.false; }); it('should calculate root transaction merkle hash', async () => { - const result = await blockService.calculateTransactionsMerkleRootHash(UInt64.fromUint(1)).toPromise(); + const result = await firstValueFrom(blockService.calculateTransactionsMerkleRootHash(UInt64.fromUint(1))); expect(result).to.be.equal('DCD14A040BC5096348FC55CACBD0D459DD6F81779C7E7C526EA52309BD6595F7'); }); }); diff --git a/test/service/CurrencyService.spec.ts b/test/service/CurrencyService.spec.ts index 8652ce9653..a6c638af62 100644 --- a/test/service/CurrencyService.spec.ts +++ b/test/service/CurrencyService.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { of as observableOf } from 'rxjs'; +import { firstValueFrom, of as observableOf } from 'rxjs'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { DtoMapping } from '../../src/core/utils/DtoMapping'; import { MosaicRepository } from '../../src/infrastructure/MosaicRepository'; @@ -103,7 +103,7 @@ describe('CurrencyService', () => { const repositoryFactory = instance(mockRepoFactory); const service = new CurrencyService(repositoryFactory); - const currencies = await service.getNetworkCurrencies().toPromise(); + const currencies = await firstValueFrom(service.getNetworkCurrencies()); const currencyNamespaceId = currencyMosaicNames.names[0].namespaceId; expect(currencies.currency).to.be.deep.equal( @@ -188,7 +188,7 @@ describe('CurrencyService', () => { const repositoryFactory = instance(mockRepoFactory); const service = new CurrencyService(repositoryFactory); - const [currency, harvest] = await service.getCurrencies([currencyMosaicId, harvestingMosaicId]).toPromise(); + const [currency, harvest] = await firstValueFrom(service.getCurrencies([currencyMosaicId, harvestingMosaicId])); expect(currency).to.be.deep.equal( new Currency({ diff --git a/test/service/MetadataTransactionservice.spec.ts b/test/service/MetadataTransactionservice.spec.ts index a36cd39247..2d490c82df 100644 --- a/test/service/MetadataTransactionservice.spec.ts +++ b/test/service/MetadataTransactionservice.spec.ts @@ -124,7 +124,7 @@ describe('MetadataTransactionService', () => { .subscribe((transaction: AccountMetadataTransaction) => { expect(transaction.type).to.be.equal(TransactionType.ACCOUNT_METADATA); expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex()); - expect(Convert.utf8ToHex(transaction.value)).to.be.equal( + expect(Convert.uint8ToHex(transaction.value)).to.be.equal( Convert.xor(Convert.utf8ToUint8(value), Convert.utf8ToUint8(value + deltaValue)), ); expect(transaction.valueSizeDelta).to.be.equal(deltaValue.length); @@ -148,7 +148,7 @@ describe('MetadataTransactionService', () => { .subscribe((transaction: MosaicMetadataTransaction) => { expect(transaction.type).to.be.equal(TransactionType.MOSAIC_METADATA); expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex()); - expect(Convert.utf8ToHex(transaction.value)).to.be.equal( + expect(Convert.uint8ToHex(transaction.value)).to.be.equal( Convert.xor(Convert.utf8ToUint8(value), Convert.utf8ToUint8(value + deltaValue)), ); expect(transaction.targetMosaicId.toHex()).to.be.equal(targetIdHex); @@ -173,7 +173,7 @@ describe('MetadataTransactionService', () => { .subscribe((transaction: NamespaceMetadataTransaction) => { expect(transaction.type).to.be.equal(TransactionType.NAMESPACE_METADATA); expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex()); - expect(Convert.utf8ToHex(transaction.value)).to.be.equal( + expect(Convert.uint8ToHex(transaction.value)).to.be.equal( Convert.xor(Convert.utf8ToUint8(value), Convert.utf8ToUint8(value + deltaValue)), ); expect(transaction.targetNamespaceId.toHex()).to.be.equal(targetIdHex); diff --git a/test/service/TransactionService.spec.ts b/test/service/TransactionService.spec.ts index 0a856fcd96..4d39f1eff6 100644 --- a/test/service/TransactionService.spec.ts +++ b/test/service/TransactionService.spec.ts @@ -16,7 +16,7 @@ import { ChronoUnit } from '@js-joda/core'; import { expect } from 'chai'; -import { EMPTY, from, of as observableOf } from 'rxjs'; +import { EMPTY, firstValueFrom, from, of as observableOf } from 'rxjs'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { IListener, ReceiptRepository, TransactionRepository } from '../../src/infrastructure'; import { UInt64 } from '../../src/model'; @@ -86,7 +86,7 @@ describe('TransactionService', () => { when(transactionRepositoryMock.announce(deepEqual(signedTransaction))).thenReturn(from(Promise.reject(Error('break this!')))); const service = new TransactionService(instance(transactionRepositoryMock), instance(mockedReceiptRepository)); try { - await service.announce(signedTransaction, instance(listener)).toPromise(); + await firstValueFrom(service.announce(signedTransaction, instance(listener))); expect(false).true; } catch (e) { expect(e.message).eq('break this!'); @@ -98,7 +98,7 @@ describe('TransactionService', () => { when(transactionRepositoryMock.announce(deepEqual(signedTransaction))).thenThrow(Error('break this!')); const service = new TransactionService(instance(transactionRepositoryMock), instance(mockedReceiptRepository)); try { - await service.announce(signedTransaction, instance(listener)).toPromise(); + await firstValueFrom(service.announce(signedTransaction, instance(listener))); expect(false).true; } catch (e) { expect(e.message).eq('break this!'); @@ -122,7 +122,7 @@ describe('TransactionService', () => { const announcedTransaction = service.announce(signedTransaction, instance(listener)); - const transaction = await announcedTransaction.toPromise(); + const transaction = await firstValueFrom(announcedTransaction); expect(transaction).to.be.equal(transferTransaction); }); @@ -147,7 +147,7 @@ describe('TransactionService', () => { const announcedTransaction = service.announce(signedTransaction, instance(listener)); try { - await announcedTransaction.toPromise(); + await firstValueFrom(announcedTransaction); } catch (e) { expect(e.message).to.be.equal('Some Error'); } @@ -171,7 +171,7 @@ describe('TransactionService', () => { const announcedTransaction = service.announceAggregateBonded(signedTransaction, instance(listener)); - const transaction = await announcedTransaction.toPromise(); + const transaction = await firstValueFrom(announcedTransaction); expect(transaction).to.be.equal(aggregateCompleteTransaction); }); @@ -198,7 +198,7 @@ describe('TransactionService', () => { const announcedTransaction = service.announceAggregateBonded(signedTransaction, instance(listener)); try { - await announcedTransaction.toPromise(); + await firstValueFrom(announcedTransaction); } catch (e) { expect(e.message).to.be.equal('Some Error'); } @@ -237,7 +237,7 @@ describe('TransactionService', () => { instance(listener), ); - const transaction = await announcedTransaction.toPromise(); + const transaction = await firstValueFrom(announcedTransaction); expect(transaction).to.be.equal(aggregateBondedTransaction); }); });