diff --git a/package-lock.json b/package-lock.json index 0f787f19..be4bbecf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@babel/preset-env": "^7.24.5", "@chakra-ui/react": "^2.8.2", "@deriv-com/analytics": "^1.10.1", - "@deriv-com/api-hooks": "^1.4.7", + "@deriv-com/api-hooks": "^1.4.8", "@deriv-com/translations": "^1.2.4", "@deriv-com/ui": "^1.29.0", "@deriv-com/utils": "^0.0.28", @@ -3791,20 +3791,38 @@ } }, "node_modules/@deriv-com/api-hooks": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-1.4.7.tgz", - "integrity": "sha512-A+mvQ0czQdTwXntpjQRKIOeKB9fPcZLqpPeWDKHuYKk0kuN/6Emeg84vWP2Xg1rwH592IT47g2y4HjVFmHl7pg==", + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-1.4.8.tgz", + "integrity": "sha512-CuDd8li67niEq/Mmncd2u2b1l/eP4XWwiYE/xrObmoaOxPlKPdauWiMxTDbW21HBdqW7b8U2Yc1uOhpye/5QSA==", "license": "ISC", "dependencies": { - "@deriv-com/utils": "^0.0.28", - "@deriv/api-types": "^1.0.985", + "@deriv-com/utils": "^0.0.30", + "@deriv/api-types": "^1.0.1449", "@deriv/deriv-api": "^1.0.15", - "@tanstack/react-query": "^5.48.0" + "@tanstack/react-query": "^5.51.16" }, "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "^4.18.0" + "@rollup/rollup-linux-x64-gnu": "^4.19.1" } }, + "node_modules/@deriv-com/api-hooks/node_modules/@deriv-com/utils": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.30.tgz", + "integrity": "sha512-ZOpIfnQN4N1dM/JHSpQFzz+0jRW5mefy2BpzvFnvMBtp/IVY6+2Uw304cAIBuz56sKnTPP1FTBW7ndRuJDKpMQ==" + }, + "node_modules/@deriv-com/api-hooks/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz", + "integrity": "sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@deriv-com/eslint-config-deriv": { "version": "2.1.0-beta.3", "resolved": "https://registry.npmjs.org/@deriv-com/eslint-config-deriv/-/eslint-config-deriv-2.1.0-beta.3.tgz", @@ -3873,9 +3891,10 @@ "integrity": "sha512-JJayPckG5ajwZjJ0H3VYe9GXcTpMY7oNOkMRiqwv14dtcsMTsYow9cVs3vfbiL4U59WGQBGMkkbh0EwSjYVrvQ==" }, "node_modules/@deriv/api-types": { - "version": "1.0.995", - "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.995.tgz", - "integrity": "sha512-RR6BQUKa2QhnKuW0aIJPIxbobD7VvZC2Cl89FWxw/tJZ2hcZz51Et9upnAw8d8bs3okEKxx0Rq32ZblNfeKlzg==" + "version": "1.0.1449", + "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.1449.tgz", + "integrity": "sha512-G4e6e/fRO7iX9mbfTuI4p81DA/ExqFSKLErL9d308f1Eq74soTuQ/0ht6EdYcOq9UhdsDifsSSEYbFABtRl10w==", + "license": "Apache-2.0" }, "node_modules/@deriv/deriv-api": { "version": "1.0.15", @@ -5657,20 +5676,22 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.48.0.tgz", - "integrity": "sha512-lZAfPPeVIqXCswE9SSbG33B6/91XOWt/Iq41bFeWb/mnHwQSIfFRbkS4bfs+WhIk9abRArF9Id2fp0Mgo+hq6Q==", + "version": "5.51.16", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.51.16.tgz", + "integrity": "sha512-zfV+WAtBGm1dUIbL0w/x8qTqVLKU1/Bo1p19J9LF02MmIc4FxzMImMXhFzYJQl5Hx8Wit6RiQ4tB/DvN8y9zaQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.48.0.tgz", - "integrity": "sha512-GDExbjYWzvDokyRqMSWXdrPiYpp95Aig0oeMIrxTaruOJJgWiWfUP//OAaowm2RrRkGVsavSZdko/XmIrrV2Nw==", + "version": "5.51.16", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.51.16.tgz", + "integrity": "sha512-NZnpJ30zkwaA2ZPhxJLs/qoMbd0yNAj6yyb3JTADJx9HjSdtvnNzOY1bDa3bU1B9CZTBBb7W9E1PpWlNXdgESg==", + "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.48.0" + "@tanstack/query-core": "5.51.16" }, "funding": { "type": "github", diff --git a/package.json b/package.json index 80eb5840..e54afedb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@babel/preset-env": "^7.24.5", "@chakra-ui/react": "^2.8.2", "@deriv-com/analytics": "^1.10.1", - "@deriv-com/api-hooks": "^1.4.7", + "@deriv-com/api-hooks": "^1.4.8", "@deriv-com/translations": "^1.2.4", "@deriv-com/ui": "^1.29.0", "@deriv-com/utils": "^0.0.28", diff --git a/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserCreate.spec.ts b/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserCreate.spec.ts index e76a1de2..203ea043 100644 --- a/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserCreate.spec.ts +++ b/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserCreate.spec.ts @@ -38,8 +38,8 @@ describe('useAdvertiserCreate', () => { }); it('should return modified data if the data is ready', () => { - // @ts-expect-error not all values are defined mockUseP2PAdvertiserCreate.mockReturnValueOnce({ + // @ts-expect-error not all values are defined data: { ...mockAdvertiserCreateValues, }, diff --git a/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserList.spec.ts b/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserList.spec.ts index e953f5a7..7ac05a36 100644 --- a/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserList.spec.ts +++ b/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserList.spec.ts @@ -24,9 +24,10 @@ describe('useAdvertiserList', () => { it('should return modified data if the data is ready', () => { const mockData = { ...mockAdvertiserCreateValues, is_blocked: 0 as const }; - // @ts-expect-error not all properties are defined + mockUseP2pAdvertiserList.mockReturnValueOnce({ data: [ + // @ts-expect-error not all properties are defined { ...mockData, }, diff --git a/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserUpdate.spec.ts b/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserUpdate.spec.ts index b6e2c1ce..261badf0 100644 --- a/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserUpdate.spec.ts +++ b/src/hooks/api/advertiser/p2p-advertiser/__tests__/useAdvertiserUpdate.spec.ts @@ -38,8 +38,8 @@ describe('useAdvertiserUpdate', () => { }); it('should return modified data if the data is ready', () => { - // @ts-expect-error not all values are defined mockUseP2pAdvertiserUpdate.mockReturnValueOnce({ + // @ts-expect-error not all values are defined data: { ...mockAdvertiserCreateValues, }, diff --git a/src/hooks/api/order-dispute/p2p-order-dispute/__tests__/useOrderDispute.spec.ts b/src/hooks/api/order-dispute/p2p-order-dispute/__tests__/useOrderDispute.spec.ts index 84491952..5d5bd4d2 100644 --- a/src/hooks/api/order-dispute/p2p-order-dispute/__tests__/useOrderDispute.spec.ts +++ b/src/hooks/api/order-dispute/p2p-order-dispute/__tests__/useOrderDispute.spec.ts @@ -43,7 +43,6 @@ describe('useOrderDispute', () => { }); it('should return the correct data', () => { - // @ts-expect-error - useQuery return values not specified mockUseP2pOrderDispute.mockReturnValue({ data: { account_currency: 'USD', @@ -54,6 +53,7 @@ describe('useOrderDispute', () => { payment_method: 'payment_method', type: 'buy', }, + // @ts-expect-error - useQuery return values not specified advertiser_details: { completed_orders_count: 1, first_name: 'first_name',