Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bbb3829
chore: update package configurations and dependencies to support Node…
aimensahnoun Mar 25, 2025
352dca7
chore: update CircleCI configuration for Node.js 22.x and standardize…
aimensahnoun Mar 25, 2025
c29d847
re-run ci
aimensahnoun Mar 26, 2025
99b0da0
fix : increase timeout for request creation test
aimensahnoun Mar 26, 2025
af24a88
test: add debug logging for HTTP requests and error handling in HttpD…
aimensahnoun Mar 26, 2025
ffd6edf
fix: reset fetch function
aimensahnoun Mar 26, 2025
1d94e35
chore: update graph-node image version in CircleCI configuration to v…
aimensahnoun Mar 26, 2025
8185ae6
chore: enhance CircleCI configuration with additional environment var…
aimensahnoun Mar 26, 2025
65031ce
chore: revert ci setup
aimensahnoun Mar 26, 2025
3e70c46
test: upgrade graph-node to 0.30.0
aimensahnoun Mar 26, 2025
e36993e
chore: add locale settings for PostgreSQL in CircleCI configuration
aimensahnoun Mar 26, 2025
0c41bbf
chore: update graph-node image version in CircleCI configuration to v…
aimensahnoun Mar 27, 2025
6cf52cc
chore: update PostgreSQL locale settings in CircleCI configuration to…
aimensahnoun Mar 27, 2025
588d517
feat: add debug logging for HTTP request details and error responses …
aimensahnoun Mar 27, 2025
84131e1
feat: add retry configuration options for thegraph in request-node
aimensahnoun Mar 27, 2025
7ef30a5
chore: revert circleci script
aimensahnoun Mar 27, 2025
9b86234
chore: update graphql and graphql-request dependencies to latest vers…
aimensahnoun Mar 27, 2025
aaec81d
chore: update Node.js image version in CircleCI configuration to 22.14
aimensahnoun Mar 27, 2025
582358e
feat: add keepalive and timeout options to HTTP request configuration…
aimensahnoun Mar 27, 2025
8dad87e
chore: update dependencies in request-client.js package, including no…
aimensahnoun Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
references:
working_directory: &working_directory ~/repo
node_image: &node_image
image: cimg/node:18.18
image: cimg/node:22.14
environment:
NODE_OPTIONS: '--max-old-space-size=4096'
ipfs_image: &ipfs_image
Expand Down
2 changes: 1 addition & 1 deletion .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"repository-type": "error",
"scripts-type": "error",
"version-type": "error",
"valid-values-engines": ["error", [{ "node": ">=18.0.0" }]],
"valid-values-engines": ["error", [{ "node": ">=22.0.0" }]],
"valid-values-name-scope": ["error", ["@requestnetwork"]],
"valid-values-author": ["error", ["Request Network"]],
"valid-values-private": "off",
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.18.0
v22.14.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "https://github.com/RequestNetwork/requestNetwork",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"workspaces": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/advanced-logic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/currency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-format/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/epk-cipher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/epk-decryption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/epk-signature/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"directories": {
"test": "test"
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-protocol-cipher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"directories": {
"lib": "src",
Expand Down
2 changes: 1 addition & 1 deletion packages/multi-format/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/payment-detection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/payment-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/request-client.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -55,6 +55,7 @@
"@requestnetwork/types": "0.53.0",
"@requestnetwork/utils": "0.53.0",
"ethers": "5.7.2",
"node-fetch": "^3.3.2",
"qs": "6.11.2",
"tslib": "2.5.0"
},
Expand Down
24 changes: 21 additions & 3 deletions packages/request-client.js/src/http-data-access-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import { ClientTypes } from '@requestnetwork/types';
import { retry } from '@requestnetwork/utils';
import httpConfigDefaults from './http-config-defaults';
import { stringify } from 'qs';
import fetch from 'node-fetch';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const packageJson = require('../package.json');
export type NodeConnectionConfig = { baseURL: string; headers: Record<string, string> };
export type NodeConnectionConfig = {
baseURL: string;
headers: Record<string, string>;
};

export class HttpDataAccessConfig {
/**
Expand Down Expand Up @@ -90,20 +94,34 @@ export class HttpDataAccessConfig {
}
url.search = stringify(params);
}

const r = await fetch(url, {
method,
body: body ? JSON.stringify(body) : undefined,
headers: {
'Content-Type': 'application/json',
...headers,
},

...options,
});

if (r.ok) {
return await r.json();
return (await r.json()) as T;
}

throw Object.assign(new Error(r.statusText), {
const errorBody = await r.text();
console.error('Request failed:', {
url: url.toString(),
method,
params,
body,
status: r.status,
statusText: r.statusText,
errorBody,
});

throw Object.assign(new Error(`${r.statusText}`), {
status: r.status,
statusText: r.statusText,
});
Expand Down
6 changes: 4 additions & 2 deletions packages/request-client.js/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ describe('request-client.js', () => {
});
beforeEach(() => {
spyPersistTransaction.mockReturnValue({});
spyGetTransactionsByChannelId.mockReturnValue({ result: mockedTransactions });
spyGetTransactionsByChannelId.mockReturnValue({
result: mockedTransactions,
});
});
afterAll(() => {
mockServer.close();
Expand Down Expand Up @@ -940,7 +942,7 @@ describe('request-client.js', () => {

expect(requestData.meta).not.toBeNull();
expect(requestData.meta!.transactionManagerMeta.encryptionMethod).toBe('ecies-aes256-gcm');
});
}, 30000);

it('creates an encrypted request and accept it', async () => {
const requestNetwork = new RequestNetwork({
Expand Down
2 changes: 1 addition & 1 deletion packages/request-logic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions packages/request-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/bin",
"bin": {
Expand Down Expand Up @@ -59,8 +59,8 @@
"dotenv": "8.2.0",
"ethers": "5.7.2",
"express": "4.21.0",
"graphql": "16.8.1",
"graphql-request": "6.1.0",
"graphql": "16.10.0",
"graphql-request": "7.1.2",
"http-shutdown": "1.2.2",
"http-status-codes": "2.1.4",
"morgan": "1.10.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/request-node/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const defaultValues = {
},
thegraph: {
nodeUrl: 'http://localhost:8000/subgraphs/name/RequestNetwork/request-storage',
retries: 3,
retryDelay: 1000,
timeout: 30000,
},
persistTransactionTimeout: 600,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/src/lib/index.js",
"types": "dist/src/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/thegraph-data-access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/usage-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"scripts": {
"build": "tsc -b tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-signature/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
Loading