From d2fe54f547f8565e7e1545dadb6d1b05037862f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Tue, 23 Apr 2024 12:11:58 -0300 Subject: [PATCH 01/10] fix: after serverless upgrade, GONE exceptions now throw an error (#160) --- packages/wallet-service/src/ws/utils.ts | 41 +++++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/packages/wallet-service/src/ws/utils.ts b/packages/wallet-service/src/ws/utils.ts index 0a05ba6d..71a624ee 100644 --- a/packages/wallet-service/src/ws/utils.ts +++ b/packages/wallet-service/src/ws/utils.ts @@ -7,11 +7,15 @@ import { PostToConnectionCommandOutput, DeleteConnectionCommand, DeleteConnectionCommandOutput, + GoneException, } from '@aws-sdk/client-apigatewaymanagementapi'; import util from 'util'; import { WsConnectionInfo, Severity } from '@src/types'; import { endWsConnection } from '@src/redis'; +import createDefaultLogger from '@src/logger'; + +const logger = createDefaultLogger(); export const connectionInfoFromEvent = ( event: APIGatewayProxyEvent, @@ -54,16 +58,41 @@ export const sendMessageToClient = async ( endpoint: connInfo.url, }); + const message = JSON.stringify(payload); + const command = new PostToConnectionCommand({ ConnectionId: connInfo.id, - Data: JSON.stringify(payload), + Data: message, }); - const response: PostToConnectionCommandOutput = await apiGwClient.send(command); - // http GONE(410) means client is disconnected, but still exists on our connection store - if (response.$metadata.httpStatusCode === 410) { - // cleanup connection and subscriptions from redis if GONE - return endWsConnection(client, connInfo.id); + try { + const response: PostToConnectionCommandOutput = await apiGwClient.send(command); + + if (response.$metadata.httpStatusCode !== 200) { + logger.error(response.$metadata); + throw new Error(`Status code from post to connection is not 200: ${response.$metadata.httpStatusCode}`); + } + } catch (e) { + if (e instanceof GoneException) { + logger.debug(`Received GONE exception, closing ${connInfo.id}`); + return endWsConnection(client, connInfo.id); + } + + logger.error(e); + + // Unhandled exception. We shouldn't end the connection as it might be a temporary + // instability with api gateway. + // + // Alert and move on, no need to throw here + addAlert( + 'Unhandled error while sending websocket message to client', + 'The wallet-service was unable to handle an error while attempting to send a message to a websocket client. Please check the logs.', + Severity.MINOR, + { + ConnectionId: connInfo.id, + Message: message, + }, + ) } }; From ea7f2b75e80d86bd6c5bebf1501763cad995bf89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Fri, 3 May 2024 21:51:34 -0300 Subject: [PATCH 02/10] tests: added tests for sendMessageToClient util (#163) --- .../wallet-service/tests/ws.utils.test.ts | 104 +++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) diff --git a/packages/wallet-service/tests/ws.utils.test.ts b/packages/wallet-service/tests/ws.utils.test.ts index 0aaeeac2..9dc58680 100644 --- a/packages/wallet-service/tests/ws.utils.test.ts +++ b/packages/wallet-service/tests/ws.utils.test.ts @@ -1,7 +1,47 @@ import { mockedAddAlert } from '@tests/utils/alerting.utils.mock'; -import { connectionInfoFromEvent } from '@src/ws/utils'; +import { connectionInfoFromEvent, sendMessageToClient } from '@src/ws/utils'; import { Severity } from '@src/types'; +import { logger } from '@tests/winston.mock'; +import { RedisClient } from 'redis'; +import { + GoneException, +} from '@aws-sdk/client-apigatewaymanagementapi'; +import { RedisConfig } from '@src/types'; + +const mockedSend = jest.fn(); + +jest.mock('@src/redis', () => { + const originalModule = jest.requireActual('@src/redis'); + return { + ...originalModule, + endWsConnection: jest.fn(), + }; +}); + +jest.mock('@aws-sdk/client-apigatewaymanagementapi', () => { + const originalModule = jest.requireActual('@aws-sdk/client-apigatewaymanagementapi'); + return { + ...originalModule, + ApiGatewayManagementApiClient: jest.fn().mockImplementation(() => ({ + send: mockedSend, + })), + }; +}); + +jest.mock('redis', () => ({ + RedisClient: jest.fn().mockImplementation(() => ({ + endWsConnection: jest.fn(), + on: jest.fn(), + set: jest.fn(), + get: jest.fn(), + del: jest.fn(), + quit: jest.fn(), + })), +})); + +import { endWsConnection } from '@src/redis'; + test('connectionInfoFromEvent', async () => { expect.hasAssertions(); // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -42,3 +82,65 @@ test('missing WS_DOMAIN should throw', () => { Severity.MINOR, ); }); + +describe('sendMessageToClient', () => { + let client: any; + const redisConfig: RedisConfig = { + url: 'http://doesntmatter.com', + password: 'password', + }; + const connInfo = { url: 'http://example.com', id: '1234' }; + const message = 'hello'; + + beforeEach(() => { + jest.clearAllMocks(); + client = new RedisClient(redisConfig); + }); + + it('should send a message successfully', async () => { + mockedSend.mockResolvedValue({ + $metadata: { httpStatusCode: 200 }, + }); + + await sendMessageToClient(client, connInfo, message); + + expect(mockedSend).toHaveBeenCalledWith(expect.objectContaining({ + input: expect.objectContaining({ + ConnectionId: connInfo.id, + Data: JSON.stringify(message), + }) + })); + + expect(logger.error).not.toHaveBeenCalled(); + }); + + it('should log and throw an error if API Gateway returns non-200 status', async () => { + mockedSend.mockResolvedValue({ + $metadata: { httpStatusCode: 400 }, + }); + + await sendMessageToClient(client, connInfo, message); + + expect(mockedAddAlert).toHaveBeenCalledWith( + 'Unhandled error while sending websocket message to client', + 'The wallet-service was unable to handle an error while attempting to send a message to a websocket client. Please check the logs.', + Severity.MINOR, + { + ConnectionId: connInfo.id, + Message: JSON.stringify(message), + } + ); + }); + + it('should handle GoneException by closing the connection', async () => { + mockedSend.mockRejectedValue(new GoneException({ + message: 'Connection is gone.', + $metadata: { + httpStatusCode: 410, + } + })); + + await sendMessageToClient(client, connInfo, message); + expect(endWsConnection).toHaveBeenCalledWith(client, connInfo.id); + }); +}); From 5f83d3ec89621504970d805a82e8ba672f717646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Wed, 29 May 2024 21:58:20 -0300 Subject: [PATCH 03/10] refactor: added a "common" package to share code between packages (#151) * chore: added common package * chore: using wallet-lib from daemon resolution * chore: installed shared dependencies on root project, using peerDependencies * refactor: using addAlert method from common utils * chore: updated package.json with missing deps * refactor: using types from commons on wallet-service * chore: re-added sequelize to root * refactor: removed isNftAutoReviewEnabled from services * tests: mocked assertEnv * tests: mocked assertEnv on integration tests * chore: removed nft utils * refactor: removed old addAlerts from the wallet-service package * chore: wallet-lib is now a peerDependency in wallet-service package * refactor: logger is now a required param in addAlert, refactored all methods in wallet-service package * docs: added missing hathor header * refactor: invalid type for metadata on addAlert * tests: passing mocked logger * chore: updated gitignore to ignore env files * chore: revert eslint package updates * refactor: using types from commons on wallet-service * refactor: removed unused commented line * chore: missing package in daemon * refactor: using transaction type from common * refactor: bitcoinjs is not a shared dep * chore: added a comment explaining that logger is a param temporarily * refactor: removed default from metadata * chore: lint fixes and package ordering * feat: call onNewNftEvent when a new NFT tx is received (#150) * feat: added nft utils * tests: added tests for common utils * chore: added common module to CI * refactor: moved used types to common package * tests: removed nft utils * tests: fixed nft tests on txProcessor * tests: mocking network on getconfig * tests: fixed nft tests on txProcessor * refactor: passing logger to invoke nft handler * refactor: no need to ignore ts * chore: removed jest script, instead using only test * chore: added hathor header * refactor: using common utils on txProcessor * tests: nft utils using old syntax * tests: skipped txProcessor tests * tests: fixed txProcessor tests * refactor: using isAuthority from common utils * refactor: using isAuthority from common types * refactor: using assertEnvVariablesExistance from common project * refactor: getting CREATE_NFT_MAX_RETRIES from env * docs: updated docstrings on nft utils * chore: removed events/nftCreationTx.ts * refactor: invalid import locations * refactor: remove unused lambdas (#155) * tests: fixed nft tests on txProcessor * refactor: removed all methods related to the old wallet-service txProcessor * tests: fixed failing test * fix: serverless failing (#162) * refactor: logger is now a required param in addAlert, refactored all methods in wallet-service package * chore: changed module resolution and several package locks * chore: added common library to externals whitelist and whitelisted it in tsloader * chore: wallet-service common package moved from direct path to workspace * chore: added common as a peer dependency and restored peer dependencies * chore: removed peer dependencies as they were not working with serverless-monorepo * chore: added comment on hoisting limits * chore: added comment explaining externals in webpack --- .codebuild/buildspec.yml | 1 + .github/workflows/main.yml | 6 +- .gitignore | 3 + .yarnrc.yml | 3 +- package.json | 33 +- packages/common/README.md | 1 + .../__tests__}/events/nftCreationTx.ts | 5 +- .../__tests__/utils/alerting.utils.mock.ts | 4 + .../__tests__}/utils/nft.utils.test.ts | 69 +- packages/common/jest.config.js | 18 + packages/common/package.json | 20 + packages/common/src/types.ts | 438 ++ .../src/utils/alerting.utils.ts | 13 +- packages/common/src/utils/index.utils.ts | 25 + .../src/utils/nft.utils.ts | 64 +- packages/common/src/utils/wallet.utils.ts | 19 + packages/common/tsconfig.json | 26 + packages/daemon/__tests__/db/index.test.ts | 7 +- .../daemon/__tests__/guards/guards.test.ts | 4 + .../__tests__/integration/balances.test.ts | 8 + .../__tests__/machines/SyncMachine.test.ts | 3 + .../__tests__/services/services.test.ts | 11 +- packages/daemon/__tests__/utils.ts | 3 +- packages/daemon/package.json | 11 +- packages/daemon/src/config.ts | 2 +- packages/daemon/src/db/index.ts | 14 +- packages/daemon/src/services/index.ts | 28 +- packages/daemon/src/types/event.ts | 3 +- packages/daemon/src/types/transaction.ts | 415 -- packages/daemon/src/types/wallet.ts | 2 +- packages/daemon/src/utils/alerting.ts | 57 - packages/daemon/src/utils/aws.ts | 3 +- packages/daemon/src/utils/helpers.ts | 2 +- packages/daemon/src/utils/wallet.ts | 49 +- packages/wallet-service/package.json | 17 +- packages/wallet-service/serverless.yml | 12 +- .../src/api/pushSendNotificationToDevice.ts | 9 +- .../src/api/txPushNotificationRequested.ts | 8 +- packages/wallet-service/src/api/wallet.ts | 11 +- packages/wallet-service/src/commons.ts | 15 +- packages/wallet-service/src/db/index.ts | 15 +- packages/wallet-service/src/mempool.ts | 6 +- packages/wallet-service/src/txProcessor.ts | 432 +- packages/wallet-service/src/types.ts | 67 +- packages/wallet-service/src/utils.ts | 23 - .../src/utils/pushnotification.utils.ts | 12 +- packages/wallet-service/src/ws/connection.ts | 5 +- packages/wallet-service/src/ws/utils.ts | 12 +- packages/wallet-service/tests/commons.test.ts | 4 +- packages/wallet-service/tests/db.test.ts | 7 +- .../wallet-service/tests/integration.test.ts | 314 +- .../pushSendNotificationToDevice.test.ts | 4 +- .../wallet-service/tests/txProcessor.test.ts | 741 +--- packages/wallet-service/tests/types.test.ts | 3 +- packages/wallet-service/tests/utils.ts | 2 +- .../tests/utils/alerting.utils.mock.ts | 2 +- .../utils/pushnotification.utils.test.ts | 26 +- .../wallet-service/tests/ws.utils.test.ts | 8 +- packages/wallet-service/webpack.config.js | 18 +- yarn.lock | 3696 +++++++++-------- 60 files changed, 2906 insertions(+), 3933 deletions(-) create mode 100644 packages/common/README.md rename packages/{wallet-service => common/__tests__}/events/nftCreationTx.ts (98%) create mode 100644 packages/common/__tests__/utils/alerting.utils.mock.ts rename packages/{wallet-service/tests => common/__tests__}/utils/nft.utils.test.ts (82%) create mode 100644 packages/common/jest.config.js create mode 100644 packages/common/package.json create mode 100644 packages/common/src/types.ts rename packages/{wallet-service => common}/src/utils/alerting.utils.ts (80%) create mode 100644 packages/common/src/utils/index.utils.ts rename packages/{wallet-service => common}/src/utils/nft.utils.ts (67%) create mode 100644 packages/common/src/utils/wallet.utils.ts create mode 100644 packages/common/tsconfig.json delete mode 100644 packages/daemon/src/utils/alerting.ts diff --git a/.codebuild/buildspec.yml b/.codebuild/buildspec.yml index 68eb00de..a1d9c394 100644 --- a/.codebuild/buildspec.yml +++ b/.codebuild/buildspec.yml @@ -14,6 +14,7 @@ env: CONFIRM_FIRST_ADDRESS: true VOIDED_TX_OFFSET: 20 TX_HISTORY_MAX_COUNT: 50 + CREATE_NFT_MAX_RETRIES: 3 dev_DEFAULT_SERVER: "https://wallet-service.private-nodes.testnet.hathor.network/v1a/" dev_WS_DOMAIN: "ws.dev.wallet-service.testnet.hathor.network" dev_NETWORK: "testnet" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2ccc6000..1cac9ac3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | experimental-features = nix-command flakes - + - name: Cache Nix uses: DeterminateSystems/magic-nix-cache-action@v2 @@ -59,6 +59,10 @@ jobs: CI_DB_HOST: 127.0.0.1 CI_DB_PORT: 3306 + - name: Run tests on the common modules project + run: | + nix develop . -c yarn workspace @wallet-service/common run test + - name: Run tests on the daemon run: | nix develop . -c yarn workspace sync-daemon run test diff --git a/.gitignore b/.gitignore index c30fb637..0b4715e0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,11 @@ dist coverage/ packages/daemon/dist packages/daemon/node_modules +packages/common/node_modules packages/wallet-service/node_modules packages/wallet-service/.serverless packages/wallet-service/.webpack packages/wallet-service/.env* +packages/wallet-service/.warmup .yarn/ +.env.* diff --git a/.yarnrc.yml b/.yarnrc.yml index d88b7277..a0b095c1 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -2,6 +2,7 @@ compressionLevel: mixed enableGlobalCache: false -nmHoistingLimits: dependencies +# Without this setting, the common package is hoisted in the root node_modules, causing the serverless-monorepo plugin to fail +nmHoistingLimits: workspaces nodeLinker: node-modules diff --git a/package.json b/package.json index b06533e7..d82d9bb6 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "hathor-wallet-service", "version": "1.5.0", "workspaces": [ + "packages/common", "packages/daemon", "packages/wallet-service" ], @@ -11,14 +12,34 @@ "nohoist": [ "**" ], - "repository": "git@github.com:HathorNetwork/hathor-wallet-service-sync_daemon.git", + "repository": "git@github.com:HathorNetwork/hathor-wallet-service.git", "author": "André Abadesso ", "private": true, "devDependencies": { - "dotenv": "^16.3.1", - "mysql2": "^3.6.1", - "sequelize": "^6.33.0", - "sequelize-cli": "^6.6.1" + "@types/jest": "^29.5.12", + "@typescript-eslint/eslint-plugin": "^7.4.0", + "@typescript-eslint/parser": "^7.4.0", + "dotenv": "^16.4.5", + "eslint": "^8.57.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jest": "^27.9.0", + "mysql2": "^3.9.3", + "sequelize": "^6.37.2", + "sequelize-cli": "^6.6.2" }, - "packageManager": "yarn@4.1.0" + "packageManager": "yarn@4.1.0", + "dependencies": { + "@aws-sdk/client-apigatewaymanagementapi": "3.540.0", + "@aws-sdk/client-lambda": "3.540.0", + "@aws-sdk/client-sqs": "3.540.0", + "@hathor/wallet-lib": "0.39.0", + "@wallet-service/common": "1.5.0", + "bip32": "^4.0.0", + "bitcoinjs-lib": "^6.1.5", + "bitcoinjs-message": "^2.2.0", + "jest": "^29.7.0", + "tiny-secp256k1": "^2.2.3", + "winston": "3.13.0" + } } diff --git a/packages/common/README.md b/packages/common/README.md new file mode 100644 index 00000000..bf12740b --- /dev/null +++ b/packages/common/README.md @@ -0,0 +1 @@ +# Common utils for the wallet-service diff --git a/packages/wallet-service/events/nftCreationTx.ts b/packages/common/__tests__/events/nftCreationTx.ts similarity index 98% rename from packages/wallet-service/events/nftCreationTx.ts rename to packages/common/__tests__/events/nftCreationTx.ts index 91c34833..0c91445b 100644 --- a/packages/wallet-service/events/nftCreationTx.ts +++ b/packages/common/__tests__/events/nftCreationTx.ts @@ -12,7 +12,7 @@ /* eslint-disable @typescript-eslint/no-empty-function */ import { Context } from 'aws-lambda'; -import { Transaction } from '@src/types'; +import { Transaction, TxOutput } from '../../src/types'; /** * A sample transaction for a NFT creation, as obtained by a wallet's history methods @@ -149,11 +149,12 @@ export function getTransaction(): Transaction { spent_by: o.spent_by, token_data: o.token_data, locked: false, - })), + })) as TxOutput[], height: 8, token_name: nftCreationTx.token_name, token_symbol: nftCreationTx.token_symbol, }; + return result; } diff --git a/packages/common/__tests__/utils/alerting.utils.mock.ts b/packages/common/__tests__/utils/alerting.utils.mock.ts new file mode 100644 index 00000000..263316ec --- /dev/null +++ b/packages/common/__tests__/utils/alerting.utils.mock.ts @@ -0,0 +1,4 @@ +export const mockedAddAlert = jest.fn(); +export default jest.mock('@src/utils/alerting.utils', () => ({ + addAlert: mockedAddAlert.mockReturnValue(Promise.resolve()), +})); diff --git a/packages/wallet-service/tests/utils/nft.utils.test.ts b/packages/common/__tests__/utils/nft.utils.test.ts similarity index 82% rename from packages/wallet-service/tests/utils/nft.utils.test.ts rename to packages/common/__tests__/utils/nft.utils.test.ts index 22d3a955..a93afc8f 100644 --- a/packages/wallet-service/tests/utils/nft.utils.test.ts +++ b/packages/common/__tests__/utils/nft.utils.test.ts @@ -1,12 +1,32 @@ +// @ts-ignore: Using old wallet-lib version, no types exported import hathorLib from '@hathor/wallet-lib'; -import { mockedAddAlert } from '@tests/utils/alerting.utils.mock'; +import { mockedAddAlert } from './alerting.utils.mock'; import { Severity } from '@src/types'; -import { MAX_METADATA_UPDATE_RETRIES, NftUtils } from '@src/utils/nft.utils'; -import { getHandlerContext, getTransaction } from '@events/nftCreationTx'; +import { NftUtils } from '@src/utils/nft.utils'; +import { getHandlerContext, getTransaction } from '../events/nftCreationTx'; import { LambdaClient as LambdaClientMock, InvokeCommandOutput, } from '@aws-sdk/client-lambda'; +import { Logger } from 'winston'; + +jest.mock('winston', () => { + class FakeLogger { + warn() { + return jest.fn(); + } + error() { + return jest.fn(); + } + info() { + return jest.fn(); + } + }; + + return { + Logger: FakeLogger, + } +}); jest.mock('@aws-sdk/client-lambda', () => { const mLambda = { send: jest.fn() }; @@ -17,19 +37,23 @@ jest.mock('@aws-sdk/client-lambda', () => { }; }); +const network = new hathorLib.Network('testnet'); +const logger = new Logger(); + describe('shouldInvokeNftHandlerForTx', () => { it('should return false for a NFT transaction if the feature is disabled', () => { expect.hasAssertions(); // Preparation const tx = getTransaction(); - const isNftTransaction = NftUtils.isTransactionNFTCreation(tx); + const isNftTransaction = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(isNftTransaction).toStrictEqual(true); expect(process.env.NFT_AUTO_REVIEW_ENABLED).not.toStrictEqual('true'); // Execution - const result = NftUtils.shouldInvokeNftHandlerForTx(tx); + // @ts-ignore + const result = NftUtils.shouldInvokeNftHandlerForTx(tx, network, logger); // Assertion expect(result).toBe(false); @@ -40,14 +64,14 @@ describe('shouldInvokeNftHandlerForTx', () => { // Preparation const tx = getTransaction(); - const isNftTransaction = NftUtils.isTransactionNFTCreation(tx); + const isNftTransaction = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(isNftTransaction).toStrictEqual(true); const oldValue = process.env.NFT_AUTO_REVIEW_ENABLED; process.env.NFT_AUTO_REVIEW_ENABLED = 'true'; // Execution - const result = NftUtils.shouldInvokeNftHandlerForTx(tx); + const result = NftUtils.shouldInvokeNftHandlerForTx(tx, network, logger); // Assertion expect(result).toBe(true); @@ -70,21 +94,21 @@ describe('isTransactionNFTCreation', () => { // Incorrect version tx = getTransaction(); tx.version = hathorLib.constants.DEFAULT_TX_VERSION; - result = NftUtils.isTransactionNFTCreation(tx); + result = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(result).toBe(false); expect(spyCreateTx).not.toHaveBeenCalled(); // Missing name tx = getTransaction(); tx.token_name = undefined; - result = NftUtils.isTransactionNFTCreation(tx); + result = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(result).toBe(false); expect(spyCreateTx).not.toHaveBeenCalled(); // Missing symbol tx = getTransaction(); tx.token_symbol = undefined; - result = NftUtils.isTransactionNFTCreation(tx); + result = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(result).toBe(false); expect(spyCreateTx).not.toHaveBeenCalled(); @@ -101,7 +125,7 @@ describe('isTransactionNFTCreation', () => { // Validation const tx = getTransaction(); - const result = NftUtils.isTransactionNFTCreation(tx); + const result = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(result).toBe(true); // Reverting mocks @@ -113,7 +137,7 @@ describe('isTransactionNFTCreation', () => { // Validation const tx = getTransaction(); - const result = NftUtils.isTransactionNFTCreation(tx); + const result = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(result).toBe(true); }); @@ -128,7 +152,7 @@ describe('isTransactionNFTCreation', () => { // Validation const tx = getTransaction(); - const result = NftUtils.isTransactionNFTCreation(tx); + const result = NftUtils.isTransactionNFTCreation(tx, network, logger); expect(result).toBe(false); // Reverting mocks @@ -154,11 +178,11 @@ describe('createOrUpdateNftMetadata', () => { const expectedUpdateResponse = { updated: 'ok' }; spyUpdateMetadata.mockImplementation(async () => expectedUpdateResponse); - const result = await NftUtils.createOrUpdateNftMetadata('sampleUid'); + const result = await NftUtils.createOrUpdateNftMetadata('sampleUid', 5, logger); expect(spyUpdateMetadata).toHaveBeenCalledTimes(1); - expect(spyUpdateMetadata).toHaveBeenCalledWith('sampleUid', expectedUpdateRequest); + expect(spyUpdateMetadata).toHaveBeenCalledWith('sampleUid', expectedUpdateRequest, 5, logger); expect(result).toBeUndefined(); // The method returns void }); }); @@ -181,7 +205,7 @@ describe('_updateMetadata', () => { const oldStage = process.env.STAGE; process.env.STAGE = 'dev'; // Testing all code branches, including the developer ones, for increased coverage - const result = await NftUtils._updateMetadata('sampleUid', { sampleData: 'fake' }); + const result = await NftUtils._updateMetadata('sampleUid', { sampleData: 'fake' }, 5, logger); expect(result).toStrictEqual(expectedLambdaResponse); process.env.STAGE = oldStage; }); @@ -197,7 +221,7 @@ describe('_updateMetadata', () => { }; const mLambdaClient = new LambdaClientMock({}); (mLambdaClient.send as jest.Mocked).mockImplementation(async () => { - if (failureCount < MAX_METADATA_UPDATE_RETRIES - 1) { + if (failureCount < 4) { ++failureCount; return { StatusCode: 500, @@ -207,7 +231,7 @@ describe('_updateMetadata', () => { return expectedLambdaResponse; }); - const result = await NftUtils._updateMetadata('sampleUid', { sampleData: 'fake' }); + const result = await NftUtils._updateMetadata('sampleUid', { sampleData: 'fake' }, 5, logger); expect(result).toStrictEqual(expectedLambdaResponse); }); @@ -218,7 +242,7 @@ describe('_updateMetadata', () => { let failureCount = 0; const mLambdaClient = new LambdaClientMock({}); (mLambdaClient.send as jest.Mocked).mockImplementation(() => { - if (failureCount < MAX_METADATA_UPDATE_RETRIES) { + if (failureCount < 5) { ++failureCount; return { StatusCode: 500, @@ -232,7 +256,7 @@ describe('_updateMetadata', () => { }); // eslint-disable-next-line jest/valid-expect - expect(NftUtils._updateMetadata('sampleUid', { sampleData: 'fake' })) + expect(NftUtils._updateMetadata('sampleUid', { sampleData: 'fake' }, network, logger)) .rejects.toThrow(new Error('Metadata update failed for tx_id: sampleUid.')); }); }); @@ -249,7 +273,7 @@ describe('invokeNftHandlerLambda', () => { const mLambdaClient = new LambdaClientMock({}); (mLambdaClient.send as jest.Mocked).mockImplementationOnce(async () => expectedLambdaResponse); - await expect(NftUtils.invokeNftHandlerLambda('sampleUid')).resolves.toBeUndefined(); + await expect(NftUtils.invokeNftHandlerLambda('sampleUid', 'local', logger)).resolves.toBeUndefined(); }); it('should throw when payload response status is invalid', async () => { @@ -263,7 +287,7 @@ describe('invokeNftHandlerLambda', () => { }; (mLambdaClient.send as jest.Mocked).mockImplementation(() => expectedLambdaResponse); - await expect(NftUtils.invokeNftHandlerLambda('sampleUid')) + await expect(NftUtils.invokeNftHandlerLambda('sampleUid', 'local', logger)) .rejects.toThrow(new Error('onNewNftEvent lambda invoke failed for tx: sampleUid')); expect(mockedAddAlert).toHaveBeenCalledWith( @@ -271,6 +295,7 @@ describe('invokeNftHandlerLambda', () => { 'Erroed on invokeNftHandlerLambda invocation', Severity.MINOR, { TxId: 'sampleUid' }, + logger, ); }); }); diff --git a/packages/common/jest.config.js b/packages/common/jest.config.js new file mode 100644 index 00000000..c80cb292 --- /dev/null +++ b/packages/common/jest.config.js @@ -0,0 +1,18 @@ +module.exports = { + roots: ["/__tests__"], + testRegex: ".*\\.test\\.ts$", + moduleNameMapper: { + '^@src/(.*)$': '/src/$1', + '^@tests/(.*)$': '/__tests__/$1', + '^@events/(.*)$': '/__tests__/events/$1', + }, + transform: { + "^.+\\.ts$": ["ts-jest", { + tsconfig: "./tsconfig.json", + babelConfig: { + sourceMaps: true, + } + }] + }, + moduleFileExtensions: ["ts", "js", "json", "node"] +}; diff --git a/packages/common/package.json b/packages/common/package.json new file mode 100644 index 00000000..11647654 --- /dev/null +++ b/packages/common/package.json @@ -0,0 +1,20 @@ +{ + "name": "@wallet-service/common", + "version": "1.5.0", + "packageManager": "yarn@4.1.0", + "scripts": { + "test": "jest --runInBand --collectCoverage --detectOpenHandles --forceExit" + }, + "peerDependencies": { + "@aws-sdk/client-lambda": "3.540.0", + "@hathor/wallet-lib": "0.39.0", + "winston": "^3.13.0" + }, + "devDependencies": { + "@types/aws-lambda": "^8.10.136", + "@types/node": "^20.11.30", + "jest": "^29.6.4", + "ts-jest": "^29.1.2", + "typescript": "^5.4.3" + } +} diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts new file mode 100644 index 00000000..561de83b --- /dev/null +++ b/packages/common/src/types.ts @@ -0,0 +1,438 @@ +/** + * Copyright (c) Hathor Labs and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * Alerts should follow the on-call guide for alerting, see + * https://github.com/HathorNetwork/ops-tools/blob/master/docs/on-call/guide.md#alert-severitypriority + */ + +// @ts-ignore +import { constants } from '@hathor/wallet-lib'; +import { isAuthority } from './utils/wallet.utils'; + +export interface StringMap { + [x: string]: T; +} + +export enum Severity { + CRITICAL = 'critical', + MAJOR = 'major', + MEDIUM = 'medium', + MINOR = 'minor', + WARNING = 'warning', + INFO = 'info', +} + +export interface Transaction { + // eslint-disable-next-line camelcase + tx_id: string; + nonce: number; + timestamp: number; + // eslint-disable-next-line camelcase + signal_bits: number; + version: number; + weight: number; + parents: string[]; + inputs: TxInput[]; + outputs: TxOutput[]; + height?: number; + voided?: boolean | null; + // eslint-disable-next-line camelcase + token_name?: string | null; + // eslint-disable-next-line camelcase + token_symbol?: string | null; +} + +export interface TxInput { + // eslint-disable-next-line camelcase + tx_id: string; + index: number; + value: number; + // eslint-disable-next-line camelcase + token_data: number; + script: string; + token: string; + decoded?: DecodedOutput | null; +} + +export interface TxOutput { + value: number; + script: string; + token: string; + decoded: DecodedOutput; + // eslint-disable-next-line camelcase + spent_by: string | null; + // eslint-disable-next-line camelcase + token_data: number; + locked?: boolean; +} + +export interface TxOutputWithIndex extends TxOutput { + index: number; +} + +export interface DecodedOutput { + type: string; + address: string; + timelock: number | null; +} + +export class Authorities { + /** + * Supporting up to 8 authorities (but we only have mint and melt at the moment) + */ + static LENGTH = 8; + + array: number[]; + + constructor(authorities?: number | number[]) { + let tmp: number[] = []; + if (authorities instanceof Array) { + tmp = authorities; + } else if (authorities != null) { + tmp = Authorities.intToArray(authorities); + } + + this.array = new Array(Authorities.LENGTH - tmp.length).fill(0).concat(tmp); + } + + /** + * Get the integer representation of this authority. + * + * @remarks + * Uses the array to calculate the final number. Examples: + * [0, 0, 0, 0, 1, 1, 0, 1] = 0b00001101 = 13 + * [0, 0, 1, 0, 0, 0, 0, 1] = 0b00100001 = 33 + * + * @returns The integer representation + */ + toInteger(): number { + let n = 0; + for (let i = 0; i < this.array.length; i++) { + if (this.array[i] === 0) continue; + + n += this.array[i] * (2 ** (this.array.length - i - 1)); + } + return n; + } + + toUnsignedInteger(): number { + return Math.abs(this.toInteger()); + } + + clone(): Authorities { + return new Authorities(this.array); + } + + /** + * Return a new object inverting each authority value sign. + * + * @remarks + * If value is set to 1, it becomes -1 and vice versa. Value 0 remains unchanged. + * + * @returns A new Authority object with the values inverted + */ + toNegative(): Authorities { + const finalAuthorities = this.array.map((value) => { + // This if is needed because Javascript uses the IEEE_754 standard and has negative and positive zeros, + // so (-1) * 0 would return -0. Apparently -0 === 0 is true on most cases, so there wouldn't be a problem, + // but we will leave this here to be safe. + // https://en.wikipedia.org/wiki/IEEE_754 + if (value === 0) return 0; + + return (-1) * value; + }); + return new Authorities(finalAuthorities); + } + + /** + * Return if any of the authorities has a negative value. + * + * @remarks + * Negative values for an authority only make sense when dealing with balances of a + * transaction. So if we consume an authority in the inputs but do not create the same + * one in the output, it will have value -1. + * + * @returns `true` if any authority is less than 0; `false` otherwise + */ + hasNegativeValue(): boolean { + return this.array.some((authority) => authority < 0); + } + + /** + * Transform an integer into an array, considering 1 array element per bit. + * + * @returns The array given an integer + */ + static intToArray(authorities: number): number[] { + const ret = []; + for (const c of authorities.toString(2)) { + ret.push(parseInt(c, 10)); + } + return ret; + } + + /** + * Merge two authorities. + * + * @remarks + * The process is done individualy for each authority value. Each a1[n] and a2[n] are compared. + * If both values are the same, the final value is the same. If one is 1 and the other -1, final + * value is 0. + * + * @returns A new object with the merged values + */ + static merge(a1: Authorities, a2: Authorities): Authorities { + return new Authorities(a1.array.map((value, index) => Math.sign(value + a2.array[index]))); + } + + toJSON(): Record { + const authorities = this.toInteger(); + return { + mint: (authorities & constants.TOKEN_MINT_MASK) > 0, // eslint-disable-line no-bitwise + melt: (authorities & constants.TOKEN_MELT_MASK) > 0, // eslint-disable-line no-bitwise + }; + } +} + +export class Balance { + totalAmountSent: number; + + lockedAmount: number; + + unlockedAmount: number; + + lockedAuthorities: Authorities; + + unlockedAuthorities: Authorities; + + lockExpires: number | null | undefined; + + constructor(totalAmountSent = 0, unlockedAmount = 0, lockedAmount = 0, lockExpires = null, unlockedAuthorities = null, lockedAuthorities = null) { + this.totalAmountSent = totalAmountSent; + this.unlockedAmount = unlockedAmount; + this.lockedAmount = lockedAmount; + this.lockExpires = lockExpires; + this.unlockedAuthorities = unlockedAuthorities || new Authorities(); + this.lockedAuthorities = lockedAuthorities || new Authorities(); + } + + /** + * Get the total balance, sum of unlocked and locked amounts. + * + * @returns The total balance + */ + total(): number { + return this.unlockedAmount + this.lockedAmount; + } + + /** + * Get all authorities, combination of unlocked and locked. + * + * @returns The combined authorities + */ + authorities(): Authorities { + return Authorities.merge(this.unlockedAuthorities, this.lockedAuthorities); + } + + /** + * Clone this Balance object. + * + * @returns A new Balance object with the same information + */ + clone(): Balance { + return new Balance( + this.totalAmountSent, + this.unlockedAmount, + this.lockedAmount, + // @ts-ignore + this.lockExpires, + this.unlockedAuthorities.clone(), + this.lockedAuthorities.clone(), + ); + } + + /** + * Merge two balances. + * + * @remarks + * In case lockExpires is set, it returns the lowest one. + * + * @param b1 - First balance + * @param b2 - Second balance + * @returns The sum of both balances and authorities + */ + static merge(b1: Balance, b2: Balance): Balance { + let lockExpires = null; + if (b1.lockExpires === null) { + lockExpires = b2.lockExpires; + } else if (b2.lockExpires === null) { + lockExpires = b1.lockExpires; + } else { + // @ts-ignore + lockExpires = Math.min(b1.lockExpires, b2.lockExpires); + } + return new Balance( + b1.totalAmountSent + b2.totalAmountSent, + b1.unlockedAmount + b2.unlockedAmount, + b1.lockedAmount + b2.lockedAmount, + // @ts-ignore + lockExpires, + Authorities.merge(b1.unlockedAuthorities, b2.unlockedAuthorities), + Authorities.merge(b1.lockedAuthorities, b2.lockedAuthorities), + ); + } +} + +export class TokenBalanceMap { + map: StringMap; + + constructor() { + this.map = {}; + } + + get(tokenId: string): Balance { + // if the token is not present, return 0 instead of undefined + return this.map[tokenId] || new Balance(0, 0, 0); + } + + set(tokenId: string, balance: Balance): void { + this.map[tokenId] = balance; + } + + getTokens(): string[] { + return Object.keys(this.map); + } + + iterator(): [string, Balance][] { + return Object.entries(this.map); + } + + clone(): TokenBalanceMap { + const cloned = new TokenBalanceMap(); + for (const [token, balance] of this.iterator()) { + cloned.set(token, balance.clone()); + } + return cloned; + } + + /** + * Return a TokenBalanceMap from js object. + * + * @remarks + * Js object is expected to have the format: + * ``` + * { + * token1: {unlocked: n, locked: m}, + * token2: {unlocked: a, locked: b, lockExpires: c}, + * token3: {unlocked: x, locked: y, unlockedAuthorities: z, lockedAuthorities: w}, + * } + * ``` + * + * @param tokenBalanceMap - The js object to convert to a TokenBalanceMap + * @returns - The new TokenBalanceMap object + */ + static fromStringMap(tokenBalanceMap: StringMap>): TokenBalanceMap { + const obj = new TokenBalanceMap(); + for (const [tokenId, balance] of Object.entries(tokenBalanceMap)) { + obj.set(tokenId, new Balance( + balance.totalSent as number, + balance.unlocked as number, + balance.locked as number, + // @ts-ignore + balance.lockExpires || null, + balance.unlockedAuthorities, + balance.lockedAuthorities, + )); + } + return obj; + } + + /** + * Merge two TokenBalanceMap objects, merging the balances for each token. + * + * @param balanceMap1 - First TokenBalanceMap + * @param balanceMap2 - Second TokenBalanceMap + * @returns The merged TokenBalanceMap + */ + static merge(balanceMap1: TokenBalanceMap, balanceMap2: TokenBalanceMap): TokenBalanceMap { + if (!balanceMap1) return balanceMap2.clone(); + if (!balanceMap2) return balanceMap1.clone(); + const mergedMap = balanceMap1.clone(); + for (const [token, balance] of balanceMap2.iterator()) { + const finalBalance = Balance.merge(mergedMap.get(token), balance); + mergedMap.set(token, finalBalance); + } + return mergedMap; + } + + /** + * Create a TokenBalanceMap from a TxOutput. + * + * @param output - The transaction output + * @returns The TokenBalanceMap object + */ + static fromTxOutput(output: TxOutput): TokenBalanceMap { + if (!output.decoded) { + throw new Error('Output has no decoded script'); + } + const token = output.token; + const value = output.value; + const obj = new TokenBalanceMap(); + + if (output.locked) { + if (isAuthority(output.token_data)) { + // @ts-ignore + obj.set(token, new Balance(0, 0, 0, output.decoded.timelock, 0, new Authorities(output.value))); + } else { + // @ts-ignore + obj.set(token, new Balance(value, 0, value, output.decoded.timelock, 0, 0)); + } + } else if (isAuthority(output.token_data)) { + // @ts-ignore + obj.set(token, new Balance(0, 0, 0, null, new Authorities(output.value), 0)); + } else { + obj.set(token, new Balance(value, value, 0, null)); + } + + return obj; + } + + /** + * Create a TokenBalanceMap from a TxInput. + * + * @remarks + * It will have only one token entry and balance will be negative. + * + * @param input - The transaction input + * @returns The TokenBalanceMap object + */ + static fromTxInput(input: TxInput): TokenBalanceMap { + const token = input.token; + const obj = new TokenBalanceMap(); + + if (isAuthority(input.token_data)) { + // for inputs, the authorities will have a value of -1 when set + const authorities = new Authorities(input.value); + obj.set( + token, + new Balance( + 0, + 0, + 0, + null, + // @ts-ignore + authorities.toNegative(), + new Authorities(0), + ), + ); + } else { + obj.set(token, new Balance(0, -input.value, 0, null)); + } + return obj; + } +} diff --git a/packages/wallet-service/src/utils/alerting.utils.ts b/packages/common/src/utils/alerting.utils.ts similarity index 80% rename from packages/wallet-service/src/utils/alerting.utils.ts rename to packages/common/src/utils/alerting.utils.ts index 556860fe..32d8b3ff 100644 --- a/packages/wallet-service/src/utils/alerting.utils.ts +++ b/packages/common/src/utils/alerting.utils.ts @@ -6,9 +6,9 @@ */ import { SendMessageCommand, SQSClient } from '@aws-sdk/client-sqs'; -import { Severity } from '@src/types'; -import { assertEnvVariablesExistence } from '@src/utils'; -import createDefaultLogger from '@src/logger'; +import { Severity } from '../types'; +import { assertEnvVariablesExistence } from './index.utils'; +import { Logger } from 'winston'; assertEnvVariablesExistence([ 'NETWORK', @@ -28,9 +28,12 @@ export const addAlert = async ( title: string, message: string, severity: Severity, - metadata?: unknown, + // XXX: logger is temporarily coming as a param until we refactor the logger + // to be a common util between projects, metadata will also be refactored + // to be a optional parameter. + metadata: unknown, + logger: Logger, ): Promise => { - const logger = createDefaultLogger(); const preparedMessage = { title, message, diff --git a/packages/common/src/utils/index.utils.ts b/packages/common/src/utils/index.utils.ts new file mode 100644 index 00000000..f2697f03 --- /dev/null +++ b/packages/common/src/utils/index.utils.ts @@ -0,0 +1,25 @@ +/** + * Copyright (c) Hathor Labs and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * Validates if a list of env variables are set in the environment. Throw if at least + * one of them is missing + * + * @param envVariables - A list of variables to check + */ +export const assertEnvVariablesExistence = (envVariables: string[]): void => { + const missingList = []; + for (const envVariable of envVariables) { + if (!(envVariable in process.env) || process.env[envVariable]?.length === 0) { + missingList.push(envVariable); + } + } + + if (missingList.length > 0) { + throw new Error(`Env missing the following variables ${missingList.join(', ')}`); + } +}; diff --git a/packages/wallet-service/src/utils/nft.utils.ts b/packages/common/src/utils/nft.utils.ts similarity index 67% rename from packages/wallet-service/src/utils/nft.utils.ts rename to packages/common/src/utils/nft.utils.ts index 60d51716..dd87a44d 100644 --- a/packages/wallet-service/src/utils/nft.utils.ts +++ b/packages/common/src/utils/nft.utils.ts @@ -6,12 +6,11 @@ */ import { LambdaClient, InvokeCommand, InvokeCommandOutput } from '@aws-sdk/client-lambda'; -import { addAlert } from '@src/utils/alerting.utils'; -import { Transaction, Severity } from '@src/types'; -import hathorLib from '@hathor/wallet-lib'; -import createDefaultLogger from '@src/logger'; - -export const MAX_METADATA_UPDATE_RETRIES: number = parseInt(process.env.MAX_METADATA_UPDATE_RETRIES || '3', 10); +import { addAlert } from './alerting.utils'; +import { Transaction, Severity } from '../types'; +// @ts-ignore +import { Network, constants, CreateTokenTransaction, helpersUtils } from '@hathor/wallet-lib'; +import { Logger } from 'winston'; /** * A helper for generating and updating a NFT Token's metadata. @@ -23,25 +22,32 @@ export const isNftAutoReviewEnabled = (): boolean => process.env.NFT_AUTO_REVIEW export class NftUtils { /** * Returns whether we should invoke our NFT handler for this tx - * @param {Transaction} tx - * @returns {boolean} + * @param tx - transaction to check + * @param network - The current network + * @param logger - A Logger instance + * @returns - true if this is a NFT creation TX, false otherwise. + * + * TODO: Remove the logger param after we unify the logger from both projects */ - static shouldInvokeNftHandlerForTx(tx: Transaction): boolean { - return isNftAutoReviewEnabled() && this.isTransactionNFTCreation(tx); + static shouldInvokeNftHandlerForTx(tx: Transaction, network: Network, logger: Logger): boolean { + return isNftAutoReviewEnabled() && this.isTransactionNFTCreation(tx, network, logger); } /** * Returns if the transaction in the parameter is a NFT Creation. * @param {Transaction} tx * @returns {boolean} + * + * TODO: change tx type to HistoryTransaction + * TODO: Remove the logger param after we unify the logger from both projects */ - static isTransactionNFTCreation(tx: Transaction): boolean { + static isTransactionNFTCreation(tx: any, network: Network, logger: Logger): boolean { /* * To fully check if a transaction is a NFT creation, we need to instantiate a new Transaction object in the lib. * So first we do some very fast checks to filter the bulk of the requests for NFTs with minimum processing. */ if ( - tx.version !== hathorLib.constants.CREATE_TOKEN_TX_VERSION // Must be a token creation tx + tx.version !== constants.CREATE_TOKEN_TX_VERSION // Must be a token creation tx || !tx.token_name // Must have a token name || !tx.token_symbol // Must have a token symbol ) { @@ -49,13 +55,12 @@ export class NftUtils { } // Continue with a deeper validation - const logger = createDefaultLogger(); let isNftCreationTx: boolean; - let libTx: hathorLib.CreateTokenTransaction; + let libTx: CreateTokenTransaction; // Transaction parsing failures should be alerted try { - libTx = hathorLib.helpersUtils.createTxFromHistoryObject(tx); + libTx = helpersUtils.createTxFromHistoryObject(tx) as CreateTokenTransaction; } catch (ex) { logger.error('[ALERT] Error when parsing transaction on isTransactionNFTCreation', { transaction: tx, @@ -68,7 +73,7 @@ export class NftUtils { // Validate the token: the validateNft will throw if the transaction is not a NFT Creation try { - libTx.validateNft(new hathorLib.Network(process.env.NETWORK)); + libTx.validateNft(network); isNftCreationTx = true; } catch (ex) { isNftCreationTx = false; @@ -81,8 +86,9 @@ export class NftUtils { * Calls the token metadata on the Explorer Service API to update a token's metadata * @param {string} nftUid * @param {Record} metadata + * TODO: Remove the logger param after we unify the logger from both projects */ - static async _updateMetadata(nftUid: string, metadata: Record): Promise { + static async _updateMetadata(nftUid: string, metadata: Record, maxRetries: number, logger: Logger): Promise { const client = new LambdaClient({ endpoint: process.env.EXPLORER_SERVICE_LAMBDA_ENDPOINT, region: process.env.AWS_REGION, @@ -96,14 +102,13 @@ export class NftUtils { }), }); - const logger = createDefaultLogger(); let retryCount = 0; - while (retryCount < MAX_METADATA_UPDATE_RETRIES) { + while (retryCount < maxRetries) { // invoke lambda asynchronously to metadata update const response: InvokeCommandOutput = await client.send(command); // Event InvocationType returns 202 for a successful invokation if (response.StatusCode === 202) { - // End the loop successfully + // End the loop successfully return response; } @@ -111,7 +116,7 @@ export class NftUtils { nftUid, retryCount, statusCode: response.StatusCode, - message: response.Payload.toString(), + message: response.Payload?.toString(), }); ++retryCount; } @@ -122,30 +127,34 @@ export class NftUtils { /** * Identifies if the metadata for a NFT needs updating and, if it does, update it. - * @param {string} nftUid - * @returns {Promise} No data is returned after a successful update or skip + * @param nftUid - The uid of the nft to create or update + * @param maxRetries - The maximum number of retries + * @param logger - A Logger instance + * + * @returns No data is returned after a successful update or skip + * TODO: Remove the logger param after we unify the logger from both projects */ - static async createOrUpdateNftMetadata(nftUid: string): Promise { + static async createOrUpdateNftMetadata(nftUid: string, maxRetries: number, logger: Logger): Promise { // The explorer service automatically merges the metadata content if it already exists. const newMetadata = { id: nftUid, nft: true, }; - await NftUtils._updateMetadata(nftUid, newMetadata); + await NftUtils._updateMetadata(nftUid, newMetadata, maxRetries, logger); } /** * Invokes this application's own intermediary lambda `onNewNftEvent`. * This is to improve the failure tolerance on this non-critical step of the sync loop. */ - static async invokeNftHandlerLambda(txId: string): Promise { + static async invokeNftHandlerLambda(txId: string, stage: string, logger: Logger): Promise { const client = new LambdaClient({ endpoint: process.env.WALLET_SERVICE_LAMBDA_ENDPOINT, region: process.env.AWS_REGION, }); // invoke lambda asynchronously to metadata update const command = new InvokeCommand({ - FunctionName: `hathor-wallet-service-${process.env.STAGE}-onNewNftEvent`, + FunctionName: `hathor-wallet-service-${stage}-onNewNftEvent`, InvocationType: 'Event', Payload: JSON.stringify({ nftUid: txId }), }); @@ -159,6 +168,7 @@ export class NftUtils { 'Erroed on invokeNftHandlerLambda invocation', Severity.MINOR, { TxId: txId }, + logger, ); throw new Error(`onNewNftEvent lambda invoke failed for tx: ${txId}`); } diff --git a/packages/common/src/utils/wallet.utils.ts b/packages/common/src/utils/wallet.utils.ts new file mode 100644 index 00000000..56ffdf50 --- /dev/null +++ b/packages/common/src/utils/wallet.utils.ts @@ -0,0 +1,19 @@ +/** + * Copyright (c) Hathor Labs and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +// @ts-ignore +import { constants } from '@hathor/wallet-lib'; + +/** + * Checks if a given tokenData has any authority bit set + * + * tokenData merges two fields: first bit is the authority flag, while remaining + * bits represent the token index. If the first bit is 0, this is a regular + * output, if it's 1, it's an authority output + */ +export const isAuthority = (tokenData: number): boolean => ( + (tokenData & constants.TOKEN_AUTHORITY_MASK) > 0 +); diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json new file mode 100644 index 00000000..813c8dde --- /dev/null +++ b/packages/common/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "sourceMap": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "outDir": "./dist", + "types": ["node", "jest"], + "paths": { + "@src/*": ["src/*"], + "@tests/*": ["__tests__/*"], + "@events/*": ["__tests__/events/*"] + } + }, + "include": [ + "src/**/*.ts", + "__tests__/**/*.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/packages/daemon/__tests__/db/index.test.ts b/packages/daemon/__tests__/db/index.test.ts index bc3157d8..3d4ab12f 100644 --- a/packages/daemon/__tests__/db/index.test.ts +++ b/packages/daemon/__tests__/db/index.test.ts @@ -65,8 +65,9 @@ import { createOutput, XPUBKEY, } from '../utils'; -import { isAuthority } from '../../src/utils'; -import { Authorities, DbTxOutput, StringMap, TokenBalanceMap, TokenInfo, WalletStatus } from '../../src/types'; +import { isAuthority } from '@wallet-service/common/src/utils/wallet.utils'; +import { DbTxOutput, StringMap, TokenInfo, WalletStatus } from '../../src/types'; +import { Authorities, TokenBalanceMap } from '@wallet-service/common/src/types'; // Use a single mysql connection for all tests let mysql: Connection; @@ -1108,7 +1109,7 @@ describe('sync metadata', () => { }); }); -// TODO: This test is duplicated from the wallet-service package, we should +// TODO: This test is duplicated from the wallet-service package, we should // have methods shared between the two projects describe('getTokenSymbols', () => { it('should return a map of token symbol by token id', async () => { diff --git a/packages/daemon/__tests__/guards/guards.test.ts b/packages/daemon/__tests__/guards/guards.test.ts index 2726888c..1b38ec71 100644 --- a/packages/daemon/__tests__/guards/guards.test.ts +++ b/packages/daemon/__tests__/guards/guards.test.ts @@ -28,6 +28,10 @@ jest.mock('../../src/config', () => { }; }); +jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ + assertEnvVariablesExistence: jest.fn(), +})); + import getConfig from '../../src/config'; const TxCache = { diff --git a/packages/daemon/__tests__/integration/balances.test.ts b/packages/daemon/__tests__/integration/balances.test.ts index cc32fa70..8d8708f5 100644 --- a/packages/daemon/__tests__/integration/balances.test.ts +++ b/packages/daemon/__tests__/integration/balances.test.ts @@ -34,10 +34,15 @@ jest.mock('../../src/config', () => { }; }); +jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ + assertEnvVariablesExistence: jest.fn(), +})); + import getConfig from '../../src/config'; // @ts-ignore getConfig.mockReturnValue({ + NETWORK: 'testnet', SERVICE_NAME: 'daemon-test', CONSOLE_LEVEL: 'debug', TX_CACHE_SIZE: 100, @@ -81,6 +86,7 @@ describe('unvoided transaction scenario', () => { it('should do a full sync and the balances should match', async () => { // @ts-ignore getConfig.mockReturnValue({ + NETWORK: 'testnet', SERVICE_NAME: 'daemon-test', CONSOLE_LEVEL: 'debug', TX_CACHE_SIZE: 100, @@ -129,6 +135,7 @@ describe('reorg scenario', () => { it('should do a full sync and the balances should match', async () => { // @ts-ignore getConfig.mockReturnValue({ + NETWORK: 'testnet', SERVICE_NAME: 'daemon-test', CONSOLE_LEVEL: 'debug', TX_CACHE_SIZE: 100, @@ -177,6 +184,7 @@ describe('single chain blocks and transactions scenario', () => { it('should do a full sync and the balances should match', async () => { // @ts-ignore getConfig.mockReturnValue({ + NETWORK: 'testnet', SERVICE_NAME: 'daemon-test', CONSOLE_LEVEL: 'debug', TX_CACHE_SIZE: 100, diff --git a/packages/daemon/__tests__/machines/SyncMachine.test.ts b/packages/daemon/__tests__/machines/SyncMachine.test.ts index 1fed2945..65629a8e 100644 --- a/packages/daemon/__tests__/machines/SyncMachine.test.ts +++ b/packages/daemon/__tests__/machines/SyncMachine.test.ts @@ -29,6 +29,9 @@ import getConfig from '../../src/config'; const { TX_CACHE_SIZE, FULLNODE_PEER_ID, STREAM_ID } = getConfig(); const { VERTEX_METADATA_CHANGED, NEW_VERTEX_ACCEPTED, REORG_STARTED } = EventFixtures; +jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ + assertEnvVariablesExistence: jest.fn(), +})); const TxCache = new LRU(TX_CACHE_SIZE); diff --git a/packages/daemon/__tests__/services/services.test.ts b/packages/daemon/__tests__/services/services.test.ts index db4692cb..9ebc3ff0 100644 --- a/packages/daemon/__tests__/services/services.test.ts +++ b/packages/daemon/__tests__/services/services.test.ts @@ -28,10 +28,9 @@ import { handleVoidedTx, handleVertexAccepted, metadataDiff, - fetchMinRewardBlocks, } from '../../src/services'; import logger from '../../src/logger'; -import { +import { getAddressBalanceMap, prepareInputs, prepareOutputs, @@ -91,6 +90,10 @@ jest.mock('../../src/utils', () => ({ getFullnodeHttpUrl: jest.fn(), })); +jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ + assertEnvVariablesExistence: jest.fn(), +})); + beforeEach(() => { jest.clearAllMocks(); }); @@ -452,9 +455,9 @@ describe('handleVertexAccepted', () => { maxGap: 10 }, }); - + await handleVertexAccepted(context as any, {} as any); - + expect(getDbConnection).toHaveBeenCalled(); expect(mockDb.beginTransaction).toHaveBeenCalled(); expect(getTransactionById).toHaveBeenCalledWith(mockDb, 'hashValue'); diff --git a/packages/daemon/__tests__/utils.ts b/packages/daemon/__tests__/utils.ts index 74a9af53..a20f362b 100644 --- a/packages/daemon/__tests__/utils.ts +++ b/packages/daemon/__tests__/utils.ts @@ -6,7 +6,8 @@ */ import { Connection as MysqlConnection, RowDataPacket } from 'mysql2/promise'; -import { DbTxOutput, EventTxInput, TxInput, TxOutputWithIndex } from "../src/types"; +import { DbTxOutput, EventTxInput } from '../src/types'; +import { TxInput, TxOutputWithIndex } from '@wallet-service/common/src/types'; import { AddressBalanceRow, AddressTableRow, diff --git a/packages/daemon/package.json b/packages/daemon/package.json index 8b4efd23..4b871e19 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -42,10 +42,14 @@ "tslib": "^2.1.0", "typescript": "^4.9.5" }, + "peerDependencies": { + "@aws-sdk/client-lambda": "3.540.0", + "@aws-sdk/client-sqs": "3.540.0", + "@hathor/wallet-lib": "0.39.0", + "winston": "^3.13.0" + }, "dependencies": { - "@aws-sdk/client-lambda": "^3.474.0", - "@aws-sdk/client-sqs": "^3.474.0", - "@hathor/wallet-lib": "^0.39.0", + "@wallet-service/common": "workspace:^", "assert": "^2.1.0", "aws-sdk": "^2.1454.0", "axios": "^1.6.2", @@ -54,7 +58,6 @@ "mysql2": "^3.5.2", "sequelize": "^6.33.0", "websocket": "^1.0.33", - "winston": "^3.3.3", "ws": "^8.13.0", "xstate": "^4.38.2" } diff --git a/packages/daemon/src/config.ts b/packages/daemon/src/config.ts index ca95043e..0e676212 100644 --- a/packages/daemon/src/config.ts +++ b/packages/daemon/src/config.ts @@ -43,7 +43,7 @@ export const CONSOLE_LEVEL = process.env.CONSOLE_LEVEL ?? 'debug'; export const TX_CACHE_SIZE = parseInt(process.env.TX_CACHE_SIZE ?? '10000', 10); // Number of blocks before unlocking a block utxo export const BLOCK_REWARD_LOCK = parseInt(process.env.BLOCK_REWARD_LOCK ?? '10', 10); -export const STAGE = process.env.STAGE; +export const STAGE = process.env.STAGE ?? 'local'; // Fullnode information, used to make sure we're connected to the same fullnode export const FULLNODE_PEER_ID = process.env.FULLNODE_PEER_ID; diff --git a/packages/daemon/src/db/index.ts b/packages/daemon/src/db/index.ts index 43bd30a1..b80cf5d9 100644 --- a/packages/daemon/src/db/index.ts +++ b/packages/daemon/src/db/index.ts @@ -6,12 +6,9 @@ */ import mysql, { Connection as MysqlConnection, Pool } from 'mysql2/promise'; import { - TokenBalanceMap, DbTxOutput, StringMap, Wallet, - TxInput, - TxOutputWithIndex, EventTxInput, GenerateAddresses, AddressIndexMap, @@ -23,7 +20,12 @@ import { Miner, TokenSymbolsRow, } from '../types'; -import { isAuthority } from '../utils'; +import { + TxInput, + TokenBalanceMap, + TxOutputWithIndex, +} from '@wallet-service/common/src/types'; +import { isAuthority } from '@wallet-service/common/src/utils/wallet.utils'; import { AddressBalanceRow, AddressTxHistorySumRow, @@ -161,7 +163,7 @@ export const addUtxos = async ( * @param inputs - The transaction inputs * @param txId - The transaction that spent these utxos */ -export const updateTxOutputSpentBy = async (mysql: any, inputs: TxInput[], txId: string): Promise => { +export const updateTxOutputSpentBy = async (mysql: any, inputs: TxInput[], txId: string): Promise => { const entries = inputs.map((input) => [input.tx_id, input.index]); // entries might be empty if there are no inputs if (entries.length) { @@ -241,7 +243,7 @@ export const getTxOutputsFromTx = async ( * @returns A list of tx outputs */ -export const getTxOutputs = async ( +export const getTxOutputs = async ( mysql: any, inputs: {txId: string, index: number}[], ): Promise => { diff --git a/packages/daemon/src/services/index.ts b/packages/daemon/src/services/index.ts index 98210a2e..ea462c5d 100644 --- a/packages/daemon/src/services/index.ts +++ b/packages/daemon/src/services/index.ts @@ -9,11 +9,9 @@ import hathorLib from '@hathor/wallet-lib'; import axios from 'axios'; import { get } from 'lodash'; +import { NftUtils } from '@wallet-service/common/src/utils/nft.utils'; import { - TxOutputWithIndex, StringMap, - TokenBalanceMap, - TxInput, Wallet, DbTxOutput, DbTransaction, @@ -21,8 +19,13 @@ import { Event, Context, FullNodeEvent, - Transaction, } from '../types'; +import { + TxInput, + Transaction, + TokenBalanceMap, + TxOutputWithIndex, +} from '@wallet-service/common/src/types'; import { prepareOutputs, getAddressBalanceMap, @@ -311,6 +314,7 @@ export const handleVertexAccepted = async (context: Context, _event: Event) => { height: metadata.height, token_name, token_symbol, + signal_bits: 0, // TODO: we should actually receive this and store in the database }; try { @@ -343,9 +347,23 @@ export const handleVertexAccepted = async (context: Context, _event: Event) => { logger.error('Failed to send push notification to wallet-service lambda'); logger.error(e); } + + const { + NETWORK, + STAGE, + } = getConfig(); + + const network = new hathorLib.Network(NETWORK); + + // Validating for NFTs only after the tx is successfully added + if (NftUtils.shouldInvokeNftHandlerForTx(tx, network, logger)) { + // This process is not critical, so we run it in a fire-and-forget manner, not waiting for the promise. + // In case of errors, just log the asynchronous exception and take no action on it. + NftUtils.invokeNftHandlerLambda(tx.tx_id, STAGE, logger) + .catch((err) => logger.error('[ALERT] Errored on nftHandlerLambda invocation', err)); + } } - // TODO: Send message on SQS for real-time update await dbUpdateLastSyncedEvent(mysql, fullNodeEvent.event.id); await mysql.commit(); diff --git a/packages/daemon/src/types/event.ts b/packages/daemon/src/types/event.ts index 59079055..ca2685c6 100644 --- a/packages/daemon/src/types/event.ts +++ b/packages/daemon/src/types/event.ts @@ -14,7 +14,7 @@ export type MetadataDecidedEvent = { originalEvent: FullNodeEvent; } -export type WebSocketSendEvent = +export type WebSocketSendEvent = | { type: 'START_STREAM'; window_size: number; @@ -75,6 +75,7 @@ export type FullNodeEvent = { tokens: string[]; token_name: null | string; token_symbol: null | string; + signal_bits: number; metadata: { hash: string; voided_by: string[]; diff --git a/packages/daemon/src/types/transaction.ts b/packages/daemon/src/types/transaction.ts index cbb04f3d..a933b6ec 100644 --- a/packages/daemon/src/types/transaction.ts +++ b/packages/daemon/src/types/transaction.ts @@ -5,30 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -// @ts-ignore -import hathorLib from '@hathor/wallet-lib'; -import { isAuthority } from '../utils'; -import { StringMap } from './utils'; - - -export interface DecodedOutput { - type: string; - address: string; - timelock: number | null; -} - -export interface TxOutput { - value: number; - script: string; - token: string; - decoded: DecodedOutput | null; - // eslint-disable-next-line camelcase - spent_by?: string | null; - // eslint-disable-next-line camelcase - token_data: number; - locked?: boolean; -} - export interface DbTxOutput { txId: string; index: number; @@ -45,397 +21,6 @@ export interface DbTxOutput { voided?: boolean | null; } -export interface TxOutputWithIndex extends TxOutput { - index: number; -} - -export interface TxInput { - // eslint-disable-next-line camelcase - tx_id: string; - index: number; - value: number; - // eslint-disable-next-line camelcase - token_data: number; - script: string; - token: string; - decoded: DecodedOutput | null; -} - -export class Authorities { - /** - * Supporting up to 8 authorities (but we only have mint and melt at the moment) - */ - static LENGTH = 8; - - array: number[]; - - constructor(authorities?: number | number[]) { - let tmp: number[] = []; - if (authorities instanceof Array) { - tmp = authorities; - } else if (authorities != null) { - tmp = Authorities.intToArray(authorities); - } - - this.array = new Array(Authorities.LENGTH - tmp.length).fill(0).concat(tmp); - } - - /** - * Get the integer representation of this authority. - * - * @remarks - * Uses the array to calculate the final number. Examples: - * [0, 0, 0, 0, 1, 1, 0, 1] = 0b00001101 = 13 - * [0, 0, 1, 0, 0, 0, 0, 1] = 0b00100001 = 33 - * - * @returns The integer representation - */ - toInteger(): number { - let n = 0; - for (let i = 0; i < this.array.length; i++) { - if (this.array[i] === 0) continue; - - n += this.array[i] * (2 ** (this.array.length - i - 1)); - } - return n; - } - - toUnsignedInteger(): number { - return Math.abs(this.toInteger()); - } - - clone(): Authorities { - return new Authorities(this.array); - } - - /** - * Return a new object inverting each authority value sign. - * - * @remarks - * If value is set to 1, it becomes -1 and vice versa. Value 0 remains unchanged. - * - * @returns A new Authority object with the values inverted - */ - toNegative(): Authorities { - const finalAuthorities = this.array.map((value) => { - // This if is needed because Javascript uses the IEEE_754 standard and has negative and positive zeros, - // so (-1) * 0 would return -0. Apparently -0 === 0 is true on most cases, so there wouldn't be a problem, - // but we will leave this here to be safe. - // https://en.wikipedia.org/wiki/IEEE_754 - if (value === 0) return 0; - - return (-1) * value; - }); - return new Authorities(finalAuthorities); - } - - /** - * Return if any of the authorities has a negative value. - * - * @remarks - * Negative values for an authority only make sense when dealing with balances of a - * transaction. So if we consume an authority in the inputs but do not create the same - * one in the output, it will have value -1. - * - * @returns `true` if any authority is less than 0; `false` otherwise - */ - hasNegativeValue(): boolean { - return this.array.some((authority) => authority < 0); - } - - /** - * Transform an integer into an array, considering 1 array element per bit. - * - * @returns The array given an integer - */ - static intToArray(authorities: number): number[] { - const ret = []; - for (const c of authorities.toString(2)) { - ret.push(parseInt(c, 10)); - } - return ret; - } - - /** - * Merge two authorities. - * - * @remarks - * The process is done individualy for each authority value. Each a1[n] and a2[n] are compared. - * If both values are the same, the final value is the same. If one is 1 and the other -1, final - * value is 0. - * - * @returns A new object with the merged values - */ - static merge(a1: Authorities, a2: Authorities): Authorities { - return new Authorities(a1.array.map((value, index) => Math.sign(value + a2.array[index]))); - } - - toJSON(): Record { - const authorities = this.toInteger(); - return { - mint: (authorities & hathorLib.constants.TOKEN_MINT_MASK) > 0, // eslint-disable-line no-bitwise - melt: (authorities & hathorLib.constants.TOKEN_MELT_MASK) > 0, // eslint-disable-line no-bitwise - }; - } -} - -export class Balance { - totalAmountSent: number; - - lockedAmount: number; - - unlockedAmount: number; - - lockedAuthorities: Authorities; - - unlockedAuthorities: Authorities; - - lockExpires: number | null | undefined; - - constructor(totalAmountSent = 0, unlockedAmount = 0, lockedAmount = 0, lockExpires = null, unlockedAuthorities = null, lockedAuthorities = null) { - this.totalAmountSent = totalAmountSent; - this.unlockedAmount = unlockedAmount; - this.lockedAmount = lockedAmount; - this.lockExpires = lockExpires; - this.unlockedAuthorities = unlockedAuthorities || new Authorities(); - this.lockedAuthorities = lockedAuthorities || new Authorities(); - } - - /** - * Get the total balance, sum of unlocked and locked amounts. - * - * @returns The total balance - */ - total(): number { - return this.unlockedAmount + this.lockedAmount; - } - - /** - * Get all authorities, combination of unlocked and locked. - * - * @returns The combined authorities - */ - authorities(): Authorities { - return Authorities.merge(this.unlockedAuthorities, this.lockedAuthorities); - } - - /** - * Clone this Balance object. - * - * @returns A new Balance object with the same information - */ - clone(): Balance { - return new Balance( - this.totalAmountSent, - this.unlockedAmount, - this.lockedAmount, - // @ts-ignore - this.lockExpires, - this.unlockedAuthorities.clone(), - this.lockedAuthorities.clone(), - ); - } - - /** - * Merge two balances. - * - * @remarks - * In case lockExpires is set, it returns the lowest one. - * - * @param b1 - First balance - * @param b2 - Second balance - * @returns The sum of both balances and authorities - */ - static merge(b1: Balance, b2: Balance): Balance { - let lockExpires = null; - if (b1.lockExpires === null) { - lockExpires = b2.lockExpires; - } else if (b2.lockExpires === null) { - lockExpires = b1.lockExpires; - } else { - // @ts-ignore - lockExpires = Math.min(b1.lockExpires, b2.lockExpires); - } - return new Balance( - b1.totalAmountSent + b2.totalAmountSent, - b1.unlockedAmount + b2.unlockedAmount, - b1.lockedAmount + b2.lockedAmount, - // @ts-ignore - lockExpires, - Authorities.merge(b1.unlockedAuthorities, b2.unlockedAuthorities), - Authorities.merge(b1.lockedAuthorities, b2.lockedAuthorities), - ); - } -} - -export class TokenBalanceMap { - map: StringMap; - - constructor() { - this.map = {}; - } - - get(tokenId: string): Balance { - // if the token is not present, return 0 instead of undefined - return this.map[tokenId] || new Balance(0, 0, 0); - } - - set(tokenId: string, balance: Balance): void { - this.map[tokenId] = balance; - } - - getTokens(): string[] { - return Object.keys(this.map); - } - - iterator(): [string, Balance][] { - return Object.entries(this.map); - } - - clone(): TokenBalanceMap { - const cloned = new TokenBalanceMap(); - for (const [token, balance] of this.iterator()) { - cloned.set(token, balance.clone()); - } - return cloned; - } - - /** - * Return a TokenBalanceMap from js object. - * - * @remarks - * Js object is expected to have the format: - * ``` - * { - * token1: {unlocked: n, locked: m}, - * token2: {unlocked: a, locked: b, lockExpires: c}, - * token3: {unlocked: x, locked: y, unlockedAuthorities: z, lockedAuthorities: w}, - * } - * ``` - * - * @param tokenBalanceMap - The js object to convert to a TokenBalanceMap - * @returns - The new TokenBalanceMap object - */ - static fromStringMap(tokenBalanceMap: StringMap>): TokenBalanceMap { - const obj = new TokenBalanceMap(); - for (const [tokenId, balance] of Object.entries(tokenBalanceMap)) { - obj.set(tokenId, new Balance( - balance.totalSent as number, - balance.unlocked as number, - balance.locked as number, - // @ts-ignore - balance.lockExpires || null, - balance.unlockedAuthorities, - balance.lockedAuthorities, - )); - } - return obj; - } - - /** - * Merge two TokenBalanceMap objects, merging the balances for each token. - * - * @param balanceMap1 - First TokenBalanceMap - * @param balanceMap2 - Second TokenBalanceMap - * @returns The merged TokenBalanceMap - */ - static merge(balanceMap1: TokenBalanceMap, balanceMap2: TokenBalanceMap): TokenBalanceMap { - if (!balanceMap1) return balanceMap2.clone(); - if (!balanceMap2) return balanceMap1.clone(); - const mergedMap = balanceMap1.clone(); - for (const [token, balance] of balanceMap2.iterator()) { - const finalBalance = Balance.merge(mergedMap.get(token), balance); - mergedMap.set(token, finalBalance); - } - return mergedMap; - } - - /** - * Create a TokenBalanceMap from a TxOutput. - * - * @param output - The transaction output - * @returns The TokenBalanceMap object - */ - static fromTxOutput(output: TxOutput): TokenBalanceMap { - if (!output.decoded) { - throw new Error('Output has no decoded script'); - } - const token = output.token; - const value = output.value; - const obj = new TokenBalanceMap(); - - if (output.locked) { - if (isAuthority(output.token_data)) { - // @ts-ignore - obj.set(token, new Balance(0, 0, 0, output.decoded.timelock, 0, new Authorities(output.value))); - } else { - // @ts-ignore - obj.set(token, new Balance(value, 0, value, output.decoded.timelock, 0, 0)); - } - } else if (isAuthority(output.token_data)) { - // @ts-ignore - obj.set(token, new Balance(0, 0, 0, null, new Authorities(output.value), 0)); - } else { - obj.set(token, new Balance(value, value, 0, null)); - } - - return obj; - } - - /** - * Create a TokenBalanceMap from a TxInput. - * - * @remarks - * It will have only one token entry and balance will be negative. - * - * @param input - The transaction input - * @returns The TokenBalanceMap object - */ - static fromTxInput(input: TxInput): TokenBalanceMap { - const token = input.token; - const obj = new TokenBalanceMap(); - - if (isAuthority(input.token_data)) { - // for inputs, the authorities will have a value of -1 when set - const authorities = new Authorities(input.value); - obj.set( - token, - new Balance( - 0, - 0, - 0, - null, - // @ts-ignore - authorities.toNegative(), - new Authorities(0), - ), - ); - } else { - obj.set(token, new Balance(0, -input.value, 0, null)); - } - return obj; - } -} - -export interface Transaction { - // eslint-disable-next-line camelcase - tx_id: string; - nonce: number; - timestamp: number; - // eslint-disable-next-line camelcase - voided: boolean; - version: number; - weight: number; - parents: string[]; - inputs: TxInput[]; - outputs: TxOutput[]; - height?: number; - // eslint-disable-next-line camelcase - token_name?: string | null; - // eslint-disable-next-line camelcase - token_symbol?: string | null; -} - export interface DbTransaction { tx_id: string; timestamp: number; diff --git a/packages/daemon/src/types/wallet.ts b/packages/daemon/src/types/wallet.ts index bdbd9ee5..3d2a0f85 100644 --- a/packages/daemon/src/types/wallet.ts +++ b/packages/daemon/src/types/wallet.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import { TokenBalanceMap } from "./transaction"; +import { TokenBalanceMap } from '@wallet-service/common/src/types'; export enum WalletStatus { CREATING = 'creating', diff --git a/packages/daemon/src/utils/alerting.ts b/packages/daemon/src/utils/alerting.ts deleted file mode 100644 index f74f0947..00000000 --- a/packages/daemon/src/utils/alerting.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) Hathor Labs and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import { Severity } from '../types'; -import getConfig from '../config'; -import logger from '../logger'; -import { sendMessageSQS } from './aws'; - -/** - * Adds a message to the SQS alerting queue - * - * @param title - The alert's title - * @param message - The alert's message - * @param severity - The alert's severity (critical, major, medium, minor, warning or info) - * @param metadata - Key value object being the key the title - */ -export const addAlert = async ( - title: string, - message: string, - severity: Severity = Severity.INFO, - metadata?: unknown, -): Promise => { - const { - NETWORK, - ACCOUNT_ID, - SERVICE_NAME, - ALERT_MANAGER_TOPIC, - ALERT_MANAGER_REGION, - } = getConfig(); - - const preparedMessage = { - title, - message, - severity, - metadata, - environment: NETWORK, - application: SERVICE_NAME, - }; - - try { - const QUEUE_URL = `https://sqs.${ALERT_MANAGER_REGION}.amazonaws.com/${ACCOUNT_ID}/${ALERT_MANAGER_TOPIC}`; - - await sendMessageSQS(QUEUE_URL, JSON.stringify(preparedMessage), { - None: { - DataType: 'String', - StringValue: '--', - }, - }); - } catch(err) { - logger.error('[ALERT] Erroed while sending message to the alert sqs queue'); - logger.error(err); - } -}; diff --git a/packages/daemon/src/utils/aws.ts b/packages/daemon/src/utils/aws.ts index 63044dcd..c27de295 100644 --- a/packages/daemon/src/utils/aws.ts +++ b/packages/daemon/src/utils/aws.ts @@ -4,7 +4,7 @@ import { SendMessageCommand, SendMessageCommandOutput, SQSClient, MessageAttribu import { StringMap } from '../types'; import getConfig from '../config'; import logger from '../logger'; -import { addAlert } from './alerting'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; export function buildFunctionName(functionName: string): string { const { STAGE } = getConfig(); @@ -50,6 +50,7 @@ export const invokeOnTxPushNotificationRequestedLambda = async (walletBalanceVal `${ON_TX_PUSH_NOTIFICATION_REQUESTED_FUNCTION_NAME} lambda invoke failed for wallets`, Severity.MINOR, { Wallets: walletIdList }, + logger, ); throw new Error(`${ON_TX_PUSH_NOTIFICATION_REQUESTED_FUNCTION_NAME} lambda invoke failed for wallets: ${walletIdList}`); } diff --git a/packages/daemon/src/utils/helpers.ts b/packages/daemon/src/utils/helpers.ts index d24e2ac0..ed1fe2c4 100644 --- a/packages/daemon/src/utils/helpers.ts +++ b/packages/daemon/src/utils/helpers.ts @@ -28,6 +28,6 @@ export const getFullnodeWsUrl = () => { const fullNodeUrl = new URL(`${protocol}${FULLNODE_HOST}`); fullNodeUrl.pathname = '/v1a/event_ws'; - + return fullNodeUrl.toString(); }; diff --git a/packages/daemon/src/utils/wallet.ts b/packages/daemon/src/utils/wallet.ts index 18c1c8a6..1aa2263b 100644 --- a/packages/daemon/src/utils/wallet.ts +++ b/packages/daemon/src/utils/wallet.ts @@ -13,20 +13,22 @@ import { AddressBalance, AddressTotalBalance, DbTxOutput, - DecodedOutput, EventTxInput, EventTxOutput, StringMap, - TokenBalanceMap, TokenBalanceValue, - Transaction, - TxInput, - TxOutput, - TxOutputWithIndex, Wallet, WalletBalance, WalletBalanceValue, } from '../types'; +import { + DecodedOutput, + Transaction, + TxOutputWithIndex, + TxInput, + TxOutput, + TokenBalanceMap, +} from '@wallet-service/common/src/types'; import { fetchAddressBalance, fetchAddressTxHistorySum, @@ -40,17 +42,6 @@ import { import logger from '../logger'; import { stringMapIterator } from './helpers'; -/** - * Checks if a given tokenData has any authority bit set - * - * tokenData merges two fields: first bit is the authority flag, while remaining - * bits represent the token index. If the first bit is 0, this is a regular - * output, if it's 1, it's an authority output - */ -export const isAuthority = (tokenData: number): boolean => ( - (tokenData & constants.TOKEN_AUTHORITY_MASK) > 0 -); - /** * Prepares transaction outputs with additional metadata and indexing. * @@ -59,11 +50,11 @@ export const isAuthority = (tokenData: number): boolean => ( * enhanced with additional data like the token it represents, its index in the * transaction, and its decoded information. * - * @param outputs - An array of transaction outputs, each containing data like value, + * @param outputs - An array of transaction outputs, each containing data like value, * script, and token data. - * @param tokens - An array of token identifiers corresponding to different tokens involved + * @param tokens - An array of token identifiers corresponding to different tokens involved * in the transaction. - * @returns - An array of outputs, each augmented with index and additional + * @returns - An array of outputs, each augmented with index and additional * metadata. */ export const prepareOutputs = (outputs: EventTxOutput[], tokens: string[]): TxOutputWithIndex[] => { @@ -270,13 +261,13 @@ export const unlockTimelockedUtxos = async (mysql: MysqlConnection, now: number) /** * Prepares transaction input data for processing or display. * - * This function takes an array of EventTxInput objects and an array of token identifiers - * to prepare an array of TxInput objects. Each input is processed to include additional information + * This function takes an array of EventTxInput objects and an array of token identifiers + * to prepare an array of TxInput objects. Each input is processed to include additional information * such as the token involved and the decoded output data. * - * @param inputs - An array of transaction inputs, each containing data like + * @param inputs - An array of transaction inputs, each containing data like * transaction hash, index, and spent output information. - * @param tokens - An array of token identifiers corresponding to different tokens involved + * @param tokens - An array of token identifiers corresponding to different tokens involved * in the transaction. * @returns - An array of prepared inputs, each enriched with additional data. */ @@ -358,16 +349,16 @@ export const getTokenListFromInputsAndOutputs = (inputs: TxInput[], outputs: TxO /** * Validates the consistency of address balances. - * - * This method is designed to validate that the sum of unlocked and locked balances - * for each address in a given set matches the corresponding total balance from the address's + * + * This method is designed to validate that the sum of unlocked and locked balances + * for each address in a given set matches the corresponding total balance from the address's * transaction history. * * If any of these conditions are not met, the function will throw an assertion error, indicating a mismatch. - * + * * @param mysql - The MySQL connection object to perform database operations. * @param addresses - An array of addresses whose balances need to be validated. - * @returns - The function returns a promise that resolves to void. It does not return + * @returns - The function returns a promise that resolves to void. It does not return * any value but serves the purpose of validation. */ export const validateAddressBalances = async (mysql: MysqlConnection, addresses: string[]): Promise => { diff --git a/packages/wallet-service/package.json b/packages/wallet-service/package.json index 5a52cc95..3699da5b 100644 --- a/packages/wallet-service/package.json +++ b/packages/wallet-service/package.json @@ -11,19 +11,19 @@ "author": "Hathor Labs", "license": "MIT", "dependencies": { - "@aws-sdk/client-apigatewaymanagementapi": "^3.465.0", - "@aws-sdk/client-lambda": "^3.465.0", - "@aws-sdk/client-sqs": "^3.465.0", + "@aws-sdk/client-apigatewaymanagementapi": "3.540.0", + "@aws-sdk/client-lambda": "3.540.0", + "@aws-sdk/client-sqs": "3.540.0", "@hathor/healthcheck-lib": "^0.1.0", - "@hathor/wallet-lib": "^0.39.0", "@middy/core": "^2.5.7", "@middy/http-cors": "^2.5.7", "@types/redis": "^2.8.28", "aws-lambda": "^1.0.7", "axios": "^0.21.1", "bip32": "^3.0.1", - "bitcoinjs-lib": "^6.0.1", + "bitcoinjs-lib": "^6.1.5", "bitcoinjs-message": "^2.2.0", + "bitcore-lib": "8.25.10", "bitcore-mnemonic": "8.25.10", "firebase-admin": "^11.3.0", "joi": "^17.4.0", @@ -37,7 +37,11 @@ "source-map-support": "^0.5.19", "tiny-secp256k1": "^2.2.1", "uuid": "^8.3.0", - "winston": "^3.7.2" + "winston": "^3.13.0" + }, + "peerDependencies": { + "@hathor/wallet-lib": "^0.39.0", + "@wallet-service/common": "1.5.0" }, "devDependencies": { "@types/aws-lambda": "^8.10.95", @@ -45,7 +49,6 @@ "@types/node": "^18.0.4", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^3.3.0", - "bitcore-lib": "8.25.10", "dotenv": "^10.0.0", "eslint": "^8.50.0", "eslint-config-airbnb-base": "^14.2.1", diff --git a/packages/wallet-service/serverless.yml b/packages/wallet-service/serverless.yml index afaf71ea..cbe6e594 100644 --- a/packages/wallet-service/serverless.yml +++ b/packages/wallet-service/serverless.yml @@ -11,6 +11,7 @@ custom: - schedule: rate(5 minutes) webpack: webpackConfig: ./webpack.config.js + packager: "npm" includeModules: true prune: automatic: true @@ -222,17 +223,6 @@ functions: warmup: walletWarmer: enabled: false - onHandleReorgRequest: - handler: src/txProcessor.onHandleReorgRequest - timeout: 300 # 5 minutes - warmup: - walletWarmer: - enabled: false - onNewTxEvent: - handler: src/txProcessor.onNewTxEvent - warmup: - walletWarmer: - enabled: false onNewNftEvent: handler: src/txProcessor.onNewNftEvent warmup: diff --git a/packages/wallet-service/src/api/pushSendNotificationToDevice.ts b/packages/wallet-service/src/api/pushSendNotificationToDevice.ts index 353f71e9..56881502 100644 --- a/packages/wallet-service/src/api/pushSendNotificationToDevice.ts +++ b/packages/wallet-service/src/api/pushSendNotificationToDevice.ts @@ -8,13 +8,15 @@ import { Handler } from 'aws-lambda'; import { closeDbConnection, getDbConnection } from '@src/utils'; import Joi, { ValidationError } from 'joi'; -import { Severity, SendNotificationToDevice } from '@src/types'; +import { SendNotificationToDevice } from '@src/types'; import { getPushDevice, unregisterPushDevice } from '@src/db'; import createDefaultLogger from '@src/logger'; import { isPushProviderAllowed, PushNotificationUtils, PushNotificationError } from '@src/utils/pushnotification.utils'; -import { addAlert } from '@src/utils/alerting.utils'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; +import { Severity } from '@wallet-service/common/src/types'; const mysql = getDbConnection(); +const logger = createDefaultLogger(); class PushSendNotificationToDeviceInputValidator { static readonly bodySchema = Joi.object({ @@ -41,7 +43,6 @@ class PushSendNotificationToDeviceInputValidator { * This lambda is called by API Gateway on POST /push/register */ export const send: Handler = async (event, context) => { - const logger = createDefaultLogger(); // Logs the request id on every line, so we can see all logs from a request logger.defaultMeta = { requestId: context.awsRequestId, @@ -69,6 +70,7 @@ export const send: Handler, { success: boolean, message?: string, details?: unknown }> = async (event, context) => { - const logger = createDefaultLogger(); // Logs the request id on every line, so we can see all logs from a request logger.defaultMeta = { module: __filename, @@ -102,6 +102,7 @@ export const handleRequest: Handler, { success: bo '-', Severity.MINOR, { details }, + logger, ); logger.error('Invalid payload while handling push notification request.', { details }); return { success: false, message: pushNotificationMessage.invalidPayload, details }; @@ -207,6 +208,7 @@ const _sendNotification = async (notification: SendNotificationToDevice, logger: '-', Severity.MINOR, { ...notification }, + logger, ); logger.error('Unexpected failure while calling invokeSendNotificationHandlerLambda.', { ...notification, error }); } diff --git a/packages/wallet-service/src/api/wallet.ts b/packages/wallet-service/src/api/wallet.ts index 981a0e60..d709e7d3 100644 --- a/packages/wallet-service/src/api/wallet.ts +++ b/packages/wallet-service/src/api/wallet.ts @@ -21,7 +21,7 @@ import { updateWalletStatus, updateWalletAuthXpub, } from '@src/db'; -import { Severity, WalletStatus } from '@src/types'; +import { WalletStatus } from '@src/types'; import { closeDbConnection, getDbConnection, @@ -38,7 +38,8 @@ import middy from '@middy/core'; import cors from '@middy/http-cors'; import Joi from 'joi'; import createDefaultLogger from '@src/logger'; -import { addAlert } from '@src/utils/alerting.utils'; +import { Severity } from '@wallet-service/common/src/types'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; const mysql = getDbConnection(); @@ -350,8 +351,7 @@ export const load: APIGatewayProxyHandler = middy(async (event) => { */ await invokeLoadWalletAsync(xpubkeyStr, maxGap); } catch (e) { - logger.error('Error on lambda wallet invoke', e); - + logger.error(e); const newRetryCount = wallet.retryCount ? wallet.retryCount + 1 : 1; // update wallet status to 'error' await updateWalletStatus(mysql, walletId, WalletStatus.ERROR, newRetryCount); @@ -411,6 +411,7 @@ export const loadWalletFailed: Handler = async (event) => { RequestID: RequestID.Value, ErrorMessage: ErrorMessage.Value, }, + logger, ); continue; } @@ -437,6 +438,7 @@ export const loadWalletFailed: Handler = async (event) => { RequestID: RequestID.Value, ErrorMessage: ErrorMessage.Value, }, + logger, ); } } catch (e) { @@ -446,6 +448,7 @@ export const loadWalletFailed: Handler = async (event) => { // This is major because the user will be stuck in a loading cycle Severity.MAJOR, { event }, + logger, ); } }; diff --git a/packages/wallet-service/src/commons.ts b/packages/wallet-service/src/commons.ts index 35fcc51c..809ce4cd 100644 --- a/packages/wallet-service/src/commons.ts +++ b/packages/wallet-service/src/commons.ts @@ -39,11 +39,8 @@ import { getTokenSymbols, } from '@src/db'; import { - DecodedOutput, StringMap, TokenBalanceMap, - TxInput, - TxOutput, TxOutputWithIndex, DbTxOutput, Tx, @@ -55,12 +52,17 @@ import { AddressTotalBalance, WalletProxyHandler, WalletBalance, - Transaction, WalletBalanceValue, - Severity, } from '@src/types'; import { Logger } from 'winston'; -import { addAlert } from '@src/utils/alerting.utils'; +import { + DecodedOutput, + TxInput, + TxOutput, + Transaction, + Severity, +} from '@wallet-service/common/src/types'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; import { getUnixTimestamp, @@ -523,6 +525,7 @@ export const handleReorg = async (mysql: ServerlessMysql, logger: Logger): Promi `A reorg with ${currentHeight - height} blocks has been detected`, Severity.MINOR, { walletServiceHeight: currentHeight, fullNodeHeight: height }, + logger, ); } diff --git a/packages/wallet-service/src/db/index.ts b/packages/wallet-service/src/db/index.ts index 248a2ca6..da913f5e 100644 --- a/packages/wallet-service/src/db/index.ts +++ b/packages/wallet-service/src/db/index.ts @@ -21,7 +21,6 @@ import { StringMap, TokenBalanceMap, TokenInfo, - TxInput, TxOutputWithIndex, TxProposal, TxProposalStatus, @@ -40,20 +39,26 @@ import { PushDevice, TxByIdToken, PushDeviceSettings, - Severity, } from '@src/types'; import { getUnixTimestamp, - isAuthority, getAddressPath, xpubDeriveChild, getAddresses, } from '@src/utils'; +import { + isAuthority, +} from '@wallet-service/common/src/utils/wallet.utils'; import { getWalletFromDbEntry, getTxsFromDBResult, } from '@src/db/utils'; -import { addAlert } from '@src/utils/alerting.utils'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; +import { TxInput, Severity } from '@wallet-service/common/src/types'; +import { Logger } from 'winston'; +import createDefaultLogger from '@src/logger'; + +const logger: Logger = createDefaultLogger(); const BLOCK_VERSION = [ constants.BLOCK_VERSION, @@ -2593,6 +2598,7 @@ export const getTotalSupply = async ( '-', Severity.MINOR, { tokenId }, + logger, ); throw new Error('Total supply query returned no results'); } @@ -2651,6 +2657,7 @@ export const getTotalTransactions = async ( '-', Severity.MINOR, { tokenId }, + logger, ); throw new Error('Total transactions query returned no results'); } diff --git a/packages/wallet-service/src/mempool.ts b/packages/wallet-service/src/mempool.ts index 94357dd2..4ed2e7d3 100644 --- a/packages/wallet-service/src/mempool.ts +++ b/packages/wallet-service/src/mempool.ts @@ -11,7 +11,7 @@ import { getMempoolTransactionsBeforeDate, updateTx, } from '@src/db'; -import { Block, Severity, Tx } from '@src/types'; +import { Block, Tx } from '@src/types'; import { handleVoided } from '@src/commons'; import { isTxVoided, @@ -20,7 +20,8 @@ import { getDbConnection, } from '@src/utils'; import createDefaultLogger from '@src/logger'; -import { addAlert } from '@src/utils/alerting.utils'; +import { Severity } from '@wallet-service/common/src/types'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; const mysql = getDbConnection(); @@ -65,6 +66,7 @@ export const onHandleOldVoidedTxs = async (): Promise => { `Transaction ${tx.txId} is not yet confirmed on our database but it is not voided on the fullnode.`, Severity.MAJOR, { Tx: transaction }, + logger, ); logger.error(`Transaction ${tx.txId} is not yet confirmed on our database but it is not voided on the fullnode.`); // Check if it is confirmed by a block diff --git a/packages/wallet-service/src/txProcessor.ts b/packages/wallet-service/src/txProcessor.ts index fd20bdad..a3748243 100644 --- a/packages/wallet-service/src/txProcessor.ts +++ b/packages/wallet-service/src/txProcessor.ts @@ -5,250 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -import { SendMessageCommand, SQSClient } from '@aws-sdk/client-sqs'; -import { APIGatewayProxyHandler, APIGatewayProxyResult, Handler, SQSEvent } from 'aws-lambda'; +import { Handler } from 'aws-lambda'; import 'source-map-support/register'; -import hathorLib from '@hathor/wallet-lib'; -import { - getAddressBalanceMap, - getWalletBalanceMap, - markLockedOutputs, - unlockUtxos, - unlockTimelockedUtxos, - searchForLatestValidBlock, - getTokenListFromInputsAndOutputs, - handleReorg, - handleVoided, - prepareOutputs, - getWalletBalancesForTx, -} from '@src/commons'; -import { Logger } from 'winston'; -import { - addNewAddresses, - addUtxos, - addOrUpdateTx, - updateTx, - generateAddresses, - getAddressWalletInfo, - getLockedUtxoFromInputs, - getUtxosLockedAtHeight, - updateTxOutputSpentBy, - storeTokenInformation, - updateAddressTablesWithTx, - updateWalletTablesWithTx, - incrementTokensTxCount, - fetchTx, - addMiner, - cleanupVoidedTx, - checkTxWasVoided, -} from '@src/db'; -import { - transactionDecorator, -} from '@src/db/utils'; -import { - TxOutputWithIndex, - StringMap, - Transaction, - TokenBalanceMap, - Wallet, - Tx, - Severity, -} from '@src/types'; -import { - closeDbConnection, - getDbConnection, - getUnixTimestamp, -} from '@src/utils'; import createDefaultLogger from '@src/logger'; -import { NftUtils } from '@src/utils/nft.utils'; -import { PushNotificationUtils, isPushNotificationEnabled } from '@src/utils/pushnotification.utils'; -import { addAlert } from '@src/utils/alerting.utils'; +import { NftUtils } from '@wallet-service/common/src/utils/nft.utils'; -const mysql = getDbConnection(); - -export const IGNORE_TXS = { - mainnet: [ - '000006cb93385b8b87a545a1cbb6197e6caff600c12cc12fc54250d39c8088fc', - '0002d4d2a15def7604688e1878ab681142a7b155cbe52a6b4e031250ae96db0a', - '0002ad8d1519daaddc8e1a37b14aac0b045129c01832281fb1c02d873c7abbf9', - ], - testnet: [ - '0000033139d08176d1051fb3a272c3610457f0c7f686afbe0afe3d37f966db85', - '00e161a6b0bee1781ea9300680913fb76fd0fac4acab527cd9626cc1514abdc9', - '00975897028ceb037307327c953f5e7ad4d3f42402d71bd3d11ecb63ac39f01a', - ], -}; - -/** - * Function called when a new transaction arrives. - * - * @remarks - * This is a lambda function that should be triggered by an SQS event. The queue might batch - * messages, so we expect a list of transactions. This function only parses the SQS event and - * calls the appropriate function to handle the transaction. - * - * @param event - The SQS event - * @deprecated - */ -export const onNewTxEvent = async (event: SQSEvent): Promise => { - const logger: Logger = createDefaultLogger(); - - // TODO not sure if it should be 'now' or max(now, tx.timestamp), as we allow some flexibility for timestamps - const now = getUnixTimestamp(); - const blockRewardLock = parseInt(process.env.BLOCK_REWARD_LOCK, 10); - - for (const evt of event.Records) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - await addNewTx(logger, evt.body, now, blockRewardLock); - } - - await closeDbConnection(mysql); - - // TODO delete message from queue - // https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html - // When a consumer receives and processes a message from a queue, the message remains in the queue. - // Amazon SQS doesn't automatically delete the message. Thus, the consumer must delete the message from the - // queue after receiving and processing it. - - return { - statusCode: 200, - body: JSON.stringify({ message: 'Added new transactions' }), - }; -}; - -/** - * Function called when to process new transactions or blocks. - * - * @remarks - * This is a lambda function that should be invoked using the aws-sdk. - */ -export const onNewTxRequest: APIGatewayProxyHandler = async (event, context) => { - const logger = createDefaultLogger(); - - // Logs the request id on every line so we can see all logs from a request - logger.defaultMeta = { - requestId: context.awsRequestId, - }; - - const now = getUnixTimestamp(); - const blockRewardLock = parseInt(process.env.BLOCK_REWARD_LOCK, 10); - const tx = (event.body as unknown) as Transaction; - - // Critical processing: add the transaction to the database. - try { - await addNewTx(logger, tx, now, blockRewardLock); - } catch (e) { - // eslint-disable-next-line - logger.error('Errored on onNewTxRequest: ', e); - await addAlert( - 'Error on onNewTxRequest', - 'Erroed on onNewTxRequest lambda', - Severity.MINOR, - { TxId: tx.tx_id, error: e.message }, - ); - - return { - statusCode: 500, - body: JSON.stringify({ - success: false, - message: 'Tx processor failed', - }), - }; - } - - // Validating for NFTs only after the tx is successfully added - if (NftUtils.shouldInvokeNftHandlerForTx(tx)) { - // This process is not critical, so we run it in a fire-and-forget manner, not waiting for the promise. - // In case of errors, just log the asynchronous exception and take no action on it. - NftUtils.invokeNftHandlerLambda(tx.tx_id) - .catch((err) => logger.error('[ALERT] Errored on nftHandlerLambda invocation', err)); - } - - if (isPushNotificationEnabled()) { - const walletBalanceMap = await getWalletBalancesForTx(mysql, tx); - const { length: hasAffectWallets } = Object.keys(walletBalanceMap); - if (hasAffectWallets) { - PushNotificationUtils.invokeOnTxPushNotificationRequestedLambda(walletBalanceMap) - .catch((err: Error) => logger.error('Errored on invokeOnTxPushNotificationRequestedLambda invocation', err)); - } - } - - return { - statusCode: 200, - body: JSON.stringify({ success: true }), - }; -}; - -/** - * Function called when a reorg is detected on the wallet-service daemon - * - * @remarks - * This is a lambda function that should be invoked using the aws-sdk. - */ -export const onHandleReorgRequest: APIGatewayProxyHandler = async (_event, context) => { - const logger = createDefaultLogger(); - - logger.defaultMeta = { - requestId: context.awsRequestId, - }; - - try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - /* eslint-disable-next-line @typescript-eslint/ban-types */ - const wrappedHandleReorg = await transactionDecorator(mysql, handleReorg); - - await wrappedHandleReorg(mysql, logger); - - return { - statusCode: 200, - body: JSON.stringify({ success: true }), - }; - } catch (e) { - // eslint-disable-next-line - logger.error('Errored on onHandleReorgRequest: ', e); - return { - statusCode: 500, - body: JSON.stringify({ - success: false, - message: 'Reorg failed.', - }), - }; - } -}; - -/** - * Function called to search for the latest valid block - * - * @remarks - * This is a lambda function that should be invoked using the aws-sdk. - */ -export const onSearchForLatestValidBlockRequest: APIGatewayProxyHandler = async () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const latestValidBlock = await searchForLatestValidBlock(mysql); - - return { - statusCode: 200, - body: JSON.stringify({ success: true, latestValidBlock }), - }; -}; - -export const handleVoidedTx = async (tx: Transaction): Promise => { - const txId = tx.tx_id; - const transaction: Tx = await fetchTx(mysql, txId); - const logger = createDefaultLogger(); - logger.defaultMeta = { - txId, - }; - - if (!transaction) { - throw new Error(`Transaction ${txId} not found.`); - } - - await handleVoided(mysql, logger, transaction); -}; +export const CREATE_NFT_MAX_RETRIES: number = parseInt(process.env.CREATE_NFT_MAX_RETRIES || '3', 10); /** * This intermediary handler is responsible for making the final validations and calling @@ -275,7 +37,7 @@ export const onNewNftEvent: Handler< try { // Checks existing metadata on this transaction and updates it if necessary - await NftUtils.createOrUpdateNftMetadata(event.nftUid); + await NftUtils.createOrUpdateNftMetadata(event.nftUid, CREATE_NFT_MAX_RETRIES, logger); } catch (e) { logger.error('Errored on onNewNftEvent: ', e); @@ -290,189 +52,3 @@ export const onNewNftEvent: Handler< success: true, }; }; - -/** - * Add a new transaction or block, updating the proper tables. - * - * @param tx - The transaction or block - * @param now - Current timestamp - * @param blockRewardLock - The block reward lock - */ -const _unsafeAddNewTx = async (_logger: Logger, tx: Transaction, now: number, blockRewardLock: number): Promise => { - const txId = tx.tx_id; - const network = process.env.NETWORK; - - // add the tx id to all logs from this method, so we can search by txId on CloudWatch - const logger = _logger; - logger.defaultMeta = { - ...logger.defaultMeta, - txId, - }; - - logger.debug(`Transaction ${txId} received`, { - tx, - }); - - // we should ignore genesis transactions as they have no parents, inputs and outputs and we expect the service - // to already have the pre-mine utxos on its database. - if (network in IGNORE_TXS) { - if (IGNORE_TXS[network].includes(txId)) { - throw new Error('Rejecting tx as it is part of the genesis transactions.'); - } - } - - const dbTx: Tx = await fetchTx(mysql, txId); - - // check if we already have the tx on our database: - if (dbTx) { - // ignore tx if we already have it confirmed on our database - if (dbTx.height) { - logger.debug(`Ignoring ${txId} as it already has height on the database`, { - txId, - }); - return; - } - - // set height and break out because it was already on the mempool - // so we can consider that our balances have already been calculated - // and the utxos were already inserted - await updateTx(mysql, txId, tx.height, tx.timestamp, tx.version, tx.weight); - - return; - } - - // check if this tx was already on the database in the past and got voided: - const voidedTx = await checkTxWasVoided(mysql, txId); - - if (voidedTx) { - logger.info(`Transaction ${txId} received and was voided on database`, { - tx, - }); - // this tx was already in the database in the past as voided and is now valid - // again, we need to cleanup the tx_output and address_tx_history tables so we - // can safely add it again. Balances were already re-calculated on the handleReorg - // method, so we don't need to handle that here. - await cleanupVoidedTx(mysql, txId); - } - - let heightlock = null; - if (tx.version === hathorLib.constants.BLOCK_VERSION - || tx.version === hathorLib.constants.MERGED_MINED_BLOCK_VERSION) { - // unlock older blocks - const utxos = await getUtxosLockedAtHeight(mysql, now, tx.height); - logger.debug(`Block transaction, unlocking ${utxos.length} locked utxos at height ${tx.height}`, { - unlockedUtxos: utxos, - }); - await unlockUtxos(mysql, utxos, false); - - // set heightlock - heightlock = tx.height + blockRewardLock; - - // get the first output address - const blockRewardOutput = tx.outputs[0]; - - // add miner to the miners table - await addMiner(mysql, blockRewardOutput.decoded.address, tx.tx_id); - - // here we check if we have any utxos on our database that is locked but - // has its timelock < now - // - // we've decided to do this here considering that it is acceptable to have - // a delay between the actual timelock expiration time and the next block - // (that will unlock it). This delay is only perceived on the wallet as the - // sync mechanism will unlock the timelocked utxos as soon as they are seen - // on a received transaction. - await unlockTimelockedUtxos(mysql, now); - } - - if (tx.version === hathorLib.constants.CREATE_TOKEN_TX_VERSION) { - await storeTokenInformation(mysql, tx.tx_id, tx.token_name, tx.token_symbol); - } - - const outputs: TxOutputWithIndex[] = prepareOutputs(tx.outputs, txId, logger); - - // check if any of the inputs are still marked as locked and update tables accordingly. - // See remarks on getLockedUtxoFromInputs for more explanation. It's important to perform this - // before updating the balances - const lockedInputs = await getLockedUtxoFromInputs(mysql, tx.inputs); - await unlockUtxos(mysql, lockedInputs, true); - - // add transaction outputs to the tx_outputs table - markLockedOutputs(outputs, now, heightlock !== null); - logger.debug(`Adding ${txId} to database`); - await addOrUpdateTx(mysql, txId, tx.height, tx.timestamp, tx.version, tx.weight); - logger.debug(`Adding ${outputs.length} utxos to database`); - await addUtxos(mysql, txId, outputs, heightlock); - - // mark the tx_outputs used in the transaction (tx.inputs) as spent by txId - logger.debug(`Marking ${tx.inputs.length} tx_outputs as spent`, { - inputs: tx.inputs, - }); - await updateTxOutputSpentBy(mysql, tx.inputs, txId); - - // get balance of each token for each address - const addressBalanceMap: StringMap = getAddressBalanceMap(tx.inputs, outputs); - logger.debug('Updating address_balance and address_tx_history tables', { - addressBalanceMap, - }); - - const tokenList: string[] = getTokenListFromInputsAndOutputs(tx.inputs, outputs); - - // Update transaction count with the new tx - await incrementTokensTxCount(mysql, tokenList); - - // update address tables (address, address_balance, address_tx_history) - await updateAddressTablesWithTx(mysql, txId, tx.timestamp, addressBalanceMap); - - // for the addresses present on the tx, check if there are any wallets associated - const addressWalletMap: StringMap = await getAddressWalletInfo(mysql, Object.keys(addressBalanceMap)); - - // for each already started wallet, update databases - const seenWallets = new Set(); - for (const wallet of Object.values(addressWalletMap)) { - const walletId = wallet.walletId; - - // this map might contain duplicate wallet values, as 2 different addresses might belong to the same wallet - if (seenWallets.has(walletId)) continue; - seenWallets.add(walletId); - const { newAddresses, lastUsedAddressIndex } = await generateAddresses(mysql, wallet.xpubkey, wallet.maxGap); - // might need to generate new addresses to keep maxGap - await addNewAddresses(mysql, walletId, newAddresses, lastUsedAddressIndex); - // update existing addresses' walletId and index - } - // update wallet_balance and wallet_tx_history tables - const walletBalanceMap: StringMap = getWalletBalanceMap(addressWalletMap, addressBalanceMap); - logger.debug('Updating wallet_balance and wallet_tx_history tables', { - walletBalanceMap, - }); - await updateWalletTablesWithTx(mysql, txId, tx.timestamp, walletBalanceMap); - - const queueUrl = process.env.NEW_TX_SQS; - if (!queueUrl) return; - - const client = new SQSClient({}); - const command = new SendMessageCommand({ - QueueUrl: queueUrl, - MessageBody: JSON.stringify({ - wallets: Array.from(seenWallets), - tx, - }), - }); - - await client.send(command); -}; - -/** - * Add a new transaction or block, updating the proper tables. - * @remarks This is a wrapper for _unsafeAddNewTx that adds automatic transaction and rollback on failure - * - * @param tx - The transaction or block - * @param now - Current timestamp - * @param blockRewardLock - The block reward lock - */ -export const addNewTx = async (logger: Logger, tx: Transaction, now: number, blockRewardLock: number): Promise => { - /* eslint-disable-next-line @typescript-eslint/ban-types */ - const wrappedAddNewTx = await transactionDecorator(mysql, _unsafeAddNewTx); - - return wrappedAddNewTx(logger, tx, now, blockRewardLock); -}; diff --git a/packages/wallet-service/src/types.ts b/packages/wallet-service/src/types.ts index f9fc1f58..dde54bd7 100644 --- a/packages/wallet-service/src/types.ts +++ b/packages/wallet-service/src/types.ts @@ -7,9 +7,10 @@ * LICENSE file in the root directory of this source tree. */ +import { TxInput, TxOutput } from '@wallet-service/common/src/types'; + import hathorLib from '@hathor/wallet-lib'; -// eslint-disable-next-line -import { isAuthority } from '@src/utils'; +import { isAuthority } from '@wallet-service/common/src/utils/wallet.utils'; import { APIGatewayProxyEvent, @@ -517,59 +518,10 @@ export type DbSelectResult = Array>; * Hathor types */ -export interface DecodedOutput { - type: string; - address: string; - timelock: number | null; -} - -export interface TxOutput { - value: number; - script: string; - token: string; - decoded: DecodedOutput; - // eslint-disable-next-line camelcase - spent_by: string | null; - // eslint-disable-next-line camelcase - token_data: number; - locked?: boolean; -} - export interface TxOutputWithIndex extends TxOutput { index: number; } -export interface TxInput { - // eslint-disable-next-line camelcase - tx_id: string; - index: number; - value: number; - // eslint-disable-next-line camelcase - token_data: number; - script: string; - token: string; - decoded: DecodedOutput; -} - -export interface Transaction { - // eslint-disable-next-line camelcase - tx_id: string; - nonce: number; - timestamp: number; - // eslint-disable-next-line camelcase - signal_bits: number; - version: number; - weight: number; - parents: string[]; - inputs: TxInput[]; - outputs: TxOutput[]; - height?: number; - // eslint-disable-next-line camelcase - token_name?: string; - // eslint-disable-next-line camelcase - token_symbol?: string; -} - export interface IWalletOutput { address: string; value: number; @@ -797,16 +749,3 @@ export interface WalletBalanceValue { addresses: string[], walletBalanceForTx: TokenBalanceValue[], } - -/** - * Alerts should follow the on-call guide for alerting, see - * https://github.com/HathorNetwork/ops-tools/blob/master/docs/on-call/guide.md#alert-severitypriority - */ -export enum Severity { - CRITICAL = 'critical', - MAJOR = 'major', - MEDIUM = 'medium', - MINOR = 'minor', - WARNING = 'warning', - INFO = 'info', -} diff --git a/packages/wallet-service/src/utils.ts b/packages/wallet-service/src/utils.ts index d32ab07a..dea16943 100644 --- a/packages/wallet-service/src/utils.ts +++ b/packages/wallet-service/src/utils.ts @@ -142,10 +142,6 @@ export const closeDbConnection = async (mysql: ServerlessMysql): Promise = } }; -export const isAuthority = (tokenData: number): boolean => ( - (tokenData & hathorLib.constants.TOKEN_AUTHORITY_MASK) > 0 // eslint-disable-line no-bitwise -); - /** * Shuffle an array in place. * @@ -366,22 +362,3 @@ export const getAddressFromXpub = (xpubkey: string): string => { network: hathorNetwork, }).address; }; - -/** - * Validates if a list of env variables are set in the environment. Throw if at least - * one of them is missing - * - * @param envVariables - A list of variables to check - */ -export const assertEnvVariablesExistence = (envVariables: string[]): void => { - const missingList = []; - for (const envVariable of envVariables) { - if (!(envVariable in process.env) || process.env[envVariable].length === 0) { - missingList.push(envVariable); - } - } - - if (missingList.length > 0) { - throw new Error(`Env missing the following variables ${missingList.join(', ')}`); - } -}; diff --git a/packages/wallet-service/src/utils/pushnotification.utils.ts b/packages/wallet-service/src/utils/pushnotification.utils.ts index f15ea992..ea885630 100644 --- a/packages/wallet-service/src/utils/pushnotification.utils.ts +++ b/packages/wallet-service/src/utils/pushnotification.utils.ts @@ -6,12 +6,13 @@ */ import { LambdaClient, InvokeCommand, InvokeCommandOutput } from '@aws-sdk/client-lambda'; -import { PushProvider, Severity, SendNotificationToDevice, StringMap, WalletBalanceValue } from '@src/types'; +import { PushProvider, SendNotificationToDevice, StringMap, WalletBalanceValue } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; import fcmAdmin, { credential, messaging, ServiceAccount } from 'firebase-admin'; import { MulticastMessage } from 'firebase-admin/messaging'; import createDefaultLogger from '@src/logger'; -import { assertEnvVariablesExistence } from '@src/utils'; -import { addAlert } from '@src/utils/alerting.utils'; +import { assertEnvVariablesExistence } from '@wallet-service/common/src/utils/index.utils'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; const logger = createDefaultLogger(); @@ -37,6 +38,8 @@ try { 'Lambda missing env variables', e.message, // This should contain the list of env variables that are missing Severity.MINOR, + null, + logger, ); } @@ -215,6 +218,7 @@ export class PushNotificationUtils { 'Error while calling sendMulticast(message) of Firebase Cloud Message.', Severity.MAJOR, { error }, + logger, ); logger.error('Error while calling sendMulticast(message) of Firebase Cloud Message.', { error }); return { success: false, errorMessage: PushNotificationError.UNKNOWN }; @@ -248,6 +252,7 @@ export class PushNotificationUtils { `${SEND_NOTIFICATION_FUNCTION_NAME} lambda invoke failed for device: ${notification.deviceId}`, Severity.MINOR, { DeviceId: notification.deviceId }, + logger, ); throw new Error(`${SEND_NOTIFICATION_FUNCTION_NAME} lambda invoke failed for device: ${notification.deviceId}`); } @@ -284,6 +289,7 @@ export class PushNotificationUtils { `${ON_TX_PUSH_NOTIFICATION_REQUESTED_FUNCTION_NAME} lambda invoke failed for wallets`, Severity.MINOR, { Wallets: walletIdList }, + logger, ); throw new Error(`${ON_TX_PUSH_NOTIFICATION_REQUESTED_FUNCTION_NAME} lambda invoke failed for wallets: ${walletIdList}`); } diff --git a/packages/wallet-service/src/ws/connection.ts b/packages/wallet-service/src/ws/connection.ts index 1423b97e..757c2e31 100644 --- a/packages/wallet-service/src/ws/connection.ts +++ b/packages/wallet-service/src/ws/connection.ts @@ -20,10 +20,10 @@ import { initWsConnection, endWsConnection, } from '@src/redis'; -import { Severity } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; import { closeDbConnection, getDbConnection } from '@src/utils'; import createDefaultLogger from '@src/logger'; -import { addAlert } from '@src/utils/alerting.utils'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; const mysql = getDbConnection(); const logger = createDefaultLogger(); @@ -57,6 +57,7 @@ export const connect = async ( '-', Severity.MINOR, { error: e.message }, + logger, ); logger.error('Captured error on connect websocket lambda', e); diff --git a/packages/wallet-service/src/ws/utils.ts b/packages/wallet-service/src/ws/utils.ts index 71a624ee..f933a186 100644 --- a/packages/wallet-service/src/ws/utils.ts +++ b/packages/wallet-service/src/ws/utils.ts @@ -1,6 +1,6 @@ import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; import { RedisClient } from 'redis'; -import { addAlert } from '@src/utils/alerting.utils'; +import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; import { ApiGatewayManagementApiClient, PostToConnectionCommand, @@ -9,17 +9,20 @@ import { DeleteConnectionCommandOutput, GoneException, } from '@aws-sdk/client-apigatewaymanagementapi'; +import { Logger } from 'winston'; +import createDefaultLogger from '@src/logger'; import util from 'util'; -import { WsConnectionInfo, Severity } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; +import { WsConnectionInfo } from '@src/types'; import { endWsConnection } from '@src/redis'; -import createDefaultLogger from '@src/logger'; const logger = createDefaultLogger(); export const connectionInfoFromEvent = ( event: APIGatewayProxyEvent, ): WsConnectionInfo => { + const logger: Logger = createDefaultLogger(); const connID = event.requestContext.connectionId; if (process.env.IS_OFFLINE === 'true') { // This will enter when running the service on serverless offline mode @@ -36,6 +39,8 @@ export const connectionInfoFromEvent = ( 'Erroed while fetching connection info', 'Domain not on env variables', Severity.MINOR, + null, + logger, ); // Throw so we receive an alert telling us that something is wrong with the env variable @@ -92,6 +97,7 @@ export const sendMessageToClient = async ( ConnectionId: connInfo.id, Message: message, }, + logger, ) } }; diff --git a/packages/wallet-service/tests/commons.test.ts b/packages/wallet-service/tests/commons.test.ts index d9e6b9a1..b385b418 100644 --- a/packages/wallet-service/tests/commons.test.ts +++ b/packages/wallet-service/tests/commons.test.ts @@ -16,10 +16,12 @@ import { TokenBalanceMap, DbTxOutput, Block, +} from '@src/types'; +import { TxInput, TxOutput, Transaction, -} from '@src/types'; +} from '@wallet-service/common/src/types'; import { closeDbConnection, getDbConnection } from '@src/utils'; import { addToAddressTable, diff --git a/packages/wallet-service/tests/db.test.ts b/packages/wallet-service/tests/db.test.ts index d29c4cf5..7b32e0b7 100644 --- a/packages/wallet-service/tests/db.test.ts +++ b/packages/wallet-service/tests/db.test.ts @@ -103,15 +103,14 @@ import { DbTxOutput, PushDevice, PushProvider, - Severity, Block, - AddressInfo, } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; +import { isAuthority } from '@wallet-service/common/src/utils/wallet.utils'; import { closeDbConnection, getDbConnection, getUnixTimestamp, - isAuthority, getWalletId, } from '@src/utils'; import { @@ -2459,6 +2458,7 @@ test('getTotalSupply', async () => { '-', Severity.MINOR, { tokenId: 'undefined-token' }, + logger, ); }); @@ -2529,6 +2529,7 @@ test('getTotalTransactions', async () => { '-', Severity.MINOR, { tokenId: 'undefined-token' }, + logger, ); }); diff --git a/packages/wallet-service/tests/integration.test.ts b/packages/wallet-service/tests/integration.test.ts index ab8401ae..e56d2d30 100644 --- a/packages/wallet-service/tests/integration.test.ts +++ b/packages/wallet-service/tests/integration.test.ts @@ -4,8 +4,10 @@ import eventTemplate from '@events/eventTemplate.json'; import { loadWallet, loadWalletFailed } from '@src/api/wallet'; import { createWallet, getMinersList } from '@src/db'; import * as txProcessor from '@src/txProcessor'; -import { Transaction, WalletStatus, TxInput, Severity } from '@src/types'; +import { WalletStatus } from '@src/types'; +import { Transaction, TxInput, Severity } from '@wallet-service/common/src/types'; import { closeDbConnection, getDbConnection, getUnixTimestamp, getWalletId } from '@src/utils'; +import { Logger } from 'winston'; import { ADDRESSES, XPUBKEY, @@ -150,44 +152,6 @@ afterAll(async () => { process.env = OLD_ENV; }); -// eslint-disable-next-line jest/prefer-expect-assertions, jest/expect-expect -test('receive blocks and txs and then start wallet', async () => { - /* - * receive first block - */ - await txProcessor.onNewTxEvent(blockEvent); - await checkAfterReceivingFirstBlock(false); - - /* - * receive second block - */ - await txProcessor.onNewTxEvent(blockEvent2); - await checkAfterReceivingSecondBlock(false); - - /* - * add transaction that sends block reward to 2 different addresses on same wallet - */ - await txProcessor.onNewTxEvent(txEvent); - await checkAfterReceivingTx1(false); - - // txEvent2 uses utxos that are not from the received blocks, so we must add them to the database - await addToUtxoTable(mysql, tx2Inputs); - - /* - * add transaction that sends block reward to 2 different addresses, one of which is not in this wallet - */ - await txProcessor.onNewTxEvent(txEvent2); - await checkAfterReceivingTx2(false); - - /* - * create wallet - */ - await createWallet(mysql, walletId, XPUBKEY, AUTH_XPUBKEY, maxGap); - await loadWallet({ xpubkey: XPUBKEY, maxGap }, null, null); - - await checkAfterReceivingTx2(true); -}, 60000); - test('load wallet, and simulate DLQ event', async () => { /* * create wallet @@ -243,276 +207,6 @@ test('load wallet, and simulate DLQ event', async () => { RequestID: REQUEST_ID, ErrorMessage: 'The lambda exploded', }, + expect.any(Logger), ); }, 60000); - -// eslint-disable-next-line jest/prefer-expect-assertions, jest/expect-expect -test('start wallet and then receive blocks and txs', async () => { - /* - * create wallet - */ - await createWallet(mysql, walletId, XPUBKEY, AUTH_XPUBKEY, maxGap); - await loadWallet({ xpubkey: XPUBKEY, maxGap }, null, null); - - /* - * receive a block - */ - await txProcessor.onNewTxEvent(blockEvent); - await checkAfterReceivingFirstBlock(true); - - /* - * receive second block - */ - await txProcessor.onNewTxEvent(blockEvent2); - await checkAfterReceivingSecondBlock(true); - - /* - * add transaction that sends block reward to 2 different addresses on same wallet - */ - await txProcessor.onNewTxEvent(txEvent); - await checkAfterReceivingTx1(true); - - // txEvent2 uses utxos that are not from the received blocks, so we must add them to the database - await addToUtxoTable(mysql, tx2Inputs); - - /* - * add transaction that sends block reward to 2 different addresses, one of which is not in this wallet - */ - await txProcessor.onNewTxEvent(txEvent2); - await checkAfterReceivingTx2(true); -}, 60000); - -// eslint-disable-next-line jest/prefer-expect-assertions, jest/expect-expect -test('receive blocks, start wallet and then receive transactions', async () => { - /* - * receive a block - */ - await txProcessor.onNewTxEvent(blockEvent); - await checkAfterReceivingFirstBlock(false); - - /* - * receive second block - */ - await txProcessor.onNewTxEvent(blockEvent2); - await checkAfterReceivingSecondBlock(false); - - /* - * create wallet - */ - await createWallet(mysql, walletId, XPUBKEY, AUTH_XPUBKEY, maxGap); - await loadWallet({ xpubkey: XPUBKEY, maxGap }, null, null); - - /* - * add transaction that sends block reward to 2 different addresses on same wallet - */ - await txProcessor.onNewTxEvent(txEvent); - await checkAfterReceivingTx1(true); - - // txEvent2 uses utxos that are not from the received blocks, so we must add them to the database - await addToUtxoTable(mysql, tx2Inputs); - - /* - * add transaction that sends block reward to 2 different addresses, one of which is not in this wallet - */ - await txProcessor.onNewTxEvent(txEvent2); - await checkAfterReceivingTx2(true); -}, 35000); - -// eslint-disable-next-line jest/prefer-expect-assertions, jest/expect-expect -test('receive blocks and tx1, start wallet and then receive tx2', async () => { - /* - * receive a block - */ - await txProcessor.onNewTxEvent(blockEvent); - await checkAfterReceivingFirstBlock(false); - - /* - * receive second block - */ - await txProcessor.onNewTxEvent(blockEvent2); - await checkAfterReceivingSecondBlock(false); - - /* - * add transaction that sends block reward to 2 different addresses on same wallet - */ - await txProcessor.onNewTxEvent(txEvent); - await checkAfterReceivingTx1(false); - - /* - * create wallet - */ - await createWallet(mysql, walletId, XPUBKEY, AUTH_XPUBKEY, maxGap); - await loadWallet({ xpubkey: XPUBKEY, maxGap }, null, null); - - // txEvent2 uses utxos that are not from the received blocks, so we must add them to the database - await addToUtxoTable(mysql, tx2Inputs); - - /* - * add transaction that sends block reward to 2 different addresses, one of which is not in this wallet - */ - await txProcessor.onNewTxEvent(txEvent2); - await checkAfterReceivingTx2(true); -}, 35000); - -// eslint-disable-next-line jest/prefer-expect-assertions, jest/expect-expect -test('receive blocks fom 3 different miners, check miners list', async () => { - /* - * receive a block - */ - await txProcessor.onNewTxEvent(blockEvent); - - /* - * receive second block - */ - await txProcessor.onNewTxEvent(blockEvent2); - - /* - * receive the third block - */ - await txProcessor.onNewTxEvent(blockEvent3); - - /* - * receive the fourth block - */ - await txProcessor.onNewTxEvent(blockEvent4); - - const minerList = await getMinersList(mysql); - - expect(minerList).toHaveLength(3); -}, 35000); - -/* - * After receiving the block, we only have 1 used address and block rewards are locked - */ -const checkAfterReceivingFirstBlock = async (walletStarted = false) => { - const blockRewardLock = parseInt(process.env.BLOCK_REWARD_LOCK, 10); - await expect( - checkUtxoTable(mysql, 1, txId1, 0, htrToken, ADDRESSES[0], blockReward, 0, null, block.height + blockRewardLock, true), - ).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 1, ADDRESSES[0], htrToken, 0, blockReward, null, 1)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 1, ADDRESSES[0], txId1, htrToken, blockReward, block.timestamp)).resolves.toBe(true); - if (walletStarted) { - await expect(checkWalletTable(mysql, 1, walletId, WalletStatus.READY)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 1, walletId, htrToken, txId1, blockReward, block.timestamp)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 1, walletId, htrToken, 0, blockReward, null, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 1, ADDRESSES[0], 0, walletId, 1)).resolves.toBe(true); - // addresses other than the used on must have been added to address table - for (let i = 1; i < maxGap + 1; i++) { - await expect(checkAddressTable(mysql, maxGap + 1, ADDRESSES[i], i, walletId, 0)).resolves.toBe(true); - } - } else { - await expect(checkWalletTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 0)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 1, ADDRESSES[0], null, null, 1)).resolves.toBe(true); - } -}; - -/* - * After receiving second block, rewards from the first block are unlocked - */ -const checkAfterReceivingSecondBlock = async (walletStarted = false) => { - const blockRewardLock = parseInt(process.env.BLOCK_REWARD_LOCK, 10); - await expect( - checkUtxoTable(mysql, 2, txId2, 0, htrToken, ADDRESSES[0], blockReward, 0, null, block2.height + blockRewardLock, true), - ).resolves.toBe(true); - // first block utxo is unlocked - await expect( - checkUtxoTable(mysql, 2, txId1, 0, htrToken, ADDRESSES[0], blockReward, 0, null, block.height + blockRewardLock, false), - ).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 1, ADDRESSES[0], htrToken, blockReward, blockReward, null, 2)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 2, ADDRESSES[0], txId1, htrToken, blockReward, block.timestamp)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 2, ADDRESSES[0], txId2, htrToken, blockReward, block2.timestamp)).resolves.toBe(true); - if (walletStarted) { - await expect(checkWalletTable(mysql, 1, walletId, WalletStatus.READY)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 2, walletId, htrToken, txId1, blockReward, block.timestamp)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 2, walletId, htrToken, txId2, blockReward, block2.timestamp)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 1, walletId, htrToken, blockReward, blockReward, null, 2)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 1, ADDRESSES[0], 0, walletId, 2)).resolves.toBe(true); - // addresses other than the used on must have been added to address table - for (let i = 1; i < maxGap + 1; i++) { - await expect(checkAddressTable(mysql, maxGap + 1, ADDRESSES[i], i, walletId, 0)).resolves.toBe(true); - } - } else { - await expect(checkWalletTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 0)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 1, ADDRESSES[0], null, null, 2)).resolves.toBe(true); - } -}; - -/* - * This tx sends the block output to 2 addresses on the same wallet, so we have 3 used addresses - */ -const checkAfterReceivingTx1 = async (walletStarted = false) => { - await expect(checkUtxoTable(mysql, 3, txId3, 0, htrToken, ADDRESSES[1], blockReward - 5000, 0, null, null, false)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 3, txId3, 1, htrToken, ADDRESSES[2], 5000, 0, null, null, false)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 3, ADDRESSES[0], htrToken, 0, blockReward, null, 3)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 3, ADDRESSES[1], htrToken, blockReward - 5000, 0, null, 1)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 3, ADDRESSES[2], htrToken, 5000, 0, null, 1)).resolves.toBe(true); - // 3 new entries must have been address to address_tx_history - await expect(checkAddressTxHistoryTable(mysql, 5, ADDRESSES[0], txId3, htrToken, (-1) * blockReward, tx.timestamp)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 5, ADDRESSES[1], txId3, htrToken, blockReward - 5000, tx.timestamp)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 5, ADDRESSES[2], txId3, htrToken, 5000, tx.timestamp)).resolves.toBe(true); - if (walletStarted) { - await expect(checkWalletTable(mysql, 1, walletId, WalletStatus.READY)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 3, walletId, htrToken, txId1, blockReward, block.timestamp)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 3, walletId, htrToken, txId2, blockReward, block2.timestamp)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 3, walletId, htrToken, txId3, 0, tx.timestamp)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 1, walletId, htrToken, blockReward, blockReward, null, 3)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 3, ADDRESSES[0], 0, walletId, 3)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 3, ADDRESSES[1], 1, walletId, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 3, ADDRESSES[2], 2, walletId, 1)).resolves.toBe(true); - } else { - await expect(checkWalletTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 0)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 3, ADDRESSES[0], null, null, 3)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 3, ADDRESSES[1], null, null, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 3, ADDRESSES[2], null, null, 1)).resolves.toBe(true); - } -}; - -/* - * This tx sends the 5000 HTR output to 2 addresses, one on the same wallet (1000 HTR, locked) and another that's not (4000 HTR) - */ -const checkAfterReceivingTx2 = async (walletStarted = false) => { - await expect(checkUtxoTable(mysql, 5, txId3, 0, htrToken, ADDRESSES[1], blockReward - 5000, 0, null, null, false)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 5, txId4, 0, htrToken, ADDRESSES[6], 1000, 0, timelock, null, true)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 5, txId4, 1, htrToken, 'HCuWC2qgNP47BtWtsTM48PokKitVdR6pch', 4000, 0, null, null, false)).resolves.toBe(true); - // we now have 5 addresses total - await expect(checkAddressBalanceTable(mysql, 5, ADDRESSES[0], htrToken, 0, blockReward, null, 3)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 5, ADDRESSES[1], htrToken, blockReward - 5000, 0, null, 1)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 5, ADDRESSES[2], htrToken, 0, 0, null, 2)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 5, ADDRESSES[6], htrToken, 0, 1000, timelock, 1)).resolves.toBe(true); // locked - await expect(checkAddressBalanceTable(mysql, 5, 'HCuWC2qgNP47BtWtsTM48PokKitVdR6pch', htrToken, 4000, 0, null, 1)).resolves.toBe(true); - // 3 new entries must have been address to address_tx_history - await expect(checkAddressTxHistoryTable(mysql, 8, ADDRESSES[2], txId4, htrToken, -5000, tx2.timestamp)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 8, ADDRESSES[6], txId4, htrToken, 1000, tx2.timestamp)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 8, 'HCuWC2qgNP47BtWtsTM48PokKitVdR6pch', txId4, htrToken, 4000, tx2.timestamp)).resolves.toBe(true); - if (walletStarted) { - await expect(checkWalletTable(mysql, 1, walletId, WalletStatus.READY)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 4, walletId, htrToken, txId1, blockReward, block.timestamp)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 4, walletId, htrToken, txId2, blockReward, block2.timestamp)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 4, walletId, htrToken, txId3, 0, tx.timestamp)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 4, walletId, htrToken, txId4, -4000, tx2.timestamp)).resolves.toBe(true); - await expect( - checkWalletBalanceTable(mysql, 1, walletId, htrToken, blockReward - 4000 - 1000, blockReward + 1000, timelock, 4), - ).resolves.toBe(true); - // HLfGaQoxssGbZ4h9wbLyiCafdE8kPm6Fo4 has index 6, so we have 12 addresses from the wallet plus the other one - await expect(checkAddressTable(mysql, maxGap + 7 + 1, ADDRESSES[0], 0, walletId, 3)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 7 + 1, ADDRESSES[1], 1, walletId, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 7 + 1, ADDRESSES[2], 2, walletId, 2)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 7 + 1, ADDRESSES[6], 6, walletId, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 7 + 1, 'HCuWC2qgNP47BtWtsTM48PokKitVdR6pch', null, null, 1)).resolves.toBe(true); - } else { - await expect(checkWalletTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletTxHistoryTable(mysql, 0)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 0)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 5, ADDRESSES[0], null, null, 3)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 5, ADDRESSES[1], null, null, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 5, ADDRESSES[2], null, null, 2)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 5, ADDRESSES[6], null, null, 1)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 5, 'HCuWC2qgNP47BtWtsTM48PokKitVdR6pch', null, null, 1)).resolves.toBe(true); - } -}; diff --git a/packages/wallet-service/tests/pushSendNotificationToDevice.test.ts b/packages/wallet-service/tests/pushSendNotificationToDevice.test.ts index 04cc0607..7848f429 100644 --- a/packages/wallet-service/tests/pushSendNotificationToDevice.test.ts +++ b/packages/wallet-service/tests/pushSendNotificationToDevice.test.ts @@ -21,7 +21,7 @@ import { checkPushDevicesTable, } from '@tests/utils'; import { APIGatewayProxyResult, Context } from 'aws-lambda'; -import { Severity } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; const mysql = getDbConnection(); @@ -243,6 +243,7 @@ describe('alert', () => { '-', Severity.MINOR, { deviceId: 'device1' }, + logger, ); }); @@ -284,6 +285,7 @@ describe('alert', () => { '-', Severity.MINOR, { deviceId: 'device1', pushProvider: 'ios' }, + logger, ); }); }); diff --git a/packages/wallet-service/tests/txProcessor.test.ts b/packages/wallet-service/tests/txProcessor.test.ts index 31b63bd1..42b4565b 100644 --- a/packages/wallet-service/tests/txProcessor.test.ts +++ b/packages/wallet-service/tests/txProcessor.test.ts @@ -1,423 +1,18 @@ /* eslint-disable @typescript-eslint/no-empty-function */ -import firebaseMock from '@tests/utils/firebase-admin.mock'; -import { mockedAddAlert } from '@tests/utils/alerting.utils.mock'; -import hathorLib from '@hathor/wallet-lib'; -import eventTemplate from '@events/eventTemplate.json'; -import tokenCreationTx from '@events/tokenCreationTx.json'; -import { - getLatestHeight, - getTokenInformation, - fetchTx, - getTxOutput, - getWalletTxHistory, -} from '@src/db'; -import * as Db from '@src/db'; import * as txProcessor from '@src/txProcessor'; -import { closeDbConnection, getDbConnection, isAuthority } from '@src/utils'; -import { NftUtils } from '@src/utils/nft.utils'; -import { - XPUBKEY, - AUTH_XPUBKEY, - addToAddressTable, - addToAddressBalanceTable, - addToUtxoTable, - addToWalletTable, - addToWalletBalanceTable, - cleanDatabase, - checkUtxoTable, - checkAddressTable, - checkAddressBalanceTable, - checkAddressTxHistoryTable, - checkWalletBalanceTable, - createOutput, - createInput, - addToAddressTxHistoryTable, - addToWalletTxHistoryTable, -} from '@tests/utils'; -import { getHandlerContext, nftCreationTx } from '@events/nftCreationTx'; -import * as pushNotificationUtils from '@src/utils/pushnotification.utils'; -import * as commons from '@src/commons'; -import { Context } from 'aws-lambda'; -import { StringMap, WalletBalanceValue, Severity } from '@src/types'; -import createDefaultLogger from '@src/logger'; +import { NftUtils } from '@wallet-service/common/src/utils/nft.utils'; +import { getHandlerContext, nftCreationTx } from '@wallet-service/common/__tests__/events/nftCreationTx'; -const mysql = getDbConnection(); -const blockReward = 6400; -const OLD_ENV = process.env; +const defaultLogger = { + error: jest.fn(), + warn: jest.fn(), + info: jest.fn(), +} -beforeEach(async () => { - await cleanDatabase(mysql); -}); - -beforeAll(async () => { - // modify env so block reward is unlocked after 1 new block (overrides .env file) - jest.resetModules(); - process.env = { ...OLD_ENV }; - process.env.BLOCK_REWARD_LOCK = '1'; - firebaseMock.resetAllMocks(); -}); - -afterAll(async () => { - await closeDbConnection(mysql); - // restore old env - process.env = OLD_ENV; -}); - -/* - * In an unlikely scenario, we can receive a tx spending a UTXO that is still marked as locked. - */ -test('spend "locked" utxo', async () => { - expect.hasAssertions(); - - const txId1 = 'txId1'; - const txId2 = 'txId2'; - const token = 'tokenId'; - const addr = 'address'; - const walletId = 'walletId'; - const timelock = 1000; - const maxGap = parseInt(process.env.MAX_ADDRESS_GAP, 10); - - await addToWalletTable(mysql, [{ - id: walletId, - xpubkey: XPUBKEY, - authXpubkey: AUTH_XPUBKEY, - status: 'ready', - maxGap: 10, - createdAt: 1, - readyAt: 2, - }]); - - // we received a tx that has timelock - await addToUtxoTable(mysql, [{ - txId: txId1, - index: 0, - tokenId: token, - address: addr, - value: 2500, - authorities: 0, - timelock, - heightlock: null, - locked: true, - spentBy: null, - }]); - - await addToAddressTable(mysql, [ - { address: addr, index: 0, walletId, transactions: 1 }, - ]); - - await addToAddressBalanceTable(mysql, [ - [addr, token, 0, 2500, timelock, 1, 0, 0, 2500], - ]); - - await addToWalletBalanceTable(mysql, [{ - walletId, - tokenId: token, - unlockedBalance: 0, - lockedBalance: 2500, - unlockedAuthorities: 0, - lockedAuthorities: 0, - timelockExpires: timelock, - transactions: 1, - }]); - - // let's now receive a tx that spends this utxo, while it's still marked as locked - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const tx = evt.Records[0].body; - tx.version = 1; - tx.tx_id = txId2; - tx.timestamp += timelock + 1; - tx.inputs = [createInput(2500, addr, txId1, 0, token)]; - tx.outputs = [ - createOutput(0, 2000, addr, token), // one output to the same address - createOutput(1, 500, 'other', token), // and one to another address - ]; - await txProcessor.onNewTxEvent(evt); - - await expect(checkUtxoTable(mysql, 2, txId2, 0, token, addr, 2000, 0, null, null, false)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 2, txId2, 1, token, 'other', 500, 0, null, null, false)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 2, addr, 0, walletId, 2)).resolves.toBe(true); - await expect(checkAddressTable(mysql, maxGap + 2, 'other', null, null, 1)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 2, addr, token, 2000, 0, null, 2)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 2, 'other', token, 500, 0, null, 1)).resolves.toBe(true); - await expect(checkWalletBalanceTable(mysql, 1, walletId, token, 2000, 0, null, 2)).resolves.toBe(true); -}); - -test('Genesis transactions should throw', async () => { - expect.hasAssertions(); - - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const tx = evt.Records[0].body; - - tx.inputs = []; - tx.outputs = []; - tx.parents = []; - - process.env.NETWORK = 'mainnet'; - - tx.tx_id = txProcessor.IGNORE_TXS.mainnet[0]; - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('Rejecting tx as it is part of the genesis transactions.'); - - tx.tx_id = txProcessor.IGNORE_TXS.mainnet[1]; - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('Rejecting tx as it is part of the genesis transactions.'); - - tx.tx_id = txProcessor.IGNORE_TXS.mainnet[2]; - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('Rejecting tx as it is part of the genesis transactions.'); - - process.env.NETWORK = 'testnet'; - - tx.tx_id = txProcessor.IGNORE_TXS.testnet[0]; - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('Rejecting tx as it is part of the genesis transactions.'); - - tx.tx_id = txProcessor.IGNORE_TXS.testnet[1]; - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('Rejecting tx as it is part of the genesis transactions.'); - - tx.tx_id = txProcessor.IGNORE_TXS.testnet[2]; - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('Rejecting tx as it is part of the genesis transactions.'); -}); - -/* - * receive some transactions and blocks and make sure database is correct - */ -test('txProcessor', async () => { - expect.hasAssertions(); - const blockRewardLock = parseInt(process.env.BLOCK_REWARD_LOCK, 10); - - // receive a block - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const block = evt.Records[0].body; - block.version = 0; - block.tx_id = 'txId1'; - block.height = 1; - block.inputs = []; - block.outputs = [createOutput(0, blockReward, 'address1')]; - await txProcessor.onNewTxEvent(evt); - // check databases - await expect(checkUtxoTable(mysql, 1, 'txId1', 0, '00', 'address1', blockReward, 0, null, block.height + blockRewardLock, true)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 1, 'address1', null, null, 1)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 1, 'address1', '00', 0, blockReward, null, 1)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 1, 'address1', 'txId1', '00', blockReward, block.timestamp)).resolves.toBe(true); - expect(await getLatestHeight(mysql)).toBe(block.height); - - // receive another block, for the same address - block.tx_id = 'txId2'; - block.timestamp += 10; - block.height += 1; - await txProcessor.onNewTxEvent(evt); - // we now have 2 blocks, still only 1 address - await expect(checkUtxoTable(mysql, 2, 'txId2', 0, '00', 'address1', blockReward, 0, null, block.height + blockRewardLock, true)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 1, 'address1', null, null, 2)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 1, 'address1', '00', blockReward, blockReward, null, 2)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 2, 'address1', 'txId2', '00', blockReward, block.timestamp)).resolves.toBe(true); - expect(await getLatestHeight(mysql)).toBe(block.height); - - // receive another block, for a different address - block.tx_id = 'txId3'; - block.timestamp += 10; - block.height += 1; - block.outputs = [createOutput(0, blockReward, 'address2')]; - await txProcessor.onNewTxEvent(evt); - // we now have 3 blocks and 2 addresses - await expect(checkUtxoTable(mysql, 3, 'txId3', 0, '00', 'address2', blockReward, 0, null, block.height + blockRewardLock, true)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 2, 'address2', null, null, 1)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 3, 'address2', 'txId3', '00', blockReward, block.timestamp)).resolves.toBe(true); - // new block reward is locked - await expect(checkAddressBalanceTable(mysql, 2, 'address2', '00', 0, blockReward, null, 1)).resolves.toBe(true); - // address1's balance is all unlocked now - await expect(checkAddressBalanceTable(mysql, 2, 'address1', '00', 2 * blockReward, 0, null, 2)).resolves.toBe(true); - expect(await getLatestHeight(mysql)).toBe(block.height); - - // spend first block to 2 other addresses - const tx = evt.Records[0].body; - tx.version = 1; - tx.tx_id = 'txId4'; - tx.timestamp += 10; - tx.inputs = [createInput(blockReward, 'address1', 'txId1', 0)]; - tx.outputs = [ - createOutput(0, 5, 'address3'), - createOutput(1, blockReward - 5, 'address4'), - ]; - await txProcessor.onNewTxEvent(evt); - expect(await getLatestHeight(mysql)).toBe(block.height); - for (const [index, output] of tx.outputs.entries()) { - const { token, decoded, value } = output; - // we now have 4 utxos (had 3, 2 added and 1 removed) - await expect(checkUtxoTable(mysql, 4, tx.tx_id, index, token, decoded.address, value, 0, decoded.timelock, null, false)).resolves.toBe(true); - // the 2 addresses on the outputs have been added to the address table, with null walletId and index - await expect(checkAddressTable(mysql, 4, decoded.address, null, null, 1)).resolves.toBe(true); - // there are 4 different addresses with some balance - await expect(checkAddressBalanceTable(mysql, 4, decoded.address, token, value, 0, null, 1)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 6, decoded.address, tx.tx_id, token, value, tx.timestamp)).resolves.toBe(true); - } - for (const input of tx.inputs) { - const { decoded, token, value } = input; - // the input will have a negative amount in the address_tx_history table - await expect(checkAddressTxHistoryTable(mysql, 6, decoded.address, tx.tx_id, token, (-1) * value, tx.timestamp)).resolves.toBe(true); - } - // address1 balance has decreased - await expect(checkAddressBalanceTable(mysql, 4, 'address1', '00', blockReward, 0, null, 3)).resolves.toBe(true); - // address2 balance is still locked - await expect(checkAddressBalanceTable(mysql, 4, 'address2', '00', 0, blockReward, null, 1)).resolves.toBe(true); -}); - -test('txProcessor should be able to re-process txs that were voided in the past', async () => { - expect.hasAssertions(); - - const walletId = 'walletId'; - const txId = 'txId1'; - const address = 'address1'; - const tokenId = '00'; - - await addToWalletTable(mysql, [{ - id: walletId, - xpubkey: XPUBKEY, - authXpubkey: AUTH_XPUBKEY, - status: 'ready', - maxGap: 10, - createdAt: 1, - readyAt: 2, - }]); - - await addToAddressTable(mysql, [ - { address, index: 0, walletId, transactions: 1 }, - ]); - - // receive a block - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const block = evt.Records[0].body; - const blockUtxo = createOutput(0, blockReward, address); - block.version = 0; - block.tx_id = txId; - block.height = 1; - block.inputs = []; - block.outputs = [blockUtxo]; - - await txProcessor.onNewTxEvent(evt); - - const logger = createDefaultLogger(); - - // void it - const transaction = await fetchTx(mysql, txId); - await commons.handleVoided(mysql, logger, transaction); - - // call it again with the same tx - await txProcessor.onNewTxEvent(evt); - - expect(await getTxOutput(mysql, txId, 0, false)).toStrictEqual({ - txId, - index: 0, - tokenId, - address, - value: blockReward, - authorities: 0, - timelock: null, - heightlock: 2, - locked: true, - txProposalId: null, - txProposalIndex: null, - spentBy: null, - }); - - expect(await getWalletTxHistory(mysql, walletId, tokenId, 0, 10)).toStrictEqual([ - { - txId: 'txId1', - timestamp: expect.anything(), - voided: 0, - balance: 6400, - version: 0, - }, - ]); - - expect(await checkAddressTxHistoryTable( - mysql, - 1, - address, - txId, - tokenId, - blockReward, - block.timestamp, - )).toStrictEqual(true); -}); - -test('txProcessor should ignore NFT outputs', async () => { - expect.hasAssertions(); - - const txId1 = 'txId1'; - const txId2 = 'txId2'; - const addr = 'address'; - const walletId = 'walletId'; - const timelock = 1000; - - await addToWalletTable(mysql, [{ - id: walletId, - xpubkey: XPUBKEY, - authXpubkey: AUTH_XPUBKEY, - status: 'ready', - maxGap: 10, - createdAt: 1, - readyAt: 2, - }]); - - await addToUtxoTable(mysql, [{ - txId: txId1, - index: 0, - tokenId: '00', - address: addr, - value: 41, - authorities: 0, - timelock: null, - heightlock: null, - locked: false, - spentBy: null, - }]); - - await addToAddressTable(mysql, [ - { address: addr, index: 0, walletId, transactions: 1 }, - ]); - - await addToAddressBalanceTable(mysql, [ - [addr, '00', 41, 0, null, 1, 0, 0, 41], - ]); - - await addToAddressTxHistoryTable(mysql, [ - { address: addr, txId: txId1, tokenId: '00', balance: 41, timestamp: 0 }, - ]); - - await addToWalletBalanceTable(mysql, [{ - walletId, - tokenId: '00', - unlockedBalance: 41, - lockedBalance: 0, - unlockedAuthorities: 0, - lockedAuthorities: 0, - timelockExpires: null, - transactions: 1, - }]); - - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const tx = evt.Records[0].body; - tx.version = 1; - tx.tx_id = txId2; - tx.timestamp += timelock + 1; - tx.inputs = [createInput(41, addr, txId1, 0, '00')]; - const invalidScriptOutput = createOutput(0, 1, addr, '00'); - tx.outputs = [ - { - ...invalidScriptOutput, - index: null, - decoded: null, - }, - createOutput(1, 39, addr, '00'), - ]; - await txProcessor.onNewTxEvent(evt); - // check databases - await expect(checkUtxoTable(mysql, 1, txId2, 1, '00', addr, 39, 0, null, null, false)).resolves.toBe(true); -}); +jest.mock('@src/logger', () => ({ + __esModule: true, + default: () => defaultLogger, +})); describe('NFT metadata updating', () => { const spyUpdateMetadata = jest.spyOn(NftUtils, '_updateMetadata'); @@ -455,7 +50,14 @@ describe('NFT metadata updating', () => { () => '', ); expect(spyUpdateMetadata).toHaveBeenCalledTimes(1); - expect(spyUpdateMetadata).toHaveBeenCalledWith(nftCreationTx.tx_id, { id: nftCreationTx.tx_id, nft: true }); + expect(spyUpdateMetadata).toHaveBeenCalledWith(nftCreationTx.tx_id, { id: nftCreationTx.tx_id, nft: true }, txProcessor.CREATE_NFT_MAX_RETRIES, expect.objectContaining({ + error: expect.any(Function), + info: expect.any(Function), + warn: expect.any(Function), + defaultMeta: { + requestId: expect.any(String) + }, + })); expect(result).toStrictEqual({ success: true }); }); @@ -478,305 +80,16 @@ describe('NFT metadata updating', () => { message: `onNewNftEvent failed for token ${nftCreationTx.tx_id}`, }; expect(result).toStrictEqual(expectedResult); - expect(spyCreateOrUpdate).toHaveBeenCalledWith(nftCreationTx.tx_id); + expect(spyCreateOrUpdate).toHaveBeenCalledWith(nftCreationTx.tx_id, txProcessor.CREATE_NFT_MAX_RETRIES, expect.objectContaining({ + error: expect.any(Function), + info: expect.any(Function), + warn: expect.any(Function), + defaultMeta: { + requestId: expect.any(String) + }, + })); spyCreateOrUpdate.mockReset(); spyCreateOrUpdate.mockRestore(); }); }); - -test('receive token creation tx', async () => { - expect.hasAssertions(); - - // we must already have a tx to be used for deposit - await addToUtxoTable(mysql, [{ - txId: tokenCreationTx.inputs[0].tx_id, - index: tokenCreationTx.inputs[0].index, - tokenId: tokenCreationTx.inputs[0].token, - address: tokenCreationTx.inputs[0].decoded.address, - value: tokenCreationTx.inputs[0].value, - authorities: 0, - timelock: null, - heightlock: null, - locked: false, - spentBy: null, - }]); - await addToAddressBalanceTable(mysql, [[tokenCreationTx.inputs[0].decoded.address, - tokenCreationTx.inputs[0].token, tokenCreationTx.inputs[0].value, 0, null, 1, 0, 0, tokenCreationTx.inputs[0].value]]); - - // receive event - const evt = JSON.parse(JSON.stringify(eventTemplate)); - evt.Records[0].body = tokenCreationTx; - await txProcessor.onNewTxEvent(evt); - - for (const [index, output] of tokenCreationTx.outputs.entries()) { - let value = output.value; - let authorities = 0; - if (isAuthority(output.token_data)) { // eslint-disable-line no-bitwise - authorities = value; - value = 0; - } - const { token } = output; - const { address, timelock } = output.decoded; - const length = tokenCreationTx.outputs.length; - const transactions = index === 0 ? 2 : 1; // this address already has the first tx received - await expect( - checkUtxoTable(mysql, length, tokenCreationTx.tx_id, index, token, address, value, authorities, timelock, null, false), - ).resolves.toBe(true); - - await expect(checkAddressBalanceTable(mysql, length, address, token, value, 0, null, transactions, authorities, 0)).resolves.toBe(true); - } - const tokenInfo = await getTokenInformation(mysql, tokenCreationTx.tx_id); - expect(tokenInfo.id).toBe(tokenCreationTx.tx_id); - expect(tokenInfo.name).toBe(tokenCreationTx.token_name); - expect(tokenInfo.symbol).toBe(tokenCreationTx.token_symbol); -}); - -test('onHandleVoidedTxRequest', async () => { - expect.hasAssertions(); - - const txId1 = 'txId1'; - const txId2 = 'txId2'; - const txId3 = 'txId3'; - const token = 'tokenId'; - const addr = 'address'; - const walletId = 'walletId'; - const timelock = 1000; - - await addToWalletTable(mysql, [{ - id: walletId, - xpubkey: XPUBKEY, - authXpubkey: AUTH_XPUBKEY, - status: 'ready', - maxGap: 10, - createdAt: 1, - readyAt: 2, - }]); - - await addToUtxoTable(mysql, [{ - txId: txId1, - index: 0, - tokenId: token, - address: addr, - value: 2500, - authorities: 0, - timelock: null, - heightlock: null, - locked: false, - spentBy: null, - }]); - - await addToAddressTable(mysql, [ - { address: addr, index: 0, walletId, transactions: 1 }, - ]); - - await addToAddressBalanceTable(mysql, [ - [addr, token, 2500, 0, null, 1, 0, 0, 2500], - ]); - - await addToAddressTxHistoryTable(mysql, [ - { address: addr, txId: txId1, tokenId: token, balance: 2500, timestamp: 0 }, - ]); - - await addToWalletBalanceTable(mysql, [{ - walletId, - tokenId: token, - unlockedBalance: 2500, - lockedBalance: 0, - unlockedAuthorities: 0, - lockedAuthorities: 0, - timelockExpires: null, - transactions: 1, - }]); - - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const tx = evt.Records[0].body; - tx.version = 1; - tx.tx_id = txId2; - tx.timestamp += timelock + 1; - tx.inputs = [createInput(2500, addr, txId1, 0, token)]; - tx.outputs = [ - createOutput(0, 2000, addr, token), // one output to the same address - createOutput(1, 500, 'other', token), // and one to another address - ]; - - // Adds txId2 that spends the utxo with index 0 from txId1 - await txProcessor.onNewTxEvent(evt); - - const evt2 = JSON.parse(JSON.stringify(eventTemplate)); - const tx2 = evt2.Records[0].body; - tx2.version = 1; - tx2.tx_id = txId3; - tx2.timestamp += 1; - tx2.inputs = [createInput(2000, addr, txId2, 0, token)]; - tx2.outputs = [ - createOutput(0, 1500, addr, token), // one output to the same address - createOutput(1, 500, 'other', token), // and one to another address - ]; - - // Adds txId3 that spends the utxo with index 0 from txId2 - await txProcessor.onNewTxEvent(evt2); - - // Balance for addr should be 1500 and it should have 3 transactions (txId1, txId2 and txId3) - await expect(checkAddressBalanceTable(mysql, 2, addr, token, 1500, 0, null, 3)).resolves.toBe(true); - - // Voids the first transaction (txId2), causing txId3 to be voided as well, - // as it spends utxos from txId2 - await txProcessor.handleVoidedTx(tx); - - // both utxos should be voided - await expect(checkUtxoTable(mysql, 5, txId2, 0, token, addr, 2000, 0, null, null, false, null, true)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 5, txId2, 1, token, 'other', 500, 0, null, null, false, null, true)).resolves.toBe(true); - - // txId3 will be voided because txId2 was voided and it spends its utxo - await expect(checkUtxoTable(mysql, 5, txId3, 0, token, addr, 1500, 0, null, null, false, null, true)).resolves.toBe(true); - - // the original utxo (txId1, 0) should not be voided and should not have been spent - await expect(checkUtxoTable(mysql, 5, txId1, 0, token, addr, 2500, 0, null, null, false, null, false)).resolves.toBe(true); - - // Balance should be back to 2500 as the transactions that spent the original utxo were voided and we should - // have total of one transaction as both txId2 and txId3 were voided. - await expect(checkAddressBalanceTable(mysql, 2, addr, token, 2500, 0, null, 1)).resolves.toBe(true); -}, 20000); - -test('txProcessor should rollback the entire transaction if an error occurs on balance calculation', async () => { - expect.hasAssertions(); - const blockRewardLock = parseInt(process.env.BLOCK_REWARD_LOCK, 10); - - // receive a block - const evt = JSON.parse(JSON.stringify(eventTemplate)); - const block = evt.Records[0].body; - block.version = 0; - block.tx_id = 'txId1'; - block.height = 1; - block.inputs = []; - block.outputs = [createOutput(0, blockReward, 'address1')]; - await txProcessor.onNewTxEvent(evt); - - // check databases - await expect(checkUtxoTable(mysql, 1, 'txId1', 0, '00', 'address1', blockReward, 0, null, block.height + blockRewardLock, true)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 1, 'address1', null, null, 1)).resolves.toBe(true); - await expect(checkAddressBalanceTable(mysql, 1, 'address1', '00', 0, blockReward, null, 1)).resolves.toBe(true); - await expect(checkAddressTxHistoryTable(mysql, 1, 'address1', 'txId1', '00', blockReward, block.timestamp)).resolves.toBe(true); - expect(await getLatestHeight(mysql)).toBe(block.height); - - // receive another block, for the same address and make it fail so it will rollback the entire transaction - block.tx_id = 'txId2'; - block.timestamp += 10; - block.height = 2; - - const spy = jest.spyOn(Db, 'unlockUtxos'); - spy.mockImplementationOnce(() => { - throw new Error('unlock-utxos-error'); - }); - - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('unlock-utxos-error'); - - let latestHeight = await getLatestHeight(mysql); - - // last transaction should have been rolled back and latest height will be the first successful block's height - expect(latestHeight).toBe(block.height - 1); - - // send again should work (we are using mockImplementationOnce) - await txProcessor.onNewTxEvent(evt); - latestHeight = await getLatestHeight(mysql); - expect(latestHeight).toBe(block.height); - - // test subsequent calls - block.tx_id = 'txId3'; - block.timestamp += 10; - block.height = 3; - await txProcessor.onNewTxEvent(evt); - block.tx_id = 'txId4'; - block.timestamp += 10; - block.height = 4; - await txProcessor.onNewTxEvent(evt); - block.tx_id = 'txId5'; - block.timestamp += 10; - block.height = 5; - await txProcessor.onNewTxEvent(evt); - - latestHeight = await getLatestHeight(mysql); - expect(latestHeight).toBe(block.height); - - // Send another one that will also rollback - spy.mockImplementationOnce(() => { - throw new Error('unlock-utxos-error'); - }); - block.tx_id = 'txId6'; - block.timestamp += 10; - block.height = 6; - await expect(() => txProcessor.onNewTxEvent(evt)).rejects.toThrow('unlock-utxos-error'); - - latestHeight = await getLatestHeight(mysql); - expect(latestHeight).toBe(block.height - 1); - - // finally, test the balances - await expect(checkUtxoTable(mysql, 5, 'txId2', 0, '00', 'address1', blockReward, 0, null, 2 + blockRewardLock, false)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 5, 'txId3', 0, '00', 'address1', blockReward, 0, null, 3 + blockRewardLock, false)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 5, 'txId4', 0, '00', 'address1', blockReward, 0, null, 4 + blockRewardLock, false)).resolves.toBe(true); - await expect(checkUtxoTable(mysql, 5, 'txId5', 0, '00', 'address1', blockReward, 0, null, 5 + blockRewardLock, true)).resolves.toBe(true); - await expect(checkAddressTable(mysql, 1, 'address1', null, null, 5)).resolves.toBe(true); - // txId5 is locked, so our address balance will be 25600 - await expect(checkAddressBalanceTable(mysql, 1, 'address1', '00', blockReward * 4, blockReward, null, 5)).resolves.toBe(true); -}); - -test('txProcess onNewTxRequest with push notification', async () => { - expect.hasAssertions(); - - const fakeEvent = JSON.parse(JSON.stringify(eventTemplate)).Records[0]; - const fakeContext = { - awsRequestId: 'requestId', - } as unknown as Context; - const fakeWalletBalanceValue = { 123: { txId: 'txId' } } as unknown as StringMap; - - const addNewTxMock = jest.spyOn(txProcessor, 'addNewTx'); - const isTransactionNFTCreationMock = jest.spyOn(NftUtils, 'isTransactionNFTCreation'); - const isPushNotificationEnabledMock = jest.spyOn(pushNotificationUtils, 'isPushNotificationEnabled'); - const getWalletBalancesForTxMock = jest.spyOn(commons, 'getWalletBalancesForTx'); - const invokeOnTxPushNotificationRequestedLambdaMock = jest.spyOn(pushNotificationUtils.PushNotificationUtils, 'invokeOnTxPushNotificationRequestedLambda'); - - /** - * Push notification disabled - */ - addNewTxMock.mockImplementation(() => Promise.resolve()); - isTransactionNFTCreationMock.mockReturnValue(false); - isPushNotificationEnabledMock.mockReturnValue(false); - - await txProcessor.onNewTxRequest(fakeEvent, fakeContext, null); - - expect(invokeOnTxPushNotificationRequestedLambdaMock).toHaveBeenCalledTimes(0); - - /** - * Push notification enabled - */ - isPushNotificationEnabledMock.mockReturnValue(true); - // Get a valid wallet balance value to invoke push notification lambda - getWalletBalancesForTxMock.mockResolvedValue(fakeWalletBalanceValue); - invokeOnTxPushNotificationRequestedLambdaMock.mockResolvedValue(); - - await txProcessor.onNewTxRequest(fakeEvent, fakeContext, null); - - expect(invokeOnTxPushNotificationRequestedLambdaMock).toHaveBeenCalledTimes(1); -}); - -test('onNewTxRequest should send alert on SQS on failure', async () => { - expect.hasAssertions(); - - const addNewTxSpy = jest.spyOn(txProcessor, 'addNewTx'); - addNewTxSpy.mockImplementationOnce(() => Promise.reject(new Error('error'))); - - const fakeEvent = JSON.parse(JSON.stringify(eventTemplate)).Records[0]; - const fakeContext = { - awsRequestId: 'requestId', - } as unknown as Context; - - await txProcessor.onNewTxRequest(fakeEvent, fakeContext, null); - - expect(mockedAddAlert).toHaveBeenCalledWith( - 'Error on onNewTxRequest', - 'Erroed on onNewTxRequest lambda', - Severity.MINOR, - { TxId: null, error: 'error' }, - ); -}); diff --git a/packages/wallet-service/tests/types.test.ts b/packages/wallet-service/tests/types.test.ts index d14768f6..94d4d195 100644 --- a/packages/wallet-service/tests/types.test.ts +++ b/packages/wallet-service/tests/types.test.ts @@ -1,4 +1,5 @@ -import { Authorities, Balance, DecodedOutput, TokenBalanceMap, TxInput, TxOutput } from '@src/types'; +import { Authorities, Balance, TokenBalanceMap } from '@src/types'; +import { DecodedOutput, TxInput, TxOutput } from '@wallet-service/common/src/types'; test('Authorities', () => { expect.hasAssertions(); diff --git a/packages/wallet-service/tests/utils.ts b/packages/wallet-service/tests/utils.ts index 88c33602..b1cc0b47 100644 --- a/packages/wallet-service/tests/utils.ts +++ b/packages/wallet-service/tests/utils.ts @@ -3,7 +3,6 @@ import { ServerlessMysql } from 'serverless-mysql'; import { isEqual } from 'lodash'; import { DbSelectResult, - TxInput, TxOutputWithIndex, FullNodeVersionData, WalletBalanceValue, @@ -11,6 +10,7 @@ import { PushProvider, DbTxOutput, } from '@src/types'; +import { TxInput } from '@wallet-service/common/src/types'; import { getWalletId } from '@src/utils'; import { walletUtils, Network, network, HathorWalletServiceWallet } from '@hathor/wallet-lib'; import { diff --git a/packages/wallet-service/tests/utils/alerting.utils.mock.ts b/packages/wallet-service/tests/utils/alerting.utils.mock.ts index 263316ec..2ee23067 100644 --- a/packages/wallet-service/tests/utils/alerting.utils.mock.ts +++ b/packages/wallet-service/tests/utils/alerting.utils.mock.ts @@ -1,4 +1,4 @@ export const mockedAddAlert = jest.fn(); -export default jest.mock('@src/utils/alerting.utils', () => ({ +export default jest.mock('@wallet-service/common/src/utils/alerting.utils', () => ({ addAlert: mockedAddAlert.mockReturnValue(Promise.resolve()), })); diff --git a/packages/wallet-service/tests/utils/pushnotification.utils.test.ts b/packages/wallet-service/tests/utils/pushnotification.utils.test.ts index 80c942ef..c48ab255 100644 --- a/packages/wallet-service/tests/utils/pushnotification.utils.test.ts +++ b/packages/wallet-service/tests/utils/pushnotification.utils.test.ts @@ -6,7 +6,8 @@ import { sendMulticastMock, messaging, initFirebaseAdminMock } from '@tests/util import { logger } from '@tests/winston.mock'; import { PushNotificationUtils, PushNotificationError, buildFunctionName, FunctionName } from '@src/utils/pushnotification.utils'; import * as pushnotificationUtils from '@src/utils/pushnotification.utils'; -import { SendNotificationToDevice, Severity } from '@src/types'; +import { SendNotificationToDevice } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; import { sendMock, lambdaInvokeCommandMock } from '@tests/utils/aws-sdk.mock'; import { LambdaClient } from '@aws-sdk/client-lambda'; import { buildWalletBalanceValueMap } from '@tests/utils'; @@ -76,6 +77,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables WALLET_SERVICE_LAMBDA_ENDPOINT', Severity.MINOR, + null, + logger, ); }); @@ -92,6 +95,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables STAGE', Severity.MINOR, + null, + logger, ); }); @@ -108,6 +113,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_PROJECT_ID', Severity.MINOR, + null, + logger, ); }); @@ -124,6 +131,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_PRIVATE_KEY_ID', Severity.MINOR, + null, + logger, ); }); @@ -140,6 +149,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_PRIVATE_KEY', Severity.MINOR, + null, + logger, ); }); @@ -157,6 +168,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_CLIENT_EMAIL', Severity.MINOR, + null, + logger, ); }); @@ -174,6 +187,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_CLIENT_ID', Severity.MINOR, + null, + logger, ); }); @@ -191,6 +206,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_AUTH_URI', Severity.MINOR, + null, + logger, ); }); @@ -208,6 +225,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_TOKEN_URI', Severity.MINOR, + null, + logger, ); }); @@ -225,6 +244,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_AUTH_PROVIDER_X509_CERT_URL', Severity.MINOR, + null, + logger, ); }); @@ -242,6 +263,8 @@ describe('PushNotificationUtils', () => { 'Lambda missing env variables', 'Env missing the following variables FIREBASE_CLIENT_X509_CERT_URL', Severity.MINOR, + null, + logger, ); }); @@ -380,6 +403,7 @@ describe('PushNotificationUtils', () => { 'Error while calling sendMulticast(message) of Firebase Cloud Message.', Severity.MAJOR, { error: { code: 'any-other-code' } }, + logger, ); }); }); diff --git a/packages/wallet-service/tests/ws.utils.test.ts b/packages/wallet-service/tests/ws.utils.test.ts index 9dc58680..6972cde8 100644 --- a/packages/wallet-service/tests/ws.utils.test.ts +++ b/packages/wallet-service/tests/ws.utils.test.ts @@ -1,6 +1,7 @@ +import { Logger } from 'winston'; import { mockedAddAlert } from '@tests/utils/alerting.utils.mock'; import { connectionInfoFromEvent, sendMessageToClient } from '@src/ws/utils'; -import { Severity } from '@src/types'; +import { Severity } from '@wallet-service/common/src/types'; import { logger } from '@tests/winston.mock'; import { RedisClient } from 'redis'; @@ -80,6 +81,8 @@ test('missing WS_DOMAIN should throw', () => { 'Erroed while fetching connection info', 'Domain not on env variables', Severity.MINOR, + null, + expect.any(Logger), ); }); @@ -128,7 +131,8 @@ describe('sendMessageToClient', () => { { ConnectionId: connInfo.id, Message: JSON.stringify(message), - } + }, + expect.any(Logger), ); }); diff --git a/packages/wallet-service/webpack.config.js b/packages/wallet-service/webpack.config.js index b7bf98f5..b4a4a990 100644 --- a/packages/wallet-service/webpack.config.js +++ b/packages/wallet-service/webpack.config.js @@ -9,7 +9,7 @@ module.exports = { entry: slsw.lib.entries, devtool: slsw.lib.webpack.isLocal ? 'eval-cheap-module-source-map' : 'source-map', resolve: { - extensions: ['.mjs', '.json', '.ts'], + extensions: ['.js', '.mjs', '.json', '.ts'], symlinks: false, cacheWithContext: false, alias: { @@ -24,7 +24,14 @@ module.exports = { filename: '[name].js', }, target: 'node', - externals: [nodeExternals()], + // The bundle gets too big if we allow webpack to bundle all dependencies so + // we remove them from the bundle (they get loaded in runtime). + // + // We are adding the common project to allowlist because otherwise it would not + // be seen by the serverless-monorepo package. + externals: [nodeExternals({ + allowlist: [new RegExp("@wallet-service/common*")], + })], module: { rules: [ // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader` @@ -33,7 +40,12 @@ module.exports = { loader: 'ts-loader', exclude: [ [ - path.resolve(__dirname, 'node_modules'), + // The common module is not transpiled to javascript, so it needs + // to be loaded with the ts-loader + function(modulePath) { + return /node_modules/.test(modulePath) && + !/node_modules\/@wallet-service\/common/.test(modulePath); + }, path.resolve(__dirname, '.serverless'), path.resolve(__dirname, '.webpack'), ], diff --git a/yarn.lock b/yarn.lock index 5d5f8e1b..0851e97a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -99,50 +99,51 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-apigatewaymanagementapi@npm:^3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/client-apigatewaymanagementapi@npm:3.465.0" +"@aws-sdk/client-apigatewaymanagementapi@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/client-apigatewaymanagementapi@npm:3.540.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.465.0" - "@aws-sdk/core": "npm:3.465.0" - "@aws-sdk/credential-provider-node": "npm:3.465.0" - "@aws-sdk/middleware-host-header": "npm:3.465.0" - "@aws-sdk/middleware-logger": "npm:3.465.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.465.0" - "@aws-sdk/middleware-signing": "npm:3.465.0" - "@aws-sdk/middleware-user-agent": "npm:3.465.0" - "@aws-sdk/region-config-resolver": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@aws-sdk/util-user-agent-browser": "npm:3.465.0" - "@aws-sdk/util-user-agent-node": "npm:3.465.0" - "@smithy/config-resolver": "npm:^2.0.18" - "@smithy/fetch-http-handler": "npm:^2.2.6" - "@smithy/hash-node": "npm:^2.0.15" - "@smithy/invalid-dependency": "npm:^2.0.13" - "@smithy/middleware-content-length": "npm:^2.0.15" - "@smithy/middleware-endpoint": "npm:^2.2.0" - "@smithy/middleware-retry": "npm:^2.0.20" - "@smithy/middleware-serde": "npm:^2.0.13" - "@smithy/middleware-stack": "npm:^2.0.7" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/node-http-handler": "npm:^2.1.9" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/smithy-client": "npm:^2.1.15" - "@smithy/types": "npm:^2.5.0" - "@smithy/url-parser": "npm:^2.0.13" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.0" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.19" - "@smithy/util-defaults-mode-node": "npm:^2.0.25" - "@smithy/util-endpoints": "npm:^1.0.4" - "@smithy/util-retry": "npm:^2.0.6" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/bc065fe81fd96630721788d68e19689cfd95fa361ca77e23c70f0fd0fe2fc3b2bc8d88a7b5db4f4325b0d15733233c5537596730cbc8b9e3d4c1f987d8cd146e + "@aws-sdk/client-sts": "npm:3.540.0" + "@aws-sdk/core": "npm:3.535.0" + "@aws-sdk/credential-provider-node": "npm:3.540.0" + "@aws-sdk/middleware-host-header": "npm:3.535.0" + "@aws-sdk/middleware-logger": "npm:3.535.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.535.0" + "@aws-sdk/middleware-user-agent": "npm:3.540.0" + "@aws-sdk/region-config-resolver": "npm:3.535.0" + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@aws-sdk/util-user-agent-browser": "npm:3.535.0" + "@aws-sdk/util-user-agent-node": "npm:3.535.0" + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/core": "npm:^1.4.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/hash-node": "npm:^2.2.0" + "@smithy/invalid-dependency": "npm:^2.2.0" + "@smithy/middleware-content-length": "npm:^2.2.0" + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-body-length-browser": "npm:^2.2.0" + "@smithy/util-body-length-node": "npm:^2.3.0" + "@smithy/util-defaults-mode-browser": "npm:^2.2.0" + "@smithy/util-defaults-mode-node": "npm:^2.3.0" + "@smithy/util-endpoints": "npm:^1.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/5ecfd8eb752cc9c7fa6d80044a2da143e5a55cb0e827588fe9d1042db148a9b4d8645e00e974cc44b940581d7065f8245b1070beafcad46e90a55c091103237c languageName: node linkType: hard @@ -194,6 +195,59 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-lambda@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/client-lambda@npm:3.540.0" + dependencies: + "@aws-crypto/sha256-browser": "npm:3.0.0" + "@aws-crypto/sha256-js": "npm:3.0.0" + "@aws-sdk/client-sts": "npm:3.540.0" + "@aws-sdk/core": "npm:3.535.0" + "@aws-sdk/credential-provider-node": "npm:3.540.0" + "@aws-sdk/middleware-host-header": "npm:3.535.0" + "@aws-sdk/middleware-logger": "npm:3.535.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.535.0" + "@aws-sdk/middleware-user-agent": "npm:3.540.0" + "@aws-sdk/region-config-resolver": "npm:3.535.0" + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@aws-sdk/util-user-agent-browser": "npm:3.535.0" + "@aws-sdk/util-user-agent-node": "npm:3.535.0" + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/core": "npm:^1.4.0" + "@smithy/eventstream-serde-browser": "npm:^2.2.0" + "@smithy/eventstream-serde-config-resolver": "npm:^2.2.0" + "@smithy/eventstream-serde-node": "npm:^2.2.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/hash-node": "npm:^2.2.0" + "@smithy/invalid-dependency": "npm:^2.2.0" + "@smithy/middleware-content-length": "npm:^2.2.0" + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-body-length-browser": "npm:^2.2.0" + "@smithy/util-body-length-node": "npm:^2.3.0" + "@smithy/util-defaults-mode-browser": "npm:^2.2.0" + "@smithy/util-defaults-mode-node": "npm:^2.3.0" + "@smithy/util-endpoints": "npm:^1.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + "@smithy/util-stream": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + "@smithy/util-waiter": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/d0871a578a81c99b679fdaf6d388e342f30af12a8392c4c7dcf389f10603cb7b541ac355caab999846688911465f070eba2167cb58583b813a6954dcbcf28e2e + languageName: node + linkType: hard + "@aws-sdk/client-lambda@npm:^3.421.0": version: 3.423.0 resolution: "@aws-sdk/client-lambda@npm:3.423.0" @@ -244,205 +298,102 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-lambda@npm:^3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/client-lambda@npm:3.465.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.465.0" - "@aws-sdk/core": "npm:3.465.0" - "@aws-sdk/credential-provider-node": "npm:3.465.0" - "@aws-sdk/middleware-host-header": "npm:3.465.0" - "@aws-sdk/middleware-logger": "npm:3.465.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.465.0" - "@aws-sdk/middleware-signing": "npm:3.465.0" - "@aws-sdk/middleware-user-agent": "npm:3.465.0" - "@aws-sdk/region-config-resolver": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@aws-sdk/util-user-agent-browser": "npm:3.465.0" - "@aws-sdk/util-user-agent-node": "npm:3.465.0" - "@smithy/config-resolver": "npm:^2.0.18" - "@smithy/eventstream-serde-browser": "npm:^2.0.13" - "@smithy/eventstream-serde-config-resolver": "npm:^2.0.13" - "@smithy/eventstream-serde-node": "npm:^2.0.13" - "@smithy/fetch-http-handler": "npm:^2.2.6" - "@smithy/hash-node": "npm:^2.0.15" - "@smithy/invalid-dependency": "npm:^2.0.13" - "@smithy/middleware-content-length": "npm:^2.0.15" - "@smithy/middleware-endpoint": "npm:^2.2.0" - "@smithy/middleware-retry": "npm:^2.0.20" - "@smithy/middleware-serde": "npm:^2.0.13" - "@smithy/middleware-stack": "npm:^2.0.7" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/node-http-handler": "npm:^2.1.9" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/smithy-client": "npm:^2.1.15" - "@smithy/types": "npm:^2.5.0" - "@smithy/url-parser": "npm:^2.0.13" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.0" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.19" - "@smithy/util-defaults-mode-node": "npm:^2.0.25" - "@smithy/util-endpoints": "npm:^1.0.4" - "@smithy/util-retry": "npm:^2.0.6" - "@smithy/util-stream": "npm:^2.0.20" - "@smithy/util-utf8": "npm:^2.0.2" - "@smithy/util-waiter": "npm:^2.0.13" - tslib: "npm:^2.5.0" - checksum: 10/b8fd3f4cca15f69d33f1589d461b1266f7d96526d0174f2b4cc1baacac8e43d6e55750c814bc51f3c3446fe40f52fd441b4d99487814c2051b41f41cd6baa612 - languageName: node - linkType: hard - -"@aws-sdk/client-lambda@npm:^3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/client-lambda@npm:3.474.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.474.0" - "@aws-sdk/core": "npm:3.474.0" - "@aws-sdk/credential-provider-node": "npm:3.474.0" - "@aws-sdk/middleware-host-header": "npm:3.468.0" - "@aws-sdk/middleware-logger": "npm:3.468.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.468.0" - "@aws-sdk/middleware-signing": "npm:3.468.0" - "@aws-sdk/middleware-user-agent": "npm:3.470.0" - "@aws-sdk/region-config-resolver": "npm:3.470.0" - "@aws-sdk/types": "npm:3.468.0" - "@aws-sdk/util-endpoints": "npm:3.470.0" - "@aws-sdk/util-user-agent-browser": "npm:3.468.0" - "@aws-sdk/util-user-agent-node": "npm:3.470.0" - "@smithy/config-resolver": "npm:^2.0.21" - "@smithy/eventstream-serde-browser": "npm:^2.0.15" - "@smithy/eventstream-serde-config-resolver": "npm:^2.0.15" - "@smithy/eventstream-serde-node": "npm:^2.0.15" - "@smithy/fetch-http-handler": "npm:^2.3.1" - "@smithy/hash-node": "npm:^2.0.17" - "@smithy/invalid-dependency": "npm:^2.0.15" - "@smithy/middleware-content-length": "npm:^2.0.17" - "@smithy/middleware-endpoint": "npm:^2.2.3" - "@smithy/middleware-retry": "npm:^2.0.24" - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/middleware-stack": "npm:^2.0.9" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/node-http-handler": "npm:^2.2.1" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.1" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.22" - "@smithy/util-defaults-mode-node": "npm:^2.0.29" - "@smithy/util-endpoints": "npm:^1.0.7" - "@smithy/util-retry": "npm:^2.0.8" - "@smithy/util-stream": "npm:^2.0.23" - "@smithy/util-utf8": "npm:^2.0.2" - "@smithy/util-waiter": "npm:^2.0.15" - tslib: "npm:^2.5.0" - checksum: 10/a0b440441cc4ac5e0af5c6ec3bbf39a7c3935dc457a9cc5276161e9955c7d102a61ba93d3c3d359cc6f57f2afbe3684521c5c9b33da68f97a4e4413bbb2b0639 - languageName: node - linkType: hard - -"@aws-sdk/client-sqs@npm:^3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/client-sqs@npm:3.465.0" +"@aws-sdk/client-sqs@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/client-sqs@npm:3.540.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.465.0" - "@aws-sdk/core": "npm:3.465.0" - "@aws-sdk/credential-provider-node": "npm:3.465.0" - "@aws-sdk/middleware-host-header": "npm:3.465.0" - "@aws-sdk/middleware-logger": "npm:3.465.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.465.0" - "@aws-sdk/middleware-sdk-sqs": "npm:3.465.0" - "@aws-sdk/middleware-signing": "npm:3.465.0" - "@aws-sdk/middleware-user-agent": "npm:3.465.0" - "@aws-sdk/region-config-resolver": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@aws-sdk/util-user-agent-browser": "npm:3.465.0" - "@aws-sdk/util-user-agent-node": "npm:3.465.0" - "@smithy/config-resolver": "npm:^2.0.18" - "@smithy/fetch-http-handler": "npm:^2.2.6" - "@smithy/hash-node": "npm:^2.0.15" - "@smithy/invalid-dependency": "npm:^2.0.13" - "@smithy/md5-js": "npm:^2.0.15" - "@smithy/middleware-content-length": "npm:^2.0.15" - "@smithy/middleware-endpoint": "npm:^2.2.0" - "@smithy/middleware-retry": "npm:^2.0.20" - "@smithy/middleware-serde": "npm:^2.0.13" - "@smithy/middleware-stack": "npm:^2.0.7" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/node-http-handler": "npm:^2.1.9" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/smithy-client": "npm:^2.1.15" - "@smithy/types": "npm:^2.5.0" - "@smithy/url-parser": "npm:^2.0.13" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.0" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.19" - "@smithy/util-defaults-mode-node": "npm:^2.0.25" - "@smithy/util-endpoints": "npm:^1.0.4" - "@smithy/util-retry": "npm:^2.0.6" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/ee8f583b63d54c513cc2c11d5d606d6bfdb378546845a0816ca144bdb23aace4768c0824924acc7c94481868ccbd8a393487a83a4a8dd8adf2957dbc1b37e884 - languageName: node - linkType: hard - -"@aws-sdk/client-sqs@npm:^3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/client-sqs@npm:3.474.0" + "@aws-sdk/client-sts": "npm:3.540.0" + "@aws-sdk/core": "npm:3.535.0" + "@aws-sdk/credential-provider-node": "npm:3.540.0" + "@aws-sdk/middleware-host-header": "npm:3.535.0" + "@aws-sdk/middleware-logger": "npm:3.535.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.535.0" + "@aws-sdk/middleware-sdk-sqs": "npm:3.535.0" + "@aws-sdk/middleware-user-agent": "npm:3.540.0" + "@aws-sdk/region-config-resolver": "npm:3.535.0" + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@aws-sdk/util-user-agent-browser": "npm:3.535.0" + "@aws-sdk/util-user-agent-node": "npm:3.535.0" + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/core": "npm:^1.4.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/hash-node": "npm:^2.2.0" + "@smithy/invalid-dependency": "npm:^2.2.0" + "@smithy/md5-js": "npm:^2.2.0" + "@smithy/middleware-content-length": "npm:^2.2.0" + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-body-length-browser": "npm:^2.2.0" + "@smithy/util-body-length-node": "npm:^2.3.0" + "@smithy/util-defaults-mode-browser": "npm:^2.2.0" + "@smithy/util-defaults-mode-node": "npm:^2.3.0" + "@smithy/util-endpoints": "npm:^1.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/2e98b2d31ee6986dbea1cb22b533a863e54302b832233995923304a3d6235b4a8407b5db5878e78ba40336e23ec3291ed40463cc928da8948b3c915bb5c79ac9 + languageName: node + linkType: hard + +"@aws-sdk/client-sso-oidc@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/client-sso-oidc@npm:3.540.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.474.0" - "@aws-sdk/core": "npm:3.474.0" - "@aws-sdk/credential-provider-node": "npm:3.474.0" - "@aws-sdk/middleware-host-header": "npm:3.468.0" - "@aws-sdk/middleware-logger": "npm:3.468.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.468.0" - "@aws-sdk/middleware-sdk-sqs": "npm:3.468.0" - "@aws-sdk/middleware-signing": "npm:3.468.0" - "@aws-sdk/middleware-user-agent": "npm:3.470.0" - "@aws-sdk/region-config-resolver": "npm:3.470.0" - "@aws-sdk/types": "npm:3.468.0" - "@aws-sdk/util-endpoints": "npm:3.470.0" - "@aws-sdk/util-user-agent-browser": "npm:3.468.0" - "@aws-sdk/util-user-agent-node": "npm:3.470.0" - "@smithy/config-resolver": "npm:^2.0.21" - "@smithy/fetch-http-handler": "npm:^2.3.1" - "@smithy/hash-node": "npm:^2.0.17" - "@smithy/invalid-dependency": "npm:^2.0.15" - "@smithy/md5-js": "npm:^2.0.17" - "@smithy/middleware-content-length": "npm:^2.0.17" - "@smithy/middleware-endpoint": "npm:^2.2.3" - "@smithy/middleware-retry": "npm:^2.0.24" - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/middleware-stack": "npm:^2.0.9" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/node-http-handler": "npm:^2.2.1" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.1" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.22" - "@smithy/util-defaults-mode-node": "npm:^2.0.29" - "@smithy/util-endpoints": "npm:^1.0.7" - "@smithy/util-retry": "npm:^2.0.8" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/46ded5a040ed30940706ed98926fb51963a986465c311187f360df102d1823db388d641453c50e9c6c0ca2148c6bcdddeb0c41ded6617535b50e174c33910946 + "@aws-sdk/client-sts": "npm:3.540.0" + "@aws-sdk/core": "npm:3.535.0" + "@aws-sdk/middleware-host-header": "npm:3.535.0" + "@aws-sdk/middleware-logger": "npm:3.535.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.535.0" + "@aws-sdk/middleware-user-agent": "npm:3.540.0" + "@aws-sdk/region-config-resolver": "npm:3.535.0" + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@aws-sdk/util-user-agent-browser": "npm:3.535.0" + "@aws-sdk/util-user-agent-node": "npm:3.535.0" + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/core": "npm:^1.4.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/hash-node": "npm:^2.2.0" + "@smithy/invalid-dependency": "npm:^2.2.0" + "@smithy/middleware-content-length": "npm:^2.2.0" + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-body-length-browser": "npm:^2.2.0" + "@smithy/util-body-length-node": "npm:^2.3.0" + "@smithy/util-defaults-mode-browser": "npm:^2.2.0" + "@smithy/util-defaults-mode-node": "npm:^2.3.0" + "@smithy/util-endpoints": "npm:^1.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + peerDependencies: + "@aws-sdk/credential-provider-node": ^3.540.0 + checksum: 10/3d730be4c5031381f3c10b26243e26e5d50178f3aa511a38c0ad28b7f8e68897daead41da65dac98cfe81f6c0e37b074cf02bb63179ff112bdfd2472b70e1160 languageName: node linkType: hard @@ -488,91 +439,49 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sso@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/client-sso@npm:3.465.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/core": "npm:3.465.0" - "@aws-sdk/middleware-host-header": "npm:3.465.0" - "@aws-sdk/middleware-logger": "npm:3.465.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.465.0" - "@aws-sdk/middleware-user-agent": "npm:3.465.0" - "@aws-sdk/region-config-resolver": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@aws-sdk/util-user-agent-browser": "npm:3.465.0" - "@aws-sdk/util-user-agent-node": "npm:3.465.0" - "@smithy/config-resolver": "npm:^2.0.18" - "@smithy/fetch-http-handler": "npm:^2.2.6" - "@smithy/hash-node": "npm:^2.0.15" - "@smithy/invalid-dependency": "npm:^2.0.13" - "@smithy/middleware-content-length": "npm:^2.0.15" - "@smithy/middleware-endpoint": "npm:^2.2.0" - "@smithy/middleware-retry": "npm:^2.0.20" - "@smithy/middleware-serde": "npm:^2.0.13" - "@smithy/middleware-stack": "npm:^2.0.7" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/node-http-handler": "npm:^2.1.9" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/smithy-client": "npm:^2.1.15" - "@smithy/types": "npm:^2.5.0" - "@smithy/url-parser": "npm:^2.0.13" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.0" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.19" - "@smithy/util-defaults-mode-node": "npm:^2.0.25" - "@smithy/util-endpoints": "npm:^1.0.4" - "@smithy/util-retry": "npm:^2.0.6" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/0f3c7ee4f3d0b321973ab2c75980a7d3e01fd23bf69b55444324fd7e6d17da3bd8a9dc10b3f6901cab79e8269f943362070ae249341c2fa8ea7caf7ab525d76d - languageName: node - linkType: hard - -"@aws-sdk/client-sso@npm:3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/client-sso@npm:3.474.0" +"@aws-sdk/client-sso@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/client-sso@npm:3.540.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/core": "npm:3.474.0" - "@aws-sdk/middleware-host-header": "npm:3.468.0" - "@aws-sdk/middleware-logger": "npm:3.468.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.468.0" - "@aws-sdk/middleware-user-agent": "npm:3.470.0" - "@aws-sdk/region-config-resolver": "npm:3.470.0" - "@aws-sdk/types": "npm:3.468.0" - "@aws-sdk/util-endpoints": "npm:3.470.0" - "@aws-sdk/util-user-agent-browser": "npm:3.468.0" - "@aws-sdk/util-user-agent-node": "npm:3.470.0" - "@smithy/config-resolver": "npm:^2.0.21" - "@smithy/fetch-http-handler": "npm:^2.3.1" - "@smithy/hash-node": "npm:^2.0.17" - "@smithy/invalid-dependency": "npm:^2.0.15" - "@smithy/middleware-content-length": "npm:^2.0.17" - "@smithy/middleware-endpoint": "npm:^2.2.3" - "@smithy/middleware-retry": "npm:^2.0.24" - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/middleware-stack": "npm:^2.0.9" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/node-http-handler": "npm:^2.2.1" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.1" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.22" - "@smithy/util-defaults-mode-node": "npm:^2.0.29" - "@smithy/util-endpoints": "npm:^1.0.7" - "@smithy/util-retry": "npm:^2.0.8" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/2f5b630564c39fc8792b91fdd774d0b61ed22086d92b5c0a2c8f37c1ac46b64c94f4ac6c4fe3259a2ab5b339b4740ef75768c48cca1083464705022fba73a5c0 + "@aws-sdk/core": "npm:3.535.0" + "@aws-sdk/middleware-host-header": "npm:3.535.0" + "@aws-sdk/middleware-logger": "npm:3.535.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.535.0" + "@aws-sdk/middleware-user-agent": "npm:3.540.0" + "@aws-sdk/region-config-resolver": "npm:3.535.0" + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@aws-sdk/util-user-agent-browser": "npm:3.535.0" + "@aws-sdk/util-user-agent-node": "npm:3.535.0" + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/core": "npm:^1.4.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/hash-node": "npm:^2.2.0" + "@smithy/invalid-dependency": "npm:^2.2.0" + "@smithy/middleware-content-length": "npm:^2.2.0" + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-body-length-browser": "npm:^2.2.0" + "@smithy/util-body-length-node": "npm:^2.3.0" + "@smithy/util-defaults-mode-browser": "npm:^2.2.0" + "@smithy/util-defaults-mode-node": "npm:^2.3.0" + "@smithy/util-endpoints": "npm:^1.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/8e2a021624c102ab5a35216ecf1e42dc9d0b7bfb1213477783f64bcc227dcc6cc2363359678b702549d44332f3d2d71173374bd7bf56ea0093aa351a9cba2a90 languageName: node linkType: hard @@ -622,123 +531,66 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/client-sts@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/client-sts@npm:3.465.0" +"@aws-sdk/client-sts@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/client-sts@npm:3.540.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/core": "npm:3.465.0" - "@aws-sdk/credential-provider-node": "npm:3.465.0" - "@aws-sdk/middleware-host-header": "npm:3.465.0" - "@aws-sdk/middleware-logger": "npm:3.465.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.465.0" - "@aws-sdk/middleware-sdk-sts": "npm:3.465.0" - "@aws-sdk/middleware-signing": "npm:3.465.0" - "@aws-sdk/middleware-user-agent": "npm:3.465.0" - "@aws-sdk/region-config-resolver": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@aws-sdk/util-user-agent-browser": "npm:3.465.0" - "@aws-sdk/util-user-agent-node": "npm:3.465.0" - "@smithy/config-resolver": "npm:^2.0.18" - "@smithy/fetch-http-handler": "npm:^2.2.6" - "@smithy/hash-node": "npm:^2.0.15" - "@smithy/invalid-dependency": "npm:^2.0.13" - "@smithy/middleware-content-length": "npm:^2.0.15" - "@smithy/middleware-endpoint": "npm:^2.2.0" - "@smithy/middleware-retry": "npm:^2.0.20" - "@smithy/middleware-serde": "npm:^2.0.13" - "@smithy/middleware-stack": "npm:^2.0.7" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/node-http-handler": "npm:^2.1.9" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/smithy-client": "npm:^2.1.15" - "@smithy/types": "npm:^2.5.0" - "@smithy/url-parser": "npm:^2.0.13" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.0" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.19" - "@smithy/util-defaults-mode-node": "npm:^2.0.25" - "@smithy/util-endpoints": "npm:^1.0.4" - "@smithy/util-retry": "npm:^2.0.6" - "@smithy/util-utf8": "npm:^2.0.2" - fast-xml-parser: "npm:4.2.5" - tslib: "npm:^2.5.0" - checksum: 10/5239c4396306e55e584fa3961cbac98f00fc3848564d2ad88af607b44bd864c4e5d85e14c73d2bf278c6381ebd3a2fa8ccc326a88c15afe97ee46d75f21f9c66 + "@aws-sdk/core": "npm:3.535.0" + "@aws-sdk/middleware-host-header": "npm:3.535.0" + "@aws-sdk/middleware-logger": "npm:3.535.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.535.0" + "@aws-sdk/middleware-user-agent": "npm:3.540.0" + "@aws-sdk/region-config-resolver": "npm:3.535.0" + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@aws-sdk/util-user-agent-browser": "npm:3.535.0" + "@aws-sdk/util-user-agent-node": "npm:3.535.0" + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/core": "npm:^1.4.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/hash-node": "npm:^2.2.0" + "@smithy/invalid-dependency": "npm:^2.2.0" + "@smithy/middleware-content-length": "npm:^2.2.0" + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-body-length-browser": "npm:^2.2.0" + "@smithy/util-body-length-node": "npm:^2.3.0" + "@smithy/util-defaults-mode-browser": "npm:^2.2.0" + "@smithy/util-defaults-mode-node": "npm:^2.3.0" + "@smithy/util-endpoints": "npm:^1.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + peerDependencies: + "@aws-sdk/credential-provider-node": ^3.540.0 + checksum: 10/1344fe3d8ecd0e399859b50034d7b3400ab7f67b3734180bd6ecdef464a1069cdd1135dfc39864fd97033be8c3c9551f28b65e07d658307963836d3f548b4e69 languageName: node linkType: hard -"@aws-sdk/client-sts@npm:3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/client-sts@npm:3.474.0" +"@aws-sdk/core@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/core@npm:3.535.0" dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/core": "npm:3.474.0" - "@aws-sdk/credential-provider-node": "npm:3.474.0" - "@aws-sdk/middleware-host-header": "npm:3.468.0" - "@aws-sdk/middleware-logger": "npm:3.468.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.468.0" - "@aws-sdk/middleware-user-agent": "npm:3.470.0" - "@aws-sdk/region-config-resolver": "npm:3.470.0" - "@aws-sdk/types": "npm:3.468.0" - "@aws-sdk/util-endpoints": "npm:3.470.0" - "@aws-sdk/util-user-agent-browser": "npm:3.468.0" - "@aws-sdk/util-user-agent-node": "npm:3.470.0" - "@smithy/config-resolver": "npm:^2.0.21" - "@smithy/core": "npm:^1.1.0" - "@smithy/fetch-http-handler": "npm:^2.3.1" - "@smithy/hash-node": "npm:^2.0.17" - "@smithy/invalid-dependency": "npm:^2.0.15" - "@smithy/middleware-content-length": "npm:^2.0.17" - "@smithy/middleware-endpoint": "npm:^2.2.3" - "@smithy/middleware-retry": "npm:^2.0.24" - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/middleware-stack": "npm:^2.0.9" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/node-http-handler": "npm:^2.2.1" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.1" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.22" - "@smithy/util-defaults-mode-node": "npm:^2.0.29" - "@smithy/util-endpoints": "npm:^1.0.7" - "@smithy/util-middleware": "npm:^2.0.8" - "@smithy/util-retry": "npm:^2.0.8" - "@smithy/util-utf8": "npm:^2.0.2" + "@smithy/core": "npm:^1.4.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/signature-v4": "npm:^2.2.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" fast-xml-parser: "npm:4.2.5" - tslib: "npm:^2.5.0" - checksum: 10/acd452293d763715016ce886203099303c6e1db968b9ac6ee20a9275151eb16340a98f277a3670fa3b24dcf7f5031d854601be9cafc8ed9964327f0d17ba91a0 - languageName: node - linkType: hard - -"@aws-sdk/core@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/core@npm:3.465.0" - dependencies: - "@smithy/smithy-client": "npm:^2.1.15" - tslib: "npm:^2.5.0" - checksum: 10/d6b1c37ef46ff5e9de5b7b2f86182c0813c367c48765ba94f82bca0b8b2154d8364c5ba2873cf149afddab262734ad554dca2e2023a29defdaf5c4c36ff37fac - languageName: node - linkType: hard - -"@aws-sdk/core@npm:3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/core@npm:3.474.0" - dependencies: - "@smithy/core": "npm:^1.1.0" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/signature-v4": "npm:^2.0.0" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/9da2048ed33fe197b0a790528cde25d72d8e50bbe5ed63f5d3ced9aae117c85d5470825de642c301fc780c51bd12a2c9b468112a47af07ba0155df484e48f8aa + tslib: "npm:^2.6.2" + checksum: 10/f80dd5f6293dbfa11fdfdaed6dc56142c86eaf074231be990ce127ebd9fd92e2b574d751d5b15c397b885ad60ef0550b5d80bc516979d0b0289605c9eacdfdb0 languageName: node linkType: hard @@ -754,27 +606,32 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-env@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/credential-provider-env@npm:3.465.0" +"@aws-sdk/credential-provider-env@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/credential-provider-env@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/c12a7a1f021e3410afd001a14075d27c2f3d0a72b7f9b62728f5e7127940aff4d94eb65c1dec792a440da1a8d165636ca88a172a14375eec41f9492c4214014c + "@aws-sdk/types": "npm:3.535.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/a9ab16146a2ba6d5d4af901ebacbd4576effd42c90debc274a9e827bd0a958072b068dfab54e8c6735cc96de40196d84c90c2543692336cca0decef2a16f2fd2 languageName: node linkType: hard -"@aws-sdk/credential-provider-env@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/credential-provider-env@npm:3.468.0" +"@aws-sdk/credential-provider-http@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/credential-provider-http@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/5e8fe5c7a94534d0570e5767a224dfd92f3b039336263ad3121c74aef4ecdac111f24b17be7c78d8a04ed09b2b3d89b65a3bc020180d23d6c5bb4fe98d85f89f + "@aws-sdk/types": "npm:3.535.0" + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-stream": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/989d97be76e7c93801c216e18974741df14d66c5a1069bc01d80b26a73bae714a4070d1469db8a00db51d8914167e2c8d17eee565fb9fba29527895b0b165e85 languageName: node linkType: hard @@ -796,39 +653,22 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-ini@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/credential-provider-ini@npm:3.465.0" - dependencies: - "@aws-sdk/credential-provider-env": "npm:3.465.0" - "@aws-sdk/credential-provider-process": "npm:3.465.0" - "@aws-sdk/credential-provider-sso": "npm:3.465.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@smithy/credential-provider-imds": "npm:^2.0.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/4c592f7d5592ac2c7013a07fdfcdf66a58de57cddbc71645f1b8595a2ced008143bc03842274fe6ae1cb20ab115b6dc33f7e7f327afe65f401ebb5d101e4beb7 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-ini@npm:3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/credential-provider-ini@npm:3.474.0" +"@aws-sdk/credential-provider-ini@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/credential-provider-ini@npm:3.540.0" dependencies: - "@aws-sdk/credential-provider-env": "npm:3.468.0" - "@aws-sdk/credential-provider-process": "npm:3.468.0" - "@aws-sdk/credential-provider-sso": "npm:3.474.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.468.0" - "@aws-sdk/types": "npm:3.468.0" - "@smithy/credential-provider-imds": "npm:^2.0.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/4784eabcf0dd39717d5b9eb33deac1602112cfe4ebd57917847813bc41a354b97c5d1c34fcf7b035ad76740dbf2dfb0f080e2f5f77302ceefe4ecc7096db918a + "@aws-sdk/client-sts": "npm:3.540.0" + "@aws-sdk/credential-provider-env": "npm:3.535.0" + "@aws-sdk/credential-provider-process": "npm:3.535.0" + "@aws-sdk/credential-provider-sso": "npm:3.540.0" + "@aws-sdk/credential-provider-web-identity": "npm:3.540.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/credential-provider-imds": "npm:^2.3.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/71d6a3eda7ec07e2c516e149f75f33d35217c8ea54cf705fde06173d35fd118f2c1569e56ddd89f229049ef8edcfec26cbebbd51d84c0781f131df1537bab222 languageName: node linkType: hard @@ -851,41 +691,23 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-node@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/credential-provider-node@npm:3.465.0" - dependencies: - "@aws-sdk/credential-provider-env": "npm:3.465.0" - "@aws-sdk/credential-provider-ini": "npm:3.465.0" - "@aws-sdk/credential-provider-process": "npm:3.465.0" - "@aws-sdk/credential-provider-sso": "npm:3.465.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@smithy/credential-provider-imds": "npm:^2.0.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/194c88b21a686364983393e5e1373b6664ef6a93a26f34a362517c5ee6a537dad11e68e791a98cf7d39c94e5c6ae4767e5dd867250957de66a4b298e127bdc0b - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-node@npm:3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/credential-provider-node@npm:3.474.0" +"@aws-sdk/credential-provider-node@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/credential-provider-node@npm:3.540.0" dependencies: - "@aws-sdk/credential-provider-env": "npm:3.468.0" - "@aws-sdk/credential-provider-ini": "npm:3.474.0" - "@aws-sdk/credential-provider-process": "npm:3.468.0" - "@aws-sdk/credential-provider-sso": "npm:3.474.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.468.0" - "@aws-sdk/types": "npm:3.468.0" - "@smithy/credential-provider-imds": "npm:^2.0.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/2e1ab98b9ffa32918234e4bc3387d23127c227c886212c7dbb0b307719d59984785f5a6ec17bb9849e2925994e9a4cdaed0b78d7095ad9aaa6f614bc18e897a4 + "@aws-sdk/credential-provider-env": "npm:3.535.0" + "@aws-sdk/credential-provider-http": "npm:3.535.0" + "@aws-sdk/credential-provider-ini": "npm:3.540.0" + "@aws-sdk/credential-provider-process": "npm:3.535.0" + "@aws-sdk/credential-provider-sso": "npm:3.540.0" + "@aws-sdk/credential-provider-web-identity": "npm:3.540.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/credential-provider-imds": "npm:^2.3.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/78fde961d1b0b9b5e19b7a8e3ccae2daf35c3cb1dd4fee58e8960e7f7d97a0f42a470caab5c62aa5568f1b2d39171992164f22eb32e5cc231db34a9be4743bc9 languageName: node linkType: hard @@ -902,29 +724,16 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-process@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/credential-provider-process@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/678a09af9ec7978e3f0de0060ddeab1c251a8ce4203e84dc00f569c4ba29eda350861bd30b24bb0b4e854451f098b8ed0b0dbcb85876a3a03b19d004185427a3 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-process@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/credential-provider-process@npm:3.468.0" +"@aws-sdk/credential-provider-process@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/credential-provider-process@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/7a345716ac618d8c36db7dafd168d7d12807fd3e181392f61da116eb061d3b8eef135f06c30031104831289caa5c56f7e70448e56c04a892a793cc51ab137013 + "@aws-sdk/types": "npm:3.535.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/59260bcd5d42ee61269a3a3d9b2c6c9ab0b6af2b1d48826018e56d44014c3a85fceaf175f3855a24a5f3093ee367afea49a72a559bc7ceb30e7cc9be049c4b0a languageName: node linkType: hard @@ -943,33 +752,18 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-sso@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/credential-provider-sso@npm:3.465.0" +"@aws-sdk/credential-provider-sso@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/credential-provider-sso@npm:3.540.0" dependencies: - "@aws-sdk/client-sso": "npm:3.465.0" - "@aws-sdk/token-providers": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/68ee03c12ce4bfbb4287b1655a0e595cf8e423f0107a87c6b0d4d108e420f3bd554e32427198f74bf26ca9d3bb859fd24a3826ccbd1727a77690c0766aff078b - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-sso@npm:3.474.0": - version: 3.474.0 - resolution: "@aws-sdk/credential-provider-sso@npm:3.474.0" - dependencies: - "@aws-sdk/client-sso": "npm:3.474.0" - "@aws-sdk/token-providers": "npm:3.470.0" - "@aws-sdk/types": "npm:3.468.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/fa35b0eba0fa500a6c35cd3b10831b9599606ddf54ee328264ec044c22296320eff391fc15a9506150b587891325a64cdb29ba1fb616ed924c3f8bba2d495773 + "@aws-sdk/client-sso": "npm:3.540.0" + "@aws-sdk/token-providers": "npm:3.540.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/9aa974a56a2effb2254df63bc5ec08595d6ca9bd5d724d8fc463e798131bfab0c15a47c32f2b359765ef44241dd737ebd09202a09690214f6e52060eba2f0dcd languageName: node linkType: hard @@ -985,27 +779,16 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/credential-provider-web-identity@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/credential-provider-web-identity@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/5c7a7cded65f05b9beeec57e293e9b9b1870693bebb3016219d02dc0bb134baf031efbe11a4115cfbbd18d0f2d3e4b16263bc0359d31187659062782b260a57b - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-web-identity@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/credential-provider-web-identity@npm:3.468.0" +"@aws-sdk/credential-provider-web-identity@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.540.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/a5fac595637703e6d270c26a2121d574f6f18f96df45d81d7eb1e4e9230c2cf4710f1655e6cd3602dda93e4d447d34bfa707868aaa7083492522d6ab5443a716 + "@aws-sdk/client-sts": "npm:3.540.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/889dac368f27fde4a47428dd9ba23ba8352bb01a6c9674b36b3972feef5acc68ff5ba37b8932413bff34c7ed128d1a840369e663ac0291eb8ebd8a6fe48e5ce0 languageName: node linkType: hard @@ -1021,27 +804,15 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-host-header@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-host-header@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/d315aad512145cbf442100145d74b95a194e658fd989466510fec1925032a18fa72e1ec98ace843b0d3045e4ebee02eb8637aa39dcbdc8e864adb634ac4305f8 - languageName: node - linkType: hard - -"@aws-sdk/middleware-host-header@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/middleware-host-header@npm:3.468.0" +"@aws-sdk/middleware-host-header@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/middleware-host-header@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/d511dea932f68c02f4c683d2b31345c6f9b9d63c7e5be6b4ebf829da056519c63fdc215b19e16628f37b0d57be95d6c107593de452e26fb71f713368da26cbf4 + "@aws-sdk/types": "npm:3.535.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/a32cb45c88c8e2361ca4cfca8cd7dc84e743e39e3a161ac4d9aa6c0916b3f259f32c2c8d84cfb60971c4da69fe17b387df75d21903aab8c2c56586cbe025c91c languageName: node linkType: hard @@ -1056,25 +827,14 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-logger@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-logger@npm:3.465.0" +"@aws-sdk/middleware-logger@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/middleware-logger@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/351984f7541a4201ea04d1b954b072c1d521bcc15a58bd46b6778be36ee1712934d3546f3be9f11bf32cee2498e2a8854d24168f4546bd0636d2fd9a0a2e259c - languageName: node - linkType: hard - -"@aws-sdk/middleware-logger@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/middleware-logger@npm:3.468.0" - dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/75dba345d91451e0a0d2d95c15f12934a9b29be0a271f1904552bfe81cf3a5daf2b0c027fe03a7b475c8a256ea8158c8c87d641a473c943add8bfcb6e40c341d + "@aws-sdk/types": "npm:3.535.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/1edb993a1e020848be08904e07e7f8bc4925cece85c74d5d67f787e4fe3dcc80da558dd71c530e0910fb86313b9c3955cb4585d1ddbf47fcb85bf8024c735e3a languageName: node linkType: hard @@ -1090,53 +850,29 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-recursion-detection@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-recursion-detection@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/ee8f806f9400f04de760b576800266df6674d423032aaa211c6c0609ca565c2d9009d12673624dacad5d2d32128d638a24da35aa0db88c56bc3720cea3c7c6c4 - languageName: node - linkType: hard - -"@aws-sdk/middleware-recursion-detection@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/middleware-recursion-detection@npm:3.468.0" - dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/490855cfde0abd0e769dfdb63355ba645dfe4bc6b82a90b05ab648ae098f2af7ec6f76dab315825bfe02c2b37f307b1d895728547c5a9c592377f309199ba4ab - languageName: node - linkType: hard - -"@aws-sdk/middleware-sdk-sqs@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-sdk-sqs@npm:3.465.0" +"@aws-sdk/middleware-recursion-detection@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/types": "npm:^2.5.0" - "@smithy/util-hex-encoding": "npm:^2.0.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/09bad59f85f411f8f3fa30c22c505c4682bd5cc6f859bd4a53feb715ee4d86668b82fb739c1240f02e0abcdb9cae6de1ee7948f5aff53aaa5b4772c829e2efd9 + "@aws-sdk/types": "npm:3.535.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/cf231a98e8f85c4592ccdc8c3d6bff10951fea96c06978068ce6667c6d4c99f95f14b836996dac27c31848030f662f1600629cc63554c5c0d8b4242bba4c5bea languageName: node linkType: hard -"@aws-sdk/middleware-sdk-sqs@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/middleware-sdk-sqs@npm:3.468.0" +"@aws-sdk/middleware-sdk-sqs@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/middleware-sdk-sqs@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-hex-encoding": "npm:^2.0.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/becbe86421896455c73bba3189a98ef5800ae4b0393cb942939db119c8910435cff94f75a3afdb33761a6e12dfcd8c801cd9e1f4c1ab24442f7c9792ccbeeaa4 + "@aws-sdk/types": "npm:3.535.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-hex-encoding": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/614fc1d6875d1aaf4f2f43869f62fd0e6cf8099624eea98cd766e84449a87c5ee3ac45fb93e178bdf6b366e2891155d0e8d5e071409cbe822a475d6b0c6804ea languageName: node linkType: hard @@ -1152,18 +888,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-sdk-sts@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-sdk-sts@npm:3.465.0" - dependencies: - "@aws-sdk/middleware-signing": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/1a741493769fefb6aa172a597d1bc0c9cb446400b93a783d75a270a0cede5731e7a072a8ecdd5fe4f4ed6de04caa98c8427af9e7cefe624ae4fe03a8cb987eaf - languageName: node - linkType: hard - "@aws-sdk/middleware-signing@npm:3.418.0": version: 3.418.0 resolution: "@aws-sdk/middleware-signing@npm:3.418.0" @@ -1179,36 +903,6 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-signing@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-signing@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/signature-v4": "npm:^2.0.0" - "@smithy/types": "npm:^2.5.0" - "@smithy/util-middleware": "npm:^2.0.6" - tslib: "npm:^2.5.0" - checksum: 10/6740ac0a45a976327d63ca518667c49addfcd9d702f76a1459b875b6724d391d8af8038b6ea4c95955ecd0d314bfe6f17f7dbac84562c61ec91ed1aa92e655b4 - languageName: node - linkType: hard - -"@aws-sdk/middleware-signing@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/middleware-signing@npm:3.468.0" - dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/signature-v4": "npm:^2.0.0" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-middleware": "npm:^2.0.8" - tslib: "npm:^2.5.0" - checksum: 10/e14d0ace15d8e67700955dda58de3017b8d012ff363737266063224d481df0d1efe86f6b292b847ab2b13ffc2115e9d95f622291512266a82eebc9959ad7b4c5 - languageName: node - linkType: hard - "@aws-sdk/middleware-user-agent@npm:3.418.0": version: 3.418.0 resolution: "@aws-sdk/middleware-user-agent@npm:3.418.0" @@ -1222,29 +916,16 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/middleware-user-agent@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/middleware-user-agent@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/fd82408a1e34623a06bd23a80e274732f57ef939896e38e39bcaa4b88beaab42239811cd5237af7df779b24387b25542a0b004079e6ec43e05287e7889e688f0 - languageName: node - linkType: hard - -"@aws-sdk/middleware-user-agent@npm:3.470.0": - version: 3.470.0 - resolution: "@aws-sdk/middleware-user-agent@npm:3.470.0" +"@aws-sdk/middleware-user-agent@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/middleware-user-agent@npm:3.540.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@aws-sdk/util-endpoints": "npm:3.470.0" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/e5597ff614e7efe804483357b1e10bae62e24aef6484a6038d085c6483e947ac30df5e928cc03b4311d6fca4549fab696131b3a282355222f60a8c73025d3498 + "@aws-sdk/types": "npm:3.535.0" + "@aws-sdk/util-endpoints": "npm:3.540.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/032a37e91682a7330e7553c1728c84528a16a1e4efb0d3a0823db49a5c56b64d0cf1a84b4863a5314fc4954d824a77786493f0d305b72305fabd75c4badd7697 languageName: node linkType: hard @@ -1261,29 +942,17 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/region-config-resolver@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/region-config-resolver@npm:3.465.0" - dependencies: - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/types": "npm:^2.5.0" - "@smithy/util-config-provider": "npm:^2.0.0" - "@smithy/util-middleware": "npm:^2.0.6" - tslib: "npm:^2.5.0" - checksum: 10/97c92a1a1f3ffb8489649156b5c61052d0af0802fecaa97da0c5859ff0a83ff45b8ecf773909f63ca430c3fa4b3ea9c0b68e07b192dbb9b88fe4fdaf162bfc93 - languageName: node - linkType: hard - -"@aws-sdk/region-config-resolver@npm:3.470.0": - version: 3.470.0 - resolution: "@aws-sdk/region-config-resolver@npm:3.470.0" +"@aws-sdk/region-config-resolver@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/region-config-resolver@npm:3.535.0" dependencies: - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-config-provider": "npm:^2.0.0" - "@smithy/util-middleware": "npm:^2.0.8" - tslib: "npm:^2.5.0" - checksum: 10/cef036e44b9af913f83e6f2782c13eaa7c048954904bf2d5728639bc08c4328236b55860d85acdca7d951d773d8f932a90745b507955c3004cb15b28c8f1f0ab + "@aws-sdk/types": "npm:3.535.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-config-provider": "npm:^2.3.0" + "@smithy/util-middleware": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/a7a1ef6f85f1d05a03d8a132bd4a822c51ac0ba88799d3c3b340118b40c958dc412ed9c97a8945fce8b35ec1f31192003e638e419345054bc514943a9962eb72 languageName: node linkType: hard @@ -1330,93 +999,17 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/token-providers@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/token-providers@npm:3.465.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/middleware-host-header": "npm:3.465.0" - "@aws-sdk/middleware-logger": "npm:3.465.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.465.0" - "@aws-sdk/middleware-user-agent": "npm:3.465.0" - "@aws-sdk/region-config-resolver": "npm:3.465.0" - "@aws-sdk/types": "npm:3.465.0" - "@aws-sdk/util-endpoints": "npm:3.465.0" - "@aws-sdk/util-user-agent-browser": "npm:3.465.0" - "@aws-sdk/util-user-agent-node": "npm:3.465.0" - "@smithy/config-resolver": "npm:^2.0.18" - "@smithy/fetch-http-handler": "npm:^2.2.6" - "@smithy/hash-node": "npm:^2.0.15" - "@smithy/invalid-dependency": "npm:^2.0.13" - "@smithy/middleware-content-length": "npm:^2.0.15" - "@smithy/middleware-endpoint": "npm:^2.2.0" - "@smithy/middleware-retry": "npm:^2.0.20" - "@smithy/middleware-serde": "npm:^2.0.13" - "@smithy/middleware-stack": "npm:^2.0.7" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/node-http-handler": "npm:^2.1.9" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/protocol-http": "npm:^3.0.9" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/smithy-client": "npm:^2.1.15" - "@smithy/types": "npm:^2.5.0" - "@smithy/url-parser": "npm:^2.0.13" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.0" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.19" - "@smithy/util-defaults-mode-node": "npm:^2.0.25" - "@smithy/util-endpoints": "npm:^1.0.4" - "@smithy/util-retry": "npm:^2.0.6" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/30cff56d0f4e07d708e02a40e67fdaad713ba5ed62274b06b29e93a60815c52b3f271d9e183e8846728d6a65cfdceb10e4369d8af67dbfd6a6363865e45790ad - languageName: node - linkType: hard - -"@aws-sdk/token-providers@npm:3.470.0": - version: 3.470.0 - resolution: "@aws-sdk/token-providers@npm:3.470.0" +"@aws-sdk/token-providers@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/token-providers@npm:3.540.0" dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/middleware-host-header": "npm:3.468.0" - "@aws-sdk/middleware-logger": "npm:3.468.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.468.0" - "@aws-sdk/middleware-user-agent": "npm:3.470.0" - "@aws-sdk/region-config-resolver": "npm:3.470.0" - "@aws-sdk/types": "npm:3.468.0" - "@aws-sdk/util-endpoints": "npm:3.470.0" - "@aws-sdk/util-user-agent-browser": "npm:3.468.0" - "@aws-sdk/util-user-agent-node": "npm:3.470.0" - "@smithy/config-resolver": "npm:^2.0.21" - "@smithy/fetch-http-handler": "npm:^2.3.1" - "@smithy/hash-node": "npm:^2.0.17" - "@smithy/invalid-dependency": "npm:^2.0.15" - "@smithy/middleware-content-length": "npm:^2.0.17" - "@smithy/middleware-endpoint": "npm:^2.2.3" - "@smithy/middleware-retry": "npm:^2.0.24" - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/middleware-stack": "npm:^2.0.9" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/node-http-handler": "npm:^2.2.1" - "@smithy/property-provider": "npm:^2.0.0" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/shared-ini-file-loader": "npm:^2.0.6" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-body-length-browser": "npm:^2.0.1" - "@smithy/util-body-length-node": "npm:^2.1.0" - "@smithy/util-defaults-mode-browser": "npm:^2.0.22" - "@smithy/util-defaults-mode-node": "npm:^2.0.29" - "@smithy/util-endpoints": "npm:^1.0.7" - "@smithy/util-retry": "npm:^2.0.8" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/c12043d08fa5cc12bf2c64f33552f60d12fafc180892ca5f4d47f77222d546992edc7c6fb530d8af7d6b77c72d0e2abfa4702f6c9fd2fbfa366decf4dc367014 + "@aws-sdk/client-sso-oidc": "npm:3.540.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/137e43d2257ac87302033bf59731a7c5d21f1fab047c673d90f1adb036cde889debe159f2a59aec70c9daefe0d76528eae51d821f178c0de20b1e328efc25c14 languageName: node linkType: hard @@ -1430,23 +1023,13 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/types@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/types@npm:3.465.0" - dependencies: - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - checksum: 10/09bbdf1789bad734b35f370edd0d6b3bfea4654c1dd6d959828b24a3daf8438fce6dfb1f94aa7b66e7989825e31b405c20b731efa7ec73342240e52437461fe9 - languageName: node - linkType: hard - -"@aws-sdk/types@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/types@npm:3.468.0" +"@aws-sdk/types@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/types@npm:3.535.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/d2599c6e73e932925ecebdb4f71bfa25895423ddf6ea981ea815dcf7a307c989d5e53bc9d2a95fed14fd0f6223bcf561dcff64113cf5a77b3d5b263664323b03 + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/29c2def0ef0a10c0cc44d45b18e149ed6884a6417ddef7a23a58d50ad83f71cf0b00dd774fcc57fcdf85e1e21a8849d9e25999943435a1487ee8ac127a668c6d languageName: node linkType: hard @@ -1460,25 +1043,15 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-endpoints@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/util-endpoints@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/util-endpoints": "npm:^1.0.4" - tslib: "npm:^2.5.0" - checksum: 10/0d23fb4961db4cfdccef61d6767d1b208c139e6dac01f0f2fcc37e3f8ca67125e07fece1e6e95ada71ab65f7da4514f4f835e8fe1d8530138e70f12d5f1540a9 - languageName: node - linkType: hard - -"@aws-sdk/util-endpoints@npm:3.470.0": - version: 3.470.0 - resolution: "@aws-sdk/util-endpoints@npm:3.470.0" +"@aws-sdk/util-endpoints@npm:3.540.0": + version: 3.540.0 + resolution: "@aws-sdk/util-endpoints@npm:3.540.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/util-endpoints": "npm:^1.0.7" - tslib: "npm:^2.5.0" - checksum: 10/6e14724c5951f9b9b91c75b3553b25d5219412914a9897e62aebbafb6f0f366c8f69861074c36f81380e6b5469f371b96a9d9fd9b2b7f86ead84fa29068aefdc + "@aws-sdk/types": "npm:3.535.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-endpoints": "npm:^1.2.0" + tslib: "npm:^2.6.2" + checksum: 10/0adf6ef1007e5f059059d926b6ac68a1ae2b70093a8d8af1c5cc15cf62a6291f436f065fc31b6a1950200d4c97cf7ce3e7e8e554b2657b9e11570749a224a5da languageName: node linkType: hard @@ -1503,27 +1076,15 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-user-agent-browser@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/util-user-agent-browser@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/types": "npm:^2.5.0" - bowser: "npm:^2.11.0" - tslib: "npm:^2.5.0" - checksum: 10/942b30c0c98069d2e11a871297a61ba1cf32743e150f9dcf318f45060d8206ee5f797ee38257186f6ea708bb2b337b299efd1a4fcd7be7942b3781c6aadd455f - languageName: node - linkType: hard - -"@aws-sdk/util-user-agent-browser@npm:3.468.0": - version: 3.468.0 - resolution: "@aws-sdk/util-user-agent-browser@npm:3.468.0" +"@aws-sdk/util-user-agent-browser@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/types": "npm:^2.7.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/types": "npm:^2.12.0" bowser: "npm:^2.11.0" - tslib: "npm:^2.5.0" - checksum: 10/b2d78fa8565f29219192d1f70b834d4d982fe3ec757a493bd0c2edffb20d606b9bec50fca955fd00787e939935eb71498ca637f5fddd1476255b01f460396737 + tslib: "npm:^2.6.2" + checksum: 10/76edb3cb012af16777988c8c63d74504431af33d8ebbcb891abbb972498e49d02ee43e61cf09facf22909d69df645d53480640884d2e76de581016851cafa6d3 languageName: node linkType: hard @@ -1544,37 +1105,20 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-user-agent-node@npm:3.465.0": - version: 3.465.0 - resolution: "@aws-sdk/util-user-agent-node@npm:3.465.0" - dependencies: - "@aws-sdk/types": "npm:3.465.0" - "@smithy/node-config-provider": "npm:^2.1.5" - "@smithy/types": "npm:^2.5.0" - tslib: "npm:^2.5.0" - peerDependencies: - aws-crt: ">=1.0.0" - peerDependenciesMeta: - aws-crt: - optional: true - checksum: 10/cdbfb4a01197f91337630fa83fe5fcf4cfe5e0d1535d98db186e7ef05d93c966cbef7348bd7a630ff9e9ea07dfb25c952355d51e9d0e58814694b181e7120d79 - languageName: node - linkType: hard - -"@aws-sdk/util-user-agent-node@npm:3.470.0": - version: 3.470.0 - resolution: "@aws-sdk/util-user-agent-node@npm:3.470.0" +"@aws-sdk/util-user-agent-node@npm:3.535.0": + version: 3.535.0 + resolution: "@aws-sdk/util-user-agent-node@npm:3.535.0" dependencies: - "@aws-sdk/types": "npm:3.468.0" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" + "@aws-sdk/types": "npm:3.535.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" peerDependencies: aws-crt: ">=1.0.0" peerDependenciesMeta: aws-crt: optional: true - checksum: 10/05571ba83dcbb91273fe3b9c1c69ced301489e76f78fe299ba74c125c775912110b8721d19ebc1a9270b115797124cd97a4b9a3fbe8355eadec1138a06cbc82f + checksum: 10/29f8f4e580ebf738e4bc4ea28e942c990ca5146739e424dd33f754359354101e9239cf4e1b3329fe0f776c261075a2248ddc0feabaeaac322cfd57894c731ecb languageName: node linkType: hard @@ -1987,6 +1531,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:^1.6.0": + version: 1.6.0 + resolution: "@colors/colors@npm:1.6.0" + checksum: 10/66d00284a3a9a21e5e853b256942e17edbb295f4bd7b9aa7ef06bbb603568d5173eb41b0f64c1e51748bc29d382a23a67d99956e57e7431c64e47e74324182d9 + languageName: node + linkType: hard + "@cspotcode/source-map-support@npm:^0.8.0": version: 0.8.1 resolution: "@cspotcode/source-map-support@npm:0.8.1" @@ -2025,9 +1576,9 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.2": - version: 2.1.2 - resolution: "@eslint/eslintrc@npm:2.1.2" +"@eslint/eslintrc@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/eslintrc@npm:2.1.4" dependencies: ajv: "npm:^6.12.4" debug: "npm:^4.3.2" @@ -2038,14 +1589,14 @@ __metadata: js-yaml: "npm:^4.1.0" minimatch: "npm:^3.1.2" strip-json-comments: "npm:^3.1.1" - checksum: 10/fa25638f2666cac6810f98ee7d0f4b912f191806467c1b40d72bac759fffef0b3357f12a1869817286837b258e4de3517e0c7408520e156ca860fc53a1fbaed9 + checksum: 10/7a3b14f4b40fc1a22624c3f84d9f467a3d9ea1ca6e9a372116cb92507e485260359465b58e25bcb6c9981b155416b98c9973ad9b796053fd7b3f776a6946bce8 languageName: node linkType: hard -"@eslint/js@npm:8.50.0": - version: 8.50.0 - resolution: "@eslint/js@npm:8.50.0" - checksum: 10/1600a84ea1635cb46ae9f9cbc7c4cb054e54b8032707531b3b812d6096e46c54c449e8ecec7eb99725c3aa6da1ebbd4a60ca4fda925200395d5839ded09a0da8 +"@eslint/js@npm:8.57.0": + version: 8.57.0 + resolution: "@eslint/js@npm:8.57.0" + checksum: 10/3c501ce8a997cf6cbbaf4ed358af5492875e3550c19b9621413b82caa9ae5382c584b0efa79835639e6e0ddaa568caf3499318e5bdab68643ef4199dce5eb0a0 languageName: node linkType: hard @@ -2574,7 +2125,7 @@ __metadata: languageName: node linkType: hard -"@hathor/wallet-lib@npm:^0.39.0": +"@hathor/wallet-lib@npm:0.39.0": version: 0.39.0 resolution: "@hathor/wallet-lib@npm:0.39.0" dependencies: @@ -2590,14 +2141,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.11": - version: 0.11.11 - resolution: "@humanwhocodes/config-array@npm:0.11.11" +"@humanwhocodes/config-array@npm:^0.11.14": + version: 0.11.14 + resolution: "@humanwhocodes/config-array@npm:0.11.14" dependencies: - "@humanwhocodes/object-schema": "npm:^1.2.1" - debug: "npm:^4.1.1" + "@humanwhocodes/object-schema": "npm:^2.0.2" + debug: "npm:^4.3.1" minimatch: "npm:^3.0.5" - checksum: 10/4aad64bc4c68ec99a72c91ad9a8a9070e8da47e8fc4f51eefa2eaf56f4b0cae17dfc3ff82eb9268298f687b5bb3b68669ff542203c77bcd400dc27924d56cad6 + checksum: 10/3ffb24ecdfab64014a230e127118d50a1a04d11080cbb748bc21629393d100850496456bbcb4e8c438957fe0934430d731042f1264d6a167b62d32fc2863580a languageName: node linkType: hard @@ -2608,10 +2159,10 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^1.2.1": - version: 1.2.1 - resolution: "@humanwhocodes/object-schema@npm:1.2.1" - checksum: 10/b48a8f87fcd5fdc4ac60a31a8bf710d19cc64556050575e6a35a4a48a8543cf8cde1598a65640ff2cdfbfd165b38f9db4fa3782bea7848eb585cc3db824002e6 +"@humanwhocodes/object-schema@npm:^2.0.2": + version: 2.0.2 + resolution: "@humanwhocodes/object-schema@npm:2.0.2" + checksum: 10/ef915e3e2f34652f3d383b28a9a99cfea476fa991482370889ab14aac8ecd2b38d47cc21932526c6d949da0daf4a4a6bf629d30f41b0caca25e146819cbfa70e languageName: node linkType: hard @@ -3158,6 +2709,13 @@ __metadata: languageName: node linkType: hard +"@scure/base@npm:^1.1.1": + version: 1.1.6 + resolution: "@scure/base@npm:1.1.6" + checksum: 10/814fd1cce24f1e152751fabca2853d26aaa96ff8a9349c43d9aebc3b3d8ca88dd902966e1c289590a37f35d4c4436c6aedb1b386924b2909072045af4c3e9fe4 + languageName: node + linkType: hard + "@serverless/dashboard-plugin@npm:^7.0.2": version: 7.0.5 resolution: "@serverless/dashboard-plugin@npm:7.0.5" @@ -3328,23 +2886,13 @@ __metadata: languageName: node linkType: hard -"@smithy/abort-controller@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/abort-controller@npm:2.0.14" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/ec0334438bcbcdbeee0c1005b95ca10f79f8e03f145ac854183cba1963cba368380d3dfd44eca208a7c6cd627597edea1dafbc99e269e29201a61dec08aa6987 - languageName: node - linkType: hard - -"@smithy/abort-controller@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/abort-controller@npm:2.0.15" +"@smithy/abort-controller@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/abort-controller@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/c2ee2d57cfe58515f8a228f72ad2aa033db294fa13295078b836de9839f512e681245720f6130f66c13b314b3dff0f8b0886758e5117250511d66c41af07125f + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/dd4f1496a06d69fa3e1e430c432b2ee455422680ba4f9e217cbaf6a4dfb8f5bb0c3886db09e234839db94cb89db93b1c7c15a999f3320f656a0004d3c4f77d06 languageName: node linkType: hard @@ -3361,44 +2909,32 @@ __metadata: languageName: node linkType: hard -"@smithy/config-resolver@npm:^2.0.18, @smithy/config-resolver@npm:^2.0.19": - version: 2.0.19 - resolution: "@smithy/config-resolver@npm:2.0.19" +"@smithy/config-resolver@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/config-resolver@npm:2.2.0" dependencies: - "@smithy/node-config-provider": "npm:^2.1.6" - "@smithy/types": "npm:^2.6.0" - "@smithy/util-config-provider": "npm:^2.0.0" - "@smithy/util-middleware": "npm:^2.0.7" - tslib: "npm:^2.5.0" - checksum: 10/c2d7dc945df3a3d8e4e14e371bdb4653b75d3c481e680cc559ae15ef3464d7c44a35de936a982726c4cc04a87d918e5af5ef9efe10115f9d3fff112aee604222 + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-config-provider": "npm:^2.3.0" + "@smithy/util-middleware": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/a2dc144434af649845f68c862185fdf162b8161bf196887f667b67742a456a678424189193110beea13d1916fb64931b69d6632b4c3a1888e9c6adf58416c937 languageName: node linkType: hard -"@smithy/config-resolver@npm:^2.0.21": - version: 2.0.21 - resolution: "@smithy/config-resolver@npm:2.0.21" +"@smithy/core@npm:^1.4.0": + version: 1.4.0 + resolution: "@smithy/core@npm:1.4.0" dependencies: - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-config-provider": "npm:^2.0.0" - "@smithy/util-middleware": "npm:^2.0.8" - tslib: "npm:^2.5.0" - checksum: 10/21c1a8eb4ee5d22f98713a41c16bdfe40e5f9c7cd0a5eb4442ee18f87afb405a4b845ee76fd794ce61060e993fa24522b46554dfc225a287dfa44b3dc7374f0c - languageName: node - linkType: hard - -"@smithy/core@npm:^1.1.0": - version: 1.1.0 - resolution: "@smithy/core@npm:1.1.0" - dependencies: - "@smithy/middleware-endpoint": "npm:^2.2.3" - "@smithy/middleware-retry": "npm:^2.0.24" - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/293aa1fc614a677e3de3eceb29dafff2ee469efe698f939c37d0b8067ec85c112f49be6a5e305617d572852d50a2daced933c0e42be1c9f327823d6fd1470c32 + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-retry": "npm:^2.2.0" + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-middleware": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/c8851f7347b98e09c55200fbfb634e96f6f8eff70989410eebd88965d96096b197bbf5779df938e746fc2f63e947eb6e24a17d2f36ce2dd9b799e5f16d464c31 languageName: node linkType: hard @@ -3415,29 +2951,16 @@ __metadata: languageName: node linkType: hard -"@smithy/credential-provider-imds@npm:^2.1.2": - version: 2.1.2 - resolution: "@smithy/credential-provider-imds@npm:2.1.2" +"@smithy/credential-provider-imds@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/credential-provider-imds@npm:2.3.0" dependencies: - "@smithy/node-config-provider": "npm:^2.1.6" - "@smithy/property-provider": "npm:^2.0.15" - "@smithy/types": "npm:^2.6.0" - "@smithy/url-parser": "npm:^2.0.14" - tslib: "npm:^2.5.0" - checksum: 10/632d023515bb436e80d6d82268dadf1cb86721e086d027bcf33fa7cfefa2f4bcae8aa7171f6ad07bab7e0476f74e05c5b381bccaf759da25c9ec8406802d06cb - languageName: node - linkType: hard - -"@smithy/credential-provider-imds@npm:^2.1.4": - version: 2.1.4 - resolution: "@smithy/credential-provider-imds@npm:2.1.4" - dependencies: - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/property-provider": "npm:^2.0.16" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - tslib: "npm:^2.5.0" - checksum: 10/4311eae8ba86563b7ba7c1f45a7c75f94b82c8b527a336af9631391c383666329273d5c9e0c9e2b62eeb10253b048003b293dc88ae038f878995b5a85c2e2c69 + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/a14bda4cc66f4e638aca83b77d1fc45c75ba6a8516655488269f095c8e035097d79c8d107e74fc61275a75abe0d62bf280f9a4d1f6b395b4972c47b98cd4e569 languageName: node linkType: hard @@ -3453,49 +2976,15 @@ __metadata: languageName: node linkType: hard -"@smithy/eventstream-codec@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/eventstream-codec@npm:2.0.14" - dependencies: - "@aws-crypto/crc32": "npm:3.0.0" - "@smithy/types": "npm:^2.6.0" - "@smithy/util-hex-encoding": "npm:^2.0.0" - tslib: "npm:^2.5.0" - checksum: 10/a124898d3138ac43bdd65af5fef5eba4e7270e9d1d93602ea4101e3648b6d3f56ed348e759772c007f0b253c542a01e5161cdbe3d4414d82abef5daf4fe5bed3 - languageName: node - linkType: hard - -"@smithy/eventstream-codec@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/eventstream-codec@npm:2.0.15" +"@smithy/eventstream-codec@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/eventstream-codec@npm:2.2.0" dependencies: "@aws-crypto/crc32": "npm:3.0.0" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-hex-encoding": "npm:^2.0.0" - tslib: "npm:^2.5.0" - checksum: 10/feed4eeb80d636d0d9654eefa269e51e10b1afcc696ad81e144acc7dd30d3123793d05a36949c9454d64fd43414a6e1a720b689c917d2ec0c8e19d417ae78ede - languageName: node - linkType: hard - -"@smithy/eventstream-serde-browser@npm:^2.0.13": - version: 2.0.14 - resolution: "@smithy/eventstream-serde-browser@npm:2.0.14" - dependencies: - "@smithy/eventstream-serde-universal": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/e7caaf6ad57c646329a0b9f061ae0a623f09f3818154bf495b3bf8be5c375e5c93e2a0a1b4f8bb421212ffe28a63c20f2bc13d35e5700146f6c81a8b4f9b30f1 - languageName: node - linkType: hard - -"@smithy/eventstream-serde-browser@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/eventstream-serde-browser@npm:2.0.15" - dependencies: - "@smithy/eventstream-serde-universal": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/8bae1d59247ffb1b20a308a944e34f95b7725eedc45d8d4f5cce6d3e732cd94a889933057f4ceb7b0e9bd64afd3384febe71a6a9d25452aa9eaa6858b0072a13 + "@smithy/types": "npm:^2.12.0" + "@smithy/util-hex-encoding": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/c258d9df82c574416c40795481e4accd4ccf65f065944114a8a336758ad21bd5190ba69f48e57a3cd0e4aa67af35fa4b960b58475890a64d483799739bab0a23 languageName: node linkType: hard @@ -3510,23 +2999,14 @@ __metadata: languageName: node linkType: hard -"@smithy/eventstream-serde-config-resolver@npm:^2.0.13": - version: 2.0.14 - resolution: "@smithy/eventstream-serde-config-resolver@npm:2.0.14" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/47540c64f5d847736419e086eee9ead42ea42d262e8f6565b859e7d5bd7e1416cef1bc7c489cd6d8ee781017d5cd0d66c6a42b54521f3846e26fa1374ebec5ca - languageName: node - linkType: hard - -"@smithy/eventstream-serde-config-resolver@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/eventstream-serde-config-resolver@npm:2.0.15" +"@smithy/eventstream-serde-browser@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/eventstream-serde-browser@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/d8124edd4aefac89e2c5286d6c88d997214cc20c0739c0c0167a8122cabdd72ba80c052c3f4893e10f2ec7a517cc97c2e77885f2caba09e5bb711a0bd03630ba + "@smithy/eventstream-serde-universal": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/5eb7f24c813dc7d7efd9fd1498159a67767a96f85d971126daa5dc1e1d9170f1de7ddd5325b8f442a943f875a4d0e64c0ded63c5bbeb5810eb3cdaa5f7117113 languageName: node linkType: hard @@ -3540,25 +3020,13 @@ __metadata: languageName: node linkType: hard -"@smithy/eventstream-serde-node@npm:^2.0.13": - version: 2.0.14 - resolution: "@smithy/eventstream-serde-node@npm:2.0.14" - dependencies: - "@smithy/eventstream-serde-universal": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/cdd3d44296377422a4e61a54a795fde5d7675f068c00b2199c2a28245ae89ec39b9171419873427549a423f1ba20139f7572d2945a93d18dac14743bdbb15dea - languageName: node - linkType: hard - -"@smithy/eventstream-serde-node@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/eventstream-serde-node@npm:2.0.15" +"@smithy/eventstream-serde-config-resolver@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/eventstream-serde-config-resolver@npm:2.2.0" dependencies: - "@smithy/eventstream-serde-universal": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/7f1bec1d952089f9629cd73e3161c24bbd4f8a781001ae40e10b557152cb944a898ad3f46228b41366f1e46a190eb8d9fea8ea9cb1fb93e19a182b374f9f1839 + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/4006101f3a66eb3e1ac779f9b77c731ce3396b0124626b5e8f98cb327e558c65144ecb34f79dba71f7a3bcbde7f394eddd7a13a49992e6443157732d416d9c7f languageName: node linkType: hard @@ -3573,6 +3041,17 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-node@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/eventstream-serde-node@npm:2.2.0" + dependencies: + "@smithy/eventstream-serde-universal": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/5f297d9f9b0a1322d251f751e4f0d19d0d3e3a5cfec14e44a4c0ed7a087f73020d3683e5c7abedf3b8e1bee313e3dc2c955e733ac27c236cd10e07c37cab8312 + languageName: node + linkType: hard + "@smithy/eventstream-serde-universal@npm:^2.0.10": version: 2.0.10 resolution: "@smithy/eventstream-serde-universal@npm:2.0.10" @@ -3584,25 +3063,14 @@ __metadata: languageName: node linkType: hard -"@smithy/eventstream-serde-universal@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/eventstream-serde-universal@npm:2.0.14" - dependencies: - "@smithy/eventstream-codec": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/e4f90a7caf6604e62955a6524082eb25e94d9c1514f0cea9474cf9b33f252ec4d3d48a50cfeac75399a99a492b21f671b24ae5abb4935b0aa2c849a789139031 - languageName: node - linkType: hard - -"@smithy/eventstream-serde-universal@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/eventstream-serde-universal@npm:2.0.15" +"@smithy/eventstream-serde-universal@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/eventstream-serde-universal@npm:2.2.0" dependencies: - "@smithy/eventstream-codec": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/40f330bbdc3a5e4b372324bbe97c75e4d7e6cfcf530b6a022015da659c95881260d6e871cbdd19e1d5a80af62ef4ef509cba5f75f18e3e8b941d7e2e431ace3b + "@smithy/eventstream-codec": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/9c4b2959b588f9a74272bfa48721bbcb23954aa51c2a3450b029fa41d393da0db77278a08e644a524044483b397688ce08b36b49a112f259cf8d62523985df5d languageName: node linkType: hard @@ -3619,53 +3087,16 @@ __metadata: languageName: node linkType: hard -"@smithy/fetch-http-handler@npm:^2.2.6, @smithy/fetch-http-handler@npm:^2.2.7": - version: 2.2.7 - resolution: "@smithy/fetch-http-handler@npm:2.2.7" - dependencies: - "@smithy/protocol-http": "npm:^3.0.10" - "@smithy/querystring-builder": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - "@smithy/util-base64": "npm:^2.0.1" - tslib: "npm:^2.5.0" - checksum: 10/73f868d456d7b5aa7a116f35d13e45bf93f0936ec10dac48cce04d866130f3335cf545eb0d16a4c248aa48d6f5b7a1ba5666ba912d6a8f0295c2cd37d1ec3196 - languageName: node - linkType: hard - -"@smithy/fetch-http-handler@npm:^2.3.1": - version: 2.3.1 - resolution: "@smithy/fetch-http-handler@npm:2.3.1" - dependencies: - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/querystring-builder": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-base64": "npm:^2.0.1" - tslib: "npm:^2.5.0" - checksum: 10/a0b50b2f4ed03018d132b8c3d57493c9ff46711d961fc2c05b66274a1749e4ddc15a2d589515aa7019c67f33dbcc388113c2860e818dea827342750c6dc7d70d - languageName: node - linkType: hard - -"@smithy/hash-node@npm:^2.0.15": - version: 2.0.16 - resolution: "@smithy/hash-node@npm:2.0.16" - dependencies: - "@smithy/types": "npm:^2.6.0" - "@smithy/util-buffer-from": "npm:^2.0.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/740e0794d20a9553095c705a307bfe8fa384519b98e2df515b5b0873752913e33845620a541ba299a9cdd7fd9fad588a6573f801aa86a4644408fd086da7cc07 - languageName: node - linkType: hard - -"@smithy/hash-node@npm:^2.0.17": - version: 2.0.17 - resolution: "@smithy/hash-node@npm:2.0.17" +"@smithy/fetch-http-handler@npm:^2.5.0": + version: 2.5.0 + resolution: "@smithy/fetch-http-handler@npm:2.5.0" dependencies: - "@smithy/types": "npm:^2.7.0" - "@smithy/util-buffer-from": "npm:^2.0.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/7b6923a2f2b7eb461facc5112568f6645265ddc8503be7c49586fb44c283d08f27c362f3f828c1d0ec052953ce9d20149f5b0ce399cbb4da7d09dc7c55a2f2dd + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/querystring-builder": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-base64": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/83283b298e05d14c35b3bd9a0f14a2f402e477ed6e28c027ea866df3187f1721464d00b7f7c1fe97bf6bdcc4dbac32f97d69a56dc602f0946e8d13f1dc364b35 languageName: node linkType: hard @@ -3681,23 +3112,15 @@ __metadata: languageName: node linkType: hard -"@smithy/invalid-dependency@npm:^2.0.13": - version: 2.0.14 - resolution: "@smithy/invalid-dependency@npm:2.0.14" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/cdb7f4de939ef7bb5a666fa47fb6d65bb4684855a4d97056a0457697e0caf276b735f6409df90b96d9b51560aca7ba45bf08cc3288fb23619179c4ab3ba7c1b0 - languageName: node - linkType: hard - -"@smithy/invalid-dependency@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/invalid-dependency@npm:2.0.15" +"@smithy/hash-node@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/hash-node@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/3bfc6a221b7dfd58b2acb93a40928fb7e240379406fea3d12b34fb924b7158b18849028c32bafa7df04405a2d4be65179f63d31cf0003058a55f136b5e2860e8 + "@smithy/types": "npm:^2.12.0" + "@smithy/util-buffer-from": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/d39c4e37bd5af8153671c0738c8db9ed64569457e2c8f80e40ac2e355b718c33e85bab8c7f54f1a3474f43bec88a53e3d4a238cebf23a13a19db7b8ec6106f71 languageName: node linkType: hard @@ -3711,6 +3134,16 @@ __metadata: languageName: node linkType: hard +"@smithy/invalid-dependency@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/invalid-dependency@npm:2.2.0" + dependencies: + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/2ef41cc2093eeff3541c7af4ee3dd173aed3982fb1c1f58fa70657fa944e661107e21d1275bb63d0914699a2e7357a0f53c884cf1155e6b5992f72ffe9077113 + languageName: node + linkType: hard + "@smithy/is-array-buffer@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/is-array-buffer@npm:2.0.0" @@ -3720,25 +3153,23 @@ __metadata: languageName: node linkType: hard -"@smithy/md5-js@npm:^2.0.15": - version: 2.0.16 - resolution: "@smithy/md5-js@npm:2.0.16" +"@smithy/is-array-buffer@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/is-array-buffer@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.6.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/fb37d9dc48b486660f48059e745c74d8f3a9e400e3520e7cc78ffb3f46b517227157455a008ea09a60319d5ea7072133ebd2e570bb020f0361f1a190887b82c8 + tslib: "npm:^2.6.2" + checksum: 10/d366743ecc7a9fc3bad21dbb3950d213c12bdd4aeb62b1265bf6cbe38309df547664ef3e51ab732e704485194f15e89d361943b0bfbe3fe1a4b3178b942913cc languageName: node linkType: hard -"@smithy/md5-js@npm:^2.0.17": - version: 2.0.17 - resolution: "@smithy/md5-js@npm:2.0.17" +"@smithy/md5-js@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/md5-js@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/289d0bee75233145a4c713a9e6bf70c2259c81e7abb5cf48815b4db8205120376c6fb12d3776d970b1813f55dc2e099a8a670cf2522bf21018071bb731edd81d + "@smithy/types": "npm:^2.12.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/433abbd079770f8cc8749de15b321711cd5e7b73c43467dc1ae8e6091882430f588d39e9bcc935748637d33694a184f1ddec408d8c607ad7dbdb51d5f233652a languageName: node linkType: hard @@ -3753,25 +3184,14 @@ __metadata: languageName: node linkType: hard -"@smithy/middleware-content-length@npm:^2.0.15": - version: 2.0.16 - resolution: "@smithy/middleware-content-length@npm:2.0.16" - dependencies: - "@smithy/protocol-http": "npm:^3.0.10" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/32db634c119907f4ed3b27b4ad26cde1affb20d5d7dd09af450c82419c23b652c248222aab5de3dbc5ecd10dda1fc27844dba88f77ff7d5be75287d69fdcd3f7 - languageName: node - linkType: hard - -"@smithy/middleware-content-length@npm:^2.0.17": - version: 2.0.17 - resolution: "@smithy/middleware-content-length@npm:2.0.17" +"@smithy/middleware-content-length@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/middleware-content-length@npm:2.2.0" dependencies: - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/77f6b93299ca3e484a5e18f835ed6b00d8a898facf8576c7566743218b3ce0e197297912156ae2b8ba87ba9bfabdd8c5b66eaa66f8fb2ead4045e39309159a6e + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/0df67d3531a5f421d3e4c11ad8065393cdf316a6c12277867456402cd86c377cf4ad078530f083a3c713be2bd281e9c610156129734dd9ef7ed7594e8e15c658 languageName: node linkType: hard @@ -3788,33 +3208,18 @@ __metadata: languageName: node linkType: hard -"@smithy/middleware-endpoint@npm:^2.2.0": - version: 2.2.1 - resolution: "@smithy/middleware-endpoint@npm:2.2.1" - dependencies: - "@smithy/middleware-serde": "npm:^2.0.14" - "@smithy/node-config-provider": "npm:^2.1.6" - "@smithy/shared-ini-file-loader": "npm:^2.2.5" - "@smithy/types": "npm:^2.6.0" - "@smithy/url-parser": "npm:^2.0.14" - "@smithy/util-middleware": "npm:^2.0.7" - tslib: "npm:^2.5.0" - checksum: 10/2ed4d12be8c7c846e7f68f8421bb74daf43632d1276ca09d5215d8bf9033c54df7b59cfd0390a9c3e630fac9ddb456baa28f531a197eb753cad54e6b7795b5ca - languageName: node - linkType: hard - -"@smithy/middleware-endpoint@npm:^2.2.3": - version: 2.2.3 - resolution: "@smithy/middleware-endpoint@npm:2.2.3" - dependencies: - "@smithy/middleware-serde": "npm:^2.0.15" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/shared-ini-file-loader": "npm:^2.2.7" - "@smithy/types": "npm:^2.7.0" - "@smithy/url-parser": "npm:^2.0.15" - "@smithy/util-middleware": "npm:^2.0.8" - tslib: "npm:^2.5.0" - checksum: 10/392204943143e5d692e1dc28b81371f26acc781fa34c96e0380703fe760724cfac4b2370394c377e40d56aa9e74965a48653ec8814527f73cb442e3e82ed2fd6 +"@smithy/middleware-endpoint@npm:^2.5.0": + version: 2.5.0 + resolution: "@smithy/middleware-endpoint@npm:2.5.0" + dependencies: + "@smithy/middleware-serde": "npm:^2.3.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/url-parser": "npm:^2.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/9d4ea6335671d97a58d245b5497bddbee7b44c45de49e930e9ab2685bf0e57029a5d76f61cf4390f1d336231459ef562f90d80e988ce3b272bf33aa394fcf29a languageName: node linkType: hard @@ -3834,36 +3239,20 @@ __metadata: languageName: node linkType: hard -"@smithy/middleware-retry@npm:^2.0.20": - version: 2.0.21 - resolution: "@smithy/middleware-retry@npm:2.0.21" - dependencies: - "@smithy/node-config-provider": "npm:^2.1.6" - "@smithy/protocol-http": "npm:^3.0.10" - "@smithy/service-error-classification": "npm:^2.0.7" - "@smithy/types": "npm:^2.6.0" - "@smithy/util-middleware": "npm:^2.0.7" - "@smithy/util-retry": "npm:^2.0.7" - tslib: "npm:^2.5.0" - uuid: "npm:^8.3.2" - checksum: 10/61de5f151315c26919f117d019f1a971f78365ee7d3de1c0b32425b4962f04199521df771037790e4026c550aceed77041430cc247ec0e05e9c14bb24ae4d4ea - languageName: node - linkType: hard - -"@smithy/middleware-retry@npm:^2.0.24": - version: 2.0.24 - resolution: "@smithy/middleware-retry@npm:2.0.24" - dependencies: - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/service-error-classification": "npm:^2.0.8" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-middleware": "npm:^2.0.8" - "@smithy/util-retry": "npm:^2.0.8" - tslib: "npm:^2.5.0" +"@smithy/middleware-retry@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/middleware-retry@npm:2.2.0" + dependencies: + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/service-error-classification": "npm:^2.1.5" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-retry": "npm:^2.2.0" + tslib: "npm:^2.6.2" uuid: "npm:^8.3.2" - checksum: 10/7627caec01d37169892f4d13dbc4dcfd8b6a9e7d49c5d9bb4b770ebd9c90c7a71faf12b6461c6a9b154a54dba22656e3cf150710c5c58d54602de2bb14f9d3a8 + checksum: 10/ee534e2c5abd6838f3f30f1b71539bac3bcff21235aea6e5b9c01116e82a662b1e6cb1d04f9345b76f2c1a03766a049918cbb7f219346b61bd2af009263b9438 languageName: node linkType: hard @@ -3877,23 +3266,13 @@ __metadata: languageName: node linkType: hard -"@smithy/middleware-serde@npm:^2.0.13, @smithy/middleware-serde@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/middleware-serde@npm:2.0.14" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/6343405b1844aaa01ebb254bdddfec37b617d28bcac09dfaf80940410f767cd4a79784609e4522e459e2e1e5db2c52a2e5b0547f7d7b2831b63324db2f519586 - languageName: node - linkType: hard - -"@smithy/middleware-serde@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/middleware-serde@npm:2.0.15" +"@smithy/middleware-serde@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/middleware-serde@npm:2.3.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/7c1a4a027422fde89c2a55463a44266020efe72e278414ff50281715db8ff7a0229ead1c1c75634a5b722a0b40468d489acb59c3ff19004591b74b6b21d8792b + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/dfd9c35ccf2a8d11a041d028689627763823e60cd47b3bd94c1da3b578c475f7f251557b6bc6524730a701ba7338682537de480af6337bea2cfdca01ca8a80f3 languageName: node linkType: hard @@ -3907,23 +3286,13 @@ __metadata: languageName: node linkType: hard -"@smithy/middleware-stack@npm:^2.0.7, @smithy/middleware-stack@npm:^2.0.8": - version: 2.0.8 - resolution: "@smithy/middleware-stack@npm:2.0.8" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/55ad4d0513eb635a8983b3ae3fdd75dee527ac9975b1bb9cca2276f52f8f3ffcac723dcf0a4373ed4938879581ccb0df769ea9210708374e73b0797d3904f480 - languageName: node - linkType: hard - -"@smithy/middleware-stack@npm:^2.0.9": - version: 2.0.9 - resolution: "@smithy/middleware-stack@npm:2.0.9" +"@smithy/middleware-stack@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/middleware-stack@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/f61cc4ba71760424a63528f84f57d8ee71314a945d72f6fbe685308f08da817e8023b98c06c352b747684205668a73afe4d03bcb12013f5a254399850f88e01c + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/b45e13242212ecfbb618af35063946caa53d8954ec730de2dbd42b2a9ecac11fe7f3cd58ef6e1202425fbd5e0b2088f45bd8e30253523b146a78f04062a820e1 languageName: node linkType: hard @@ -3939,40 +3308,15 @@ __metadata: languageName: node linkType: hard -"@smithy/node-config-provider@npm:^2.1.5, @smithy/node-config-provider@npm:^2.1.6": - version: 2.1.6 - resolution: "@smithy/node-config-provider@npm:2.1.6" - dependencies: - "@smithy/property-provider": "npm:^2.0.15" - "@smithy/shared-ini-file-loader": "npm:^2.2.5" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/01d69eba3f1ce86cc1e9951fe344da43546612c8e1c981ee0f42b551b30a0b7ff435d9653d74dde42be331fba3f7a9f5afedbb62f800a32725151377f6957b7d - languageName: node - linkType: hard - -"@smithy/node-config-provider@npm:^2.1.8": - version: 2.1.8 - resolution: "@smithy/node-config-provider@npm:2.1.8" - dependencies: - "@smithy/property-provider": "npm:^2.0.16" - "@smithy/shared-ini-file-loader": "npm:^2.2.7" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/938203fb0b3166c8334c4e74bc9153f707b392f1cf93a8397f4ba07736b5cb339d05115aa3efa6afc7bb015cbd0e76bd7ea7a13d35dd3cc643ac969e9ef4d893 - languageName: node - linkType: hard - -"@smithy/node-http-handler@npm:^2.1.10, @smithy/node-http-handler@npm:^2.1.9": - version: 2.1.10 - resolution: "@smithy/node-http-handler@npm:2.1.10" +"@smithy/node-config-provider@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/node-config-provider@npm:2.3.0" dependencies: - "@smithy/abort-controller": "npm:^2.0.14" - "@smithy/protocol-http": "npm:^3.0.10" - "@smithy/querystring-builder": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/22af345a37cdba4973d496654bd32ab01f5ec176d312b50e0ae44a27c4857b18729f3acc2517ecc78925f28592b05ae104963d963bb1517bb4bcec30bd0e0d4e + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/shared-ini-file-loader": "npm:^2.4.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/1add1b70f2be8b84f9814da6a998bdde603b68627d961b26daf9845552d7c485fce3e5b663479e718c89440c66f3ceea607adbcde38a844c90fbba164cc53c1e languageName: node linkType: hard @@ -3989,16 +3333,16 @@ __metadata: languageName: node linkType: hard -"@smithy/node-http-handler@npm:^2.2.1": - version: 2.2.1 - resolution: "@smithy/node-http-handler@npm:2.2.1" +"@smithy/node-http-handler@npm:^2.5.0": + version: 2.5.0 + resolution: "@smithy/node-http-handler@npm:2.5.0" dependencies: - "@smithy/abort-controller": "npm:^2.0.15" - "@smithy/protocol-http": "npm:^3.0.11" - "@smithy/querystring-builder": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/1df37d998e9ca5b5e99a6ee20185eb1e55b104acf2f96ab1bd1007906e049e13dc8ae8cef36a6379d9d296440c7110349dce7fef11a341eb2704f0c24524c5d6 + "@smithy/abort-controller": "npm:^2.2.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/querystring-builder": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/0ed937770ec766699d21f6e5b3560e44a666461fa2b44da75598d2c02ab9c0f22b4b251917e942e4bdc132882c193be49030d565a7dc722139ce145d9d162adf languageName: node linkType: hard @@ -4012,43 +3356,13 @@ __metadata: languageName: node linkType: hard -"@smithy/property-provider@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/property-provider@npm:2.0.15" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/672e7730ca541a95d74e1a698790aea7c5c64994eff941e7b932f6dd60a66aa8fa8e594f00710df94d9f8b4f34882f2ddaf93e349ef01d6bb30fe39d7ccfb38a - languageName: node - linkType: hard - -"@smithy/property-provider@npm:^2.0.16": - version: 2.0.16 - resolution: "@smithy/property-provider@npm:2.0.16" - dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/62984f913b7ba77d41fa4ffec354c45d2bb3eb9df209edfddf9b4ea6aec29c745ab79418960ae2a3f109291ffb1279746a05929692b76df23c1fc5569a5837e4 - languageName: node - linkType: hard - -"@smithy/protocol-http@npm:^3.0.10, @smithy/protocol-http@npm:^3.0.9": - version: 3.0.10 - resolution: "@smithy/protocol-http@npm:3.0.10" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/8efbdad96105fd0c29abfd2396f0b1e9e08747b1275a8e147e0bbcdffdd95b6deb06ac8354bca9ba9c0b82a0bbb5b98b16331e0c5f87d069c515b04126c5c12f - languageName: node - linkType: hard - -"@smithy/protocol-http@npm:^3.0.11": - version: 3.0.11 - resolution: "@smithy/protocol-http@npm:3.0.11" +"@smithy/property-provider@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/property-provider@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/7d56eaaf9f712e3af0d2607b9e24bf36a4e8fd369737b6401c329278319e5e91394170bfcf82ec77c3fb672f6dec943cba377ebdaf085fd3d3e0c1ae6cc54d08 + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/191ddc92aa3c38fda0d95d11559823ea90436fdbb3f51fbd20eb57a63268663eed233b7bace507dd4d52a9798a52cacc8fbcd636a04f4a79816a05dd140cb997 languageName: node linkType: hard @@ -4062,6 +3376,16 @@ __metadata: languageName: node linkType: hard +"@smithy/protocol-http@npm:^3.3.0": + version: 3.3.0 + resolution: "@smithy/protocol-http@npm:3.3.0" + dependencies: + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/4fc882004f6aafac3a6c9110aa264e34db5421893bac046f9ee6683726c9aae49288cf776caadac0b82f2303add353f41d1a194e2cb22acc4f237722198abeb5 + languageName: node + linkType: hard + "@smithy/querystring-builder@npm:^2.0.10": version: 2.0.10 resolution: "@smithy/querystring-builder@npm:2.0.10" @@ -4073,25 +3397,14 @@ __metadata: languageName: node linkType: hard -"@smithy/querystring-builder@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/querystring-builder@npm:2.0.14" - dependencies: - "@smithy/types": "npm:^2.6.0" - "@smithy/util-uri-escape": "npm:^2.0.0" - tslib: "npm:^2.5.0" - checksum: 10/7ee2ac4ea48a75a3e63af90bd3b8b3f508bae3b257a0037ba6e767e19b60536558cc0ee5a54761b413ada64b0c970fc01b063b8c2d22275a85a4572498a88798 - languageName: node - linkType: hard - -"@smithy/querystring-builder@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/querystring-builder@npm:2.0.15" +"@smithy/querystring-builder@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/querystring-builder@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - "@smithy/util-uri-escape": "npm:^2.0.0" - tslib: "npm:^2.5.0" - checksum: 10/63cd0e29a4ed536b47954f7f641bc08f62266173f1385806c142bec80237e4727ce4bfbba6a5d48302d2f705c4e639fe4503da380989fc701181b7035623c82e + "@smithy/types": "npm:^2.12.0" + "@smithy/util-uri-escape": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/d69b3313f0464bf3e8efaa28f94e7b14f594ea913d31f7795b8fc378ad3a2bcfeb6657fa815b9ac800ce113647aabb3ef8412bab13671db41c5139f3cd5784a8 languageName: node linkType: hard @@ -4105,23 +3418,13 @@ __metadata: languageName: node linkType: hard -"@smithy/querystring-parser@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/querystring-parser@npm:2.0.14" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/19c3633ebc852b7ebfe28bfae4438b7f1d3e6bc998fd2c08ff99662f3127e5784905240395833202ed59051bf80505c78d93f34a3945f382d30847dee55cb449 - languageName: node - linkType: hard - -"@smithy/querystring-parser@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/querystring-parser@npm:2.0.15" +"@smithy/querystring-parser@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/querystring-parser@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/846eee7e7abf366d41bacaf948a38d57ebf641e47bfb8aa15c37fbec6c187d376b0d83d3ec29510b714ec490b76f7c4974eeb5ce5790adb88b5ad4dc107fea53 + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/4e9b14f1e0c2761bd761057a5b38526c7301c6a9b3f6410ff5d5b7a0b72944521dd6d50d6322f3f36ae51dc5768d83cde2df32e56882d6b6560501d9a2617a93 languageName: node linkType: hard @@ -4134,21 +3437,12 @@ __metadata: languageName: node linkType: hard -"@smithy/service-error-classification@npm:^2.0.7": - version: 2.0.7 - resolution: "@smithy/service-error-classification@npm:2.0.7" - dependencies: - "@smithy/types": "npm:^2.6.0" - checksum: 10/930c63fc88c6cc97a28dd13ae2d4a4bac41b2d6d61a84b99ab9005cccff665b126c264912d0a0250e3f3d9e152061b34df3323159f0bad7b47055dffd476bc06 - languageName: node - linkType: hard - -"@smithy/service-error-classification@npm:^2.0.8": - version: 2.0.8 - resolution: "@smithy/service-error-classification@npm:2.0.8" +"@smithy/service-error-classification@npm:^2.1.5": + version: 2.1.5 + resolution: "@smithy/service-error-classification@npm:2.1.5" dependencies: - "@smithy/types": "npm:^2.7.0" - checksum: 10/5193c8e820446793b339b885b43a3fd9e7a4ba5d2cb6ff6f4ae62a997519b669ba9b9983f146532a72fbdfb741be34754678f5fd68a4534c83741d3a069bd00a + "@smithy/types": "npm:^2.12.0" + checksum: 10/189af1ea4bcc24e4ed6bb6a221da2995a5da26db41a271dc360b7e86c52511d8ed5d7abc64027f8d523c0c2a45bf45c7fb05ecec2c3b05ca23d9a559607475d6 languageName: node linkType: hard @@ -4162,23 +3456,13 @@ __metadata: languageName: node linkType: hard -"@smithy/shared-ini-file-loader@npm:^2.2.5": - version: 2.2.5 - resolution: "@smithy/shared-ini-file-loader@npm:2.2.5" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/6dfc2d7146da7be5570c08709e4065d428573068d5863b7ddd481b6574c7e18e19ecfad8a0e01780c84bb1bdff38a1de56d7eff68b7a8c9797702c405aedceb9 - languageName: node - linkType: hard - -"@smithy/shared-ini-file-loader@npm:^2.2.7": - version: 2.2.7 - resolution: "@smithy/shared-ini-file-loader@npm:2.2.7" +"@smithy/shared-ini-file-loader@npm:^2.4.0": + version: 2.4.0 + resolution: "@smithy/shared-ini-file-loader@npm:2.4.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/014dd77366168f225488b78e85fb0a5ee73d3a5f0996fad96f4be88b8b87642be0370964634f1098a3393305f9aa84cfc6ae4946c26076d56ecc279373fbe636 + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/63bc0ce07840100cd19d276636dac6b9261f3feabce647fae16c1fe82dbfe817e9de9603be3f8df9ac43334cce2be6ddaf1795c3e188a37971742d0a19531e33 languageName: node linkType: hard @@ -4198,27 +3482,19 @@ __metadata: languageName: node linkType: hard -"@smithy/smithy-client@npm:^2.1.15, @smithy/smithy-client@npm:^2.1.16": - version: 2.1.16 - resolution: "@smithy/smithy-client@npm:2.1.16" - dependencies: - "@smithy/middleware-stack": "npm:^2.0.8" - "@smithy/types": "npm:^2.6.0" - "@smithy/util-stream": "npm:^2.0.21" - tslib: "npm:^2.5.0" - checksum: 10/daca467424bb742d64e077cb33cb9874c59aa11fa66d0e502aa6a453c85d7b1104056e388891fd4e954f832ff2bb14b267307e168ee974c92e1290fced49dcff - languageName: node - linkType: hard - -"@smithy/smithy-client@npm:^2.1.18": - version: 2.1.18 - resolution: "@smithy/smithy-client@npm:2.1.18" +"@smithy/signature-v4@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/signature-v4@npm:2.2.0" dependencies: - "@smithy/middleware-stack": "npm:^2.0.9" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-stream": "npm:^2.0.23" - tslib: "npm:^2.5.0" - checksum: 10/b34182367401e586bc0cb0f17aaba6d16955eb0e58abdbe578b5df0f4539bd0ffe17adef7cec52ec6e43cd4dce237daa77930b30deaa48b5ac298e767a412113 + "@smithy/eventstream-codec": "npm:^2.2.0" + "@smithy/is-array-buffer": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-hex-encoding": "npm:^2.2.0" + "@smithy/util-middleware": "npm:^2.2.0" + "@smithy/util-uri-escape": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/c1d356c73d7641a9f5636e0598fcc5a7e4a06d2a464a39f1cb0a9104b8f0166291e37ee1afd158c7815d933a01d6a2ba5b08090f055d177094ac8690a58bbd93 languageName: node linkType: hard @@ -4234,30 +3510,35 @@ __metadata: languageName: node linkType: hard -"@smithy/types@npm:^2.3.3, @smithy/types@npm:^2.3.4": - version: 2.3.4 - resolution: "@smithy/types@npm:2.3.4" +"@smithy/smithy-client@npm:^2.5.0": + version: 2.5.0 + resolution: "@smithy/smithy-client@npm:2.5.0" dependencies: - tslib: "npm:^2.5.0" - checksum: 10/8a5ad3b47e6318215786bc61787e1ff7a11b002c9d27b4af2d307edbfa522d21097b2a6bd7f83657736f6c646a61e03cd2d1be3c3f8f7353860e976e64323584 + "@smithy/middleware-endpoint": "npm:^2.5.0" + "@smithy/middleware-stack": "npm:^2.2.0" + "@smithy/protocol-http": "npm:^3.3.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-stream": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/ea12f139b6967d477b42b0af634861f1d4040cdeeef2cfea87c213845e202db63231a2a967048e799c756f5f84bb292cfbe90df2cec338c287d1324cff4e79f9 languageName: node linkType: hard -"@smithy/types@npm:^2.5.0, @smithy/types@npm:^2.6.0": - version: 2.6.0 - resolution: "@smithy/types@npm:2.6.0" +"@smithy/types@npm:^2.12.0": + version: 2.12.0 + resolution: "@smithy/types@npm:2.12.0" dependencies: - tslib: "npm:^2.5.0" - checksum: 10/15e147838ab1997ef1a795b844f67e307c66fd8337d5ef9e17787a58b6a04ec0bd064b91f3fba5406f525e4205ca23ceb6c19aa7673777abcb3f6263b4e39b29 + tslib: "npm:^2.6.2" + checksum: 10/2fb459b10d0c51d10da92e9d4b1551c1312dfb2a4739c4aeaeab703e8b35260a87ebc0c1cbb8a1deba669369ae7addab4eb81d99c70d0021b13cd26050a8c9b8 languageName: node linkType: hard -"@smithy/types@npm:^2.7.0": - version: 2.7.0 - resolution: "@smithy/types@npm:2.7.0" +"@smithy/types@npm:^2.3.3, @smithy/types@npm:^2.3.4": + version: 2.3.4 + resolution: "@smithy/types@npm:2.3.4" dependencies: tslib: "npm:^2.5.0" - checksum: 10/f2428a072b77240ebd44e3394ce723a1559e90c13ed9518b025e7c0ad589c836ab613e0f725419bfd5636d5950aaa04f9acf35f908295e1b3a7068501aae8a91 + checksum: 10/8a5ad3b47e6318215786bc61787e1ff7a11b002c9d27b4af2d307edbfa522d21097b2a6bd7f83657736f6c646a61e03cd2d1be3c3f8f7353860e976e64323584 languageName: node linkType: hard @@ -4272,25 +3553,14 @@ __metadata: languageName: node linkType: hard -"@smithy/url-parser@npm:^2.0.13, @smithy/url-parser@npm:^2.0.14": - version: 2.0.14 - resolution: "@smithy/url-parser@npm:2.0.14" - dependencies: - "@smithy/querystring-parser": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/d379bfc899dc0130f46c20a1c6c75041d4d27bebbfd0f29a4d2978b524bb21fa4471133da283bff7002f8c41a7a26d385f4f264b602b7363cdba6a8308c5bbae - languageName: node - linkType: hard - -"@smithy/url-parser@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/url-parser@npm:2.0.15" +"@smithy/url-parser@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/url-parser@npm:2.2.0" dependencies: - "@smithy/querystring-parser": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/b064650b900ecb2f0426b95df56e59d590e03fc399d0c87d4368e813fcef3a13f597c9aec03661ad31a88e27d0dc4c576e6fd7b88d503f371ef857b8eb48f0b2 + "@smithy/querystring-parser": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/85a8acd44985140fd62428927f90ba597faa3b2b3b3f9ad18333df675c669cde39d43b4c990b586cd36d7abe0b5feca9c544fda2ff3366d886a1cedcc041a5b4 languageName: node linkType: hard @@ -4304,13 +3574,14 @@ __metadata: languageName: node linkType: hard -"@smithy/util-base64@npm:^2.0.1": - version: 2.0.1 - resolution: "@smithy/util-base64@npm:2.0.1" +"@smithy/util-base64@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/util-base64@npm:2.3.0" dependencies: - "@smithy/util-buffer-from": "npm:^2.0.0" - tslib: "npm:^2.5.0" - checksum: 10/6c71765396e7c36229f78b3ab7404d86390b4191350955b3af3ca6e3e42f67428801722706153f5593571be51f3b418843c49326d894cd4445eb9ed9a04844a7 + "@smithy/util-buffer-from": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/72da04a4cc026b8f75aa983af385669f6e2f771ded7ee4a8637efd7f33a96986fa6ca070f884abe432e25354dcef4315891e9bbc6194dd7f370e6b6ee0ee20cb languageName: node linkType: hard @@ -4323,12 +3594,12 @@ __metadata: languageName: node linkType: hard -"@smithy/util-body-length-browser@npm:^2.0.1": - version: 2.0.1 - resolution: "@smithy/util-body-length-browser@npm:2.0.1" +"@smithy/util-body-length-browser@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-body-length-browser@npm:2.2.0" dependencies: - tslib: "npm:^2.5.0" - checksum: 10/fdeea18772d7d4542d0192a5cf9b145f7626b8ab76be57bd7453cb73d84480bb12f83b982467b7e4dc015434e16c9e3f7ffdffa0e4ba1c4f6e570c0425bee3d1 + tslib: "npm:^2.6.2" + checksum: 10/2b5fdceafec4fd4867645347d31ee464236945501446c34d5db0eab16316edba9b48dfa267067ed3dcd5c4349b0cca1c68d72e1921c4ad528f9479ee4311ad49 languageName: node linkType: hard @@ -4341,6 +3612,15 @@ __metadata: languageName: node linkType: hard +"@smithy/util-body-length-node@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/util-body-length-node@npm:2.3.0" + dependencies: + tslib: "npm:^2.6.2" + checksum: 10/244678838b8c926f61898ff101e3a392d9c5cea809df0589bf8fe283ff08cfe52eb090e421308ec102861f5caca7be7bae02e1a27d1a0458fdb1b613f0f72203 + languageName: node + linkType: hard + "@smithy/util-buffer-from@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/util-buffer-from@npm:2.0.0" @@ -4351,6 +3631,16 @@ __metadata: languageName: node linkType: hard +"@smithy/util-buffer-from@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-buffer-from@npm:2.2.0" + dependencies: + "@smithy/is-array-buffer": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/53253e4e351df3c4b7907dca48a0a6ceae783e98a8e73526820b122b3047a53fd127c19f4d8301f68d852011d821da519da783de57e0b22eed57c4df5b90d089 + languageName: node + linkType: hard + "@smithy/util-config-provider@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/util-config-provider@npm:2.0.0" @@ -4360,6 +3650,15 @@ __metadata: languageName: node linkType: hard +"@smithy/util-config-provider@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/util-config-provider@npm:2.3.0" + dependencies: + tslib: "npm:^2.6.2" + checksum: 10/840a76d209f9f6e04ef116905a85a9bb5d87d2382f2348b55f2c95b66bfd60eba435b8d7aa6b16d1f856a04d15ed87092f4febd480eae83093cd0db832b7ea6b + languageName: node + linkType: hard + "@smithy/util-defaults-mode-browser@npm:^2.0.10": version: 2.0.13 resolution: "@smithy/util-defaults-mode-browser@npm:2.0.13" @@ -4373,29 +3672,16 @@ __metadata: languageName: node linkType: hard -"@smithy/util-defaults-mode-browser@npm:^2.0.19": - version: 2.0.20 - resolution: "@smithy/util-defaults-mode-browser@npm:2.0.20" - dependencies: - "@smithy/property-provider": "npm:^2.0.15" - "@smithy/smithy-client": "npm:^2.1.16" - "@smithy/types": "npm:^2.6.0" - bowser: "npm:^2.11.0" - tslib: "npm:^2.5.0" - checksum: 10/43f4f7a186f1a8fb7aeb0c6dbcde4d84c00edcc5ca9700500f003da9a02a89a913bd5ef6759a9eac9a7f8ce4400cf4827ffdba957f033051e989cca2306e7ee6 - languageName: node - linkType: hard - -"@smithy/util-defaults-mode-browser@npm:^2.0.22": - version: 2.0.22 - resolution: "@smithy/util-defaults-mode-browser@npm:2.0.22" +"@smithy/util-defaults-mode-browser@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-defaults-mode-browser@npm:2.2.0" dependencies: - "@smithy/property-provider": "npm:^2.0.16" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" bowser: "npm:^2.11.0" - tslib: "npm:^2.5.0" - checksum: 10/69bb381e49f4f5ef22788d9367d0ea2a62d1a2411d8666ad2170e1d13dc45c0fa55116f1bb1a12f45abbac9c20997fe1f234afc718ae6ea584cb4ee4afded547 + tslib: "npm:^2.6.2" + checksum: 10/06def0134965de01a35ba1a814d83a464b9d752974109a306588418a643a4205a716635cd4b97a3fc80af4a74c1e82550221f6d1ebea3c8e0d7106d8647e240d languageName: node linkType: hard @@ -4414,55 +3700,29 @@ __metadata: languageName: node linkType: hard -"@smithy/util-defaults-mode-node@npm:^2.0.25": - version: 2.0.26 - resolution: "@smithy/util-defaults-mode-node@npm:2.0.26" - dependencies: - "@smithy/config-resolver": "npm:^2.0.19" - "@smithy/credential-provider-imds": "npm:^2.1.2" - "@smithy/node-config-provider": "npm:^2.1.6" - "@smithy/property-provider": "npm:^2.0.15" - "@smithy/smithy-client": "npm:^2.1.16" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/5ef44082a7ddfe9994e3ecbba169bbfbf9ba7340b766edd1c7d31ad63a5adcbcabe9d22b3e53fe4238ce6527bf6fdeb44cc9fcef7812f8e8fbacde077a078086 - languageName: node - linkType: hard - -"@smithy/util-defaults-mode-node@npm:^2.0.29": - version: 2.0.29 - resolution: "@smithy/util-defaults-mode-node@npm:2.0.29" - dependencies: - "@smithy/config-resolver": "npm:^2.0.21" - "@smithy/credential-provider-imds": "npm:^2.1.4" - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/property-provider": "npm:^2.0.16" - "@smithy/smithy-client": "npm:^2.1.18" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/fd55c71222a861d2737e347783acb712ede8af80ae538a5ca74ff75855128e7349f42843b7991de261862a1999a55df3877cc9d7bc5c258bd57f0e3443219c46 - languageName: node - linkType: hard - -"@smithy/util-endpoints@npm:^1.0.4": - version: 1.0.5 - resolution: "@smithy/util-endpoints@npm:1.0.5" +"@smithy/util-defaults-mode-node@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/util-defaults-mode-node@npm:2.3.0" dependencies: - "@smithy/node-config-provider": "npm:^2.1.6" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/65e97429d2e9e15465043a9227378555579e05a4be0d4835f82bed5a3ce795e3f51201f4f55ed3c89fa9bde250f36e858fb3cf62004294fddee54d01fe5647d8 + "@smithy/config-resolver": "npm:^2.2.0" + "@smithy/credential-provider-imds": "npm:^2.3.0" + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/property-provider": "npm:^2.2.0" + "@smithy/smithy-client": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/2dab5c7b346b128d50ef7c4e7d80d4dbe8f7ba1578bf0ae3b78ea0c6dd6c02778e8b8c71d880163f835be6cc9ee435b55d645fd0f5cae3983765990d3115079d languageName: node linkType: hard -"@smithy/util-endpoints@npm:^1.0.7": - version: 1.0.7 - resolution: "@smithy/util-endpoints@npm:1.0.7" +"@smithy/util-endpoints@npm:^1.2.0": + version: 1.2.0 + resolution: "@smithy/util-endpoints@npm:1.2.0" dependencies: - "@smithy/node-config-provider": "npm:^2.1.8" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/4ede4e47a6d1f73894825e799c9d1061f20e344ff7a36971312ed3941ab820ac9803b7133fe6540a0fa85c739bc5725f095bcf2be881df444c613e468946812d + "@smithy/node-config-provider": "npm:^2.3.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/5c175e656120bb02825d07f9ca79a6319b52027cbc492a34d8a042be85d686fc9a4ff8df8544e24594e97fb33b6516a1e5ab187d5db34c852c3f30fce76e2d2d languageName: node linkType: hard @@ -4475,6 +3735,15 @@ __metadata: languageName: node linkType: hard +"@smithy/util-hex-encoding@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-hex-encoding@npm:2.2.0" + dependencies: + tslib: "npm:^2.6.2" + checksum: 10/1c98323e5837c3c3e41169f38a87d0d69e6d0fb4482593025a00de90861ab635381093dcc35c78cffde6a448b5cd885735f049a5e39375e0431a09b491935f01 + languageName: node + linkType: hard + "@smithy/util-middleware@npm:^2.0.2, @smithy/util-middleware@npm:^2.0.3": version: 2.0.3 resolution: "@smithy/util-middleware@npm:2.0.3" @@ -4485,23 +3754,13 @@ __metadata: languageName: node linkType: hard -"@smithy/util-middleware@npm:^2.0.6, @smithy/util-middleware@npm:^2.0.7": - version: 2.0.7 - resolution: "@smithy/util-middleware@npm:2.0.7" - dependencies: - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/053ee434d72d57c5629076adc42aad4357da7aab480f70fddda2b852205c4371465da450025d9719019c8e5900ff613b82332b6b050ea841d5f49dd060e135c6 - languageName: node - linkType: hard - -"@smithy/util-middleware@npm:^2.0.8": - version: 2.0.8 - resolution: "@smithy/util-middleware@npm:2.0.8" +"@smithy/util-middleware@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-middleware@npm:2.2.0" dependencies: - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/b28342e36c301a5b2c2d7110528845e219569137c4f947614680f4fb67a5606681fd26a4c56171b814340c8d2b9b17807f34df2d60fd660c803c4d602dfe5a47 + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/c6b874de71184472c7b2ca2859322bbd7bffe05d11c68a821d2831a6c79a15d5ba22366d2fd72415f636481296dffa16a2aab7b44c2106e400858be7ea0dc464 languageName: node linkType: hard @@ -4516,25 +3775,14 @@ __metadata: languageName: node linkType: hard -"@smithy/util-retry@npm:^2.0.6, @smithy/util-retry@npm:^2.0.7": - version: 2.0.7 - resolution: "@smithy/util-retry@npm:2.0.7" - dependencies: - "@smithy/service-error-classification": "npm:^2.0.7" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/6ee41e84d4b87f4bdbf7ee45666387b13723230b3a1c3b86f51988e0ca878fa89c068f6c12640d52e85a8c825565ebf658620ba9a158d61fb4a2d698ecb0c2d8 - languageName: node - linkType: hard - -"@smithy/util-retry@npm:^2.0.8": - version: 2.0.8 - resolution: "@smithy/util-retry@npm:2.0.8" +"@smithy/util-retry@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-retry@npm:2.2.0" dependencies: - "@smithy/service-error-classification": "npm:^2.0.8" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/fdcfc20d8a9290adfd6ebd30a6d0dcda849ba9fad9f53dcca34564ae7e871dcd97da66b739571809835ee375946a4bcc0d42cde2e98762e4829bde077d529e28 + "@smithy/service-error-classification": "npm:^2.1.5" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/c55522ee8ef528c29db21d70dd8d0a5db04a5a06a437f5e55f8deea907533a4f78df93e6c22e1071116fde5efde13524459c5566830d4f8ee6e140da7ffba44b languageName: node linkType: hard @@ -4554,35 +3802,19 @@ __metadata: languageName: node linkType: hard -"@smithy/util-stream@npm:^2.0.20, @smithy/util-stream@npm:^2.0.21": - version: 2.0.21 - resolution: "@smithy/util-stream@npm:2.0.21" - dependencies: - "@smithy/fetch-http-handler": "npm:^2.2.7" - "@smithy/node-http-handler": "npm:^2.1.10" - "@smithy/types": "npm:^2.6.0" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-buffer-from": "npm:^2.0.0" - "@smithy/util-hex-encoding": "npm:^2.0.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/69fe2403f1d32fd7aa9a5a71f0638b31e5aed870c5fa0b15dbf6fabb11e068e9a6c5bc85629a40b5822e521355de57e76ebee022db947120670ea96f65990cee - languageName: node - linkType: hard - -"@smithy/util-stream@npm:^2.0.23": - version: 2.0.23 - resolution: "@smithy/util-stream@npm:2.0.23" +"@smithy/util-stream@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-stream@npm:2.2.0" dependencies: - "@smithy/fetch-http-handler": "npm:^2.3.1" - "@smithy/node-http-handler": "npm:^2.2.1" - "@smithy/types": "npm:^2.7.0" - "@smithy/util-base64": "npm:^2.0.1" - "@smithy/util-buffer-from": "npm:^2.0.0" - "@smithy/util-hex-encoding": "npm:^2.0.0" - "@smithy/util-utf8": "npm:^2.0.2" - tslib: "npm:^2.5.0" - checksum: 10/4dacaded6d5834fda89cc5f5348e97988fb38724461e3fa70b44b7fbfa44eb91f015914bcb98c60174b4a82666851ca8df14fe0e6bcf5c63af1e65074144e5fe + "@smithy/fetch-http-handler": "npm:^2.5.0" + "@smithy/node-http-handler": "npm:^2.5.0" + "@smithy/types": "npm:^2.12.0" + "@smithy/util-base64": "npm:^2.3.0" + "@smithy/util-buffer-from": "npm:^2.2.0" + "@smithy/util-hex-encoding": "npm:^2.2.0" + "@smithy/util-utf8": "npm:^2.3.0" + tslib: "npm:^2.6.2" + checksum: 10/deab9955e47833577dae9efa057feaed822d5f7dd813ad9fd5a6e332ca9c92079c8cac6e1e6e1c254495a5df0c2756ef7498f5e7e0a783b51609a384c971a7f2 languageName: node linkType: hard @@ -4595,45 +3827,32 @@ __metadata: languageName: node linkType: hard -"@smithy/util-utf8@npm:^2.0.0": - version: 2.0.0 - resolution: "@smithy/util-utf8@npm:2.0.0" +"@smithy/util-uri-escape@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-uri-escape@npm:2.2.0" dependencies: - "@smithy/util-buffer-from": "npm:^2.0.0" - tslib: "npm:^2.5.0" - checksum: 10/43c924be7883287937d91a1f042196b1e7f9400e9114759c2ac5b4fedb6756063faf2e684b153a96573b0039b745c196968ce53ae9f38a2aeb690ad0c3c27ea8 + tslib: "npm:^2.6.2" + checksum: 10/ffb93944865b2966ce101da2d484d149dc6e2a51cdecdb3b3bc3e632f936058234f3806038bef4cbc5baf762a7f09184c488ea814594492e56c68afabbb2522b languageName: node linkType: hard -"@smithy/util-utf8@npm:^2.0.2": - version: 2.0.2 - resolution: "@smithy/util-utf8@npm:2.0.2" +"@smithy/util-utf8@npm:^2.0.0": + version: 2.0.0 + resolution: "@smithy/util-utf8@npm:2.0.0" dependencies: "@smithy/util-buffer-from": "npm:^2.0.0" tslib: "npm:^2.5.0" - checksum: 10/9356200ac7ccef414cd924b4fd2bfeb1d0a2e7992b4c924f0328205ab9bb8c688bc4b5c271c237db90ea75fb448f32c1f76c6e8883c2f088ea0559737ea99d9d - languageName: node - linkType: hard - -"@smithy/util-waiter@npm:^2.0.13": - version: 2.0.14 - resolution: "@smithy/util-waiter@npm:2.0.14" - dependencies: - "@smithy/abort-controller": "npm:^2.0.14" - "@smithy/types": "npm:^2.6.0" - tslib: "npm:^2.5.0" - checksum: 10/782143eb2c622787bea4ef485b872fc4726d3aee83150607bb726a717de920833645ae5ecc58edd8d7101f6c6a5632e23272d5892eca9a93d53dcb9a72b1dccd + checksum: 10/43c924be7883287937d91a1f042196b1e7f9400e9114759c2ac5b4fedb6756063faf2e684b153a96573b0039b745c196968ce53ae9f38a2aeb690ad0c3c27ea8 languageName: node linkType: hard -"@smithy/util-waiter@npm:^2.0.15": - version: 2.0.15 - resolution: "@smithy/util-waiter@npm:2.0.15" +"@smithy/util-utf8@npm:^2.3.0": + version: 2.3.0 + resolution: "@smithy/util-utf8@npm:2.3.0" dependencies: - "@smithy/abort-controller": "npm:^2.0.15" - "@smithy/types": "npm:^2.7.0" - tslib: "npm:^2.5.0" - checksum: 10/87d0b08720461e651be0cd35784292c3bf5cfd88a64acd78185b1d2c5dcf66d5c6ea068d1416c33e276c9e4aef14fb93441f80843987ca5901716a5bd35cf271 + "@smithy/util-buffer-from": "npm:^2.2.0" + tslib: "npm:^2.6.2" + checksum: 10/c766ead8dac6bc6169f4cac1cc47ef7bd86928d06255148f9528228002f669c8cc49f78dc2b9ba5d7e214d40315024a9e32c5c9130b33e20f0fe4532acd0dff5 languageName: node linkType: hard @@ -4648,6 +3867,17 @@ __metadata: languageName: node linkType: hard +"@smithy/util-waiter@npm:^2.2.0": + version: 2.2.0 + resolution: "@smithy/util-waiter@npm:2.2.0" + dependencies: + "@smithy/abort-controller": "npm:^2.2.0" + "@smithy/types": "npm:^2.12.0" + tslib: "npm:^2.6.2" + checksum: 10/a98f99721a325717eb32eafdd6ab046c055c7f3a23455f79b92e2769e5c874bf5d1d026cabe2ec0b3545ebd0c45017b1025243920eee788d70d3bdbc205264f1 + languageName: node + linkType: hard + "@szmarczak/http-timer@npm:^4.0.5": version: 4.0.6 resolution: "@szmarczak/http-timer@npm:4.0.6" @@ -4706,6 +3936,13 @@ __metadata: languageName: node linkType: hard +"@types/aws-lambda@npm:^8.10.136": + version: 8.10.136 + resolution: "@types/aws-lambda@npm:8.10.136" + checksum: 10/df7afa66d3ee9fb3697cd81156c7f71104437d81e0bce8a16e8c6c56f176ea93c1f3cb7ed0f219936f410849b413a739c485ca8572c22fb24b46b8ecd571949a + languageName: node + linkType: hard + "@types/aws-lambda@npm:^8.10.95": version: 8.10.123 resolution: "@types/aws-lambda@npm:8.10.123" @@ -4920,6 +4157,16 @@ __metadata: languageName: node linkType: hard +"@types/jest@npm:^29.5.12": + version: 29.5.12 + resolution: "@types/jest@npm:29.5.12" + dependencies: + expect: "npm:^29.0.0" + pretty-format: "npm:^29.0.0" + checksum: 10/312e8dcf92cdd5a5847d6426f0940829bca6fe6b5a917248f3d7f7ef5d85c9ce78ef05e47d2bbabc40d41a930e0e36db2d443d2610a9e3db9062da2d5c904211 + languageName: node + linkType: hard + "@types/jest@npm:^29.5.4": version: 29.5.5 resolution: "@types/jest@npm:29.5.5" @@ -4930,13 +4177,20 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.3, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.13 resolution: "@types/json-schema@npm:7.0.13" checksum: 10/24000f93d34b3848053b8eb36bbbcfb6b465f691d61186ddac9596b6f1fb105ae84a8be63c0c0f3b6d8f7eb6f891f6cdf3c34910aefc756a1971164c4262de1a languageName: node linkType: hard +"@types/json-schema@npm:^7.0.3": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 10/1a3c3e06236e4c4aab89499c428d585527ce50c24fe8259e8b3926d3df4cfbbbcf306cfc73ddfb66cbafc973116efd15967020b0f738f63e09e64c7d260519e7 + languageName: node + linkType: hard + "@types/json5@npm:^0.0.29": version: 0.0.29 resolution: "@types/json5@npm:0.0.29" @@ -5065,6 +4319,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^20.11.30": + version: 20.11.30 + resolution: "@types/node@npm:20.11.30" + dependencies: + undici-types: "npm:~5.26.4" + checksum: 10/78515bc768d2b878e2e06a1c20eb4f5840072b79b8d28ff3dd0a7feaaf48fd3a2ac03cfa5bc7564da82db5906b43e9ba0e5df9f43d870b7aae2942306e208815 + languageName: node + linkType: hard + "@types/parse-json@npm:^4.0.0": version: 4.0.0 resolution: "@types/parse-json@npm:4.0.0" @@ -5196,14 +4459,39 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^6.7.3, @typescript-eslint/eslint-plugin@npm:^6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/eslint-plugin@npm:6.7.4" + version: 6.21.0 + resolution: "@typescript-eslint/eslint-plugin@npm:6.21.0" + dependencies: + "@eslint-community/regexpp": "npm:^4.5.1" + "@typescript-eslint/scope-manager": "npm:6.21.0" + "@typescript-eslint/type-utils": "npm:6.21.0" + "@typescript-eslint/utils": "npm:6.21.0" + "@typescript-eslint/visitor-keys": "npm:6.21.0" + debug: "npm:^4.3.4" + graphemer: "npm:^1.4.0" + ignore: "npm:^5.2.4" + natural-compare: "npm:^1.4.0" + semver: "npm:^7.5.4" + ts-api-utils: "npm:^1.0.1" + peerDependencies: + "@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/a57de0f630789330204cc1531f86cfc68b391cafb1ba67c8992133f1baa2a09d629df66e71260b040de4c9a3ff1252952037093c4128b0d56c4dbb37720b4c1d + languageName: node + linkType: hard + +"@typescript-eslint/eslint-plugin@npm:^7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/eslint-plugin@npm:7.4.0" dependencies: "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:6.7.4" - "@typescript-eslint/type-utils": "npm:6.7.4" - "@typescript-eslint/utils": "npm:6.7.4" - "@typescript-eslint/visitor-keys": "npm:6.7.4" + "@typescript-eslint/scope-manager": "npm:7.4.0" + "@typescript-eslint/type-utils": "npm:7.4.0" + "@typescript-eslint/utils": "npm:7.4.0" + "@typescript-eslint/visitor-keys": "npm:7.4.0" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" ignore: "npm:^5.2.4" @@ -5211,12 +4499,12 @@ __metadata: semver: "npm:^7.5.4" ts-api-utils: "npm:^1.0.1" peerDependencies: - "@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 + "@typescript-eslint/parser": ^7.0.0 + eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/d888cef041d0d4f804c6f37831afd5cfc93579894313de34bda1197a688f007580c6f48aa791243af59fec476d9f605e9f21e87452ade7b50df9b5d53a0160a3 + checksum: 10/9bd8852c7e4e9608c3fded94f7c60506cc7d2b6d8a8c1cad6d48969a7363751b20282874e55ccdf180635cf204cb10b3e1e5c3d1cff34d4fcd07762be3fc138e languageName: node linkType: hard @@ -5268,20 +4556,38 @@ __metadata: linkType: hard "@typescript-eslint/parser@npm:^6.7.3": - version: 6.7.4 - resolution: "@typescript-eslint/parser@npm:6.7.4" + version: 6.21.0 + resolution: "@typescript-eslint/parser@npm:6.21.0" dependencies: - "@typescript-eslint/scope-manager": "npm:6.7.4" - "@typescript-eslint/types": "npm:6.7.4" - "@typescript-eslint/typescript-estree": "npm:6.7.4" - "@typescript-eslint/visitor-keys": "npm:6.7.4" + "@typescript-eslint/scope-manager": "npm:6.21.0" + "@typescript-eslint/types": "npm:6.21.0" + "@typescript-eslint/typescript-estree": "npm:6.21.0" + "@typescript-eslint/visitor-keys": "npm:6.21.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/78284615694b4bcb54dec5079bab7e36a04f58cf7cbd005a5eaa05a1544769e41d7a47c2be651312b2f764f5612b3c11ed63799f3bb5b628d2b7720252f3572c + checksum: 10/4d51cdbc170e72275efc5ef5fce48a81ec431e4edde8374f4d0213d8d370a06823e1a61ae31d502a5f1b0d1f48fc4d29a1b1b5c2dcf809d66d3872ccf6e46ac7 + languageName: node + linkType: hard + +"@typescript-eslint/parser@npm:^7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/parser@npm:7.4.0" + dependencies: + "@typescript-eslint/scope-manager": "npm:7.4.0" + "@typescript-eslint/types": "npm:7.4.0" + "@typescript-eslint/typescript-estree": "npm:7.4.0" + "@typescript-eslint/visitor-keys": "npm:7.4.0" + debug: "npm:^4.3.4" + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/142a9e1187d305ed43b4fef659c36fa4e28359467198c986f0955c70b4067c9799f4c85d9881fbf099c55dfb265e30666e28b3ef290520e242b45ca7cb8e4ca9 languageName: node linkType: hard @@ -5295,22 +4601,32 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/scope-manager@npm:6.7.4" +"@typescript-eslint/scope-manager@npm:6.21.0": + version: 6.21.0 + resolution: "@typescript-eslint/scope-manager@npm:6.21.0" + dependencies: + "@typescript-eslint/types": "npm:6.21.0" + "@typescript-eslint/visitor-keys": "npm:6.21.0" + checksum: 10/fe91ac52ca8e09356a71dc1a2f2c326480f3cccfec6b2b6d9154c1a90651ab8ea270b07c67df5678956c3bbf0bbe7113ab68f68f21b20912ea528b1214197395 + languageName: node + linkType: hard + +"@typescript-eslint/scope-manager@npm:7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/scope-manager@npm:7.4.0" dependencies: - "@typescript-eslint/types": "npm:6.7.4" - "@typescript-eslint/visitor-keys": "npm:6.7.4" - checksum: 10/eabf3f0d18389c9c799c9f9648c9fcd1b098468979459d86267f51403ab2bb005d16b6d1278c6d54794956b4c699d41e7d8bb84e73db2b448f73797701907e9d + "@typescript-eslint/types": "npm:7.4.0" + "@typescript-eslint/visitor-keys": "npm:7.4.0" + checksum: 10/8cf9292444f9731017a707cac34bef5ae0eb33b5cd42ed07fcd046e981d97889d9201d48e02f470f2315123f53771435e10b1dc81642af28a11df5352a8e8be2 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/type-utils@npm:6.7.4" +"@typescript-eslint/type-utils@npm:6.21.0": + version: 6.21.0 + resolution: "@typescript-eslint/type-utils@npm:6.21.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:6.7.4" - "@typescript-eslint/utils": "npm:6.7.4" + "@typescript-eslint/typescript-estree": "npm:6.21.0" + "@typescript-eslint/utils": "npm:6.21.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.0.1" peerDependencies: @@ -5318,7 +4634,24 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/88778c47d912c4846645ed817e33a7c05433353954b670f6d257748361f5cf88ec6dd089e109298ec9c58a8a2cb96509ca9187b7d46bf810c1b0d61e3f475746 + checksum: 10/d03fb3ee1caa71f3ce053505f1866268d7ed79ffb7fed18623f4a1253f5b8f2ffc92636d6fd08fcbaf5bd265a6de77bf192c53105131e4724643dfc910d705fc + languageName: node + linkType: hard + +"@typescript-eslint/type-utils@npm:7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/type-utils@npm:7.4.0" + dependencies: + "@typescript-eslint/typescript-estree": "npm:7.4.0" + "@typescript-eslint/utils": "npm:7.4.0" + debug: "npm:^4.3.4" + ts-api-utils: "npm:^1.0.1" + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/a8bd0929d8237679b2b8a7817f070a4b9658ee976882fba8ff37e4a70dd33f87793e1b157771104111fe8054eaa8ad437a010b6aa465072fbdb932647125db2d languageName: node linkType: hard @@ -5336,10 +4669,17 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/types@npm:6.7.4" - checksum: 10/14aa41aefee32efe8ad469d301c2acc522e411663b912d143c327e1161242e568b8d446a72faec491b86ae44517af3ecb988823aed7b1b1bc6693ff950be4809 +"@typescript-eslint/types@npm:6.21.0": + version: 6.21.0 + resolution: "@typescript-eslint/types@npm:6.21.0" + checksum: 10/e26da86d6f36ca5b6ef6322619f8ec55aabcd7d43c840c977ae13ae2c964c3091fc92eb33730d8be08927c9de38466c5323e78bfb270a9ff1d3611fe821046c5 + languageName: node + linkType: hard + +"@typescript-eslint/types@npm:7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/types@npm:7.4.0" + checksum: 10/2782c5bf65cd3dfa9cd32bc3023676bbca22144987c3f6c6b67fd96c73d4a60b85a57458c49fd11b9971ac6531824bb3ae0664491e7a6de25d80c523c9be92b7 languageName: node linkType: hard @@ -5398,38 +4738,75 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/typescript-estree@npm:6.7.4" +"@typescript-eslint/typescript-estree@npm:6.21.0": + version: 6.21.0 + resolution: "@typescript-eslint/typescript-estree@npm:6.21.0" + dependencies: + "@typescript-eslint/types": "npm:6.21.0" + "@typescript-eslint/visitor-keys": "npm:6.21.0" + debug: "npm:^4.3.4" + globby: "npm:^11.1.0" + is-glob: "npm:^4.0.3" + minimatch: "npm:9.0.3" + semver: "npm:^7.5.4" + ts-api-utils: "npm:^1.0.1" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/b32fa35fca2a229e0f5f06793e5359ff9269f63e9705e858df95d55ca2cd7fdb5b3e75b284095a992c48c5fc46a1431a1a4b6747ede2dd08929dc1cbacc589b8 + languageName: node + linkType: hard + +"@typescript-eslint/typescript-estree@npm:7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/typescript-estree@npm:7.4.0" dependencies: - "@typescript-eslint/types": "npm:6.7.4" - "@typescript-eslint/visitor-keys": "npm:6.7.4" + "@typescript-eslint/types": "npm:7.4.0" + "@typescript-eslint/visitor-keys": "npm:7.4.0" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" + minimatch: "npm:9.0.3" semver: "npm:^7.5.4" ts-api-utils: "npm:^1.0.1" peerDependenciesMeta: typescript: optional: true - checksum: 10/3336fc8bcd141c124ab50e26a707c1ca928fa6bcb93cef4754167acbeec7022f0660e7772fc4ffa79cff139711275422449ffc9fd03c6472cf8f77e92405f82c + checksum: 10/162ec9d7582f45588342e1be36fdb60e41f50bbdfbc3035c91b517ff5d45244f776921c88d88e543e1c7d0f1e6ada5474a8316b78f1b0e6d2233b101bc45b166 languageName: node linkType: hard -"@typescript-eslint/utils@npm:6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/utils@npm:6.7.4" +"@typescript-eslint/utils@npm:6.21.0": + version: 6.21.0 + resolution: "@typescript-eslint/utils@npm:6.21.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" "@types/json-schema": "npm:^7.0.12" "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.7.4" - "@typescript-eslint/types": "npm:6.7.4" - "@typescript-eslint/typescript-estree": "npm:6.7.4" + "@typescript-eslint/scope-manager": "npm:6.21.0" + "@typescript-eslint/types": "npm:6.21.0" + "@typescript-eslint/typescript-estree": "npm:6.21.0" semver: "npm:^7.5.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 - checksum: 10/a2b9b4307385599c1b8d073e319a49a79d9b9315d642d56380385524f333dbe98325128ff6f113566ff10f3447be98b79450567060c37b013fae0b5a83c6b9cc + checksum: 10/b404a2c55a425a79d054346ae123087d30c7ecf7ed7abcf680c47bf70c1de4fabadc63434f3f460b2fa63df76bc9e4a0b9fa2383bb8a9fcd62733fb5c4e4f3e3 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/utils@npm:7.4.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@types/json-schema": "npm:^7.0.12" + "@types/semver": "npm:^7.5.0" + "@typescript-eslint/scope-manager": "npm:7.4.0" + "@typescript-eslint/types": "npm:7.4.0" + "@typescript-eslint/typescript-estree": "npm:7.4.0" + semver: "npm:^7.5.4" + peerDependencies: + eslint: ^8.56.0 + checksum: 10/ffed27e770c486cd000ff892d9049b0afe8b9d6318452a5355b78a37436cbb414bceacae413a2ac813f3e584684825d5e0baa2e6376b7ad6013a108ac91bc19d languageName: node linkType: hard @@ -5470,16 +4847,49 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:6.7.4": - version: 6.7.4 - resolution: "@typescript-eslint/visitor-keys@npm:6.7.4" +"@typescript-eslint/visitor-keys@npm:6.21.0": + version: 6.21.0 + resolution: "@typescript-eslint/visitor-keys@npm:6.21.0" + dependencies: + "@typescript-eslint/types": "npm:6.21.0" + eslint-visitor-keys: "npm:^3.4.1" + checksum: 10/30422cdc1e2ffad203df40351a031254b272f9c6f2b7e02e9bfa39e3fc2c7b1c6130333b0057412968deda17a3a68a578a78929a8139c6acef44d9d841dc72e1 + languageName: node + linkType: hard + +"@typescript-eslint/visitor-keys@npm:7.4.0": + version: 7.4.0 + resolution: "@typescript-eslint/visitor-keys@npm:7.4.0" dependencies: - "@typescript-eslint/types": "npm:6.7.4" + "@typescript-eslint/types": "npm:7.4.0" eslint-visitor-keys: "npm:^3.4.1" - checksum: 10/b9e086c04689ea2180f7cacf63fcea7e6a25bb699ae7ac78b9ed4b23633711d93e08341275e38cda8eba09697d5dcb36da493dfe0e8d4cd6aadc629dc6d4b113 + checksum: 10/70dc99f2ad116c6e2d9e55af249e4453e06bba2ceea515adef2d2e86e97e557865bb1b1d467667462443eb0d624baba36f7442fd1082f3874339bbc381c26e93 + languageName: node + linkType: hard + +"@ungap/structured-clone@npm:^1.2.0": + version: 1.2.0 + resolution: "@ungap/structured-clone@npm:1.2.0" + checksum: 10/c6fe89a505e513a7592e1438280db1c075764793a2397877ff1351721fe8792a966a5359769e30242b3cd023f2efb9e63ca2ca88019d73b564488cc20e3eab12 languageName: node linkType: hard +"@wallet-service/common@npm:1.5.0, @wallet-service/common@workspace:^, @wallet-service/common@workspace:packages/common": + version: 0.0.0-use.local + resolution: "@wallet-service/common@workspace:packages/common" + dependencies: + "@types/aws-lambda": "npm:^8.10.136" + "@types/node": "npm:^20.11.30" + jest: "npm:^29.6.4" + ts-jest: "npm:^29.1.2" + typescript: "npm:^5.4.3" + peerDependencies: + "@aws-sdk/client-lambda": 3.540.0 + "@hathor/wallet-lib": 0.39.0 + winston: ^3.13.0 + languageName: unknown + linkType: soft + "@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5": version: 1.11.6 resolution: "@webassemblyjs/ast@npm:1.11.6" @@ -5971,6 +5381,16 @@ __metadata: languageName: node linkType: hard +"array-buffer-byte-length@npm:^1.0.1": + version: 1.0.1 + resolution: "array-buffer-byte-length@npm:1.0.1" + dependencies: + call-bind: "npm:^1.0.5" + is-array-buffer: "npm:^3.0.4" + checksum: 10/53524e08f40867f6a9f35318fafe467c32e45e9c682ba67b11943e167344d2febc0f6977a17e699b05699e805c3e8f073d876f8bbf1b559ed494ad2cd0fae09e + languageName: node + linkType: hard + "array-includes@npm:^3.1.6": version: 3.1.7 resolution: "array-includes@npm:3.1.7" @@ -5984,6 +5404,20 @@ __metadata: languageName: node linkType: hard +"array-includes@npm:^3.1.7": + version: 3.1.8 + resolution: "array-includes@npm:3.1.8" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-object-atoms: "npm:^1.0.0" + get-intrinsic: "npm:^1.2.4" + is-string: "npm:^1.0.7" + checksum: 10/290b206c9451f181fb2b1f79a3bf1c0b66bb259791290ffbada760c79b284eef6f5ae2aeb4bcff450ebc9690edd25732c4c73a3c2b340fcc0f4563aed83bf488 + languageName: node + linkType: hard + "array-unflat-js@npm:^0.1.3": version: 0.1.3 resolution: "array-unflat-js@npm:0.1.3" @@ -6011,7 +5445,21 @@ __metadata: languageName: node linkType: hard -"array.prototype.flat@npm:^1.3.1": +"array.prototype.findlastindex@npm:^1.2.3": + version: 1.2.5 + resolution: "array.prototype.findlastindex@npm:1.2.5" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.0.0" + es-shim-unscopables: "npm:^1.0.2" + checksum: 10/7c5c821f357cd53ab6cc305de8086430dd8d7a2485db87b13f843e868055e9582b1fd338f02338f67fc3a1603ceaf9610dd2a470b0b506f9d18934780f95b246 + languageName: node + linkType: hard + +"array.prototype.flat@npm:^1.3.1, array.prototype.flat@npm:^1.3.2": version: 1.3.2 resolution: "array.prototype.flat@npm:1.3.2" dependencies: @@ -6023,7 +5471,7 @@ __metadata: languageName: node linkType: hard -"array.prototype.flatmap@npm:^1.3.1": +"array.prototype.flatmap@npm:^1.3.1, array.prototype.flatmap@npm:^1.3.2": version: 1.3.2 resolution: "array.prototype.flatmap@npm:1.3.2" dependencies: @@ -6050,6 +5498,22 @@ __metadata: languageName: node linkType: hard +"arraybuffer.prototype.slice@npm:^1.0.3": + version: 1.0.3 + resolution: "arraybuffer.prototype.slice@npm:1.0.3" + dependencies: + array-buffer-byte-length: "npm:^1.0.1" + call-bind: "npm:^1.0.5" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.22.3" + es-errors: "npm:^1.2.1" + get-intrinsic: "npm:^1.2.3" + is-array-buffer: "npm:^3.0.4" + is-shared-array-buffer: "npm:^1.0.2" + checksum: 10/0221f16c1e3ec7b67da870ee0e1f12b825b5f9189835392b59a22990f715827561a4f4cd5330dc7507de272d8df821be6cd4b0cb569babf5ea4be70e365a2f3d + languageName: node + linkType: hard + "arrify@npm:^2.0.0": version: 2.0.1 resolution: "arrify@npm:2.0.1" @@ -6114,6 +5578,15 @@ __metadata: languageName: node linkType: hard +"available-typed-arrays@npm:^1.0.7": + version: 1.0.7 + resolution: "available-typed-arrays@npm:1.0.7" + dependencies: + possible-typed-array-names: "npm:^1.0.0" + checksum: 10/6c9da3a66caddd83c875010a1ca8ef11eac02ba15fb592dc9418b2b5e7b77b645fa7729380a92d9835c2f05f2ca1b6251f39b993e0feb3f1517c74fa1af02cab + languageName: node + linkType: hard + "aws-lambda@npm:^1.0.7": version: 1.0.7 resolution: "aws-lambda@npm:1.0.7" @@ -6381,6 +5854,18 @@ __metadata: languageName: node linkType: hard +"bip32@npm:^4.0.0": + version: 4.0.0 + resolution: "bip32@npm:4.0.0" + dependencies: + "@noble/hashes": "npm:^1.2.0" + "@scure/base": "npm:^1.1.1" + typeforce: "npm:^1.11.5" + wif: "npm:^2.0.6" + checksum: 10/f2da719618b26e2fdec3d0bc4945cf7dc435ff93eaeebc0b6b70b8911e7a33128cf77c4c0bce45be679c5f2a96aa5128dbed329193a9f88d755ff9c90185b6a0 + languageName: node + linkType: hard + "bip66@npm:^1.1.5": version: 1.1.5 resolution: "bip66@npm:1.1.5" @@ -6390,7 +5875,7 @@ __metadata: languageName: node linkType: hard -"bitcoinjs-lib@npm:^6.0.1": +"bitcoinjs-lib@npm:^6.1.5": version: 6.1.5 resolution: "bitcoinjs-lib@npm:6.1.5" dependencies: @@ -6854,6 +6339,19 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7": + version: 1.0.7 + resolution: "call-bind@npm:1.0.7" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.4" + set-function-length: "npm:^1.2.1" + checksum: 10/cd6fe658e007af80985da5185bff7b55e12ef4c2b6f41829a26ed1eef254b1f1c12e3dfd5b2b068c6ba8b86aba62390842d81752e67dcbaec4f6f76e7113b6b7 + languageName: node + linkType: hard + "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -7482,6 +6980,39 @@ __metadata: languageName: node linkType: hard +"data-view-buffer@npm:^1.0.1": + version: 1.0.1 + resolution: "data-view-buffer@npm:1.0.1" + dependencies: + call-bind: "npm:^1.0.6" + es-errors: "npm:^1.3.0" + is-data-view: "npm:^1.0.1" + checksum: 10/5919a39a18ee919573336158fd162fdf8ada1bc23a139f28543fd45fac48e0ea4a3ad3bfde91de124d4106e65c4a7525f6a84c20ba0797ec890a77a96d13a82a + languageName: node + linkType: hard + +"data-view-byte-length@npm:^1.0.1": + version: 1.0.1 + resolution: "data-view-byte-length@npm:1.0.1" + dependencies: + call-bind: "npm:^1.0.7" + es-errors: "npm:^1.3.0" + is-data-view: "npm:^1.0.1" + checksum: 10/f33c65e58d8d0432ad79761f2e8a579818d724b5dc6dc4e700489b762d963ab30873c0f1c37d8f2ed12ef51c706d1195f64422856d25f067457aeec50cc40aac + languageName: node + linkType: hard + +"data-view-byte-offset@npm:^1.0.0": + version: 1.0.0 + resolution: "data-view-byte-offset@npm:1.0.0" + dependencies: + call-bind: "npm:^1.0.6" + es-errors: "npm:^1.3.0" + is-data-view: "npm:^1.0.1" + checksum: 10/96f34f151bf02affb7b9f98762fb7aca1dd5f4553cb57b80bce750ca609c15d33ca659568ef1d422f7e35680736cbccb893a3d4b012760c758c1446bbdc4c6db + languageName: node + linkType: hard + "dayjs@npm:^1.11.8": version: 1.11.10 resolution: "dayjs@npm:1.11.10" @@ -7489,7 +7020,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -7666,6 +7197,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.1.4": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.0.1" + checksum: 10/abdcb2505d80a53524ba871273e5da75e77e52af9e15b3aa65d8aad82b8a3a424dad7aee2cc0b71470ac7acf501e08defac362e8b6a73cdb4309f028061df4ae + languageName: node + linkType: hard + "define-lazy-prop@npm:^2.0.0": version: 2.0.0 resolution: "define-lazy-prop@npm:2.0.0" @@ -7673,7 +7215,7 @@ __metadata: languageName: node linkType: hard -"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0": +"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" dependencies: @@ -7812,6 +7354,13 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:^16.4.5": + version: 16.4.5 + resolution: "dotenv@npm:16.4.5" + checksum: 10/55a3134601115194ae0f924e54473459ed0d9fc340ae610b676e248cca45aa7c680d86365318ea964e6da4e2ea80c4514c1adab5adb43d6867fb57ff068f95c8 + languageName: node + linkType: hard + "dotenv@npm:^8.2.0": version: 8.6.0 resolution: "dotenv@npm:8.6.0" @@ -8061,6 +7610,76 @@ __metadata: languageName: node linkType: hard +"es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2": + version: 1.23.3 + resolution: "es-abstract@npm:1.23.3" + dependencies: + array-buffer-byte-length: "npm:^1.0.1" + arraybuffer.prototype.slice: "npm:^1.0.3" + available-typed-arrays: "npm:^1.0.7" + call-bind: "npm:^1.0.7" + data-view-buffer: "npm:^1.0.1" + data-view-byte-length: "npm:^1.0.1" + data-view-byte-offset: "npm:^1.0.0" + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.0.0" + es-set-tostringtag: "npm:^2.0.3" + es-to-primitive: "npm:^1.2.1" + function.prototype.name: "npm:^1.1.6" + get-intrinsic: "npm:^1.2.4" + get-symbol-description: "npm:^1.0.2" + globalthis: "npm:^1.0.3" + gopd: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.2" + has-proto: "npm:^1.0.3" + has-symbols: "npm:^1.0.3" + hasown: "npm:^2.0.2" + internal-slot: "npm:^1.0.7" + is-array-buffer: "npm:^3.0.4" + is-callable: "npm:^1.2.7" + is-data-view: "npm:^1.0.1" + is-negative-zero: "npm:^2.0.3" + is-regex: "npm:^1.1.4" + is-shared-array-buffer: "npm:^1.0.3" + is-string: "npm:^1.0.7" + is-typed-array: "npm:^1.1.13" + is-weakref: "npm:^1.0.2" + object-inspect: "npm:^1.13.1" + object-keys: "npm:^1.1.1" + object.assign: "npm:^4.1.5" + regexp.prototype.flags: "npm:^1.5.2" + safe-array-concat: "npm:^1.1.2" + safe-regex-test: "npm:^1.0.3" + string.prototype.trim: "npm:^1.2.9" + string.prototype.trimend: "npm:^1.0.8" + string.prototype.trimstart: "npm:^1.0.8" + typed-array-buffer: "npm:^1.0.2" + typed-array-byte-length: "npm:^1.0.1" + typed-array-byte-offset: "npm:^1.0.2" + typed-array-length: "npm:^1.0.6" + unbox-primitive: "npm:^1.0.2" + which-typed-array: "npm:^1.1.15" + checksum: 10/2da795a6a1ac5fc2c452799a409acc2e3692e06dc6440440b076908617188899caa562154d77263e3053bcd9389a07baa978ab10ac3b46acc399bd0c77be04cb + languageName: node + linkType: hard + +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: "npm:^1.2.4" + checksum: 10/f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 + languageName: node + linkType: hard + +"es-errors@npm:^1.2.1, es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: 10/96e65d640156f91b707517e8cdc454dd7d47c32833aa3e85d79f24f9eb7ea85f39b63e36216ef0114996581969b59fe609a94e30316b08f5f4df1d44134cf8d5 + languageName: node + linkType: hard + "es-module-lexer@npm:^1.2.1": version: 1.3.1 resolution: "es-module-lexer@npm:1.3.1" @@ -8068,6 +7687,15 @@ __metadata: languageName: node linkType: hard +"es-object-atoms@npm:^1.0.0": + version: 1.0.0 + resolution: "es-object-atoms@npm:1.0.0" + dependencies: + es-errors: "npm:^1.3.0" + checksum: 10/f8910cf477e53c0615f685c5c96210591841850871b81924fcf256bfbaa68c254457d994a4308c60d15b20805e7f61ce6abc669375e01a5349391a8c1767584f + languageName: node + linkType: hard + "es-set-tostringtag@npm:^2.0.1": version: 2.0.1 resolution: "es-set-tostringtag@npm:2.0.1" @@ -8079,6 +7707,17 @@ __metadata: languageName: node linkType: hard +"es-set-tostringtag@npm:^2.0.3": + version: 2.0.3 + resolution: "es-set-tostringtag@npm:2.0.3" + dependencies: + get-intrinsic: "npm:^1.2.4" + has-tostringtag: "npm:^1.0.2" + hasown: "npm:^2.0.1" + checksum: 10/7227fa48a41c0ce83e0377b11130d324ac797390688135b8da5c28994c0165be8b252e15cd1de41e1325e5a5412511586960213e88f9ab4a5e7d028895db5129 + languageName: node + linkType: hard + "es-shim-unscopables@npm:^1.0.0": version: 1.0.0 resolution: "es-shim-unscopables@npm:1.0.0" @@ -8088,6 +7727,15 @@ __metadata: languageName: node linkType: hard +"es-shim-unscopables@npm:^1.0.2": + version: 1.0.2 + resolution: "es-shim-unscopables@npm:1.0.2" + dependencies: + hasown: "npm:^2.0.0" + checksum: 10/6d3bf91f658a27cc7217cd32b407a0d714393a84d125ad576319b9e83a893bea165cf41270c29e9ceaa56d3cf41608945d7e2a2c31fd51c0009b0c31402b91c7 + languageName: node + linkType: hard + "es-to-primitive@npm:^1.2.1": version: 1.2.1 resolution: "es-to-primitive@npm:1.2.1" @@ -8242,7 +7890,7 @@ __metadata: languageName: node linkType: hard -"eslint-import-resolver-node@npm:^0.3.7": +"eslint-import-resolver-node@npm:^0.3.7, eslint-import-resolver-node@npm:^0.3.9": version: 0.3.9 resolution: "eslint-import-resolver-node@npm:0.3.9" dependencies: @@ -8292,6 +7940,33 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-import@npm:^2.29.1": + version: 2.29.1 + resolution: "eslint-plugin-import@npm:2.29.1" + dependencies: + array-includes: "npm:^3.1.7" + array.prototype.findlastindex: "npm:^1.2.3" + array.prototype.flat: "npm:^1.3.2" + array.prototype.flatmap: "npm:^1.3.2" + debug: "npm:^3.2.7" + doctrine: "npm:^2.1.0" + eslint-import-resolver-node: "npm:^0.3.9" + eslint-module-utils: "npm:^2.8.0" + hasown: "npm:^2.0.0" + is-core-module: "npm:^2.13.1" + is-glob: "npm:^4.0.3" + minimatch: "npm:^3.1.2" + object.fromentries: "npm:^2.0.7" + object.groupby: "npm:^1.0.1" + object.values: "npm:^1.1.7" + semver: "npm:^6.3.1" + tsconfig-paths: "npm:^3.15.0" + peerDependencies: + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + checksum: 10/5865f05c38552145423c535326ec9a7113ab2305c7614c8b896ff905cfabc859c8805cac21e979c9f6f742afa333e6f62f812eabf891a7e8f5f0b853a32593c1 + languageName: node + linkType: hard + "eslint-plugin-jest@npm:^23.13.2": version: 23.20.0 resolution: "eslint-plugin-jest@npm:23.20.0" @@ -8303,13 +7978,13 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-jest@npm:^27.4.0": - version: 27.4.2 - resolution: "eslint-plugin-jest@npm:27.4.2" +"eslint-plugin-jest@npm:^27.4.0, eslint-plugin-jest@npm:^27.9.0": + version: 27.9.0 + resolution: "eslint-plugin-jest@npm:27.9.0" dependencies: "@typescript-eslint/utils": "npm:^5.10.0" peerDependencies: - "@typescript-eslint/eslint-plugin": ^5.0.0 || ^6.0.0 + "@typescript-eslint/eslint-plugin": ^5.0.0 || ^6.0.0 || ^7.0.0 eslint: ^7.0.0 || ^8.0.0 jest: "*" peerDependenciesMeta: @@ -8317,7 +7992,7 @@ __metadata: optional: true jest: optional: true - checksum: 10/fee5d3f345fd54d5176af90285e634ae10160cddb35c4e88c6883cef43c8f63cf262661689c8e979f51daf107c3b4a81dbb019fe76e1e561d56d6a1f1f09554f + checksum: 10/bca54347280c06c56516faea76042134dd74355c2de6c23361ba0e8736ecc01c62b144eea7eda7570ea4f4ee511c583bb8dab00d7153a1bd1740eb77b0038fd4 languageName: node linkType: hard @@ -8373,17 +8048,18 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.50.0": - version: 8.50.0 - resolution: "eslint@npm:8.50.0" +"eslint@npm:^8.50.0, eslint@npm:^8.57.0": + version: 8.57.0 + resolution: "eslint@npm:8.57.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.6.1" - "@eslint/eslintrc": "npm:^2.1.2" - "@eslint/js": "npm:8.50.0" - "@humanwhocodes/config-array": "npm:^0.11.11" + "@eslint/eslintrc": "npm:^2.1.4" + "@eslint/js": "npm:8.57.0" + "@humanwhocodes/config-array": "npm:^0.11.14" "@humanwhocodes/module-importer": "npm:^1.0.1" "@nodelib/fs.walk": "npm:^1.2.8" + "@ungap/structured-clone": "npm:^1.2.0" ajv: "npm:^6.12.4" chalk: "npm:^4.0.0" cross-spawn: "npm:^7.0.2" @@ -8416,7 +8092,7 @@ __metadata: text-table: "npm:^0.2.0" bin: eslint: bin/eslint.js - checksum: 10/181f26677a80f21431e68a469470485467a5c847d14d8822c1041efc52905772816546ca4e3fc87b963b7b267d8faf960322df16a30a57044161a32199b0dcfa + checksum: 10/00496e218b23747a7a9817bf58b522276d0dc1f2e546dceb4eea49f9871574088f72f1f069a6b560ef537efa3a75261b8ef70e51ef19033da1cc4c86a755ef15 languageName: node linkType: hard @@ -9172,6 +8848,13 @@ __metadata: languageName: node linkType: hard +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 10/185e20d20f10c8d661d59aac0f3b63b31132d492e1b11fcc2a93cb2c47257ebaee7407c38513efd2b35cafdf972d9beb2ea4593c1e0f3bf8f2744836928d7454 + languageName: node + linkType: hard + "function.prototype.name@npm:^1.1.6": version: 1.1.6 resolution: "function.prototype.name@npm:1.1.6" @@ -9288,6 +8971,19 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + hasown: "npm:^2.0.0" + checksum: 10/85bbf4b234c3940edf8a41f4ecbd4e25ce78e5e6ad4e24ca2f77037d983b9ef943fd72f00f3ee97a49ec622a506b67db49c36246150377efcda1c9eb03e5f06d + languageName: node + linkType: hard + "get-package-type@npm:^0.1.0": version: 0.1.0 resolution: "get-package-type@npm:0.1.0" @@ -9345,6 +9041,17 @@ __metadata: languageName: node linkType: hard +"get-symbol-description@npm:^1.0.2": + version: 1.0.2 + resolution: "get-symbol-description@npm:1.0.2" + dependencies: + call-bind: "npm:^1.0.5" + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.4" + checksum: 10/e1cb53bc211f9dbe9691a4f97a46837a553c4e7caadd0488dc24ac694db8a390b93edd412b48dcdd0b4bbb4c595de1709effc75fc87c0839deedc6968f5bd973 + languageName: node + linkType: hard + "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -9597,6 +9304,15 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.2": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: "npm:^1.0.0" + checksum: 10/2d8c9ab8cebb572e3362f7d06139a4592105983d4317e68f7adba320fe6ddfc8874581e0971e899e633fd5f72e262830edce36d5a0bc863dad17ad20572484b2 + languageName: node + linkType: hard + "has-proto@npm:^1.0.1": version: 1.0.1 resolution: "has-proto@npm:1.0.1" @@ -9604,6 +9320,13 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.3": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: 10/0b67c2c94e3bea37db3e412e3c41f79d59259875e636ba471e94c009cdfb1fa82bf045deeffafc7dbb9c148e36cae6b467055aaa5d9fad4316e11b41e3ba551a + languageName: node + linkType: hard + "has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -9620,6 +9343,15 @@ __metadata: languageName: node linkType: hard +"has-tostringtag@npm:^1.0.2": + version: 1.0.2 + resolution: "has-tostringtag@npm:1.0.2" + dependencies: + has-symbols: "npm:^1.0.3" + checksum: 10/c74c5f5ceee3c8a5b8bc37719840dc3749f5b0306d818974141dda2471a1a2ca6c8e46b9d6ac222c5345df7a901c9b6f350b1e6d62763fec877e26609a401bfe + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -9655,14 +9387,41 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.0, hasown@npm:^2.0.1, hasown@npm:^2.0.2": + version: 2.0.2 + resolution: "hasown@npm:2.0.2" + dependencies: + function-bind: "npm:^1.1.2" + checksum: 10/7898a9c1788b2862cf0f9c345a6bec77ba4a0c0983c7f19d610c382343d4f98fa260686b225dfb1f88393a66679d2ec58ee310c1d6868c081eda7918f32cc70a + languageName: node + linkType: hard + "hathor-wallet-service@workspace:.": version: 0.0.0-use.local resolution: "hathor-wallet-service@workspace:." dependencies: - dotenv: "npm:^16.3.1" - mysql2: "npm:^3.6.1" - sequelize: "npm:^6.33.0" - sequelize-cli: "npm:^6.6.1" + "@aws-sdk/client-apigatewaymanagementapi": "npm:3.540.0" + "@aws-sdk/client-lambda": "npm:3.540.0" + "@aws-sdk/client-sqs": "npm:3.540.0" + "@hathor/wallet-lib": "npm:0.39.0" + "@types/jest": "npm:^29.5.12" + "@typescript-eslint/eslint-plugin": "npm:^7.4.0" + "@typescript-eslint/parser": "npm:^7.4.0" + "@wallet-service/common": "npm:1.5.0" + bip32: "npm:^4.0.0" + bitcoinjs-lib: "npm:^6.1.5" + bitcoinjs-message: "npm:^2.2.0" + dotenv: "npm:^16.4.5" + eslint: "npm:^8.57.0" + eslint-config-airbnb-base: "npm:^15.0.0" + eslint-plugin-import: "npm:^2.29.1" + eslint-plugin-jest: "npm:^27.9.0" + jest: "npm:^29.7.0" + mysql2: "npm:^3.9.3" + sequelize: "npm:^6.37.2" + sequelize-cli: "npm:^6.6.2" + tiny-secp256k1: "npm:^2.2.3" + winston: "npm:3.13.0" languageName: unknown linkType: soft @@ -9938,6 +9697,17 @@ __metadata: languageName: node linkType: hard +"internal-slot@npm:^1.0.7": + version: 1.0.7 + resolution: "internal-slot@npm:1.0.7" + dependencies: + es-errors: "npm:^1.3.0" + hasown: "npm:^2.0.0" + side-channel: "npm:^1.0.4" + checksum: 10/3e66720508831153ecf37d13def9f6856f9f2960989ec8a0a0476c98f887fca9eff0163127466485cb825c900c2d6fc601aa9117b7783b90ffce23a71ea5d053 + languageName: node + linkType: hard + "ip@npm:^2.0.0": version: 2.0.0 resolution: "ip@npm:2.0.0" @@ -9966,6 +9736,16 @@ __metadata: languageName: node linkType: hard +"is-array-buffer@npm:^3.0.4": + version: 3.0.4 + resolution: "is-array-buffer@npm:3.0.4" + dependencies: + call-bind: "npm:^1.0.2" + get-intrinsic: "npm:^1.2.1" + checksum: 10/34a26213d981d58b30724ef37a1e0682f4040d580fa9ff58fdfdd3cefcb2287921718c63971c1c404951e7b747c50fdc7caf6e867e951353fa71b369c04c969b + languageName: node + linkType: hard + "is-arrayish@npm:^0.2.1": version: 0.2.1 resolution: "is-arrayish@npm:0.2.1" @@ -10040,6 +9820,24 @@ __metadata: languageName: node linkType: hard +"is-core-module@npm:^2.13.1": + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" + dependencies: + hasown: "npm:^2.0.0" + checksum: 10/d53bd0cc24b0a0351fb4b206ee3908f71b9bbf1c47e9c9e14e5f06d292af1663704d2abd7e67700d6487b2b7864e0d0f6f10a1edf1892864bdffcb197d1845a2 + languageName: node + linkType: hard + +"is-data-view@npm:^1.0.1": + version: 1.0.1 + resolution: "is-data-view@npm:1.0.1" + dependencies: + is-typed-array: "npm:^1.1.13" + checksum: 10/4ba4562ac2b2ec005fefe48269d6bd0152785458cd253c746154ffb8a8ab506a29d0cfb3b74af87513843776a88e4981ae25c89457bf640a33748eab1a7216b5 + languageName: node + linkType: hard + "is-date-object@npm:^1.0.1": version: 1.0.5 resolution: "is-date-object@npm:1.0.5" @@ -10155,6 +9953,13 @@ __metadata: languageName: node linkType: hard +"is-negative-zero@npm:^2.0.3": + version: 2.0.3 + resolution: "is-negative-zero@npm:2.0.3" + checksum: 10/8fe5cffd8d4fb2ec7b49d657e1691889778d037494c6f40f4d1a524cadd658b4b53ad7b6b73a59bcb4b143ae9a3d15829af864b2c0f9d65ac1e678c4c80f17e5 + languageName: node + linkType: hard + "is-network-error@npm:^1.0.0": version: 1.0.0 resolution: "is-network-error@npm:1.0.0" @@ -10225,6 +10030,15 @@ __metadata: languageName: node linkType: hard +"is-shared-array-buffer@npm:^1.0.3": + version: 1.0.3 + resolution: "is-shared-array-buffer@npm:1.0.3" + dependencies: + call-bind: "npm:^1.0.7" + checksum: 10/bc5402900dc62b96ebb2548bf5b0a0bcfacc2db122236fe3ab3b3e3c884293a0d5eb777e73f059bcbf8dc8563bb65eae972fee0fb97e38a9ae27c8678f62bcfe + languageName: node + linkType: hard + "is-stream-ended@npm:^0.1.4": version: 0.1.4 resolution: "is-stream-ended@npm:0.1.4" @@ -10275,8 +10089,17 @@ __metadata: version: 1.1.12 resolution: "is-typed-array@npm:1.1.12" dependencies: - which-typed-array: "npm:^1.1.11" - checksum: 10/d953adfd3c41618d5e01b2a10f21817e4cdc9572772fa17211100aebb3811b6e3c2e308a0558cc87d218a30504cb90154b833013437776551bfb70606fb088ca + which-typed-array: "npm:^1.1.11" + checksum: 10/d953adfd3c41618d5e01b2a10f21817e4cdc9572772fa17211100aebb3811b6e3c2e308a0558cc87d218a30504cb90154b833013437776551bfb70606fb088ca + languageName: node + linkType: hard + +"is-typed-array@npm:^1.1.13": + version: 1.1.13 + resolution: "is-typed-array@npm:1.1.13" + dependencies: + which-typed-array: "npm:^1.1.14" + checksum: 10/f850ba08286358b9a11aee6d93d371a45e3c59b5953549ee1c1a9a55ba5c1dd1bd9952488ae194ad8f32a9cf5e79c8fa5f0cc4d78c00720aa0bbcf238b38062d languageName: node linkType: hard @@ -12036,6 +11859,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:9.0.3, minimatch@npm:^9.0.1": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10/c81b47d28153e77521877649f4bab48348d10938df9e8147a58111fe00ef89559a2938de9f6632910c4f7bf7bb5cd81191a546167e58d357f0cfb1e18cecc1c5 + languageName: node + linkType: hard + "minimatch@npm:^3.0.2, minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -12054,15 +11886,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.1": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10/c81b47d28153e77521877649f4bab48348d10938df9e8147a58111fe00ef89559a2938de9f6632910c4f7bf7bb5cd81191a546167e58d357f0cfb1e18cecc1c5 - languageName: node - linkType: hard - "minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -12238,7 +12061,7 @@ __metadata: languageName: node linkType: hard -"mysql2@npm:^3.5.2, mysql2@npm:^3.6.1": +"mysql2@npm:^3.5.2": version: 3.6.1 resolution: "mysql2@npm:3.6.1" dependencies: @@ -12254,6 +12077,22 @@ __metadata: languageName: node linkType: hard +"mysql2@npm:^3.9.3": + version: 3.9.3 + resolution: "mysql2@npm:3.9.3" + dependencies: + denque: "npm:^2.1.0" + generate-function: "npm:^2.3.1" + iconv-lite: "npm:^0.6.3" + long: "npm:^5.2.1" + lru-cache: "npm:^8.0.0" + named-placeholders: "npm:^1.1.3" + seq-queue: "npm:^0.0.5" + sqlstring: "npm:^2.3.2" + checksum: 10/3988ec668312f97e6083f6fd36f3d618c0e09925da8a8ec1c535b931514a3877ee2eb09292a642d98da623e0a3d39a585d792188f791699a17dcae6d8db0d2cd + languageName: node + linkType: hard + "mysql@npm:^2.18.1": version: 2.18.1 resolution: "mysql@npm:2.18.1" @@ -12612,6 +12451,13 @@ __metadata: languageName: node linkType: hard +"object-inspect@npm:^1.13.1": + version: 1.13.1 + resolution: "object-inspect@npm:1.13.1" + checksum: 10/92f4989ed83422d56431bc39656d4c780348eb15d397ce352ade6b7fec08f973b53744bd41b94af021901e61acaf78fcc19e65bf464ecc0df958586a672700f0 + languageName: node + linkType: hard + "object-is@npm:^1.1.5": version: 1.1.5 resolution: "object-is@npm:1.1.5" @@ -12641,7 +12487,30 @@ __metadata: languageName: node linkType: hard -"object.entries@npm:^1.1.2, object.entries@npm:^1.1.5": +"object.assign@npm:^4.1.5": + version: 4.1.5 + resolution: "object.assign@npm:4.1.5" + dependencies: + call-bind: "npm:^1.0.5" + define-properties: "npm:^1.2.1" + has-symbols: "npm:^1.0.3" + object-keys: "npm:^1.1.1" + checksum: 10/dbb22da4cda82e1658349ea62b80815f587b47131b3dd7a4ab7f84190ab31d206bbd8fe7e26ae3220c55b65725ac4529825f6142154211220302aa6b1518045d + languageName: node + linkType: hard + +"object.entries@npm:^1.1.2": + version: 1.1.8 + resolution: "object.entries@npm:1.1.8" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10/2301918fbd1ee697cf6ff7cd94f060c738c0a7d92b22fd24c7c250e9b593642c9707ad2c44d339303c1439c5967d8964251cdfc855f7f6ec55db2dd79e8dc2a7 + languageName: node + linkType: hard + +"object.entries@npm:^1.1.5": version: 1.1.7 resolution: "object.entries@npm:1.1.7" dependencies: @@ -12663,6 +12532,18 @@ __metadata: languageName: node linkType: hard +"object.fromentries@npm:^2.0.7": + version: 2.0.8 + resolution: "object.fromentries@npm:2.0.8" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-object-atoms: "npm:^1.0.0" + checksum: 10/5b2e80f7af1778b885e3d06aeb335dcc86965e39464671adb7167ab06ac3b0f5dd2e637a90d8ebd7426d69c6f135a4753ba3dd7d0fe2a7030cf718dcb910fd92 + languageName: node + linkType: hard + "object.groupby@npm:^1.0.0": version: 1.0.1 resolution: "object.groupby@npm:1.0.1" @@ -12675,6 +12556,17 @@ __metadata: languageName: node linkType: hard +"object.groupby@npm:^1.0.1": + version: 1.0.3 + resolution: "object.groupby@npm:1.0.3" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + checksum: 10/44cb86dd2c660434be65f7585c54b62f0425b0c96b5c948d2756be253ef06737da7e68d7106e35506ce4a44d16aa85a413d11c5034eb7ce5579ec28752eb42d0 + languageName: node + linkType: hard + "object.values@npm:^1.1.6": version: 1.1.7 resolution: "object.values@npm:1.1.7" @@ -12686,6 +12578,17 @@ __metadata: languageName: node linkType: hard +"object.values@npm:^1.1.7": + version: 1.2.0 + resolution: "object.values@npm:1.2.0" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10/db2e498019c354428c5dd30d02980d920ac365b155fce4dcf63eb9433f98ccf0f72624309e182ce7cc227c95e45d474e1d483418e60de2293dd23fa3ebe34903 + languageName: node + linkType: hard + "once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" @@ -13120,6 +13023,13 @@ __metadata: languageName: node linkType: hard +"possible-typed-array-names@npm:^1.0.0": + version: 1.0.0 + resolution: "possible-typed-array-names@npm:1.0.0" + checksum: 10/8ed3e96dfeea1c5880c1f4c9cb707e5fb26e8be22f14f82ef92df20fd2004e635c62ba47fbe8f2bb63bfd80dac1474be2fb39798da8c2feba2815435d1f749af + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -13527,6 +13437,18 @@ __metadata: languageName: node linkType: hard +"regexp.prototype.flags@npm:^1.5.2": + version: 1.5.2 + resolution: "regexp.prototype.flags@npm:1.5.2" + dependencies: + call-bind: "npm:^1.0.6" + define-properties: "npm:^1.2.1" + es-errors: "npm:^1.3.0" + set-function-name: "npm:^2.0.1" + checksum: 10/9fffc01da9c4e12670ff95bc5204364615fcc12d86fc30642765af908675678ebb0780883c874b2dbd184505fb52fa603d80073ecf69f461ce7f56b15d10be9c + languageName: node + linkType: hard + "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -13737,6 +13659,18 @@ __metadata: languageName: node linkType: hard +"safe-array-concat@npm:^1.1.2": + version: 1.1.2 + resolution: "safe-array-concat@npm:1.1.2" + dependencies: + call-bind: "npm:^1.0.7" + get-intrinsic: "npm:^1.2.4" + has-symbols: "npm:^1.0.3" + isarray: "npm:^2.0.5" + checksum: 10/a54f8040d7cb696a1ee38d19cc71ab3cfb654b9b81bae00c6459618cfad8214ece7e6666592f9c925aafef43d0a20c5e6fbb3413a2b618e1ce9d516a2e6dcfc5 + languageName: node + linkType: hard + "safe-buffer@npm:5.1.2, safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": version: 5.1.2 resolution: "safe-buffer@npm:5.1.2" @@ -13762,6 +13696,17 @@ __metadata: languageName: node linkType: hard +"safe-regex-test@npm:^1.0.3": + version: 1.0.3 + resolution: "safe-regex-test@npm:1.0.3" + dependencies: + call-bind: "npm:^1.0.6" + es-errors: "npm:^1.3.0" + is-regex: "npm:^1.1.4" + checksum: 10/b04de61114b10274d92e25b6de7ccb5de07f11ea15637ff636de4b5190c0f5cd8823fe586dde718504cf78055437d70fd8804976894df502fcf5a210c970afb3 + languageName: node + linkType: hard + "safe-stable-stringify@npm:^2.3.1": version: 2.4.3 resolution: "safe-stable-stringify@npm:2.4.3" @@ -13848,7 +13793,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:^7.1.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -13859,6 +13804,17 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.3.2": + version: 7.6.0 + resolution: "semver@npm:7.6.0" + dependencies: + lru-cache: "npm:^6.0.0" + bin: + semver: bin/semver.js + checksum: 10/1b41018df2d8aca5a1db4729985e8e20428c650daea60fcd16e926e9383217d00f574fab92d79612771884a98d2ee2a1973f49d630829a8d54d6570defe62535 + languageName: node + linkType: hard + "seq-queue@npm:^0.0.5": version: 0.0.5 resolution: "seq-queue@npm:0.0.5" @@ -13884,6 +13840,24 @@ __metadata: languageName: node linkType: hard +"sequelize-cli@npm:^6.6.2": + version: 6.6.2 + resolution: "sequelize-cli@npm:6.6.2" + dependencies: + cli-color: "npm:^2.0.3" + fs-extra: "npm:^9.1.0" + js-beautify: "npm:^1.14.5" + lodash: "npm:^4.17.21" + resolve: "npm:^1.22.1" + umzug: "npm:^2.3.0" + yargs: "npm:^16.2.0" + bin: + sequelize: lib/sequelize + sequelize-cli: lib/sequelize + checksum: 10/eb74375de921fb41be7d6ad707084c58f33651202c2bde80465ecb1761d7cc662b2b4ac5100629d467328c738695bd071f58feda0e352f3afac10ad2a14747ba + languageName: node + linkType: hard + "sequelize-pool@npm:^7.1.0": version: 7.1.0 resolution: "sequelize-pool@npm:7.1.0" @@ -13934,6 +13908,49 @@ __metadata: languageName: node linkType: hard +"sequelize@npm:^6.37.2": + version: 6.37.2 + resolution: "sequelize@npm:6.37.2" + dependencies: + "@types/debug": "npm:^4.1.8" + "@types/validator": "npm:^13.7.17" + debug: "npm:^4.3.4" + dottie: "npm:^2.0.6" + inflection: "npm:^1.13.4" + lodash: "npm:^4.17.21" + moment: "npm:^2.29.4" + moment-timezone: "npm:^0.5.43" + pg-connection-string: "npm:^2.6.1" + retry-as-promised: "npm:^7.0.4" + semver: "npm:^7.5.4" + sequelize-pool: "npm:^7.1.0" + toposort-class: "npm:^1.0.1" + uuid: "npm:^8.3.2" + validator: "npm:^13.9.0" + wkx: "npm:^0.5.0" + peerDependenciesMeta: + ibm_db: + optional: true + mariadb: + optional: true + mysql2: + optional: true + oracledb: + optional: true + pg: + optional: true + pg-hstore: + optional: true + snowflake-sdk: + optional: true + sqlite3: + optional: true + tedious: + optional: true + checksum: 10/425f8d5edbca3a34a5c8e68bfcc1f08a27ff5f3e12c333d0c480904404b8b5b41503c08c47fcb12c5ad6cdd463cac5a49cd1af9ce76cb09a0ce23b71145b9270 + languageName: node + linkType: hard + "serialize-javascript@npm:^6.0.1": version: 6.0.1 resolution: "serialize-javascript@npm:6.0.1" @@ -14157,6 +14174,20 @@ __metadata: languageName: node linkType: hard +"set-function-length@npm:^1.2.1": + version: 1.2.2 + resolution: "set-function-length@npm:1.2.2" + dependencies: + define-data-property: "npm:^1.1.4" + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.4" + gopd: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.2" + checksum: 10/505d62b8e088468917ca4e3f8f39d0e29f9a563b97dbebf92f4bd2c3172ccfb3c5b8e4566d5fcd00784a00433900e7cb8fbc404e2dbd8c3818ba05bb9d4a8a6d + languageName: node + linkType: hard + "set-function-name@npm:^2.0.0": version: 2.0.1 resolution: "set-function-name@npm:2.0.1" @@ -14168,6 +14199,18 @@ __metadata: languageName: node linkType: hard +"set-function-name@npm:^2.0.1": + version: 2.0.2 + resolution: "set-function-name@npm:2.0.2" + dependencies: + define-data-property: "npm:^1.1.4" + es-errors: "npm:^1.3.0" + functions-have-names: "npm:^1.2.3" + has-property-descriptors: "npm:^1.0.2" + checksum: 10/c7614154a53ebf8c0428a6c40a3b0b47dac30587c1a19703d1b75f003803f73cdfa6a93474a9ba678fa565ef5fbddc2fae79bca03b7d22ab5fd5163dbe571a74 + languageName: node + linkType: hard + "setimmediate@npm:^1.0.5": version: 1.0.5 resolution: "setimmediate@npm:1.0.5" @@ -14591,6 +14634,18 @@ __metadata: languageName: node linkType: hard +"string.prototype.trim@npm:^1.2.9": + version: 1.2.9 + resolution: "string.prototype.trim@npm:1.2.9" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.0" + es-object-atoms: "npm:^1.0.0" + checksum: 10/b2170903de6a2fb5a49bb8850052144e04b67329d49f1343cdc6a87cb24fb4e4b8ad00d3e273a399b8a3d8c32c89775d93a8f43cb42fbff303f25382079fb58a + languageName: node + linkType: hard + "string.prototype.trimend@npm:^1.0.7": version: 1.0.7 resolution: "string.prototype.trimend@npm:1.0.7" @@ -14602,6 +14657,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimend@npm:^1.0.8": + version: 1.0.8 + resolution: "string.prototype.trimend@npm:1.0.8" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10/c2e862ae724f95771da9ea17c27559d4eeced9208b9c20f69bbfcd1b9bc92375adf8af63a103194dba17c4cc4a5cb08842d929f415ff9d89c062d44689c8761b + languageName: node + linkType: hard + "string.prototype.trimstart@npm:^1.0.7": version: 1.0.7 resolution: "string.prototype.trimstart@npm:1.0.7" @@ -14613,6 +14679,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimstart@npm:^1.0.8": + version: 1.0.8 + resolution: "string.prototype.trimstart@npm:1.0.8" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10/160167dfbd68e6f7cb9f51a16074eebfce1571656fc31d40c3738ca9e30e35496f2c046fe57b6ad49f65f238a152be8c86fd9a2dd58682b5eba39dad995b3674 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -14792,9 +14869,6 @@ __metadata: version: 0.0.0-use.local resolution: "sync-daemon@workspace:packages/daemon" dependencies: - "@aws-sdk/client-lambda": "npm:^3.474.0" - "@aws-sdk/client-sqs": "npm:^3.474.0" - "@hathor/wallet-lib": "npm:^0.39.0" "@types/jest": "npm:^29.5.4" "@types/lodash": "npm:^4.14.199" "@types/mysql": "npm:^2.15.21" @@ -14802,6 +14876,7 @@ __metadata: "@types/ws": "npm:^8.5.5" "@typescript-eslint/eslint-plugin": "npm:^6.7.3" "@typescript-eslint/parser": "npm:^6.7.3" + "@wallet-service/common": "workspace:^" assert: "npm:^2.1.0" aws-sdk: "npm:^2.1454.0" axios: "npm:^1.6.2" @@ -14817,9 +14892,13 @@ __metadata: tslib: "npm:^2.1.0" typescript: "npm:^4.9.5" websocket: "npm:^1.0.33" - winston: "npm:^3.3.3" ws: "npm:^8.13.0" xstate: "npm:^4.38.2" + peerDependencies: + "@aws-sdk/client-lambda": 3.540.0 + "@aws-sdk/client-sqs": 3.540.0 + "@hathor/wallet-lib": 0.39.0 + winston: ^3.13.0 languageName: unknown linkType: soft @@ -14986,7 +15065,7 @@ __metadata: languageName: node linkType: hard -"tiny-secp256k1@npm:^2.2.1": +"tiny-secp256k1@npm:^2.2.1, tiny-secp256k1@npm:^2.2.3": version: 2.2.3 resolution: "tiny-secp256k1@npm:2.2.3" dependencies: @@ -15132,6 +15211,39 @@ __metadata: languageName: node linkType: hard +"ts-jest@npm:^29.1.2": + version: 29.1.2 + resolution: "ts-jest@npm:29.1.2" + dependencies: + bs-logger: "npm:0.x" + fast-json-stable-stringify: "npm:2.x" + jest-util: "npm:^29.0.0" + json5: "npm:^2.2.3" + lodash.memoize: "npm:4.x" + make-error: "npm:1.x" + semver: "npm:^7.5.3" + yargs-parser: "npm:^21.0.1" + peerDependencies: + "@babel/core": ">=7.0.0-beta.0 <8" + "@jest/types": ^29.0.0 + babel-jest: ^29.0.0 + jest: ^29.0.0 + typescript: ">=4.3 <6" + peerDependenciesMeta: + "@babel/core": + optional: true + "@jest/types": + optional: true + babel-jest: + optional: true + esbuild: + optional: true + bin: + ts-jest: cli.js + checksum: 10/5e40e7b933a1f3aa0d304d3c53913d1a7125fc79cd44e22b332f6e25dfe13008ddc7ac647066bb4f914d76083f7e8949f0bc156d793c30f3419f4ffd8180968b + languageName: node + linkType: hard + "ts-loader@npm:^9.4.4": version: 9.4.4 resolution: "ts-loader@npm:9.4.4" @@ -15197,6 +15309,18 @@ __metadata: languageName: node linkType: hard +"tsconfig-paths@npm:^3.15.0": + version: 3.15.0 + resolution: "tsconfig-paths@npm:3.15.0" + dependencies: + "@types/json5": "npm:^0.0.29" + json5: "npm:^1.0.2" + minimist: "npm:^1.2.6" + strip-bom: "npm:^3.0.0" + checksum: 10/2041beaedc6c271fc3bedd12e0da0cc553e65d030d4ff26044b771fac5752d0460944c0b5e680f670c2868c95c664a256cec960ae528888db6ded83524e33a14 + languageName: node + linkType: hard + "tslib@npm:^1.11.1, tslib@npm:^1.8.1": version: 1.14.1 resolution: "tslib@npm:1.14.1" @@ -15204,7 +15328,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.5.0": +"tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.5.0, tslib@npm:^2.6.2": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: 10/bd26c22d36736513980091a1e356378e8b662ded04204453d353a7f34a4c21ed0afc59b5f90719d4ba756e581a162ecbf93118dc9c6be5acf70aa309188166ca @@ -15300,6 +15424,17 @@ __metadata: languageName: node linkType: hard +"typed-array-buffer@npm:^1.0.2": + version: 1.0.2 + resolution: "typed-array-buffer@npm:1.0.2" + dependencies: + call-bind: "npm:^1.0.7" + es-errors: "npm:^1.3.0" + is-typed-array: "npm:^1.1.13" + checksum: 10/02ffc185d29c6df07968272b15d5319a1610817916ec8d4cd670ded5d1efe72901541ff2202fcc622730d8a549c76e198a2f74e312eabbfb712ed907d45cbb0b + languageName: node + linkType: hard + "typed-array-byte-length@npm:^1.0.0": version: 1.0.0 resolution: "typed-array-byte-length@npm:1.0.0" @@ -15312,6 +15447,19 @@ __metadata: languageName: node linkType: hard +"typed-array-byte-length@npm:^1.0.1": + version: 1.0.1 + resolution: "typed-array-byte-length@npm:1.0.1" + dependencies: + call-bind: "npm:^1.0.7" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-proto: "npm:^1.0.3" + is-typed-array: "npm:^1.1.13" + checksum: 10/e4a38329736fe6a73b52a09222d4a9e8de14caaa4ff6ad8e55217f6705b017d9815b7284c85065b3b8a7704e226ccff1372a72b78c2a5b6b71b7bf662308c903 + languageName: node + linkType: hard + "typed-array-byte-offset@npm:^1.0.0": version: 1.0.0 resolution: "typed-array-byte-offset@npm:1.0.0" @@ -15325,6 +15473,20 @@ __metadata: languageName: node linkType: hard +"typed-array-byte-offset@npm:^1.0.2": + version: 1.0.2 + resolution: "typed-array-byte-offset@npm:1.0.2" + dependencies: + available-typed-arrays: "npm:^1.0.7" + call-bind: "npm:^1.0.7" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-proto: "npm:^1.0.3" + is-typed-array: "npm:^1.1.13" + checksum: 10/ac26d720ebb2aacbc45e231347c359e6649f52e0cfe0e76e62005912f8030d68e4cb7b725b1754e8fdd48e433cb68df5a8620a3e420ad1457d666e8b29bf9150 + languageName: node + linkType: hard + "typed-array-length@npm:^1.0.4": version: 1.0.4 resolution: "typed-array-length@npm:1.0.4" @@ -15336,6 +15498,20 @@ __metadata: languageName: node linkType: hard +"typed-array-length@npm:^1.0.6": + version: 1.0.6 + resolution: "typed-array-length@npm:1.0.6" + dependencies: + call-bind: "npm:^1.0.7" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-proto: "npm:^1.0.3" + is-typed-array: "npm:^1.1.13" + possible-typed-array-names: "npm:^1.0.0" + checksum: 10/05e96cf4ff836743ebfc593d86133b8c30e83172cb5d16c56814d7bacfed57ce97e87ada9c4b2156d9aaa59f75cdef01c25bd9081c7826e0b869afbefc3e8c39 + languageName: node + linkType: hard + "typedarray-to-buffer@npm:^3.1.5": version: 3.1.5 resolution: "typedarray-to-buffer@npm:3.1.5" @@ -15369,6 +15545,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:^5.4.3": + version: 5.4.3 + resolution: "typescript@npm:5.4.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/de4c69f49a7ad4b1ea66a6dcc8b055ac34eb56af059a069d8988dd811c5e649be07e042e5bf573e8d0ac3ec2f30e6c999aa651cd09f6e9cbc6113749e8b6be20 + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A^4.9.3#optional!builtin, typescript@patch:typescript@npm%3A^4.9.5#optional!builtin": version: 4.9.5 resolution: "typescript@patch:typescript@npm%3A4.9.5#optional!builtin::version=4.9.5&hash=289587" @@ -15379,6 +15565,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": + version: 5.4.3 + resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=d69c25" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/3abea475798fdf7ee46e75dafc50c85f30fd1e7061559ec2af61646f23d16c91742703f04f0ac55be52f58ca05c02f77404b7b94bbad16278c9a54c9eeb4f4ea + languageName: node + linkType: hard + "uc.micro@npm:^1.0.1, uc.micro@npm:^1.0.5": version: 1.0.6 resolution: "uc.micro@npm:1.0.6" @@ -15440,6 +15636,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 10/0097779d94bc0fd26f0418b3a05472410408877279141ded2bd449167be1aed7ea5b76f756562cb3586a07f251b90799bab22d9019ceba49c037c76445f7cddd + languageName: node + linkType: hard + "uni-global@npm:^1.0.0": version: 1.0.0 resolution: "uni-global@npm:1.0.0" @@ -15673,11 +15876,10 @@ __metadata: version: 0.0.0-use.local resolution: "wallet-service@workspace:packages/wallet-service" dependencies: - "@aws-sdk/client-apigatewaymanagementapi": "npm:^3.465.0" - "@aws-sdk/client-lambda": "npm:^3.465.0" - "@aws-sdk/client-sqs": "npm:^3.465.0" + "@aws-sdk/client-apigatewaymanagementapi": "npm:3.540.0" + "@aws-sdk/client-lambda": "npm:3.540.0" + "@aws-sdk/client-sqs": "npm:3.540.0" "@hathor/healthcheck-lib": "npm:^0.1.0" - "@hathor/wallet-lib": "npm:^0.39.0" "@middy/core": "npm:^2.5.7" "@middy/http-cors": "npm:^2.5.7" "@types/aws-lambda": "npm:^8.10.95" @@ -15689,7 +15891,7 @@ __metadata: aws-lambda: "npm:^1.0.7" axios: "npm:^0.21.1" bip32: "npm:^3.0.1" - bitcoinjs-lib: "npm:^6.0.1" + bitcoinjs-lib: "npm:^6.1.5" bitcoinjs-message: "npm:^2.2.0" bitcore-lib: "npm:8.25.10" bitcore-mnemonic: "npm:8.25.10" @@ -15731,7 +15933,10 @@ __metadata: uuid: "npm:^8.3.0" webpack: "npm:^5.88.2" webpack-node-externals: "npm:^3.0.0" - winston: "npm:^3.7.2" + winston: "npm:^3.13.0" + peerDependencies: + "@hathor/wallet-lib": ^0.39.0 + "@wallet-service/common": 1.5.0 languageName: unknown linkType: soft @@ -15880,6 +16085,19 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.14, which-typed-array@npm:^1.1.15": + version: 1.1.15 + resolution: "which-typed-array@npm:1.1.15" + dependencies: + available-typed-arrays: "npm:^1.0.7" + call-bind: "npm:^1.0.7" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-tostringtag: "npm:^1.0.2" + checksum: 10/c3b6a99beadc971baa53c3ee5b749f2b9bdfa3b3b9a70650dd8511a48b61d877288b498d424712e9991d16019633086bd8b5923369460d93463c5825fa36c448 + languageName: node + linkType: hard + "which@npm:^1.2.9": version: 1.3.1 resolution: "which@npm:1.3.1" @@ -15929,22 +16147,22 @@ __metadata: languageName: node linkType: hard -"winston-transport@npm:^4.5.0": - version: 4.5.0 - resolution: "winston-transport@npm:4.5.0" +"winston-transport@npm:^4.7.0": + version: 4.7.0 + resolution: "winston-transport@npm:4.7.0" dependencies: logform: "npm:^2.3.2" readable-stream: "npm:^3.6.0" triple-beam: "npm:^1.3.0" - checksum: 10/3184b7f29fa97aac5b75ff680100656116aff8d164c09bc7459c9b7cb1ce47d02254caf96c2293791ec175c0e76e5ff59b5ed1374733e0b46248cf4f68a182fc + checksum: 10/c8eae7b110e68396edcf26aec86608bd8ac98f3cc05961064e2e577b023d9c4aa485546cacba84efaf48b7d6b1e282dc211fd959ee16cbd31d34476d96daea43 languageName: node linkType: hard -"winston@npm:^3.3.3, winston@npm:^3.7.2": - version: 3.10.0 - resolution: "winston@npm:3.10.0" +"winston@npm:3.13.0, winston@npm:^3.13.0": + version: 3.13.0 + resolution: "winston@npm:3.13.0" dependencies: - "@colors/colors": "npm:1.5.0" + "@colors/colors": "npm:^1.6.0" "@dabh/diagnostics": "npm:^2.0.2" async: "npm:^3.2.3" is-stream: "npm:^2.0.0" @@ -15954,8 +16172,8 @@ __metadata: safe-stable-stringify: "npm:^2.3.1" stack-trace: "npm:0.0.x" triple-beam: "npm:^1.3.0" - winston-transport: "npm:^4.5.0" - checksum: 10/3fe855a9b8185f5c75d485bf4b6889c0c4885e85155b6736f783b08319c201fdae11e876ef87c1d333f9a213a4f7fc413fc8c42c720fefb76c59b3abd4ff6406 + winston-transport: "npm:^4.7.0" + checksum: 10/436675598359af27e4eabde2ce578cf77da893ffd57d0479f037fef939e8eb721031f0102b14399eee93b3412b545946c431d1fff23db3beeac2ffa395537f7b languageName: node linkType: hard From 68b252be3f9e6f9e26db4543bea85b1ee28cc478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Fri, 31 May 2024 12:20:58 -0300 Subject: [PATCH 04/10] chore: using fixed yarn version (#166) --- .codebuild/buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codebuild/buildspec.yml b/.codebuild/buildspec.yml index a1d9c394..a5dbf8d7 100644 --- a/.codebuild/buildspec.yml +++ b/.codebuild/buildspec.yml @@ -174,7 +174,7 @@ phases: commands: - npm install -g yarn - corepack enable - - yarn set version stable + - yarn set version 4.1.0 - yarn install pre_build: commands: From bb20c50024b917187e81976eeeff1878366c2ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Tue, 4 Jun 2024 12:07:41 -0300 Subject: [PATCH 05/10] fix: daemon not building because of missing dependencies (#169) * chore: daemon not building because of missing dependencies * chore: better comment on yarn version * chore: eslint is now a dev dependency * chore: wallet-lib is now a peerDependency --- .dockerignore | 1 + Dockerfile | 8 +- packages/common/package.json | 5 +- packages/daemon/package.json | 12 +- packages/daemon/src/services/index.ts | 4 +- yarn.lock | 189 +++++++++++++++++++++++++- 6 files changed, 201 insertions(+), 18 deletions(-) diff --git a/.dockerignore b/.dockerignore index 43c5234c..39580c48 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,3 +9,4 @@ node_modules/ packages/daemon/dist/ packages/daemon/node_modules/ packages/wallet-service +packages/common/node_modules/ diff --git a/Dockerfile b/Dockerfile index fb630757..420b8273 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,14 @@ FROM node:20-alpine AS builder WORKDIR /app -RUN apk update && apk add python3 g++ make +RUN apk update && apk add python3 g++ make py3-setuptools COPY . . -# Use the last stable berry version: -RUN yarn set version stable +RUN corepack enable + +# Use the same version as flake's +RUN yarn set version 4.1.0 # This will install dependencies for the sync-daemon, devDependencies included: RUN yarn workspaces focus sync-daemon diff --git a/packages/common/package.json b/packages/common/package.json index 11647654..dbc95fe4 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -6,8 +6,11 @@ "test": "jest --runInBand --collectCoverage --detectOpenHandles --forceExit" }, "peerDependencies": { + "@hathor/wallet-lib": "0.39.0" + }, + "dependencies": { "@aws-sdk/client-lambda": "3.540.0", - "@hathor/wallet-lib": "0.39.0", + "@aws-sdk/client-sqs": "3.540.0", "winston": "^3.13.0" }, "devDependencies": { diff --git a/packages/daemon/package.json b/packages/daemon/package.json index 4b871e19..b397dcd7 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -34,7 +34,9 @@ "@types/ws": "^8.5.5", "@typescript-eslint/eslint-plugin": "^6.7.3", "@typescript-eslint/parser": "^6.7.3", + "eslint": "^9.3.0", "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^27.4.0", "jest": "^29.6.4", "sequelize-cli": "^6.6.1", @@ -43,13 +45,12 @@ "typescript": "^4.9.5" }, "peerDependencies": { - "@aws-sdk/client-lambda": "3.540.0", - "@aws-sdk/client-sqs": "3.540.0", - "@hathor/wallet-lib": "0.39.0", - "winston": "^3.13.0" + "@hathor/wallet-lib": "0.39.0" }, "dependencies": { - "@wallet-service/common": "workspace:^", + "@aws-sdk/client-lambda": "3.540.0", + "@aws-sdk/client-sqs": "3.540.0", + "@wallet-service/common": "1.5.0", "assert": "^2.1.0", "aws-sdk": "^2.1454.0", "axios": "^1.6.2", @@ -58,6 +59,7 @@ "mysql2": "^3.5.2", "sequelize": "^6.33.0", "websocket": "^1.0.33", + "winston": "^3.13.0", "ws": "^8.13.0", "xstate": "^4.38.2" } diff --git a/packages/daemon/src/services/index.ts b/packages/daemon/src/services/index.ts index ea462c5d..a5ea89b0 100644 --- a/packages/daemon/src/services/index.ts +++ b/packages/daemon/src/services/index.ts @@ -340,7 +340,7 @@ export const handleVertexAccepted = async (context: Context, _event: Event) => { const { length: hasAffectWallets } = Object.keys(walletBalanceMap); if (hasAffectWallets) { invokeOnTxPushNotificationRequestedLambda(walletBalanceMap) - .catch((err: Error) => logger.error('Errored on invokeOnTxPushNotificationRequestedLambda invocation', err)); + .catch((err: Error) => logger.error('Error on invokeOnTxPushNotificationRequestedLambda invocation', err)); } } } catch (e) { @@ -360,7 +360,7 @@ export const handleVertexAccepted = async (context: Context, _event: Event) => { // This process is not critical, so we run it in a fire-and-forget manner, not waiting for the promise. // In case of errors, just log the asynchronous exception and take no action on it. NftUtils.invokeNftHandlerLambda(tx.tx_id, STAGE, logger) - .catch((err) => logger.error('[ALERT] Errored on nftHandlerLambda invocation', err)); + .catch((err: unknown) => logger.error('[ALERT] Error on nftHandlerLambda invocation', err)); } } diff --git a/yarn.lock b/yarn.lock index 0851e97a..dbb1acc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1593,6 +1593,23 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^3.1.0": + version: 3.1.0 + resolution: "@eslint/eslintrc@npm:3.1.0" + dependencies: + ajv: "npm:^6.12.4" + debug: "npm:^4.3.2" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" + ignore: "npm:^5.2.0" + import-fresh: "npm:^3.2.1" + js-yaml: "npm:^4.1.0" + minimatch: "npm:^3.1.2" + strip-json-comments: "npm:^3.1.1" + checksum: 10/02bf892d1397e1029209dea685e9f4f87baf643315df2a632b5f121ec7e8548a3b34f428a007234fa82772218fa8a3ac2d10328637b9ce63b7f8344035b74db3 + languageName: node + linkType: hard + "@eslint/js@npm:8.57.0": version: 8.57.0 resolution: "@eslint/js@npm:8.57.0" @@ -1600,6 +1617,13 @@ __metadata: languageName: node linkType: hard +"@eslint/js@npm:9.3.0": + version: 9.3.0 + resolution: "@eslint/js@npm:9.3.0" + checksum: 10/3fb4b30561c34b52e7c6c6b55ea61df1cead73a525e1ccd77b1454d893dcf06f99fe9c46bf410a044ef7d3339c455bc4f75769b40c4734343f5b46d2d76b89ef + languageName: node + linkType: hard + "@fastify/busboy@npm:^1.2.1": version: 1.2.1 resolution: "@fastify/busboy@npm:1.2.1" @@ -2152,6 +2176,17 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/config-array@npm:^0.13.0": + version: 0.13.0 + resolution: "@humanwhocodes/config-array@npm:0.13.0" + dependencies: + "@humanwhocodes/object-schema": "npm:^2.0.3" + debug: "npm:^4.3.1" + minimatch: "npm:^3.0.5" + checksum: 10/524df31e61a85392a2433bf5d03164e03da26c03d009f27852e7dcfdafbc4a23f17f021dacf88e0a7a9fe04ca032017945d19b57a16e2676d9114c22a53a9d11 + languageName: node + linkType: hard + "@humanwhocodes/module-importer@npm:^1.0.1": version: 1.0.1 resolution: "@humanwhocodes/module-importer@npm:1.0.1" @@ -2166,6 +2201,20 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/object-schema@npm:^2.0.3": + version: 2.0.3 + resolution: "@humanwhocodes/object-schema@npm:2.0.3" + checksum: 10/05bb99ed06c16408a45a833f03a732f59bf6184795d4efadd33238ff8699190a8c871ad1121241bb6501589a9598dc83bf25b99dcbcf41e155cdf36e35e937a3 + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.0 + resolution: "@humanwhocodes/retry@npm:0.3.0" + checksum: 10/e574bab58680867414e225c9002e9a97eb396f85871c180fbb1a9bcdf9ded4b4de0b327f7d0c43b775873362b7c92956d4b322e8bc4b90be56077524341f04b2 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -4874,19 +4923,20 @@ __metadata: languageName: node linkType: hard -"@wallet-service/common@npm:1.5.0, @wallet-service/common@workspace:^, @wallet-service/common@workspace:packages/common": +"@wallet-service/common@npm:1.5.0, @wallet-service/common@workspace:packages/common": version: 0.0.0-use.local resolution: "@wallet-service/common@workspace:packages/common" dependencies: + "@aws-sdk/client-lambda": "npm:3.540.0" + "@aws-sdk/client-sqs": "npm:3.540.0" "@types/aws-lambda": "npm:^8.10.136" "@types/node": "npm:^20.11.30" jest: "npm:^29.6.4" ts-jest: "npm:^29.1.2" typescript: "npm:^5.4.3" + winston: "npm:^3.13.0" peerDependencies: - "@aws-sdk/client-lambda": 3.540.0 "@hathor/wallet-lib": 0.39.0 - winston: ^3.13.0 languageName: unknown linkType: soft @@ -5096,6 +5146,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.11.3": + version: 8.11.3 + resolution: "acorn@npm:8.11.3" + bin: + acorn: bin/acorn + checksum: 10/b688e7e3c64d9bfb17b596e1b35e4da9d50553713b3b3630cf5690f2b023a84eac90c56851e6912b483fe60e8b4ea28b254c07e92f17ef83d72d78745a8352dd + languageName: node + linkType: hard + "acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": version: 8.10.0 resolution: "acorn@npm:8.10.0" @@ -8025,6 +8084,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^8.0.1": + version: 8.0.1 + resolution: "eslint-scope@npm:8.0.1" + dependencies: + esrecurse: "npm:^4.3.0" + estraverse: "npm:^5.2.0" + checksum: 10/458513863d3c79005b599f40250437bddba923f18549058ea45820a8d3d4bbc67fe292751d522a0cab69dd01fe211ffde5c1a5fc867e86f2d28727b1d61610da + languageName: node + linkType: hard + "eslint-utils@npm:^2.0.0": version: 2.1.0 resolution: "eslint-utils@npm:2.1.0" @@ -8048,6 +8117,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^4.0.0": + version: 4.0.0 + resolution: "eslint-visitor-keys@npm:4.0.0" + checksum: 10/c7617166e6291a15ce2982b5c4b9cdfb6409f5c14562712d12e2584480cdf18609694b21d7dad35b02df0fa2cd037505048ded54d2f405c64f600949564eb334 + languageName: node + linkType: hard + "eslint@npm:^8.50.0, eslint@npm:^8.57.0": version: 8.57.0 resolution: "eslint@npm:8.57.0" @@ -8096,6 +8172,50 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^9.3.0": + version: 9.3.0 + resolution: "eslint@npm:9.3.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.2.0" + "@eslint-community/regexpp": "npm:^4.6.1" + "@eslint/eslintrc": "npm:^3.1.0" + "@eslint/js": "npm:9.3.0" + "@humanwhocodes/config-array": "npm:^0.13.0" + "@humanwhocodes/module-importer": "npm:^1.0.1" + "@humanwhocodes/retry": "npm:^0.3.0" + "@nodelib/fs.walk": "npm:^1.2.8" + ajv: "npm:^6.12.4" + chalk: "npm:^4.0.0" + cross-spawn: "npm:^7.0.2" + debug: "npm:^4.3.2" + escape-string-regexp: "npm:^4.0.0" + eslint-scope: "npm:^8.0.1" + eslint-visitor-keys: "npm:^4.0.0" + espree: "npm:^10.0.1" + esquery: "npm:^1.4.2" + esutils: "npm:^2.0.2" + fast-deep-equal: "npm:^3.1.3" + file-entry-cache: "npm:^8.0.0" + find-up: "npm:^5.0.0" + glob-parent: "npm:^6.0.2" + ignore: "npm:^5.2.0" + imurmurhash: "npm:^0.1.4" + is-glob: "npm:^4.0.0" + is-path-inside: "npm:^3.0.3" + json-stable-stringify-without-jsonify: "npm:^1.0.1" + levn: "npm:^0.4.1" + lodash.merge: "npm:^4.6.2" + minimatch: "npm:^3.1.2" + natural-compare: "npm:^1.4.0" + optionator: "npm:^0.9.3" + strip-ansi: "npm:^6.0.1" + text-table: "npm:^0.2.0" + bin: + eslint: bin/eslint.js + checksum: 10/c56d63bc3655ce26456cb1b6869eb16579d9b243f143374ce28e4e168ab8fd9d054700014af903b6a5445a9134108327d974ba3e75019220f62df6ce72b6f5b6 + languageName: node + linkType: hard + "esniff@npm:^1.1.0": version: 1.1.0 resolution: "esniff@npm:1.1.0" @@ -8106,6 +8226,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^10.0.1": + version: 10.0.1 + resolution: "espree@npm:10.0.1" + dependencies: + acorn: "npm:^8.11.3" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.0.0" + checksum: 10/557d6cfb4894b1489effcaed8702682086033f8a2449568933bc59493734733d750f2a87907ba575844d3933340aea2d84288f5e67020c6152f6fd18a86497b2 + languageName: node + linkType: hard + "espree@npm:^9.0.0, espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -8462,6 +8593,15 @@ __metadata: languageName: node linkType: hard +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" + dependencies: + flat-cache: "npm:^4.0.0" + checksum: 10/afe55c4de4e0d226a23c1eae62a7219aafb390859122608a89fa4df6addf55c7fd3f1a2da6f5b41e7cdff496e4cf28bbd215d53eab5c817afa96d2b40c81bfb0 + languageName: node + linkType: hard + "file-type@npm:^16.5.4": version: 16.5.4 resolution: "file-type@npm:16.5.4" @@ -8627,6 +8767,16 @@ __metadata: languageName: node linkType: hard +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" + dependencies: + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.4" + checksum: 10/58ce851d9045fffc7871ce2bd718bc485ad7e777bf748c054904b87c351ff1080c2c11da00788d78738bfb51b71e4d5ea12d13b98eb36e3358851ffe495b62dc + languageName: node + linkType: hard + "flat@npm:^5.0.2": version: 5.0.2 resolution: "flat@npm:5.0.2" @@ -8643,6 +8793,13 @@ __metadata: languageName: node linkType: hard +"flatted@npm:^3.2.9": + version: 3.3.1 + resolution: "flatted@npm:3.3.1" + checksum: 10/7b8376061d5be6e0d3658bbab8bde587647f68797cf6bfeae9dea0e5137d9f27547ab92aaff3512dd9d1299086a6d61be98e9d48a56d17531b634f77faadbc49 + languageName: node + linkType: hard + "fn.name@npm:1.x.x": version: 1.1.0 resolution: "fn.name@npm:1.1.0" @@ -9135,6 +9292,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10/03939c8af95c6df5014b137cac83aa909090c3a3985caef06ee9a5a669790877af8698ab38007e4c0186873adc14c0b13764acc754b16a754c216cc56aa5f021 + languageName: node + linkType: hard + "globalthis@npm:^1.0.3": version: 1.0.3 resolution: "globalthis@npm:1.0.3" @@ -11141,6 +11305,15 @@ __metadata: languageName: node linkType: hard +"keyv@npm:^4.5.4": + version: 4.5.4 + resolution: "keyv@npm:4.5.4" + dependencies: + json-buffer: "npm:3.0.1" + checksum: 10/167eb6ef64cc84b6fa0780ee50c9de456b422a1e18802209234f7c2cf7eae648c7741f32e50d7e24ccb22b24c13154070b01563d642755b156c357431a191e75 + languageName: node + linkType: hard + "klaw@npm:^3.0.0": version: 3.0.0 resolution: "klaw@npm:3.0.0" @@ -14869,6 +15042,8 @@ __metadata: version: 0.0.0-use.local resolution: "sync-daemon@workspace:packages/daemon" dependencies: + "@aws-sdk/client-lambda": "npm:3.540.0" + "@aws-sdk/client-sqs": "npm:3.540.0" "@types/jest": "npm:^29.5.4" "@types/lodash": "npm:^4.14.199" "@types/mysql": "npm:^2.15.21" @@ -14876,12 +15051,14 @@ __metadata: "@types/ws": "npm:^8.5.5" "@typescript-eslint/eslint-plugin": "npm:^6.7.3" "@typescript-eslint/parser": "npm:^6.7.3" - "@wallet-service/common": "workspace:^" + "@wallet-service/common": "npm:1.5.0" assert: "npm:^2.1.0" aws-sdk: "npm:^2.1454.0" axios: "npm:^1.6.2" dotenv: "npm:^8.2.0" + eslint: "npm:^9.3.0" eslint-config-airbnb-base: "npm:^15.0.0" + eslint-plugin-import: "npm:^2.29.1" eslint-plugin-jest: "npm:^27.4.0" jest: "npm:^29.6.4" lodash: "npm:^4.17.21" @@ -14892,13 +15069,11 @@ __metadata: tslib: "npm:^2.1.0" typescript: "npm:^4.9.5" websocket: "npm:^1.0.33" + winston: "npm:^3.13.0" ws: "npm:^8.13.0" xstate: "npm:^4.38.2" peerDependencies: - "@aws-sdk/client-lambda": 3.540.0 - "@aws-sdk/client-sqs": 3.540.0 "@hathor/wallet-lib": 0.39.0 - winston: ^3.13.0 languageName: unknown linkType: soft From 15ecd51d58dd5dfc01a961f64ea0005eb051d265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Tue, 4 Jun 2024 12:46:16 -0300 Subject: [PATCH 06/10] chore: bump to v1.6.0 (#167) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d82d9bb6..79bad257 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hathor-wallet-service", - "version": "1.5.0", + "version": "1.6.0", "workspaces": [ "packages/common", "packages/daemon", From b1bb95e2f424d1c58aa341df3fcfde7af4026eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Wed, 12 Jun 2024 17:11:15 -0300 Subject: [PATCH 07/10] chore: bump to v1.6.1 (#171) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79bad257..d83a9499 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hathor-wallet-service", - "version": "1.6.0", + "version": "1.6.1", "workspaces": [ "packages/common", "packages/daemon", From 7af62c2e8090c4f485e1713768dd917422df0269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Wed, 12 Jun 2024 17:14:40 -0300 Subject: [PATCH 08/10] fix: broken daemon build (#170) * chore: daemon not building because of missing dependencies * chore: eslint is now a dev dependency * chore: building common module using its own tsconfig * tests: returning original module on jest module * chore: fix mock on integration tests * tests: re-add assert env vars * chore: remove logs * chore: rebas eme * chore: added env variables on daemon config * chore: review suggestions * chore: added comment on tsconfig * tests: we don't need to mock assertEnvVariables --- .dockerignore | 3 +-- Dockerfile | 21 +++++++------------ .../__tests__/utils/alerting.utils.mock.ts | 11 +++++++--- .../common/__tests__/utils/nft.utils.test.ts | 11 +++++++++- packages/common/index.ts | 9 ++++++++ packages/common/package.json | 2 ++ packages/common/src/utils/alerting.utils.ts | 9 -------- packages/common/src/utils/index.utils.ts | 4 ++++ packages/common/src/utils/wallet.utils.ts | 1 + packages/common/tsconfig.json | 9 +++++--- packages/daemon/__tests__/db/index.test.ts | 4 ++-- .../daemon/__tests__/guards/guards.test.ts | 4 ---- .../__tests__/integration/balances.test.ts | 4 ---- .../__tests__/machines/SyncMachine.test.ts | 4 ---- .../__tests__/services/services.test.ts | 4 ---- packages/daemon/package.json | 7 ++++--- packages/daemon/src/config.ts | 2 +- packages/daemon/src/db/index.ts | 4 ++-- packages/daemon/src/services/index.ts | 4 ++-- packages/daemon/src/types/wallet.ts | 2 +- packages/daemon/src/utils/aws.ts | 2 +- packages/daemon/src/utils/wallet.ts | 2 +- packages/daemon/tsconfig.json | 6 ++++++ yarn.lock | 2 +- 24 files changed, 69 insertions(+), 62 deletions(-) create mode 100644 packages/common/index.ts diff --git a/.dockerignore b/.dockerignore index 39580c48..eafec34b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ dist/ -node_modules/ __tests__/ .git/ .github/ @@ -8,5 +7,5 @@ flake.* node_modules/ packages/daemon/dist/ packages/daemon/node_modules/ -packages/wallet-service packages/common/node_modules/ +packages/wallet-service diff --git a/Dockerfile b/Dockerfile index 420b8273..7e042a33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ # arising from the use of this software. # This software cannot be redistributed unless explicitly agreed in writing with the authors. - # Build phase FROM node:20-alpine AS builder @@ -19,19 +18,13 @@ RUN corepack enable # Use the same version as flake's RUN yarn set version 4.1.0 -# This will install dependencies for the sync-daemon, devDependencies included: -RUN yarn workspaces focus sync-daemon - -RUN yarn workspace sync-daemon build - -# This will remove all dependencies and install production deps only: -RUN yarn workspaces focus sync-daemon --production +# This will install dependencies for all packages, except for the lambdas since +# they are ignored in .dockerignore +RUN yarn install -FROM node:20-alpine - -WORKDIR /app +RUN yarn workspace sync-daemon run build -COPY --from=builder /app/packages/daemon/dist . -COPY --from=builder /app/packages/daemon/node_modules ./node_modules +# This will remove all dev dependencies and install production deps only +RUN yarn workspaces focus -A --production -CMD ["node", "index.js"] +CMD ["yarn", "workspace", "sync-daemon", "run", "start"] diff --git a/packages/common/__tests__/utils/alerting.utils.mock.ts b/packages/common/__tests__/utils/alerting.utils.mock.ts index 263316ec..c80652c1 100644 --- a/packages/common/__tests__/utils/alerting.utils.mock.ts +++ b/packages/common/__tests__/utils/alerting.utils.mock.ts @@ -1,4 +1,9 @@ export const mockedAddAlert = jest.fn(); -export default jest.mock('@src/utils/alerting.utils', () => ({ - addAlert: mockedAddAlert.mockReturnValue(Promise.resolve()), -})); +export default jest.mock('@src/utils/alerting.utils', () => { + const originalModule = jest.requireActual('@src/utils/alerting.utils'); + + return { + ...originalModule, + addAlert: mockedAddAlert.mockReturnValue(Promise.resolve()), + }; +}); diff --git a/packages/common/__tests__/utils/nft.utils.test.ts b/packages/common/__tests__/utils/nft.utils.test.ts index a93afc8f..c678bdb4 100644 --- a/packages/common/__tests__/utils/nft.utils.test.ts +++ b/packages/common/__tests__/utils/nft.utils.test.ts @@ -1,8 +1,8 @@ // @ts-ignore: Using old wallet-lib version, no types exported import hathorLib from '@hathor/wallet-lib'; import { mockedAddAlert } from './alerting.utils.mock'; -import { Severity } from '@src/types'; import { NftUtils } from '@src/utils/nft.utils'; +import { Severity } from '@src/types'; import { getHandlerContext, getTransaction } from '../events/nftCreationTx'; import { LambdaClient as LambdaClientMock, @@ -37,6 +37,15 @@ jest.mock('@aws-sdk/client-lambda', () => { }; }); +jest.mock('@src/utils/index.utils', () => { + const originalModule = jest.requireActual('@src/utils/index.utils'); + + return { + ...originalModule, + assertEnvVariablesExistence: jest.fn(), + }; +}); + const network = new hathorLib.Network('testnet'); const logger = new Logger(); diff --git a/packages/common/index.ts b/packages/common/index.ts new file mode 100644 index 00000000..c2cdc164 --- /dev/null +++ b/packages/common/index.ts @@ -0,0 +1,9 @@ +/** + * Copyright (c) Hathor Labs and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export * from './src/types'; +export * from './src/utils/index.utils'; diff --git a/packages/common/package.json b/packages/common/package.json index dbc95fe4..45d08214 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -2,7 +2,9 @@ "name": "@wallet-service/common", "version": "1.5.0", "packageManager": "yarn@4.1.0", + "main": "dist/index.js", "scripts": { + "build": "tsc --declaration", "test": "jest --runInBand --collectCoverage --detectOpenHandles --forceExit" }, "peerDependencies": { diff --git a/packages/common/src/utils/alerting.utils.ts b/packages/common/src/utils/alerting.utils.ts index 32d8b3ff..9940fbde 100644 --- a/packages/common/src/utils/alerting.utils.ts +++ b/packages/common/src/utils/alerting.utils.ts @@ -7,17 +7,8 @@ import { SendMessageCommand, SQSClient } from '@aws-sdk/client-sqs'; import { Severity } from '../types'; -import { assertEnvVariablesExistence } from './index.utils'; import { Logger } from 'winston'; -assertEnvVariablesExistence([ - 'NETWORK', - 'APPLICATION_NAME', - 'ACCOUNT_ID', - 'ALERT_MANAGER_REGION', - 'ALERT_MANAGER_TOPIC', -]); - /** * Adds a message to the SQS alerting queue * diff --git a/packages/common/src/utils/index.utils.ts b/packages/common/src/utils/index.utils.ts index f2697f03..147114d5 100644 --- a/packages/common/src/utils/index.utils.ts +++ b/packages/common/src/utils/index.utils.ts @@ -5,6 +5,10 @@ * LICENSE file in the root directory of this source tree. */ +export * from './alerting.utils'; +export * from './nft.utils'; +export * from './wallet.utils'; + /** * Validates if a list of env variables are set in the environment. Throw if at least * one of them is missing diff --git a/packages/common/src/utils/wallet.utils.ts b/packages/common/src/utils/wallet.utils.ts index 56ffdf50..66a4c43b 100644 --- a/packages/common/src/utils/wallet.utils.ts +++ b/packages/common/src/utils/wallet.utils.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + // @ts-ignore import { constants } from '@hathor/wallet-lib'; diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index 813c8dde..fefcb2f4 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -1,7 +1,9 @@ { "compilerOptions": { + "composite": true, "target": "ES2022", "module": "CommonJS", + "declaration": true, "sourceMap": true, "strict": true, "esModuleInterop": true, @@ -10,12 +12,13 @@ "outDir": "./dist", "types": ["node", "jest"], "paths": { - "@src/*": ["src/*"], - "@tests/*": ["__tests__/*"], - "@events/*": ["__tests__/events/*"] + "@src/*": ["./src/*"], + "@tests/*": ["./__tests__/*"], + "@events/*": ["./__tests__/events/*"] } }, "include": [ + "index.ts", "src/**/*.ts", "__tests__/**/*.ts" ], diff --git a/packages/daemon/__tests__/db/index.test.ts b/packages/daemon/__tests__/db/index.test.ts index 3d4ab12f..a53d14d4 100644 --- a/packages/daemon/__tests__/db/index.test.ts +++ b/packages/daemon/__tests__/db/index.test.ts @@ -65,9 +65,9 @@ import { createOutput, XPUBKEY, } from '../utils'; -import { isAuthority } from '@wallet-service/common/src/utils/wallet.utils'; +import { isAuthority } from '@wallet-service/common'; import { DbTxOutput, StringMap, TokenInfo, WalletStatus } from '../../src/types'; -import { Authorities, TokenBalanceMap } from '@wallet-service/common/src/types'; +import { Authorities, TokenBalanceMap } from '@wallet-service/common'; // Use a single mysql connection for all tests let mysql: Connection; diff --git a/packages/daemon/__tests__/guards/guards.test.ts b/packages/daemon/__tests__/guards/guards.test.ts index 1b38ec71..2726888c 100644 --- a/packages/daemon/__tests__/guards/guards.test.ts +++ b/packages/daemon/__tests__/guards/guards.test.ts @@ -28,10 +28,6 @@ jest.mock('../../src/config', () => { }; }); -jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ - assertEnvVariablesExistence: jest.fn(), -})); - import getConfig from '../../src/config'; const TxCache = { diff --git a/packages/daemon/__tests__/integration/balances.test.ts b/packages/daemon/__tests__/integration/balances.test.ts index 8d8708f5..55580f5e 100644 --- a/packages/daemon/__tests__/integration/balances.test.ts +++ b/packages/daemon/__tests__/integration/balances.test.ts @@ -34,10 +34,6 @@ jest.mock('../../src/config', () => { }; }); -jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ - assertEnvVariablesExistence: jest.fn(), -})); - import getConfig from '../../src/config'; // @ts-ignore diff --git a/packages/daemon/__tests__/machines/SyncMachine.test.ts b/packages/daemon/__tests__/machines/SyncMachine.test.ts index 65629a8e..288ba5e3 100644 --- a/packages/daemon/__tests__/machines/SyncMachine.test.ts +++ b/packages/daemon/__tests__/machines/SyncMachine.test.ts @@ -29,10 +29,6 @@ import getConfig from '../../src/config'; const { TX_CACHE_SIZE, FULLNODE_PEER_ID, STREAM_ID } = getConfig(); const { VERTEX_METADATA_CHANGED, NEW_VERTEX_ACCEPTED, REORG_STARTED } = EventFixtures; -jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ - assertEnvVariablesExistence: jest.fn(), -})); - const TxCache = new LRU(TX_CACHE_SIZE); beforeAll(async () => { diff --git a/packages/daemon/__tests__/services/services.test.ts b/packages/daemon/__tests__/services/services.test.ts index 9ebc3ff0..78b6a639 100644 --- a/packages/daemon/__tests__/services/services.test.ts +++ b/packages/daemon/__tests__/services/services.test.ts @@ -90,10 +90,6 @@ jest.mock('../../src/utils', () => ({ getFullnodeHttpUrl: jest.fn(), })); -jest.mock('@wallet-service/common/src/utils/index.utils', () => ({ - assertEnvVariablesExistence: jest.fn(), -})); - beforeEach(() => { jest.clearAllMocks(); }); diff --git a/packages/daemon/package.json b/packages/daemon/package.json index b397dcd7..6876993e 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -11,7 +11,8 @@ }, "scripts": { "lint": "eslint .", - "build": "tsc", + "build": "tsc -b", + "start": "node dist/index.js", "watch": "tsc -w", "test_images_up": "docker-compose -f ./__tests__/integration/scripts/docker-compose.yml up -d", "test_images_down": "docker-compose -f ./__tests__/integration/scripts/docker-compose.yml down", @@ -45,12 +46,12 @@ "typescript": "^4.9.5" }, "peerDependencies": { - "@hathor/wallet-lib": "0.39.0" + "@hathor/wallet-lib": "0.39.0", + "@wallet-service/common": "1.5.0" }, "dependencies": { "@aws-sdk/client-lambda": "3.540.0", "@aws-sdk/client-sqs": "3.540.0", - "@wallet-service/common": "1.5.0", "assert": "^2.1.0", "aws-sdk": "^2.1454.0", "axios": "^1.6.2", diff --git a/packages/daemon/src/config.ts b/packages/daemon/src/config.ts index 0e676212..e924f2d8 100644 --- a/packages/daemon/src/config.ts +++ b/packages/daemon/src/config.ts @@ -24,9 +24,9 @@ const requiredEnvs = [ 'ACCOUNT_ID', 'ALERT_MANAGER_TOPIC', 'ALERT_MANAGER_REGION', + 'APPLICATION_NAME', ]; - export const checkEnvVariables = () => { const missingEnv = requiredEnvs.filter(envVar => process.env[envVar] === undefined); diff --git a/packages/daemon/src/db/index.ts b/packages/daemon/src/db/index.ts index b80cf5d9..ed5d533a 100644 --- a/packages/daemon/src/db/index.ts +++ b/packages/daemon/src/db/index.ts @@ -24,8 +24,8 @@ import { TxInput, TokenBalanceMap, TxOutputWithIndex, -} from '@wallet-service/common/src/types'; -import { isAuthority } from '@wallet-service/common/src/utils/wallet.utils'; +} from '@wallet-service/common'; +import { isAuthority } from '@wallet-service/common'; import { AddressBalanceRow, AddressTxHistorySumRow, diff --git a/packages/daemon/src/services/index.ts b/packages/daemon/src/services/index.ts index a5ea89b0..d9a3f09e 100644 --- a/packages/daemon/src/services/index.ts +++ b/packages/daemon/src/services/index.ts @@ -9,7 +9,7 @@ import hathorLib from '@hathor/wallet-lib'; import axios from 'axios'; import { get } from 'lodash'; -import { NftUtils } from '@wallet-service/common/src/utils/nft.utils'; +import { NftUtils } from '@wallet-service/common'; import { StringMap, Wallet, @@ -25,7 +25,7 @@ import { Transaction, TokenBalanceMap, TxOutputWithIndex, -} from '@wallet-service/common/src/types'; +} from '@wallet-service/common'; import { prepareOutputs, getAddressBalanceMap, diff --git a/packages/daemon/src/types/wallet.ts b/packages/daemon/src/types/wallet.ts index 3d2a0f85..15159a8e 100644 --- a/packages/daemon/src/types/wallet.ts +++ b/packages/daemon/src/types/wallet.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import { TokenBalanceMap } from '@wallet-service/common/src/types'; +import { TokenBalanceMap } from '@wallet-service/common'; export enum WalletStatus { CREATING = 'creating', diff --git a/packages/daemon/src/utils/aws.ts b/packages/daemon/src/utils/aws.ts index c27de295..7c0a60b8 100644 --- a/packages/daemon/src/utils/aws.ts +++ b/packages/daemon/src/utils/aws.ts @@ -4,7 +4,7 @@ import { SendMessageCommand, SendMessageCommandOutput, SQSClient, MessageAttribu import { StringMap } from '../types'; import getConfig from '../config'; import logger from '../logger'; -import { addAlert } from '@wallet-service/common/src/utils/alerting.utils'; +import { addAlert } from '@wallet-service/common'; export function buildFunctionName(functionName: string): string { const { STAGE } = getConfig(); diff --git a/packages/daemon/src/utils/wallet.ts b/packages/daemon/src/utils/wallet.ts index 1aa2263b..1ff43b1a 100644 --- a/packages/daemon/src/utils/wallet.ts +++ b/packages/daemon/src/utils/wallet.ts @@ -28,7 +28,7 @@ import { TxInput, TxOutput, TokenBalanceMap, -} from '@wallet-service/common/src/types'; +} from '@wallet-service/common'; import { fetchAddressBalance, fetchAddressTxHistorySum, diff --git a/packages/daemon/tsconfig.json b/packages/daemon/tsconfig.json index 3c872075..d8a17e24 100644 --- a/packages/daemon/tsconfig.json +++ b/packages/daemon/tsconfig.json @@ -10,6 +10,12 @@ "outDir": "./dist", "types": ["node", "jest"] }, + // The common module is not deployed to npm and is an internal tool, + // we want it to have its own tsconfig, so this is instructing typescript + // to compile its tsconfig.json file + "references": [ + { "path": "../../node_modules/@wallet-service/common" } + ], "include": [ "src/**/*.ts" ], diff --git a/yarn.lock b/yarn.lock index dbb1acc4..5a2ee6c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15051,7 +15051,6 @@ __metadata: "@types/ws": "npm:^8.5.5" "@typescript-eslint/eslint-plugin": "npm:^6.7.3" "@typescript-eslint/parser": "npm:^6.7.3" - "@wallet-service/common": "npm:1.5.0" assert: "npm:^2.1.0" aws-sdk: "npm:^2.1454.0" axios: "npm:^1.6.2" @@ -15074,6 +15073,7 @@ __metadata: xstate: "npm:^4.38.2" peerDependencies: "@hathor/wallet-lib": 0.39.0 + "@wallet-service/common": 1.5.0 languageName: unknown linkType: soft From 8450aaf0eb58b163639c02a92ae614c478eb5468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Thu, 13 Jun 2024 13:37:20 -0300 Subject: [PATCH 09/10] chore: run with nodejs instead of yarn in Dockerfile (#173) --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7e042a33..3ed55f1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,4 +27,14 @@ RUN yarn workspace sync-daemon run build # This will remove all dev dependencies and install production deps only RUN yarn workspaces focus -A --production -CMD ["yarn", "workspace", "sync-daemon", "run", "start"] +# Run phase +FROM node:20-alpine AS runner + +WORKDIR /app + +# Copy only the necessary files from the build phase +COPY --from=builder /app . + +WORKDIR /app/packages/daemon/ + +CMD ["node", "dist/index.js"] From 6ac186c12fc51adbff5aae997f680f2fd878cfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Thu, 13 Jun 2024 16:01:20 -0300 Subject: [PATCH 10/10] chore: bump to v1.6.2 (#174) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d83a9499..67e6312e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hathor-wallet-service", - "version": "1.6.1", + "version": "1.6.2", "workspaces": [ "packages/common", "packages/daemon",