Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d442803
ci: update Node.js version in CircleCI config from 18.18 to 22.14
aimensahnoun Mar 28, 2025
98e3913
feat(http-data-access): enhance response logging for success and erro…
aimensahnoun Mar 28, 2025
4a4aa0b
fix(request): improve error logging and response handling in getTrans…
aimensahnoun Mar 28, 2025
5ca36ab
chore(deps): update graphql-request to version 7.1.2 in package.json …
aimensahnoun Mar 28, 2025
c28958a
refactor(subgraph-client): update RequestConfig import and modify con…
aimensahnoun Mar 28, 2025
29676ac
refactor(types): update TheGraphDataAccessOptions to omit headers in …
aimensahnoun Mar 28, 2025
ee54c3f
chore(jest): update transformIgnorePatterns to include specific modul…
aimensahnoun Mar 28, 2025
2334953
chore(jest): refactor Jest configuration to use ts-jest for TypeScrip…
aimensahnoun Mar 28, 2025
a8c86af
chore(jest): update Jest configuration for integration tests to inclu…
aimensahnoun Mar 28, 2025
e4306dd
chore(jest): replace ts-jest with babel-jest for JavaScript files and…
aimensahnoun Mar 28, 2025
37f1d7e
chore(integration-test): add Babel configuration and update Jest sett…
aimensahnoun Mar 28, 2025
720b686
chore(integration-test): update Babel and Jest configurations to alig…
aimensahnoun Mar 28, 2025
9de04d1
chore(integration-test): pin babel-jest version to 29.7.0 and remove …
aimensahnoun Mar 28, 2025
988bcc1
chore: update Node.js engine requirement to >=22.0.0 across all packa…
aimensahnoun Mar 28, 2025
bcf0665
chore: update jest config and add babel config
aimensahnoun Mar 28, 2025
7328d25
chore: add Babel dependencies for improved module handling and TypeSc…
aimensahnoun Mar 28, 2025
548f460
chore: remove debuggin logs.
aimensahnoun Mar 28, 2025
56e35dd
chore: add package-lock.json and update yarn.lock for consistent depe…
aimensahnoun Apr 2, 2025
92c2c4d
chore: update package.json files to manage Babel runtime dependencies…
aimensahnoun Apr 2, 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
4 changes: 4 additions & 0 deletions packages/integration-test/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-transform-modules-commonjs'],
};
14 changes: 14 additions & 0 deletions packages/integration-test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,18 @@ const jestCommonConfig = require('../../jest.config');
/** @type {import('jest').Config} */
module.exports = {
...jestCommonConfig,
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.json',
},
],
'^.+\\.js$': ['babel-jest', { configFile: './babel.config.js' }],
},
transformIgnorePatterns: ['/node_modules/(?!(graphql-request|@superfluid-finance/sdk-core)/)'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};
8 changes: 7 additions & 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 All @@ -41,6 +41,11 @@
"test:lit": "jest test/lit-protocol.test.ts --forceExit"
},
"devDependencies": {
"@babel/core": "7.23.9",
"@babel/plugin-transform-modules-commonjs": "7.23.3",
"@babel/plugin-transform-runtime": "7.23.3",
"@babel/preset-env": "7.23.3",
"@babel/preset-typescript": "7.23.3",
"@lit-protocol/lit-node-client": "7.0.5",
"@requestnetwork/advanced-logic": "0.53.0",
"@requestnetwork/currency": "0.27.0",
Expand All @@ -61,6 +66,7 @@
"@requestnetwork/web3-signature": "0.8.9",
"@types/jest": "29.5.6",
"@types/node": "18.11.9",
"babel-jest": "29.7.0",
"ethers": "5.7.2",
"jest": "29.5.0",
"jest-junit": "16.0.0",
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
2 changes: 1 addition & 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
4 changes: 3 additions & 1 deletion packages/request-client.js/src/http-data-access-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ export class HttpDataAccessConfig {
},
...options,
});

if (r.ok) {
return await r.json();
const responseBody = await r.json();
return responseBody;
}

throw Object.assign(new Error(r.statusText), {
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
4 changes: 4 additions & 0 deletions packages/request-node/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-transform-modules-commonjs'],
};
14 changes: 14 additions & 0 deletions packages/request-node/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@ const jestCommonConfig = require('../../jest.config');
/** @type {import('jest').Config} */
module.exports = {
...jestCommonConfig,
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.json',
},
],
'^.+\\.js$': ['babel-jest', { configFile: './babel.config.js' }],
},
transformIgnorePatterns: ['/node_modules/(?!(graphql-request|@superfluid-finance/sdk-core)/)'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};
8 changes: 7 additions & 1 deletion 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 @@ -69,13 +69,19 @@
"yargs": "17.6.2"
},
"devDependencies": {
"@babel/core": "7.23.9",
"@babel/plugin-transform-modules-commonjs": "7.23.3",
"@babel/plugin-transform-runtime": "7.23.3",
"@babel/preset-env": "7.23.3",
"@babel/preset-typescript": "7.23.3",
"@types/cors": "2.8.9",
"@types/express": "4.17.17",
"@types/jest": "29.5.6",
"@types/morgan": "1.9.9",
"@types/node": "18.11.9",
"@types/supertest": "2.0.10",
"@types/yargs": "17.0.14",
"babel-jest": "29.7.0",
"jest": "29.5.0",
"jest-junit": "16.0.0",
"msw": "2.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default class GetTransactionsByChannelIdHandler {
serverResponse.status(StatusCodes.OK).send(transactions);
} catch (e) {
this.logger.error(`getTransactionsByChannelId error: ${e}`);

serverResponse.status(StatusCodes.INTERNAL_SERVER_ERROR).send(e);
}
}
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
4 changes: 2 additions & 2 deletions 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 All @@ -45,7 +45,7 @@
"@requestnetwork/types": "0.53.0",
"@requestnetwork/utils": "0.53.0",
"ethers": "5.7.2",
"graphql-request": "6.1.0",
"graphql-request": "7.1.2",
"tslib": "2.5.0"
},
"devDependencies": {
Expand Down
7 changes: 5 additions & 2 deletions packages/thegraph-data-access/src/subgraph-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ import {
Transaction,
TransactionsBody,
} from './queries';
import { Variables, RequestConfig } from 'graphql-request/build/cjs/types';
import { Variables } from 'graphql-request/build/cjs/types';
import { RequestConfig } from 'graphql-request/build/legacy/helpers/types';

// Max Int value (as supported by grapqhl types)
const MAX_INT_VALUE = 0x7fffffff;

type ClientConfig = Omit<RequestConfig, 'headers'> & { headers?: Record<string, string> };

export class SubgraphClient implements StorageTypes.IIndexer {
private graphql: GraphQLClient;
public readonly endpoint: string;

private readonly DEFAULT_PAGE_SIZE = 100;
private readonly MAX_PAGE_SIZE = 1000;

constructor(endpoint: string, options?: RequestConfig) {
constructor(endpoint: string, options?: ClientConfig) {
this.endpoint = endpoint;
this.graphql = new GraphQLClient(endpoint, options);
}
Expand Down
5 changes: 2 additions & 3 deletions packages/thegraph-data-access/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { StorageTypes } from '@requestnetwork/types';
import { DataAccessBaseOptions } from '@requestnetwork/data-access';

import { RequestConfig } from 'graphql-request/build/cjs/types';
import { RequestConfig } from 'graphql-request/build/legacy/helpers/types';

export type TheGraphDataAccessOptions = DataAccessBaseOptions & {
graphql: { url: string } & RequestConfig;
graphql: { url: string } & Omit<RequestConfig, 'headers'> & { headers?: Record<string, string> };
storage?: StorageTypes.IStorageWrite;
};
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