diff --git a/.github/workflows/samples-typescript-encode-decode.yaml b/.github/workflows/samples-typescript-encode-decode.yaml index 0c3927bb943e..4794e08df42b 100644 --- a/.github/workflows/samples-typescript-encode-decode.yaml +++ b/.github/workflows/samples-typescript-encode-decode.yaml @@ -16,9 +16,9 @@ jobs: # clients - samples/client/others/typescript/encode-decode/test node-version: - - 16 - - 18 - 20 + - 22 + - 24 steps: - uses: actions/checkout@v5 diff --git a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache index 67ff4139aee1..46dd740b7d4d 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache @@ -3,8 +3,7 @@ // TODO: evaluate if we can easily get rid of this library import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; {{/node}} {{/platforms}} import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; @@ -106,7 +105,7 @@ export class RequestContext { private signal: AbortSignal | undefined = undefined; {{#platforms}} {{#node}} - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; {{/node}} {{/platforms}} @@ -182,7 +181,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -196,13 +195,12 @@ export class RequestContext { {{#platforms}} {{#node}} - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } {{/node}} {{/platforms}} diff --git a/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache b/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache index b822d4d9d3ad..a4f779b937c4 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache @@ -2,7 +2,7 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http{{importFileEx import { from, Observable } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; {{#platforms}} {{#node}} -import fetch from "node-fetch"; +import { fetch } from 'undici'; {{/node}} {{#browser}} import "whatwg-fetch"; @@ -22,7 +22,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { signal: request.getSignal(), {{#platforms}} {{#node}} - agent: request.getAgent(), + dispatcher: request.getDispatcher(), {{/node}} {{#browser}} credentials: "same-origin" diff --git a/modules/openapi-generator/src/main/resources/typescript/package.mustache b/modules/openapi-generator/src/main/resources/typescript/package.mustache index bec909615ae3..e997a0c645b1 100644 --- a/modules/openapi-generator/src/main/resources/typescript/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/package.mustache @@ -24,13 +24,11 @@ {{/supportsES6}} "exports": { ".": { - {{#supportsES6}} "import": "./dist/index.js", - {{/supportsES6}} {{^supportsES6}} "require": "./dist/index.js", {{/supportsES6}} - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -46,8 +44,7 @@ {{#fetch-api}} {{#platforms}} {{#node}} - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", + "undici": "^7.16.0", {{/node}} {{#browser}} "whatwg-fetch": "^3.0.0", @@ -61,7 +58,7 @@ {{/frameworks}} {{#platforms}} {{#node}} - "@types/node": "^16.18.126", + "@types/node": "^20.17.10", "form-data": "^4.0.4", {{/node}} {{/platforms}} diff --git a/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache index 894b2ef9d3a0..61ab39eb1556 100644 --- a/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache @@ -8,6 +8,7 @@ {{/supportsES6}} {{^supportsES6}} "target": "es5", + "module": "commonjs", {{/supportsES6}} "moduleResolution": "node", "declaration": true, diff --git a/samples/client/echo_api/typescript/build/http/http.ts b/samples/client/echo_api/typescript/build/http/http.ts index 7eaf00563272..fcedacfb8ed8 100644 --- a/samples/client/echo_api/typescript/build/http/http.ts +++ b/samples/client/echo_api/typescript/build/http/http.ts @@ -1,8 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -58,7 +57,7 @@ export class RequestContext { private body: RequestBody = undefined; private url: URL; private signal: AbortSignal | undefined = undefined; - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -132,7 +131,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -144,13 +143,12 @@ export class RequestContext { return this.signal; } - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } } diff --git a/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts b/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts index d7ce46e4bee8..23cfa867b046 100644 --- a/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts +++ b/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts @@ -1,6 +1,6 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http'; import { from, Observable } from '../rxjsStub'; -import fetch from "node-fetch"; +import { fetch } from 'undici'; export class IsomorphicFetchHttpLibrary implements HttpLibrary { @@ -13,7 +13,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), signal: request.getSignal(), - agent: request.getAgent(), + dispatcher: request.getDispatcher(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/client/echo_api/typescript/build/package.json b/samples/client/echo_api/typescript/build/package.json index a4d85fed64f7..2df36674dca8 100644 --- a/samples/client/echo_api/typescript/build/package.json +++ b/samples/client/echo_api/typescript/build/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -31,9 +32,8 @@ "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", - "@types/node": "^16.18.126", + "undici": "^7.16.0", + "@types/node": "^20.17.10", "form-data": "^4.0.4", "es6-promise": "^4.2.4" }, diff --git a/samples/client/echo_api/typescript/build/tsconfig.json b/samples/client/echo_api/typescript/build/tsconfig.json index 953996de3971..c765dce5de53 100644 --- a/samples/client/echo_api/typescript/build/tsconfig.json +++ b/samples/client/echo_api/typescript/build/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/client/others/typescript/builds/array-of-lists/http/http.ts b/samples/client/others/typescript/builds/array-of-lists/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/client/others/typescript/builds/array-of-lists/http/http.ts +++ b/samples/client/others/typescript/builds/array-of-lists/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/client/others/typescript/builds/array-of-lists/package.json b/samples/client/others/typescript/builds/array-of-lists/package.json index 000e9c5844c4..c8f6a2b429cd 100644 --- a/samples/client/others/typescript/builds/array-of-lists/package.json +++ b/samples/client/others/typescript/builds/array-of-lists/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/client/others/typescript/builds/array-of-lists/tsconfig.json b/samples/client/others/typescript/builds/array-of-lists/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/client/others/typescript/builds/array-of-lists/tsconfig.json +++ b/samples/client/others/typescript/builds/array-of-lists/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/client/others/typescript/builds/enum-single-value/http/http.ts b/samples/client/others/typescript/builds/enum-single-value/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/client/others/typescript/builds/enum-single-value/http/http.ts +++ b/samples/client/others/typescript/builds/enum-single-value/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/client/others/typescript/builds/enum-single-value/package.json b/samples/client/others/typescript/builds/enum-single-value/package.json index 000e9c5844c4..c8f6a2b429cd 100644 --- a/samples/client/others/typescript/builds/enum-single-value/package.json +++ b/samples/client/others/typescript/builds/enum-single-value/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/client/others/typescript/builds/enum-single-value/tsconfig.json b/samples/client/others/typescript/builds/enum-single-value/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/client/others/typescript/builds/enum-single-value/tsconfig.json +++ b/samples/client/others/typescript/builds/enum-single-value/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/client/others/typescript/builds/null-types-simple/http/http.ts b/samples/client/others/typescript/builds/null-types-simple/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/client/others/typescript/builds/null-types-simple/http/http.ts +++ b/samples/client/others/typescript/builds/null-types-simple/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/client/others/typescript/builds/null-types-simple/package.json b/samples/client/others/typescript/builds/null-types-simple/package.json index 000e9c5844c4..c8f6a2b429cd 100644 --- a/samples/client/others/typescript/builds/null-types-simple/package.json +++ b/samples/client/others/typescript/builds/null-types-simple/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/client/others/typescript/builds/null-types-simple/tsconfig.json b/samples/client/others/typescript/builds/null-types-simple/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/client/others/typescript/builds/null-types-simple/tsconfig.json +++ b/samples/client/others/typescript/builds/null-types-simple/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/client/others/typescript/builds/with-unique-items/http/http.ts b/samples/client/others/typescript/builds/with-unique-items/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/client/others/typescript/builds/with-unique-items/http/http.ts +++ b/samples/client/others/typescript/builds/with-unique-items/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/client/others/typescript/builds/with-unique-items/package.json b/samples/client/others/typescript/builds/with-unique-items/package.json index 000e9c5844c4..c8f6a2b429cd 100644 --- a/samples/client/others/typescript/builds/with-unique-items/package.json +++ b/samples/client/others/typescript/builds/with-unique-items/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/client/others/typescript/builds/with-unique-items/tsconfig.json b/samples/client/others/typescript/builds/with-unique-items/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/client/others/typescript/builds/with-unique-items/tsconfig.json +++ b/samples/client/others/typescript/builds/with-unique-items/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/client/others/typescript/encode-decode/build/http/http.ts b/samples/client/others/typescript/encode-decode/build/http/http.ts index 7eaf00563272..fcedacfb8ed8 100644 --- a/samples/client/others/typescript/encode-decode/build/http/http.ts +++ b/samples/client/others/typescript/encode-decode/build/http/http.ts @@ -1,8 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -58,7 +57,7 @@ export class RequestContext { private body: RequestBody = undefined; private url: URL; private signal: AbortSignal | undefined = undefined; - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -132,7 +131,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -144,13 +143,12 @@ export class RequestContext { return this.signal; } - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } } diff --git a/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts b/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts index d7ce46e4bee8..23cfa867b046 100644 --- a/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts +++ b/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts @@ -1,6 +1,6 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http'; import { from, Observable } from '../rxjsStub'; -import fetch from "node-fetch"; +import { fetch } from 'undici'; export class IsomorphicFetchHttpLibrary implements HttpLibrary { @@ -13,7 +13,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), signal: request.getSignal(), - agent: request.getAgent(), + dispatcher: request.getDispatcher(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/client/others/typescript/encode-decode/build/package-lock.json b/samples/client/others/typescript/encode-decode/build/package-lock.json index 7748175b5b02..2c38edf5b2db 100644 --- a/samples/client/others/typescript/encode-decode/build/package-lock.json +++ b/samples/client/others/typescript/encode-decode/build/package-lock.json @@ -9,51 +9,42 @@ "version": "1.0.0", "license": "Unlicense", "dependencies": { - "@types/node": "*", - "@types/node-fetch": "^2.5.7", + "@types/node": "^20.17.10", "es6-promise": "^4.2.4", - "form-data": "^2.5.0", - "node-fetch": "^2.6.0" + "form-data": "^4.0.4", + "undici": "^7.16.0" }, "devDependencies": { "typescript": "^4.0" } }, "node_modules/@types/node": { - "version": "22.12.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.12.0.tgz", - "integrity": "sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==", + "version": "20.19.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.25.tgz", + "integrity": "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==", + "license": "MIT", "dependencies": { - "undici-types": "~6.20.0" + "undici-types": "~6.21.0" } }, - "node_modules/@types/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" }, "engines": { - "node": ">= 6" + "node": ">= 0.4" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -73,23 +64,190 @@ "node": ">=0.4.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "node_modules/form-data": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.2.tgz", - "integrity": "sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12", - "safe-buffer": "^5.2.1" + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" }, "engines": { - "node": ">= 0.12" + "node": ">= 6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" } }, "node_modules/mime-db": { @@ -111,49 +269,6 @@ "node": ">= 0.6" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -167,24 +282,20 @@ "node": ">=4.2.0" } }, - "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "node_modules/undici": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" } } } diff --git a/samples/client/others/typescript/encode-decode/build/package.json b/samples/client/others/typescript/encode-decode/build/package.json index 41f90227658c..35ecc57c6c00 100644 --- a/samples/client/others/typescript/encode-decode/build/package.json +++ b/samples/client/others/typescript/encode-decode/build/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -31,9 +32,8 @@ "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", - "@types/node": "^16.18.126", + "undici": "^7.16.0", + "@types/node": "^20.17.10", "form-data": "^4.0.4", "es6-promise": "^4.2.4" }, diff --git a/samples/client/others/typescript/encode-decode/build/tsconfig.json b/samples/client/others/typescript/encode-decode/build/tsconfig.json index 953996de3971..c765dce5de53 100644 --- a/samples/client/others/typescript/encode-decode/build/tsconfig.json +++ b/samples/client/others/typescript/encode-decode/build/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/client/others/typescript/encode-decode/test/package-lock.json b/samples/client/others/typescript/encode-decode/test/package-lock.json index e294ae924b8b..dbffefb71d4f 100644 --- a/samples/client/others/typescript/encode-decode/test/package-lock.json +++ b/samples/client/others/typescript/encode-decode/test/package-lock.json @@ -13,7 +13,7 @@ "@openapitools/typescript-encode-decode": "file:../build", "@types/chai": "^4.3.0", "@types/mocha": "^10.0.0", - "@types/node": "^16.6.2", + "@types/node": "^22.12.0", "chai": "^4.3.0", "mocha": "^10.2.0", "ts-node": "^10.9.0", @@ -25,11 +25,10 @@ "version": "1.0.0", "license": "Unlicense", "dependencies": { - "@types/node": "*", - "@types/node-fetch": "^2.5.7", + "@types/node": "^20.17.10", "es6-promise": "^4.2.4", - "form-data": "^2.5.0", - "node-fetch": "^2.6.0" + "form-data": "^4.0.4", + "undici": "^7.16.0" }, "devDependencies": { "typescript": "^4.0" @@ -103,9 +102,13 @@ "integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==" }, "node_modules/@types/node": { - "version": "16.18.59", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.59.tgz", - "integrity": "sha512-PJ1w2cNeKUEdey4LiPra0ZuxZFOGvetswE8qHRriV/sUkL5Al4tTmPV9D2+Y/TPIxTHHgxTfRjZVKWhPw/ORhQ==" + "version": "22.19.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.1.tgz", + "integrity": "sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/ansi-colors": { "version": "4.1.1", @@ -1020,6 +1023,12 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/samples/client/others/typescript/encode-decode/test/package.json b/samples/client/others/typescript/encode-decode/test/package.json index 4e140fe1072e..ea563a4d0211 100644 --- a/samples/client/others/typescript/encode-decode/test/package.json +++ b/samples/client/others/typescript/encode-decode/test/package.json @@ -4,7 +4,7 @@ "@openapitools/typescript-encode-decode": "file:../build", "@types/chai": "^4.3.0", "@types/mocha": "^10.0.0", - "@types/node": "^16.6.2", + "@types/node": "^22.12.0", "chai": "^4.3.0", "mocha": "^10.2.0", "ts-node": "^10.9.0", diff --git a/samples/client/others/typescript/encode-decode/test/tsconfig.json b/samples/client/others/typescript/encode-decode/test/tsconfig.json index e4f8bee09a0b..f26646d00acd 100644 --- a/samples/client/others/typescript/encode-decode/test/tsconfig.json +++ b/samples/client/others/typescript/encode-decode/test/tsconfig.json @@ -1,20 +1,21 @@ { - "compilerOptions": { - "moduleResolution": "node", - "module": "CommonJS", - "target": "ES5", - "noImplicitAny": true, - "sourceMap": false, - "outDir": "dist", - "types": [ - "mocha" - ], - "lib": [ - "es6", - "dom" - ] - }, - "exclude": [ - "node_modules" - ] + "compilerOptions": { + "moduleResolution": "NodeNext", + "module": "NodeNext", + "target": "ES2020", + "noImplicitAny": true, + "sourceMap": false, + "outDir": "dist", + "types": [ + "mocha" + ], + "lib": [ + "es6", + "dom" + ], + "baseUrl": ".", + }, + "exclude": [ + "node_modules" + ] } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/package.json b/samples/openapi3/client/petstore/typescript/builds/browser/package.json index dec266f420ca..0133eb86c1b7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/browser/package.json @@ -20,7 +20,7 @@ "exports": { ".": { "import": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json index f88431483262..6df8f66dc984 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts index 7eaf00563272..fcedacfb8ed8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts @@ -1,8 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -58,7 +57,7 @@ export class RequestContext { private body: RequestBody = undefined; private url: URL; private signal: AbortSignal | undefined = undefined; - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -132,7 +131,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -144,13 +143,12 @@ export class RequestContext { return this.signal; } - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts index d7ce46e4bee8..23cfa867b046 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts @@ -1,6 +1,6 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http'; import { from, Observable } from '../rxjsStub'; -import fetch from "node-fetch"; +import { fetch } from 'undici'; export class IsomorphicFetchHttpLibrary implements HttpLibrary { @@ -13,7 +13,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), signal: request.getSignal(), - agent: request.getAgent(), + dispatcher: request.getDispatcher(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json b/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json index d0b78f9babb6..81a74828f47b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json @@ -9,21 +9,24 @@ "version": "1.0.0", "license": "Unlicense", "dependencies": { - "@types/node": "^16.18.126", + "@types/node": "^20.17.10", "@types/node-fetch": "^2.6.13", "es6-promise": "^4.2.4", "form-data": "^4.0.4", - "node-fetch": "^2.7.0" + "undici": "^7.16.0" }, "devDependencies": { "typescript": "^4.0" } }, "node_modules/@types/node": { - "version": "16.18.126", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.126.tgz", - "integrity": "sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==", - "license": "MIT" + "version": "20.19.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.25.tgz", + "integrity": "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/@types/node-fetch": { "version": "2.6.13", @@ -277,32 +280,6 @@ "node": ">= 0.6" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, "node_modules/typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", @@ -316,28 +293,30 @@ "node": ">=4.2.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "node_modules/undici": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "engines": { + "node": ">=20.18.1" } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" } }, "dependencies": { "@types/node": { - "version": "16.18.126", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.126.tgz", - "integrity": "sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==" + "version": "20.19.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.25.tgz", + "integrity": "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==", + "requires": { + "undici-types": "~6.21.0" + } }, "@types/node-fetch": { "version": "2.6.13", @@ -506,38 +485,21 @@ "mime-db": "1.40.0" } }, - "node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, "typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "undici": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==" }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } + "undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" } } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/package.json b/samples/openapi3/client/petstore/typescript/builds/default/package.json index be458020cd18..afbcb6448ac1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -31,9 +32,8 @@ "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", - "@types/node": "^16.18.126", + "undici": "^7.16.0", + "@types/node": "^20.17.10", "form-data": "^4.0.4", "es6-promise": "^4.2.4" }, diff --git a/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json index 953996de3971..c765dce5de53 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts index 0b57a8a07b1b..73cd7a4d05b4 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts @@ -122,7 +122,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts index 0b57a8a07b1b..73cd7a4d05b4 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts @@ -122,7 +122,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts index 7eaf00563272..fcedacfb8ed8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts @@ -1,8 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -58,7 +57,7 @@ export class RequestContext { private body: RequestBody = undefined; private url: URL; private signal: AbortSignal | undefined = undefined; - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -132,7 +131,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -144,13 +143,12 @@ export class RequestContext { return this.signal; } - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts index d7ce46e4bee8..23cfa867b046 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts @@ -1,6 +1,6 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http'; import { from, Observable } from '../rxjsStub'; -import fetch from "node-fetch"; +import { fetch } from 'undici'; export class IsomorphicFetchHttpLibrary implements HttpLibrary { @@ -13,7 +13,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), signal: request.getSignal(), - agent: request.getAgent(), + dispatcher: request.getDispatcher(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/package.json b/samples/openapi3/client/petstore/typescript/builds/explode-query/package.json index be458020cd18..afbcb6448ac1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -31,9 +32,8 @@ "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", - "@types/node": "^16.18.126", + "undici": "^7.16.0", + "@types/node": "^20.17.10", "form-data": "^4.0.4", "es6-promise": "^4.2.4" }, diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/explode-query/tsconfig.json index 953996de3971..c765dce5de53 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index e96c984cb800..adcf7ece6301 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -1,8 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -58,7 +57,7 @@ export class RequestContext { private body: RequestBody = undefined; private url: URL; private signal: AbortSignal | undefined = undefined; - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -132,7 +131,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -144,13 +143,12 @@ export class RequestContext { return this.signal; } - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts index d7ce46e4bee8..23cfa867b046 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts @@ -1,6 +1,6 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http'; import { from, Observable } from '../rxjsStub'; -import fetch from "node-fetch"; +import { fetch } from 'undici'; export class IsomorphicFetchHttpLibrary implements HttpLibrary { @@ -13,7 +13,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), signal: request.getSignal(), - agent: request.getAgent(), + dispatcher: request.getDispatcher(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/package.json b/samples/openapi3/client/petstore/typescript/builds/inversify/package.json index 7ca265741b8c..48486e8f4ead 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/package.json @@ -20,7 +20,7 @@ "exports": { ".": { "import": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -32,9 +32,8 @@ "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", - "@types/node": "^16.18.126", + "undici": "^7.16.0", + "@types/node": "^20.17.10", "form-data": "^4.0.4", "inversify": "^6.0.1", "es6-promise": "^4.2.4" diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts index 0fb26e3bb3f8..631d2b1c9dac 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/package.json b/samples/openapi3/client/petstore/typescript/builds/jquery/package.json index 1da818423668..01432e3bf7d6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts index d48cbd6b7705..eea0ee0f4ae3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts @@ -123,7 +123,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/package.json b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/package.json index 000e9c5844c4..c8f6a2b429cd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/tsconfig.json index d6a3507bd4c5..26c82bc86007 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index 7eaf00563272..fcedacfb8ed8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -1,8 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URL, URLSearchParams } from 'url'; -import * as http from 'http'; -import * as https from 'https'; +import { type Dispatcher } from 'undici'; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -58,7 +57,7 @@ export class RequestContext { private body: RequestBody = undefined; private url: URL; private signal: AbortSignal | undefined = undefined; - private agent: http.Agent | https.Agent | undefined = undefined; + private dispatcher: Dispatcher | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -132,7 +131,7 @@ export class RequestContext { this.headers["Cookie"] += name + "=" + value + "; "; } - public setHeaderParam(key: string, value: string): void { + public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } @@ -144,13 +143,12 @@ export class RequestContext { return this.signal; } - - public setAgent(agent: http.Agent | https.Agent) { - this.agent = agent; + public setDispatcher(dispatcher: Dispatcher): void { + this.dispatcher = dispatcher; } - public getAgent(): http.Agent | https.Agent | undefined { - return this.agent; + public getDispatcher(): Dispatcher | undefined { + return this.dispatcher; } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts index d7ce46e4bee8..23cfa867b046 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts @@ -1,6 +1,6 @@ import {HttpLibrary, RequestContext, ResponseContext} from './http'; import { from, Observable } from '../rxjsStub'; -import fetch from "node-fetch"; +import { fetch } from 'undici'; export class IsomorphicFetchHttpLibrary implements HttpLibrary { @@ -13,7 +13,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), signal: request.getSignal(), - agent: request.getAgent(), + dispatcher: request.getDispatcher(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/package.json b/samples/openapi3/client/petstore/typescript/builds/object_params/package.json index be458020cd18..afbcb6448ac1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/package.json @@ -18,8 +18,9 @@ "type": "commonjs", "exports": { ".": { + "import": "./dist/index.js", "require": "./dist/index.js", - "types": "./dist/index.d.js" + "types": "./dist/index.d.ts" } }, "files": [ @@ -31,9 +32,8 @@ "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.7.0", - "@types/node-fetch": "^2.6.13", - "@types/node": "^16.18.126", + "undici": "^7.16.0", + "@types/node": "^20.17.10", "form-data": "^4.0.4", "es6-promise": "^4.2.4" }, diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json index 953996de3971..c765dce5de53 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, /* Basic Options */ "target": "es5", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "typeRoots": [ diff --git a/samples/openapi3/client/petstore/typescript/builds/package-lock.json b/samples/openapi3/client/petstore/typescript/builds/package-lock.json new file mode 100644 index 000000000000..ed368b88ad25 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "builds", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/samples/openapi3/client/petstore/typescript/tests/package-lock.json b/samples/openapi3/client/petstore/typescript/tests/package-lock.json new file mode 100644 index 000000000000..acafab9eaa3a --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/tests/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "tests", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}