diff --git a/.env.example b/.env.example index 1cb905f46..c27d4078e 100644 --- a/.env.example +++ b/.env.example @@ -1,13 +1,11 @@ -# --- Local Development (Docker MSSQL) --- +# --- Local Development (Docker PostgreSQL) --- # Copy this file to .env and fill in the values -# Start MSSQL: docker compose up -d -# Create DB once: docker exec lds-mssql /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "YourStrong!Passw0rd" -C -Q "CREATE DATABASE LightningSpace" -# For local dev, only the settings below are required: +# Start PostgreSQL: docker compose up -d ENVIRONMENT=loc PORT=3000 SQL_HOST=localhost -SQL_PORT=1433 -SQL_USERNAME=sa +SQL_PORT=5432 +SQL_USERNAME=postgres SQL_PASSWORD=YourStrong!Passw0rd SQL_DB=LightningSpace SQL_SYNCHRONIZE=true diff --git a/README.md b/README.md index 08a388a5d..5693dc0f7 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ Access requires a wallet with the `DEBUG` role. The role hierarchy allows `ADMIN name = 'addDebugWalletTIMESTAMP' async up(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = 'WALLET_ADDRESS'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = 'WALLET_ADDRESS'`); } async down(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = 'WALLET_ADDRESS'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = 'WALLET_ADDRESS'`); } } ``` @@ -64,7 +64,7 @@ Access requires a wallet with the `DEBUG` role. The role hierarchy allows `ADMIN **SQL Queries:** ```bash -./scripts/db-debug.sh "SELECT TOP 10 * FROM wallet" +./scripts/db-debug.sh "SELECT * FROM wallet LIMIT 10" ./scripts/db-debug.sh "SELECT * FROM monitoring_balance" ``` @@ -81,5 +81,5 @@ Access requires a wallet with the `DEBUG` role. The role hierarchy allows `ADMIN - Only `SELECT` queries allowed (no INSERT, UPDATE, DELETE) - Sensitive columns are automatically masked (signatures, keys, secrets) -- System schemas blocked (sys, information_schema) +- System schemas blocked (pg_catalog, information_schema) - All queries are logged for audit diff --git a/docker-compose.yml b/docker-compose.yml index 9cb254add..d3787f25c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,21 +1,21 @@ services: - mssql: - image: mcr.microsoft.com/mssql/server:2022-latest - container_name: lds-mssql + postgres: + image: postgres:17-alpine + container_name: lds-postgres environment: - ACCEPT_EULA: 'Y' - MSSQL_SA_PASSWORD: 'YourStrong!Passw0rd' - MSSQL_PID: Developer + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 'YourStrong!Passw0rd' + POSTGRES_DB: LightningSpace ports: - - '1433:1433' + - '5432:5432' volumes: - - mssql-data:/var/opt/mssql + - postgres-data:/var/lib/postgresql/data healthcheck: - test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "YourStrong!Passw0rd" -C -Q "SELECT 1" -b -o /dev/null + test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 10s timeout: 3s retries: 10 start_period: 10s volumes: - mssql-data: + postgres-data: diff --git a/migration/1693381371362-Initial.js b/migration/1693381371362-Initial.js index 7814d10f5..03aa8eca5 100644 --- a/migration/1693381371362-Initial.js +++ b/migration/1693381371362-Initial.js @@ -5,16 +5,16 @@ module.exports = class Initial1693381371362 { async up(queryRunner) { await queryRunner.query( - `CREATE TABLE "user" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_8ce4c93ba419b56bd82e533724d" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_5904a9d40152f354e4c7b0202fb" DEFAULT getdate(), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`, + `CREATE TABLE "user" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`, ); await queryRunner.query( - `CREATE TABLE "wallet_provider" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_84c9dbd2dd0e662567cb7316479" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_8cb5099f91fbd28ae877b04aa74" DEFAULT getdate(), "name" nvarchar(255) NOT NULL, CONSTRAINT "UQ_1e7a695e2f2ea4ca54df5f0fc72" UNIQUE ("name"), CONSTRAINT "PK_5c7933595d00e530f9d0eecca81" PRIMARY KEY ("id"))`, + `CREATE TABLE "wallet_provider" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "name" varchar(255) NOT NULL, CONSTRAINT "UQ_1e7a695e2f2ea4ca54df5f0fc72" UNIQUE ("name"), CONSTRAINT "PK_5c7933595d00e530f9d0eecca81" PRIMARY KEY ("id"))`, ); await queryRunner.query( - `CREATE TABLE "wallet" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_2f026f6cfde1264d133a9da4a40" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_fb09ba370efe59a077ccb666826" DEFAULT getdate(), "address" nvarchar(255) NOT NULL, "signature" nvarchar(255) NOT NULL, "lnbitsUserId" nvarchar(255) NOT NULL, "lnbitsAddress" nvarchar(255) NOT NULL, "role" nvarchar(255) NOT NULL CONSTRAINT "DF_39dba1739ead1346b5eef893188" DEFAULT 'User', "walletProviderId" int NOT NULL, "userId" int NOT NULL, CONSTRAINT "UQ_1dcc9f5fd49e3dc52c6d2393c53" UNIQUE ("address"), CONSTRAINT "UQ_55b77268e1ab3d6caba35c2e1f7" UNIQUE ("lnbitsUserId"), CONSTRAINT "UQ_a380084e2f3e0213d45ce414129" UNIQUE ("lnbitsAddress"), CONSTRAINT "PK_bec464dd8d54c39c54fd32e2334" PRIMARY KEY ("id"))`, + `CREATE TABLE "wallet" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "address" varchar(255) NOT NULL, "signature" varchar(255) NOT NULL, "lnbitsUserId" varchar(255) NOT NULL, "lnbitsAddress" varchar(255) NOT NULL, "role" varchar(255) NOT NULL DEFAULT 'User', "walletProviderId" int NOT NULL, "userId" int NOT NULL, CONSTRAINT "UQ_1dcc9f5fd49e3dc52c6d2393c53" UNIQUE ("address"), CONSTRAINT "UQ_55b77268e1ab3d6caba35c2e1f7" UNIQUE ("lnbitsUserId"), CONSTRAINT "UQ_a380084e2f3e0213d45ce414129" UNIQUE ("lnbitsAddress"), CONSTRAINT "PK_bec464dd8d54c39c54fd32e2334" PRIMARY KEY ("id"))`, ); await queryRunner.query( - `CREATE TABLE "lightning_wallet" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_2a2a8f12dffb71a971554a4e5da" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_433f721ae8922b747c42ca5d6f5" DEFAULT getdate(), "lnbitsWalletId" nvarchar(255) NOT NULL, "asset" nvarchar(255) NOT NULL, "adminKey" nvarchar(255) NOT NULL, "invoiceKey" nvarchar(255) NOT NULL, "lnurlpId" nvarchar(255) NOT NULL, "walletId" int NOT NULL, CONSTRAINT "UQ_60f18254b76b69d24553d8c0562" UNIQUE ("lnbitsWalletId"), CONSTRAINT "PK_ea0c4797a4f0f6d0b9979e8a432" PRIMARY KEY ("id"))`, + `CREATE TABLE "lightning_wallet" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "lnbitsWalletId" varchar(255) NOT NULL, "asset" varchar(255) NOT NULL, "adminKey" varchar(255) NOT NULL, "invoiceKey" varchar(255) NOT NULL, "lnurlpId" varchar(255) NOT NULL, "walletId" int NOT NULL, CONSTRAINT "UQ_60f18254b76b69d24553d8c0562" UNIQUE ("lnbitsWalletId"), CONSTRAINT "PK_ea0c4797a4f0f6d0b9979e8a432" PRIMARY KEY ("id"))`, ); await queryRunner.query( `ALTER TABLE "wallet" ADD CONSTRAINT "FK_5f9d93bd5c22ed5b4211b26718a" FOREIGN KEY ("walletProviderId") REFERENCES "wallet_provider"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, diff --git a/migration/1693922883477-addAsset.js b/migration/1693922883477-addAsset.js index 40dec2675..9978da0bf 100644 --- a/migration/1693922883477-addAsset.js +++ b/migration/1693922883477-addAsset.js @@ -4,22 +4,22 @@ module.exports = class addAsset1693922883477 { name = 'addAsset1693922883477' async up(queryRunner) { - await queryRunner.query(`EXEC sp_rename "lightning_wallet.asset", "assetId"`); - await queryRunner.query(`CREATE TABLE "dbo"."asset" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_3ee68e53a3e33a8df283f66aada" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_6ed5cbbccf21b8ef558f7ef2de5" DEFAULT getdate(), "name" nvarchar(255) NOT NULL, "displayName" nvarchar(255) NOT NULL, "description" nvarchar(255), "status" nvarchar(255) NOT NULL, CONSTRAINT "UQ_119b2d1c1bdccc42057c303c44f" UNIQUE ("name"), CONSTRAINT "PK_1209d107fe21482beaea51b745e" PRIMARY KEY ("id"))`); - await queryRunner.query(`ALTER TABLE "dbo"."wallet" ADD "addressOwnershipProof" nvarchar(255) NOT NULL`); - await queryRunner.query(`ALTER TABLE "dbo"."wallet" ADD CONSTRAINT "UQ_e27ddf84aefa72d600acbf393c5" UNIQUE ("addressOwnershipProof")`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" DROP COLUMN "assetId"`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" ADD "assetId" int NOT NULL`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" ADD CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7" FOREIGN KEY ("assetId") REFERENCES "dbo"."asset"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" RENAME COLUMN "asset" TO "assetId"`); + await queryRunner.query(`CREATE TABLE "asset" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "name" varchar(255) NOT NULL, "displayName" varchar(255) NOT NULL, "description" varchar(255), "status" varchar(255) NOT NULL, CONSTRAINT "UQ_119b2d1c1bdccc42057c303c44f" UNIQUE ("name"), CONSTRAINT "PK_1209d107fe21482beaea51b745e" PRIMARY KEY ("id"))`); + await queryRunner.query(`ALTER TABLE "wallet" ADD "addressOwnershipProof" varchar(255) NOT NULL`); + await queryRunner.query(`ALTER TABLE "wallet" ADD CONSTRAINT "UQ_e27ddf84aefa72d600acbf393c5" UNIQUE ("addressOwnershipProof")`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" DROP COLUMN "assetId"`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" ADD "assetId" int NOT NULL`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" ADD CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7" FOREIGN KEY ("assetId") REFERENCES "asset"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" DROP CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7"`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" DROP COLUMN "assetId"`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" ADD "assetId" nvarchar(255) NOT NULL`); - await queryRunner.query(`ALTER TABLE "dbo"."wallet" DROP CONSTRAINT "UQ_e27ddf84aefa72d600acbf393c5"`); - await queryRunner.query(`ALTER TABLE "dbo"."wallet" DROP COLUMN "addressOwnershipProof"`); - await queryRunner.query(`DROP TABLE "dbo"."asset"`); - await queryRunner.query(`EXEC sp_rename "lightning_wallet.assetId", "asset"`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" DROP CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7"`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" DROP COLUMN "assetId"`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" ADD "assetId" varchar(255) NOT NULL`); + await queryRunner.query(`ALTER TABLE "wallet" DROP CONSTRAINT "UQ_e27ddf84aefa72d600acbf393c5"`); + await queryRunner.query(`ALTER TABLE "wallet" DROP COLUMN "addressOwnershipProof"`); + await queryRunner.query(`DROP TABLE "asset"`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" RENAME COLUMN "assetId" TO "asset"`); } } diff --git a/migration/1697006086810-Transactions.js b/migration/1697006086810-Transactions.js index d23697b79..d6e0f809a 100644 --- a/migration/1697006086810-Transactions.js +++ b/migration/1697006086810-Transactions.js @@ -4,10 +4,10 @@ module.exports = class Transactions1697006086810 { name = 'Transactions1697006086810' async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_transaction" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_1019086e384f799f2bdbe3f6085" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_cdd9335d11e2e19c02b5c5fa397" DEFAULT getdate(), "type" nvarchar(255) NOT NULL, "amount" float NOT NULL, "fee" float NOT NULL CONSTRAINT "DF_7be69ef7332f2d6ad05b8e70a06" DEFAULT 0, "balance" float, "creationTimestamp" datetime2 NOT NULL, "expiresTimestamp" datetime2, "tag" nvarchar(255), "lightningWalletId" int, "lightningTransactionId" int NOT NULL, CONSTRAINT "PK_e36b77a5263ac0f191277c4c5d2" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TABLE "transaction_lightning" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_3ba7baa12ab2299212be619da72" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_7250c44e737cdc826f69ea92eb5" DEFAULT getdate(), "type" nvarchar(255) NOT NULL, "state" nvarchar(255) NOT NULL, "transaction" nvarchar(255) NOT NULL, "secret" nvarchar(255) NOT NULL, "publicKey" nvarchar(255), "amount" float NOT NULL, "fee" float NOT NULL CONSTRAINT "DF_30767c0861424ab2245c94eb40a" DEFAULT 0, "balance" float, "creationTimestamp" datetime2 NOT NULL, "expiresTimestamp" datetime2, "confirmedTimestamp" datetime2, "description" nvarchar(MAX), "reason" nvarchar(255), "paymentRequest" nvarchar(MAX), CONSTRAINT "PK_4f9024cfed331c3c379a9b481c0" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TABLE "transaction_onchain" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_bb7bdeaf8c0bf5c34d7bf70cb89" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_957b30bd3550a277c6d6f72917c" DEFAULT getdate(), "transaction" nvarchar(255) NOT NULL, "amount" float NOT NULL, "fee" float NOT NULL CONSTRAINT "DF_4d458978566a4ffa3a28ae2d761" DEFAULT 0, "balance" float, "block" int NOT NULL, "timestamp" datetime2 NOT NULL, CONSTRAINT "UQ_8a233973c49afbbc14a01ce076b" UNIQUE ("transaction"), CONSTRAINT "PK_00b0ebb5b154922c59e2b502d19" PRIMARY KEY ("id"))`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" ADD "balance" float NOT NULL CONSTRAINT "DF_11d6f2ffc02954b3548a52b31a7" DEFAULT 0`); + await queryRunner.query(`CREATE TABLE "user_transaction" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "type" varchar(255) NOT NULL, "amount" double precision NOT NULL, "fee" double precision NOT NULL DEFAULT 0, "balance" double precision, "creationTimestamp" timestamp NOT NULL, "expiresTimestamp" timestamp, "tag" varchar(255), "lightningWalletId" int, "lightningTransactionId" int NOT NULL, CONSTRAINT "PK_e36b77a5263ac0f191277c4c5d2" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "transaction_lightning" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "type" varchar(255) NOT NULL, "state" varchar(255) NOT NULL, "transaction" varchar(255) NOT NULL, "secret" varchar(255) NOT NULL, "publicKey" varchar(255), "amount" double precision NOT NULL, "fee" double precision NOT NULL DEFAULT 0, "balance" double precision, "creationTimestamp" timestamp NOT NULL, "expiresTimestamp" timestamp, "confirmedTimestamp" timestamp, "description" text, "reason" varchar(255), "paymentRequest" text, CONSTRAINT "PK_4f9024cfed331c3c379a9b481c0" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "transaction_onchain" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "transaction" varchar(255) NOT NULL, "amount" double precision NOT NULL, "fee" double precision NOT NULL DEFAULT 0, "balance" double precision, "block" int NOT NULL, "timestamp" timestamp NOT NULL, CONSTRAINT "UQ_8a233973c49afbbc14a01ce076b" UNIQUE ("transaction"), CONSTRAINT "PK_00b0ebb5b154922c59e2b502d19" PRIMARY KEY ("id"))`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" ADD "balance" double precision NOT NULL DEFAULT 0`); await queryRunner.query(`ALTER TABLE "user_transaction" ADD CONSTRAINT "FK_34942e502f3c64e570462407e2a" FOREIGN KEY ("lightningWalletId") REFERENCES "lightning_wallet"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); await queryRunner.query(`ALTER TABLE "user_transaction" ADD CONSTRAINT "FK_b2a00eab28ff6b7052c4eee695f" FOREIGN KEY ("lightningTransactionId") REFERENCES "transaction_lightning"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); } @@ -15,8 +15,7 @@ module.exports = class Transactions1697006086810 { async down(queryRunner) { await queryRunner.query(`ALTER TABLE "user_transaction" DROP CONSTRAINT "FK_b2a00eab28ff6b7052c4eee695f"`); await queryRunner.query(`ALTER TABLE "user_transaction" DROP CONSTRAINT "FK_34942e502f3c64e570462407e2a"`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" DROP CONSTRAINT "DF_11d6f2ffc02954b3548a52b31a7"`); - await queryRunner.query(`ALTER TABLE "dbo"."lightning_wallet" DROP COLUMN "balance"`); + await queryRunner.query(`ALTER TABLE "lightning_wallet" DROP COLUMN "balance"`); await queryRunner.query(`DROP TABLE "transaction_onchain"`); await queryRunner.query(`DROP TABLE "transaction_lightning"`); await queryRunner.query(`DROP TABLE "user_transaction"`); diff --git a/migration/1715583133193-setupFrankencoinPay.js b/migration/1715583133193-setupFrankencoinPay.js index 2a99b1f00..ed9e62438 100644 --- a/migration/1715583133193-setupFrankencoinPay.js +++ b/migration/1715583133193-setupFrankencoinPay.js @@ -5,21 +5,21 @@ module.exports = class setupFrankencoinPay1715583133193 { async up(queryRunner) { await queryRunner.query(`ALTER TABLE "lightning_wallet" DROP CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7"`); - await queryRunner.query(`CREATE TABLE "asset_transfer" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_9c317475a5040ff9d7d6b8b94af" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_7726f135d70ef32fd500641f087" DEFAULT getdate(), "name" nvarchar(255) NOT NULL, "displayName" nvarchar(255) NOT NULL, "status" nvarchar(255) NOT NULL, "blockchain" nvarchar(255) NOT NULL, "address" nvarchar(255), CONSTRAINT "PK_d6055020b87303085fec8d88f5f" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "asset_transfer" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "name" varchar(255) NOT NULL, "displayName" varchar(255) NOT NULL, "status" varchar(255) NOT NULL, "blockchain" varchar(255) NOT NULL, "address" varchar(255), CONSTRAINT "PK_d6055020b87303085fec8d88f5f" PRIMARY KEY ("id"))`); await queryRunner.query(`CREATE UNIQUE INDEX "IDX_c364ba178533de8c281fe34b64" ON "asset_transfer" ("name", "blockchain") `); - await queryRunner.query(`EXEC sp_rename "asset", "asset_account"`); - await queryRunner.query(`ALTER TABLE "asset_account" ADD "symbol" nvarchar(255)`); + await queryRunner.query(`ALTER TABLE "asset" RENAME TO "asset_account"`); + await queryRunner.query(`ALTER TABLE "asset_account" ADD "symbol" varchar(255)`); await queryRunner.query(`ALTER TABLE "asset_account" ADD "minSendable" smallint`); await queryRunner.query(`ALTER TABLE "asset_account" ADD "maxSendable" bigint`); await queryRunner.query(`ALTER TABLE "asset_account" ADD "decimals" smallint`); - await queryRunner.query(`CREATE TABLE "payment_request" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_6e79eceef62060c7a1e0e2e2eaa" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_6fa00396d32e31c39e894ae33b1" DEFAULT getdate(), "state" nvarchar(255) NOT NULL, "invoiceAmount" float NOT NULL, "transferAmount" float NOT NULL, "paymentRequest" nvarchar(MAX) NOT NULL, "expiryDate" datetime2 NOT NULL, "paymentMethod" nvarchar(255) NOT NULL, "errorMessage" nvarchar(MAX), "invoiceAssetId" int, "transferAssetId" int, "lightningWalletId" int, CONSTRAINT "PK_b274a8e7b35dd0fd12e46e89f3c" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TABLE "transaction_evm" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_daf4fd3557a6e29344b11a5bab3" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_49e1d6530fda736ed4903e5ce77" DEFAULT getdate(), "state" nvarchar(255) NOT NULL, "amount" float NOT NULL, "transaction" nvarchar(255) NOT NULL, "errorMessage" nvarchar(MAX), "assetId" int, CONSTRAINT "PK_da8f5f87acf951be71790cbf71e" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "payment_request" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "state" varchar(255) NOT NULL, "invoiceAmount" double precision NOT NULL, "transferAmount" double precision NOT NULL, "paymentRequest" text NOT NULL, "expiryDate" timestamp NOT NULL, "paymentMethod" varchar(255) NOT NULL, "errorMessage" text, "invoiceAssetId" int, "transferAssetId" int, "lightningWalletId" int, CONSTRAINT "PK_b274a8e7b35dd0fd12e46e89f3c" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "transaction_evm" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "state" varchar(255) NOT NULL, "amount" double precision NOT NULL, "transaction" varchar(255) NOT NULL, "errorMessage" text, "assetId" int, CONSTRAINT "PK_da8f5f87acf951be71790cbf71e" PRIMARY KEY ("id"))`); await queryRunner.query(`ALTER TABLE "user_transaction" ADD "evmTransactionId" int`); await queryRunner.query(`ALTER TABLE "user_transaction" ADD "paymentRequestId" int`); await queryRunner.query(`ALTER TABLE "user_transaction" DROP CONSTRAINT "FK_b2a00eab28ff6b7052c4eee695f"`); - await queryRunner.query(`ALTER TABLE "user_transaction" ALTER COLUMN "lightningTransactionId" int`); + await queryRunner.query(`ALTER TABLE "user_transaction" ALTER COLUMN "lightningTransactionId" DROP NOT NULL`); await queryRunner.query(`CREATE UNIQUE INDEX "REL_5321f899f7b93e29184aca2e76" ON "user_transaction" ("evmTransactionId") WHERE "evmTransactionId" IS NOT NULL`); await queryRunner.query(`CREATE UNIQUE INDEX "REL_c5c971bdda1132ff33afab0f3d" ON "user_transaction" ("paymentRequestId") WHERE "paymentRequestId" IS NOT NULL`); await queryRunner.query(`ALTER TABLE "lightning_wallet" ADD CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7" FOREIGN KEY ("assetId") REFERENCES "asset_account"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); @@ -49,18 +49,18 @@ module.exports = class setupFrankencoinPay1715583133193 { await queryRunner.query(`ALTER TABLE "payment_request" DROP CONSTRAINT "FK_7d73326cc4a41f52df8e1924903"`); await queryRunner.query(`ALTER TABLE "payment_request" DROP CONSTRAINT "FK_653ab346cbd9f7297e2bff279fa"`); await queryRunner.query(`ALTER TABLE "lightning_wallet" DROP CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7"`); - await queryRunner.query(`DROP INDEX "REL_c5c971bdda1132ff33afab0f3d" ON "user_transaction"`); - await queryRunner.query(`DROP INDEX "REL_5321f899f7b93e29184aca2e76" ON "user_transaction"`); - await queryRunner.query(`ALTER TABLE "user_transaction" ALTER COLUMN "lightningTransactionId" int NOT NULL`); + await queryRunner.query(`DROP INDEX "REL_c5c971bdda1132ff33afab0f3d"`); + await queryRunner.query(`DROP INDEX "REL_5321f899f7b93e29184aca2e76"`); + await queryRunner.query(`ALTER TABLE "user_transaction" ALTER COLUMN "lightningTransactionId" SET NOT NULL`); await queryRunner.query(`ALTER TABLE "user_transaction" ADD CONSTRAINT "FK_b2a00eab28ff6b7052c4eee695f" FOREIGN KEY ("lightningTransactionId") REFERENCES "transaction_lightning"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); await queryRunner.query(`ALTER TABLE "user_transaction" DROP COLUMN "paymentRequestId"`); await queryRunner.query(`ALTER TABLE "user_transaction" DROP COLUMN "evmTransactionId"`); await queryRunner.query(`DROP TABLE "transaction_evm"`); await queryRunner.query(`DROP TABLE "payment_request"`); - await queryRunner.query(`DROP INDEX "IDX_c364ba178533de8c281fe34b64" ON "asset_transfer"`); + await queryRunner.query(`DROP INDEX "IDX_c364ba178533de8c281fe34b64"`); await queryRunner.query(`DROP TABLE "asset_transfer"`); - await queryRunner.query(`EXEC sp_rename "asset_account", "asset"`); + await queryRunner.query(`ALTER TABLE "asset_account" RENAME TO "asset"`); await queryRunner.query(`ALTER TABLE "lightning_wallet" ADD CONSTRAINT "FK_37f046b3cbbb273f24a4badd1f7" FOREIGN KEY ("assetId") REFERENCES "asset"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); await queryRunner.query(`UPDATE "asset" SET "status" = 'Active' WHERE "status" = 'active'`); diff --git a/migration/1715773098452-dropAssetDescription.js b/migration/1715773098452-dropAssetDescription.js index d96e1fa84..d6b8ff165 100644 --- a/migration/1715773098452-dropAssetDescription.js +++ b/migration/1715773098452-dropAssetDescription.js @@ -8,6 +8,6 @@ module.exports = class dropAssetDescription1715773098452 { } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "asset_account" ADD "description" nvarchar(255)`); + await queryRunner.query(`ALTER TABLE "asset_account" ADD "description" varchar(255)`); } } diff --git a/migration/1715957540871-setupMonitoring.js b/migration/1715957540871-setupMonitoring.js index 7997faaa7..f1e41756d 100644 --- a/migration/1715957540871-setupMonitoring.js +++ b/migration/1715957540871-setupMonitoring.js @@ -4,15 +4,15 @@ module.exports = class setupMonitoring1715957540871 { name = 'setupMonitoring1715957540871' async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "monitoring_balance" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_1924e81cee5a97b75d44d2bc4b5" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_c23448ffc708ab18d7e105d7d1c" DEFAULT getdate(), "onchainBalance" float NOT NULL, "lightningBalance" float NOT NULL, "customerBalance" float NOT NULL, "assetId" int, CONSTRAINT "PK_7b5964e6f913159bfdbd4604087" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TABLE "monitoring" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_86d36f61c6bc24957a4c25688db" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_3b53d0f951dd09113dfcd3ef87b" DEFAULT getdate(), "type" nvarchar(255) NOT NULL, "name" nvarchar(255) NOT NULL, "value" nvarchar(255) NOT NULL, CONSTRAINT "PK_22a9f9562020245a98bd2c4fb3c" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "monitoring_balance" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "onchainBalance" double precision NOT NULL, "lightningBalance" double precision NOT NULL, "customerBalance" double precision NOT NULL, "assetId" int, CONSTRAINT "PK_7b5964e6f913159bfdbd4604087" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "monitoring" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "type" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "value" varchar(255) NOT NULL, CONSTRAINT "PK_22a9f9562020245a98bd2c4fb3c" PRIMARY KEY ("id"))`); await queryRunner.query(`CREATE UNIQUE INDEX "IDX_c132236516bf54a888017a59ac" ON "monitoring" ("type", "name") `); await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD CONSTRAINT "FK_6e507ef4194b68b0ca0ff02023e" FOREIGN KEY ("assetId") REFERENCES "asset_account"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); } async down(queryRunner) { await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "FK_6e507ef4194b68b0ca0ff02023e"`); - await queryRunner.query(`DROP INDEX "IDX_c132236516bf54a888017a59ac" ON "monitoring"`); + await queryRunner.query(`DROP INDEX "IDX_c132236516bf54a888017a59ac"`); await queryRunner.query(`DROP TABLE "monitoring"`); await queryRunner.query(`DROP TABLE "monitoring_balance"`); } diff --git a/migration/1719396893496-updateMonitoringBalances.js b/migration/1719396893496-updateMonitoringBalances.js index 5619baa12..f0017c092 100644 --- a/migration/1719396893496-updateMonitoringBalances.js +++ b/migration/1719396893496-updateMonitoringBalances.js @@ -4,17 +4,14 @@ module.exports = class updateMonitoringBalances1719396893496 { name = 'updateMonitoringBalances1719396893496' async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "assetPriceInCHF" float NOT NULL CONSTRAINT "DF_62ed605d744743030504b978fa4" DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "ldsBalance" float NOT NULL CONSTRAINT "DF_cfd5f092c873462ca702ff28443" DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "ldsBalanceInCHF" float NOT NULL CONSTRAINT "DF_31e1791294be6327ebe4bf966b6" DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "assetPriceInCHF" double precision NOT NULL DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "ldsBalance" double precision NOT NULL DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "ldsBalanceInCHF" double precision NOT NULL DEFAULT 0`); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_31e1791294be6327ebe4bf966b6"`); await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP COLUMN "ldsBalanceInCHF"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_cfd5f092c873462ca702ff28443"`); await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP COLUMN "ldsBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_62ed605d744743030504b978fa4"`); await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP COLUMN "assetPriceInCHF"`); } } diff --git a/migration/1719852557357-setupFBoltcard.js b/migration/1719852557357-setupFBoltcard.js index d91a860a6..eaa1d955c 100644 --- a/migration/1719852557357-setupFBoltcard.js +++ b/migration/1719852557357-setupFBoltcard.js @@ -4,7 +4,7 @@ module.exports = class setupFBoltcard1719852557357 { name = 'setupFBoltcard1719852557357' async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_boltcard" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_194d0fe73d873bcbd405e73ed6e" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_d2fe5c5abd7ecad224e4a1486a7" DEFAULT getdate(), "status" nvarchar(255) NOT NULL, "boltcardId" nvarchar(255) NOT NULL, "cardName" nvarchar(255) NOT NULL, "uid" nvarchar(255) NOT NULL, "externalId" nvarchar(255) NOT NULL, "counter" int NOT NULL, "txLimit" float NOT NULL, "dailyLimit" float NOT NULL, "k0" nvarchar(255) NOT NULL, "k1" nvarchar(255) NOT NULL, "k2" nvarchar(255) NOT NULL, "prevK0" nvarchar(255) NOT NULL, "prevK1" nvarchar(255) NOT NULL, "prevK2" nvarchar(255) NOT NULL, "otp" nvarchar(255) NOT NULL, "creationTimestamp" datetime2 NOT NULL, "lightningWalletId" int, CONSTRAINT "UQ_2034c8acba4ab8768438fdabca8" UNIQUE ("boltcardId"), CONSTRAINT "PK_10389273e8cfe09471c5f955a80" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "user_boltcard" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "status" varchar(255) NOT NULL, "boltcardId" varchar(255) NOT NULL, "cardName" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "externalId" varchar(255) NOT NULL, "counter" int NOT NULL, "txLimit" double precision NOT NULL, "dailyLimit" double precision NOT NULL, "k0" varchar(255) NOT NULL, "k1" varchar(255) NOT NULL, "k2" varchar(255) NOT NULL, "prevK0" varchar(255) NOT NULL, "prevK1" varchar(255) NOT NULL, "prevK2" varchar(255) NOT NULL, "otp" varchar(255) NOT NULL, "creationTimestamp" timestamp NOT NULL, "lightningWalletId" int, CONSTRAINT "UQ_2034c8acba4ab8768438fdabca8" UNIQUE ("boltcardId"), CONSTRAINT "PK_10389273e8cfe09471c5f955a80" PRIMARY KEY ("id"))`); await queryRunner.query(`ALTER TABLE "user_boltcard" ADD CONSTRAINT "FK_92759113274277cf294bd6ccde9" FOREIGN KEY ("lightningWalletId") REFERENCES "lightning_wallet"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); } diff --git a/migration/1762853446614-changeMonitoringColumns.js b/migration/1762853446614-changeMonitoringColumns.js index 410236f58..e8db05392 100644 --- a/migration/1762853446614-changeMonitoringColumns.js +++ b/migration/1762853446614-changeMonitoringColumns.js @@ -4,26 +4,24 @@ module.exports = class changeMonitoringColumns1762853446614 { name = 'changeMonitoringColumns1762853446614' async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD CONSTRAINT "DF_ac1ee3f6ceaef62d8d4e65da464" DEFAULT 0 FOR "lightningBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD CONSTRAINT "DF_d27d96a891edbe6d94e98c78595" DEFAULT 0 FOR "customerBalance"`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ALTER COLUMN "lightningBalance" SET DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ALTER COLUMN "customerBalance" SET DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "rootstockBalance" float NOT NULL CONSTRAINT "DF_e6e6c92e451a1c8873820c88148" DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "rootstockBalance" double precision NOT NULL DEFAULT 0`); - await queryRunner.query(`EXEC sp_rename "monitoring_balance.onchainBalance", "lndOnchainBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD CONSTRAINT "DF_15b16bea0993decd0e402674a70" DEFAULT 0 FOR "lndOnchainBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "onchainBalance" float NOT NULL CONSTRAINT "DF_2330d3f328361a24c345faf198a" DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" RENAME COLUMN "onchainBalance" TO "lndOnchainBalance"`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ALTER COLUMN "lndOnchainBalance" SET DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "onchainBalance" double precision NOT NULL DEFAULT 0`); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_2330d3f328361a24c345faf198a"`); await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP COLUMN "onchainBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_15b16bea0993decd0e402674a70"`); - await queryRunner.query(`EXEC sp_rename "monitoring_balance.lndOnchainBalance", "onchainBalance"`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ALTER COLUMN "lndOnchainBalance" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" RENAME COLUMN "lndOnchainBalance" TO "onchainBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_e6e6c92e451a1c8873820c88148"`); await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP COLUMN "rootstockBalance"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_d27d96a891edbe6d94e98c78595"`); - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_ac1ee3f6ceaef62d8d4e65da464"`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ALTER COLUMN "customerBalance" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ALTER COLUMN "lightningBalance" DROP DEFAULT`); } } diff --git a/migration/1763453659323-addCitreaMonitoring.js b/migration/1763453659323-addCitreaMonitoring.js index eb9ff70de..ae03b9de3 100644 --- a/migration/1763453659323-addCitreaMonitoring.js +++ b/migration/1763453659323-addCitreaMonitoring.js @@ -4,11 +4,10 @@ module.exports = class addCitreaMonitoring1763453659323 { name = 'addCitreaMonitoring1763453659323' async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "citreaBalance" float NOT NULL CONSTRAINT "DF_98f1eabfa79a178eacdc47fe777" DEFAULT 0`); + await queryRunner.query(`ALTER TABLE "monitoring_balance" ADD "citreaBalance" double precision NOT NULL DEFAULT 0`); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP CONSTRAINT "DF_98f1eabfa79a178eacdc47fe777"`); await queryRunner.query(`ALTER TABLE "monitoring_balance" DROP COLUMN "citreaBalance"`); } } diff --git a/migration/1769204578000-addDebugWallet.js b/migration/1769204578000-addDebugWallet.js index 0ddce12d0..ef76c10ca 100644 --- a/migration/1769204578000-addDebugWallet.js +++ b/migration/1769204578000-addDebugWallet.js @@ -6,11 +6,11 @@ module.exports = class addDebugWallet1769204578000 { async up(queryRunner) { // Update existing wallet to DEBUG role // Note: Wallet must already exist (created via normal registration flow) - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = '0xfc2F5df4217f021C270bFD6b5C3bDB5064C97587'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = '0xfc2F5df4217f021C270bFD6b5C3bDB5064C97587'`); } async down(queryRunner) { // Revert to USER role - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = '0xfc2F5df4217f021C270bFD6b5C3bDB5064C97587'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = '0xfc2F5df4217f021C270bFD6b5C3bDB5064C97587'`); } } diff --git a/migration/1769518555000-addDebugWalletAdmin.js b/migration/1769518555000-addDebugWalletAdmin.js index f04db9759..6f7e3f384 100644 --- a/migration/1769518555000-addDebugWalletAdmin.js +++ b/migration/1769518555000-addDebugWalletAdmin.js @@ -6,11 +6,11 @@ module.exports = class addDebugWalletAdmin1769518555000 { async up(queryRunner) { // Update existing wallet to DEBUG role // Note: Wallet must already exist (created via normal registration flow) - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); } async down(queryRunner) { // Revert to USER role - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); } } diff --git a/migration/1769522277000-addDebugWallet.js b/migration/1769522277000-addDebugWallet.js index 56fcdfb2e..9410182db 100644 --- a/migration/1769522277000-addDebugWallet.js +++ b/migration/1769522277000-addDebugWallet.js @@ -4,10 +4,10 @@ module.exports = class addDebugWallet1769522277000 { name = 'addDebugWallet1769522277000' async up(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = '0xB0bAadE3e6E53aF8ba921AEB245EDEa18322EeFE'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = '0xB0bAadE3e6E53aF8ba921AEB245EDEa18322EeFE'`); } async down(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = '0xB0bAadE3e6E53aF8ba921AEB245EDEa18322EeFE'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = '0xB0bAadE3e6E53aF8ba921AEB245EDEa18322EeFE'`); } } diff --git a/migration/1769696887000-retryDebugWalletAdmin.js b/migration/1769696887000-retryDebugWalletAdmin.js index b7ccb3e6d..2cc7d11f6 100644 --- a/migration/1769696887000-retryDebugWalletAdmin.js +++ b/migration/1769696887000-retryDebugWalletAdmin.js @@ -6,11 +6,11 @@ module.exports = class retryDebugWalletAdmin1769696887000 { async up(queryRunner) { // Retry: Update existing wallet to DEBUG role // Previous migration ran before wallet was registered - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); } async down(queryRunner) { // Revert to USER role - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = '0x65137510d6Df01083f5032B77B04632681f09e7C'`); } } diff --git a/migration/1769965549000-addDebugWallet0x443BD9.js b/migration/1769965549000-addDebugWallet0x443BD9.js index f19bc33dd..5e25de9b4 100644 --- a/migration/1769965549000-addDebugWallet0x443BD9.js +++ b/migration/1769965549000-addDebugWallet0x443BD9.js @@ -4,10 +4,10 @@ module.exports = class addDebugWallet0x443BD91769965549000 { name = 'addDebugWallet0x443BD91769965549000' async up(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = '0x443BD9ebf4B03Ea9B7E1eaC56eAea73B408d14af'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = '0x443BD9ebf4B03Ea9B7E1eaC56eAea73B408d14af'`); } async down(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = '0x443BD9ebf4B03Ea9B7E1eaC56eAea73B408d14af'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = '0x443BD9ebf4B03Ea9B7E1eaC56eAea73B408d14af'`); } } diff --git a/migration/1770148471000-createAssetBoltz.js b/migration/1770148471000-createAssetBoltz.js index 4bccbacd2..a35f16f08 100644 --- a/migration/1770148471000-createAssetBoltz.js +++ b/migration/1770148471000-createAssetBoltz.js @@ -14,7 +14,7 @@ module.exports = class CreateAssetBoltz1770192795341 { * @param {QueryRunner} queryRunner */ async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "asset_boltz" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_f8eee661bfc0ba34f0f18960a35" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_bf77b89d4b7d1e854206229afea" DEFAULT getdate(), "name" nvarchar(255) NOT NULL, "blockchain" nvarchar(255) NOT NULL, "address" nvarchar(255) NOT NULL, "decimals" int NOT NULL, CONSTRAINT "PK_ff1e802368b299c2f1a88ec1af6" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "asset_boltz" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "name" varchar(255) NOT NULL, "blockchain" varchar(255) NOT NULL, "address" varchar(255) NOT NULL, "decimals" int NOT NULL, CONSTRAINT "PK_ff1e802368b299c2f1a88ec1af6" PRIMARY KEY ("id"))`); await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a5500b6a3fca6dd68cc08ea756" ON "asset_boltz" ("name", "blockchain") `); } @@ -22,7 +22,7 @@ module.exports = class CreateAssetBoltz1770192795341 { * @param {QueryRunner} queryRunner */ async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_a5500b6a3fca6dd68cc08ea756" ON "asset_boltz"`); + await queryRunner.query(`DROP INDEX "IDX_a5500b6a3fca6dd68cc08ea756"`); await queryRunner.query(`DROP TABLE "asset_boltz"`); } } diff --git a/migration/1770366346107-createMonitoringEvmBalance.js b/migration/1770366346107-createMonitoringEvmBalance.js index 1fd6d5466..d88c80b27 100644 --- a/migration/1770366346107-createMonitoringEvmBalance.js +++ b/migration/1770366346107-createMonitoringEvmBalance.js @@ -14,7 +14,7 @@ module.exports = class CreateMonitoringEvmBalance1770366346107 { * @param {QueryRunner} queryRunner */ async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "monitoring_evm_balance" ("id" int NOT NULL IDENTITY(1,1), "created" datetime2 NOT NULL CONSTRAINT "DF_a12be90866896c9f2bfca372813" DEFAULT getdate(), "updated" datetime2 NOT NULL CONSTRAINT "DF_58ba0fc2da4061d234fac997dbb" DEFAULT getdate(), "blockchain" varchar(50) NOT NULL, "nativeSymbol" varchar(10) NOT NULL, "nativeBalance" float NOT NULL CONSTRAINT "DF_3223bf469c487599a6954599f5c" DEFAULT 0, "tokenBalances" nvarchar(max), CONSTRAINT "PK_9e27ea97b0eb8872a956abd8e2f" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "monitoring_evm_balance" ("id" SERIAL NOT NULL, "created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "blockchain" varchar(50) NOT NULL, "nativeSymbol" varchar(10) NOT NULL, "nativeBalance" double precision NOT NULL DEFAULT 0, "tokenBalances" text, CONSTRAINT "PK_9e27ea97b0eb8872a956abd8e2f" PRIMARY KEY ("id"))`); await queryRunner.query(`CREATE INDEX "IDX_708ecfcf63cd709863b65da2e1" ON "monitoring_evm_balance" ("blockchain") `); } @@ -22,7 +22,7 @@ module.exports = class CreateMonitoringEvmBalance1770366346107 { * @param {QueryRunner} queryRunner */ async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_708ecfcf63cd709863b65da2e1" ON "monitoring_evm_balance"`); + await queryRunner.query(`DROP INDEX "IDX_708ecfcf63cd709863b65da2e1"`); await queryRunner.query(`DROP TABLE "monitoring_evm_balance"`); } } diff --git a/migration/1771078100000-addDebugWalletBc1q.js b/migration/1771078100000-addDebugWalletBc1q.js index 42dd62278..918d18211 100644 --- a/migration/1771078100000-addDebugWalletBc1q.js +++ b/migration/1771078100000-addDebugWalletBc1q.js @@ -4,10 +4,10 @@ module.exports = class addDebugWalletBc1q1771078100000 { name = 'addDebugWalletBc1q1771078100000' async up(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = GETDATE() WHERE address = 'bc1qv4hs4qkaw3y3e8q5z6lewuvlv7dus75az4gxxy'`); + await queryRunner.query(`UPDATE wallet SET role = 'Debug', updated = CURRENT_TIMESTAMP WHERE address = 'bc1qv4hs4qkaw3y3e8q5z6lewuvlv7dus75az4gxxy'`); } async down(queryRunner) { - await queryRunner.query(`UPDATE wallet SET role = 'User', updated = GETDATE() WHERE address = 'bc1qv4hs4qkaw3y3e8q5z6lewuvlv7dus75az4gxxy'`); + await queryRunner.query(`UPDATE wallet SET role = 'User', updated = CURRENT_TIMESTAMP WHERE address = 'bc1qv4hs4qkaw3y3e8q5z6lewuvlv7dus75az4gxxy'`); } } diff --git a/package-lock.json b/package-lock.json index 5e493fcd8..7cf54c1d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,6 @@ "http-proxy-middleware": "^3.0.5", "lnurl": "^0.24.2", "morgan": "^1.10.1", - "mssql": "^9.3.2", "nestjs-real-ip": "^2.2.0", "node-sql-parser": "^5.3.6", "passport-jwt": "^4.0.1", @@ -198,6 +197,8 @@ "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-2.5.1.tgz", "integrity": "sha512-EHaOXW0RYDKS5CFffnixdyRPak5ytiCtU7uXDcP/uiY+A6jFRwNGzzJBiznkCzvi5EYpY+YWinieqHb0oY916A==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -215,6 +216,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz", "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-util": "^1.13.0", @@ -229,6 +232,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.22.2.tgz", "integrity": "sha512-MzHym+wOi8CLUlKCQu12de0nwcq9k9Kuv43j4Wa++CsCpJwps2eeBQwD2Bu8snkxTtDKDx4GwjuR9E8yC8LNrg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -246,7 +251,9 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/@azure/abort-controller": { "version": "2.1.2", @@ -291,6 +298,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.10.1.tgz", "integrity": "sha512-Nh5PhEOeY6PrnxNPsEHRr9eimxLwgLlpmguQaHKBinFYA/RU9+kOYVOQqOrTsCL+KSxrLLl1gD8Dk5BFW/7l/w==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -309,6 +318,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz", "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-util": "^1.13.0", @@ -323,6 +334,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.22.2.tgz", "integrity": "sha512-MzHym+wOi8CLUlKCQu12de0nwcq9k9Kuv43j4Wa++CsCpJwps2eeBQwD2Bu8snkxTtDKDx4GwjuR9E8yC8LNrg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -340,13 +353,17 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/@azure/core-http-compat": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.3.1.tgz", "integrity": "sha512-az9BkXND3/d5VgdRRQVkiJb2gOmDU8Qcq4GvjtBmDICNiQ9udFmDk4ZpSB5Qq1OmtDJGlQAfBaS4palFsazQ5g==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-client": "^1.10.0", @@ -361,6 +378,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz", "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-util": "^1.13.0", @@ -375,6 +394,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.22.2.tgz", "integrity": "sha512-MzHym+wOi8CLUlKCQu12de0nwcq9k9Kuv43j4Wa++CsCpJwps2eeBQwD2Bu8snkxTtDKDx4GwjuR9E8yC8LNrg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -392,13 +413,17 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/@azure/core-lro": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz", "integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.2.0", @@ -413,13 +438,17 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/@azure/core-paging": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz", "integrity": "sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "tslib": "^2.6.2" }, @@ -431,7 +460,9 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/@azure/core-rest-pipeline": { "version": "1.16.3", @@ -501,6 +532,8 @@ "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-2.1.0.tgz", "integrity": "sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.3.0", @@ -528,6 +561,8 @@ "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "tslib": "^2.2.0" }, @@ -540,6 +575,8 @@ "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -551,6 +588,8 @@ "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "jwa": "^2.0.0", "safe-buffer": "^5.0.1" @@ -561,6 +600,8 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "license": "MIT", + "optional": true, + "peer": true, "bin": { "uuid": "dist/bin/uuid" } @@ -570,6 +611,8 @@ "resolved": "https://registry.npmjs.org/@azure/keyvault-common/-/keyvault-common-2.0.0.tgz", "integrity": "sha512-wRLVaroQtOqfg60cxkzUkGKrKMsCP6uYXAOomOIysSMyt1/YM0eUn9LqieAWM8DLcU4+07Fio2YGpPeqUbpP9w==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.3.0", @@ -589,6 +632,8 @@ "resolved": "https://registry.npmjs.org/@azure/keyvault-keys/-/keyvault-keys-4.10.0.tgz", "integrity": "sha512-eDT7iXoBTRZ2n3fLiftuGJFD+yjkiB1GNqzU2KbY1TLYeXeSPVTVgn2eJ5vmRTZ11978jy2Kg2wI7xa9Tyr8ag==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure-rest/core-client": "^2.3.3", "@azure/abort-controller": "^2.1.2", @@ -612,6 +657,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz", "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-util": "^1.13.0", @@ -626,6 +673,8 @@ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.22.2.tgz", "integrity": "sha512-MzHym+wOi8CLUlKCQu12de0nwcq9k9Kuv43j4Wa++CsCpJwps2eeBQwD2Bu8snkxTtDKDx4GwjuR9E8yC8LNrg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -643,7 +692,9 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/@azure/logger": { "version": "1.3.0", @@ -669,6 +720,8 @@ "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.39.0.tgz", "integrity": "sha512-kks/n2AJzKUk+DBqZhiD+7zeQGBl+WpSOQYzWy6hff3bU0ZrYFqr4keFLlzB5VKuKZog0X59/FGHb1RPBDZLVg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/msal-common": "13.3.3" }, @@ -681,6 +734,8 @@ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.3.tgz", "integrity": "sha512-n278DdCXKeiWhLwhEL7/u9HRMyzhUXLefeajiknf6AmEedoiOiv2r5aRJ7LXdT3NGPyubkdIbthaJlVtmuEqvA==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=0.8.0" } @@ -690,6 +745,8 @@ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.6.0.tgz", "integrity": "sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=0.8.0" } @@ -700,6 +757,8 @@ "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", "deprecated": "A newer major version of this library is available. Please upgrade to the latest available version.", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/msal-common": "13.3.1", "jsonwebtoken": "^9.0.0", @@ -714,6 +773,8 @@ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz", "integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=0.8.0" } @@ -723,6 +784,8 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "license": "MIT", + "optional": true, + "peer": true, "bin": { "uuid": "dist/bin/uuid" } @@ -2781,7 +2844,9 @@ "version": "5.6.5", "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.6.5.tgz", "integrity": "sha512-3zwefSMwHpu8iVUW8YYz227sIv6UFqO31p1Bf1ZH/Vom7CmNyUsXjDBlnNzcuhmOL1XfxZ3nvND42kR23XlbcQ==", - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "optional": true, + "peer": true }, "node_modules/@lukeed/csprng": { "version": "1.1.0", @@ -4035,7 +4100,9 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/@tediousjs/connection-string/-/connection-string-0.5.0.tgz", "integrity": "sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/@tsconfig/node10": { "version": "1.0.11", @@ -5227,6 +5294,8 @@ "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" @@ -5259,6 +5328,8 @@ "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", @@ -5293,6 +5364,8 @@ "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" } @@ -6696,6 +6769,8 @@ "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -6713,6 +6788,8 @@ "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -6730,6 +6807,8 @@ "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -6837,6 +6916,8 @@ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=8" } @@ -6846,6 +6927,8 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -7175,6 +7258,8 @@ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", @@ -7243,6 +7328,8 @@ "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.14.tgz", "integrity": "sha512-3YxX6rVb07B5TV11AV5wsL7nQCHXNwoHPsQC8S4AmBiqYhyNCJ5BRKXkXyDJvs8QzXN20NgRtxe3dEEQD9NLHA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "define-data-property": "^1.1.4", "define-properties": "^1.2.1", @@ -7317,6 +7404,8 @@ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", @@ -7785,6 +7874,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "devOptional": true, "license": "MIT", "engines": { "node": ">=0.8.x" @@ -8476,6 +8566,8 @@ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -8496,6 +8588,8 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "license": "MIT", + "optional": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8505,6 +8599,8 @@ "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" } @@ -8593,6 +8689,8 @@ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -8667,6 +8765,8 @@ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -8759,6 +8859,8 @@ "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -8792,6 +8894,8 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "dunder-proto": "^1.0.0" }, @@ -9150,6 +9254,8 @@ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", @@ -9192,6 +9298,8 @@ "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -9216,6 +9324,8 @@ "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", @@ -9235,6 +9345,8 @@ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "has-bigints": "^1.0.2" }, @@ -9263,6 +9375,8 @@ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -9312,6 +9426,8 @@ "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", @@ -9329,6 +9445,8 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" @@ -9345,6 +9463,8 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "license": "MIT", + "optional": true, + "peer": true, "bin": { "is-docker": "cli.js" }, @@ -9369,6 +9489,8 @@ "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3" }, @@ -9403,6 +9525,8 @@ "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.4", "generator-function": "^2.0.0", @@ -9444,6 +9568,8 @@ "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -9456,6 +9582,8 @@ "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -9477,6 +9605,8 @@ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -9519,6 +9649,8 @@ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", @@ -9537,6 +9669,8 @@ "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -9549,6 +9683,8 @@ "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3" }, @@ -9577,6 +9713,8 @@ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -9593,6 +9731,8 @@ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", @@ -9644,6 +9784,8 @@ "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -9656,6 +9798,8 @@ "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3" }, @@ -9671,6 +9815,8 @@ "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" @@ -9687,6 +9833,8 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -10496,7 +10644,9 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz", "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/js-sha3": { "version": "0.8.0", @@ -11686,6 +11836,8 @@ "resolved": "https://registry.npmjs.org/mssql/-/mssql-9.3.2.tgz", "integrity": "sha512-XI5GOGCCSSNL8K2SSXg9HMyugJoCjLmrhiZfcZrJrJ2r3NfTcnz3Cegeg4m+xPkNVd0o3owsSL/NsDCFYfjOlw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@tediousjs/connection-string": "^0.5.0", "commander": "^11.0.0", @@ -11706,6 +11858,8 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=16" } @@ -11746,7 +11900,9 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/native-duplexpair/-/native-duplexpair-1.0.0.tgz", "integrity": "sha512-E7QQoM+3jvNtlmyfqRZ0/U75VFgCls+fSkbml2MpgWkWyz3ox8Y58gNhfuziuQYGNNQAbFZJQck55LHCnCK6CA==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/natural-compare": { "version": "1.4.0", @@ -11800,6 +11956,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "devOptional": true, "license": "MIT" }, "node_modules/node-addon-api": { @@ -11935,6 +12092,8 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" } @@ -11944,6 +12103,8 @@ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -12010,6 +12171,8 @@ "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", @@ -12096,6 +12259,8 @@ "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.2.6", "object-keys": "^1.1.1", @@ -12734,6 +12899,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -12890,6 +13056,8 @@ "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -12912,6 +13080,8 @@ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -13058,7 +13228,9 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/rimraf": { "version": "4.4.1", @@ -13256,6 +13428,8 @@ "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", @@ -13274,7 +13448,9 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -13301,6 +13477,8 @@ "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "es-errors": "^1.3.0", "isarray": "^2.0.5" @@ -13316,13 +13494,17 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/safe-regex-test": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -13498,6 +13680,8 @@ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -13513,6 +13697,8 @@ "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", @@ -13783,7 +13969,9 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "optional": true, + "peer": true }, "node_modules/sql-highlight": { "version": "6.1.0", @@ -13845,6 +14033,8 @@ "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "es-errors": "^1.3.0", "internal-slot": "^1.1.0" @@ -13858,6 +14048,8 @@ "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=4", "npm": ">=6" @@ -13949,6 +14141,8 @@ "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", @@ -13970,6 +14164,8 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", @@ -13988,6 +14184,8 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -14185,6 +14383,8 @@ "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz", "integrity": "sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=8.0.0" } @@ -14194,6 +14394,8 @@ "resolved": "https://registry.npmjs.org/tedious/-/tedious-15.1.3.tgz", "integrity": "sha512-166EpRm5qknwhEisjZqz/mF7k14fXKJYHRg6XiAXVovd/YkyHJ3SG4Ppy89caPaNFfRr7PVYe+s4dAvKaCMFvw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@azure/identity": "^2.0.4", "@azure/keyvault-keys": "^4.4.0", @@ -14217,6 +14419,8 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -14228,6 +14432,8 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -14239,13 +14445,17 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.2.tgz", "integrity": "sha512-9fqMSQbhJykSeii05nxKl4m6Eqn2P6rOlYiS+C5Dr/HPIU/7yZxu5qzbs40tgaFORiw2Amd0mirjxatXYMkIew==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "optional": true, + "peer": true }, "node_modules/tedious/node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -14785,6 +14995,8 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", @@ -14804,6 +15016,8 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", @@ -14825,6 +15039,8 @@ "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -15091,6 +15307,8 @@ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", @@ -15480,6 +15698,8 @@ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", @@ -15499,6 +15719,8 @@ "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", @@ -15525,13 +15747,17 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/which-collection": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", diff --git a/package.json b/package.json index e8c915a92..f3bf8ec00 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "http-proxy-middleware": "^3.0.5", "lnurl": "^0.24.2", "morgan": "^1.10.1", - "mssql": "^9.3.2", "nestjs-real-ip": "^2.2.0", "node-sql-parser": "^5.3.6", "passport-jwt": "^4.0.1", diff --git a/scripts/db-debug.sh b/scripts/db-debug.sh index 584e27adb..4d3d73675 100755 --- a/scripts/db-debug.sh +++ b/scripts/db-debug.sh @@ -4,7 +4,7 @@ # # Usage: # ./scripts/db-debug.sh # Default query (wallets) -# ./scripts/db-debug.sh "SELECT TOP 10 id FROM wallet" # Custom SQL query +# ./scripts/db-debug.sh "SELECT id FROM wallet LIMIT 10" # Custom SQL query # # Environment: # Uses the central .env file. Required variables: @@ -26,14 +26,14 @@ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then echo " ./scripts/db-debug.sh [SQL_QUERY]" echo "" echo "Examples:" - echo " ./scripts/db-debug.sh \"SELECT TOP 10 * FROM wallet\"" - echo " ./scripts/db-debug.sh \"SELECT TOP 10 * FROM user_transaction ORDER BY id DESC\"" - echo " ./scripts/db-debug.sh \"SELECT TOP 10 * FROM lightning_wallet\"" + echo " ./scripts/db-debug.sh \"SELECT * FROM wallet LIMIT 10\"" + echo " ./scripts/db-debug.sh \"SELECT * FROM user_transaction ORDER BY id DESC LIMIT 10\"" + echo " ./scripts/db-debug.sh \"SELECT * FROM lightning_wallet LIMIT 10\"" exit 0 fi # --- Parse arguments --- -SQL="${1:-SELECT TOP 5 id, address, role FROM wallet ORDER BY id DESC}" +SQL="${1:-SELECT id, address, role FROM wallet ORDER BY id DESC LIMIT 5}" # --- Load environment --- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/src/config/config.ts b/src/config/config.ts index 5493a96c2..eb1741a76 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -32,21 +32,21 @@ export class Configuration { azureIpSubstring = '169.254'; database: TypeOrmModuleOptions = { - type: 'mssql', + type: 'postgres', host: process.env.SQL_HOST, - port: Number.parseInt(process.env.SQL_PORT ?? '1433'), + port: Number.parseInt(process.env.SQL_PORT ?? '5432'), username: process.env.SQL_USERNAME, password: process.env.SQL_PASSWORD, database: process.env.SQL_DB, + ssl: { + rejectUnauthorized: false, + }, entities: ['dist/**/*.entity{.ts,.js}'], autoLoadEntities: true, synchronize: process.env.SQL_SYNCHRONIZE === 'true', migrationsRun: process.env.SQL_MIGRATE === 'true', migrations: ['migration/*.js'], - connectionTimeout: 30000, - requestTimeout: 30000, logging: false, - options: { trustServerCertificate: this.environment === Environment.LOC }, }; auth = { diff --git a/src/subdomains/evm/entities/transaction-evm.entity.ts b/src/subdomains/evm/entities/transaction-evm.entity.ts index 6e89b5358..3571e0a76 100644 --- a/src/subdomains/evm/entities/transaction-evm.entity.ts +++ b/src/subdomains/evm/entities/transaction-evm.entity.ts @@ -17,13 +17,13 @@ export class TransactionEvmEntity extends IEntity { @ManyToOne(() => AssetTransferEntity, { eager: true }) asset: AssetTransferEntity; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) amount: number; @Column() transaction: string; - @Column({ length: 'MAX', nullable: true }) + @Column({ type: 'text', nullable: true }) errorMessage?: string; @OneToOne(() => UserTransactionEntity, (tx) => tx.evmTransaction, { nullable: true, eager: true }) diff --git a/src/subdomains/lightning/entities/transaction-lightning.entity.ts b/src/subdomains/lightning/entities/transaction-lightning.entity.ts index 1621c42d2..a21c59c9c 100644 --- a/src/subdomains/lightning/entities/transaction-lightning.entity.ts +++ b/src/subdomains/lightning/entities/transaction-lightning.entity.ts @@ -42,31 +42,31 @@ export class TransactionLightningEntity extends IEntity { @Column({ nullable: true }) publicKey?: string; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) amount: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) fee: number; - @Column({ type: 'float', nullable: true }) + @Column({ type: 'double precision', nullable: true }) balance?: number; - @Column({ type: 'datetime2' }) + @Column({ type: 'timestamp' }) creationTimestamp: Date; - @Column({ type: 'datetime2', nullable: true }) + @Column({ type: 'timestamp', nullable: true }) expiresTimestamp?: Date; - @Column({ type: 'datetime2', nullable: true }) + @Column({ type: 'timestamp', nullable: true }) confirmedTimestamp?: Date; - @Column({ length: 'MAX', nullable: true }) + @Column({ type: 'text', nullable: true }) description?: string; @Column({ nullable: true }) reason?: string; - @Column({ length: 'MAX', nullable: true }) + @Column({ type: 'text', nullable: true }) paymentRequest?: string; @OneToMany(() => UserTransactionEntity, (tx) => tx.lightningTransaction, { eager: true }) diff --git a/src/subdomains/lightning/entities/transaction-onchain.entity.ts b/src/subdomains/lightning/entities/transaction-onchain.entity.ts index 0d7c006f6..162a0600f 100644 --- a/src/subdomains/lightning/entities/transaction-onchain.entity.ts +++ b/src/subdomains/lightning/entities/transaction-onchain.entity.ts @@ -6,18 +6,18 @@ export class TransactionOnchainEntity extends IEntity { @Column({ unique: true }) transaction: string; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) amount: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) fee: number; - @Column({ type: 'float', nullable: true }) + @Column({ type: 'double precision', nullable: true }) balance?: number; @Column({ type: 'int' }) block: number; - @Column({ type: 'datetime2' }) + @Column({ type: 'timestamp' }) timestamp: Date; } diff --git a/src/subdomains/monitoring/entities/monitoring-balance.entity.ts b/src/subdomains/monitoring/entities/monitoring-balance.entity.ts index 7aa0b9504..6803aba11 100644 --- a/src/subdomains/monitoring/entities/monitoring-balance.entity.ts +++ b/src/subdomains/monitoring/entities/monitoring-balance.entity.ts @@ -11,28 +11,28 @@ export class MonitoringBalanceEntity extends IEntity { @ManyToOne(() => AssetAccountEntity, { eager: true }) asset: AssetAccountEntity; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) onchainBalance: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) lndOnchainBalance: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) lightningBalance: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) citreaBalance: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) customerBalance: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) assetPriceInCHF: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) ldsBalance: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) ldsBalanceInCHF: number; // --- FACTORY METHODS --- // diff --git a/src/subdomains/monitoring/entities/monitoring-evm-balance.entity.ts b/src/subdomains/monitoring/entities/monitoring-evm-balance.entity.ts index 851e87caf..aa6f8cd42 100644 --- a/src/subdomains/monitoring/entities/monitoring-evm-balance.entity.ts +++ b/src/subdomains/monitoring/entities/monitoring-evm-balance.entity.ts @@ -12,10 +12,10 @@ export class MonitoringEvmBalanceEntity extends IEntity { @Column({ type: 'varchar', length: 10 }) nativeSymbol: string; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) nativeBalance: number; - @Column({ type: 'nvarchar', length: 'max', nullable: true }) + @Column({ type: 'text', nullable: true }) tokenBalances: string; // --- FACTORY METHOD --- // diff --git a/src/subdomains/monitoring/repositories/monitoring-balance.repository.ts b/src/subdomains/monitoring/repositories/monitoring-balance.repository.ts index 8742f0788..5b9c01fc7 100644 --- a/src/subdomains/monitoring/repositories/monitoring-balance.repository.ts +++ b/src/subdomains/monitoring/repositories/monitoring-balance.repository.ts @@ -29,7 +29,7 @@ export class MonitoringBalanceRepository extends BaseRepository = { hourly: 'yyyy-MM-dd HH:00', daily: 'yyyy-MM-dd' }; + const allowedFormats: Record = { hourly: 'YYYY-MM-DD HH24:00', daily: 'YYYY-MM-DD' }; const format = allowedFormats[grouping]; if (!format) throw new Error(`Invalid grouping: ${grouping}`); @@ -42,7 +42,7 @@ export class MonitoringBalanceRepository extends BaseRepository= :fromDate', { fromDate }) - .groupBy(`FORMAT(sub.created, '${format}')`), + .groupBy(`TO_CHAR(sub.created, '${format}')`), 'latest', 'b.id = latest.maxId', ) diff --git a/src/subdomains/monitoring/repositories/monitoring-evm-balance.repository.ts b/src/subdomains/monitoring/repositories/monitoring-evm-balance.repository.ts index a4d0a2e1d..c4670a94e 100644 --- a/src/subdomains/monitoring/repositories/monitoring-evm-balance.repository.ts +++ b/src/subdomains/monitoring/repositories/monitoring-evm-balance.repository.ts @@ -25,7 +25,7 @@ export class MonitoringEvmBalanceRepository extends BaseRepository = { hourly: 'yyyy-MM-dd HH:00', daily: 'yyyy-MM-dd' }; + const allowedFormats: Record = { hourly: 'YYYY-MM-DD HH24:00', daily: 'YYYY-MM-DD' }; const format = allowedFormats[grouping]; if (!format) throw new Error(`Invalid grouping: ${grouping}`); @@ -36,7 +36,7 @@ export class MonitoringEvmBalanceRepository extends BaseRepository= :fromDate', { fromDate }) - .groupBy(`sub.blockchain, FORMAT(sub.created, '${format}')`), + .groupBy(`sub.blockchain, TO_CHAR(sub.created, '${format}')`), 'latest', 'b.id = latest.maxId', ) diff --git a/src/subdomains/payment-request/entities/payment-request.entity.ts b/src/subdomains/payment-request/entities/payment-request.entity.ts index ee44c64b6..aa992ca29 100644 --- a/src/subdomains/payment-request/entities/payment-request.entity.ts +++ b/src/subdomains/payment-request/entities/payment-request.entity.ts @@ -26,25 +26,25 @@ export class PaymentRequestEntity extends IEntity { @ManyToOne(() => AssetAccountEntity, { eager: true }) invoiceAsset: AssetAccountEntity; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) invoiceAmount: number; @ManyToOne(() => AssetTransferEntity, { eager: true, nullable: true }) transferAsset?: AssetTransferEntity; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) transferAmount: number; - @Column({ length: 'MAX' }) + @Column({ type: 'text' }) paymentRequest: string; - @Column({ type: 'datetime2' }) + @Column({ type: 'timestamp' }) expiryDate: Date; @Column() paymentMethod: PaymentRequestMethod; - @Column({ length: 'MAX', nullable: true }) + @Column({ type: 'text', nullable: true }) errorMessage?: string; @ManyToOne(() => LightningWalletEntity, { eager: true }) diff --git a/src/subdomains/support/dto/debug.config.ts b/src/subdomains/support/dto/debug.config.ts index b7f8942bc..6090c1bae 100644 --- a/src/subdomains/support/dto/debug.config.ts +++ b/src/subdomains/support/dto/debug.config.ts @@ -7,10 +7,10 @@ import { LogQueryDto, LogQueryTemplate } from './log-query.dto'; const DebugMaxResults = 10000; // Blocked database schemas (system tables) -const DebugBlockedSchemas = ['sys', 'information_schema', 'master', 'msdb', 'tempdb']; +const DebugBlockedSchemas = ['pg_catalog', 'information_schema', 'pg_toast', 'pg_temp']; // Dangerous SQL functions that could be used for data exfiltration or external connections -const DebugDangerousFunctions = ['openrowset', 'openquery', 'opendatasource', 'openxml']; +const DebugDangerousFunctions = ['pg_read_file', 'pg_read_binary_file', 'pg_ls_dir', 'lo_import', 'lo_export', 'dblink', 'dblink_exec', 'dblink_connect', 'pg_sleep', 'pg_execute_server_program']; // Blocked columns per table (sensitive data that should not be exposed via debug endpoint) const DebugBlockedCols: Record = { @@ -21,15 +21,13 @@ const DebugBlockedCols: Record = { payment_request: ['paymentRequest'], }; -// MSSQL debug query configuration -export const MssqlDebugConfig: SqlQueryConfig = { - database: SqlDialect.MSSQL, +// PostgreSQL debug query configuration +export const PostgresDebugConfig: SqlQueryConfig = { + database: SqlDialect.PostgreSQL, blockedSchemas: DebugBlockedSchemas, blockedCols: DebugBlockedCols, dangerousFunctions: DebugDangerousFunctions, maxResults: DebugMaxResults, - checkForXmlJson: true, - checkLinkedServers: true, }; // Log query templates for Azure Application Insights diff --git a/src/subdomains/support/services/support.service.ts b/src/subdomains/support/services/support.service.ts index 80e5a8268..22f5406fb 100644 --- a/src/subdomains/support/services/support.service.ts +++ b/src/subdomains/support/services/support.service.ts @@ -6,7 +6,7 @@ import { LightningLogger } from 'src/shared/services/lightning-logger'; import { DataSource } from 'typeorm'; import { BoltzDebugConfig } from '../dto/boltz-debug.config'; import { DbQueryDto } from '../dto/db-query.dto'; -import { DebugLogQueryTemplates, MssqlDebugConfig } from '../dto/debug.config'; +import { DebugLogQueryTemplates, PostgresDebugConfig } from '../dto/debug.config'; import { LogQueryDto, LogQueryResult } from '../dto/log-query.dto'; import { SqlQueryValidator } from './sql-query-validator'; import { SwapDto, SwapStatsQueryDto, SwapStatsResponseDto, SwapStatusFilter, SwapType } from '../dto/swap-stats.dto'; @@ -109,18 +109,18 @@ export class SupportService implements OnModuleDestroy { async executeDebugQuery(sql: string, userIdentifier: string): Promise[]> { // Validate query using shared validator - const { tables } = this.sqlValidator.validateQuery(sql, MssqlDebugConfig); + const { tables } = this.sqlValidator.validateQuery(sql, PostgresDebugConfig); // Log query for audit trail this.logger.verbose(`Debug query by ${userIdentifier}: ${sql.substring(0, 500)}${sql.length > 500 ? '...' : ''}`); // Execute query with result limit try { - const limitedSql = this.sqlValidator.ensureResultLimit(sql, MssqlDebugConfig); + const limitedSql = this.sqlValidator.ensureResultLimit(sql, PostgresDebugConfig); const result = await this.dataSource.query(limitedSql); // Post-execution masking (defense in depth) - this.sqlValidator.maskBlockedColumns(result, tables, MssqlDebugConfig); + this.sqlValidator.maskBlockedColumns(result, tables, PostgresDebugConfig); return result; } catch (e) { diff --git a/src/subdomains/user/domain/entities/lightning-wallet.entity.ts b/src/subdomains/user/domain/entities/lightning-wallet.entity.ts index deaeaf852..a3d110fb1 100644 --- a/src/subdomains/user/domain/entities/lightning-wallet.entity.ts +++ b/src/subdomains/user/domain/entities/lightning-wallet.entity.ts @@ -17,7 +17,7 @@ export class LightningWalletEntity extends IEntity { @Column() lnurlpId: string; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) balance: number; @ManyToOne(() => AssetAccountEntity, { nullable: false, eager: true }) diff --git a/src/subdomains/user/domain/entities/user-boltcard.entity.ts b/src/subdomains/user/domain/entities/user-boltcard.entity.ts index cba52699b..212cc0cbe 100644 --- a/src/subdomains/user/domain/entities/user-boltcard.entity.ts +++ b/src/subdomains/user/domain/entities/user-boltcard.entity.ts @@ -29,10 +29,10 @@ export class UserBoltcardEntity extends IEntity { @Column({ type: 'int' }) counter: number; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) txLimit: number; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) dailyLimit: number; @Column() @@ -56,7 +56,7 @@ export class UserBoltcardEntity extends IEntity { @Column() otp: string; - @Column({ type: 'datetime2' }) + @Column({ type: 'timestamp' }) creationTimestamp: Date; @ManyToOne(() => LightningWalletEntity, { eager: true }) diff --git a/src/subdomains/user/domain/entities/user-transaction.entity.ts b/src/subdomains/user/domain/entities/user-transaction.entity.ts index ea6e075c3..dbd4dc657 100644 --- a/src/subdomains/user/domain/entities/user-transaction.entity.ts +++ b/src/subdomains/user/domain/entities/user-transaction.entity.ts @@ -16,19 +16,19 @@ export class UserTransactionEntity extends IEntity { @Column() type: UserTransactionType; - @Column({ type: 'float' }) + @Column({ type: 'double precision' }) amount: number; - @Column({ type: 'float', default: 0 }) + @Column({ type: 'double precision', default: 0 }) fee: number; - @Column({ type: 'float', nullable: true }) + @Column({ type: 'double precision', nullable: true }) balance: number; - @Column({ type: 'datetime2' }) + @Column({ type: 'timestamp' }) creationTimestamp: Date; - @Column({ type: 'datetime2', nullable: true }) + @Column({ type: 'timestamp', nullable: true }) expiresTimestamp?: Date; @Column({ nullable: true })