@stepzen/fetch 0.45.0-experimental.8333304 → 0.45.0-experimental.d85ee8d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RequestInfo, RequestInit, Response } from 'node-fetch';
2
- declare const fetch: (url: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
1
+ import { RequestInfo, RequestInit, Response } from 'node-fetch';
2
+ declare const fetch: (url: RequestInfo, init?: RequestInit) => Promise<Response>;
3
3
  export default fetch;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAA;AAmBlE,QAAA,MAAM,KAAK,QACJ,WAAW,GAAG,GAAG,SACf,WAAW,KACjB,QAAQ,QAAQ,CAclB,CAAA;AAED,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAA;AAe7D,QAAA,MAAM,KAAK,QACJ,WAAW,SACT,WAAW,KACjB,QAAQ,QAAQ,CAclB,CAAA;AAED,eAAe,KAAK,CAAA"}
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright IBM Corp. 2020, 2024
2
2
  import { Agent as HttpAgent } from 'node:http';
3
3
  import { Agent as HttpsAgent } from 'node:https';
4
- import fetch0 from 'node-fetch';
4
+ import fetchCJSModule from 'node-fetch';
5
5
  // workaround for https://github.com/steprz/stepzen-cli/issues/934
6
6
  const httpAgent = new HttpAgent({
7
7
  keepAlive: true,
@@ -24,7 +24,7 @@ const fetch = async (url, init) => {
24
24
  else {
25
25
  urlstr = url.url;
26
26
  }
27
- return fetch0(url, {
27
+ return fetchCJSModule.default(url, {
28
28
  agent: urlstr.startsWith('https:') ? httpsAgent : httpAgent,
29
29
  ...init,
30
30
  });
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAIjC,OAAO,EAAC,KAAK,IAAI,SAAS,EAAC,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAC,KAAK,IAAI,UAAU,EAAC,MAAM,YAAY,CAAA;AAC9C,OAAO,MAAM,MAAM,YAAY,CAAA;AAE/B,kEAAkE;AAClE,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;IAC9B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;IAChC,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAEF,MAAM,KAAK,GAAG,KAAK,EACjB,GAAsB,EACtB,IAAkB,EACC,EAAE;IACrB,IAAI,MAAM,CAAA;IACV,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,CAAA;IACd,CAAC;SAAM,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAA;IACnB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,GAAG,CAAC,GAAG,CAAA;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAC3D,GAAG,IAAI;KACR,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,OAAO,EAAC,KAAK,IAAI,SAAS,EAAC,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAC,KAAK,IAAI,UAAU,EAAC,MAAM,YAAY,CAAA;AAC9C,OAAO,cAAc,MAAM,YAAY,CAAA;AAGvC,kEAAkE;AAClE,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;IAC9B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;IAChC,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAEF,MAAM,KAAK,GAAG,KAAK,EACjB,GAAgB,EAChB,IAAkB,EACC,EAAE;IACrB,IAAI,MAAM,CAAA;IACV,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,CAAA;IACd,CAAC;SAAM,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAA;IACnB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,GAAG,CAAC,GAAG,CAAA;IAClB,CAAC;IAED,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE;QACjC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAC3D,GAAG,IAAI;KACR,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stepzen/fetch",
3
3
  "description": "StepZen implementation of the fetch() API for NodeJS",
4
- "version": "0.45.0-experimental.8333304",
4
+ "version": "0.45.0-experimental.d85ee8d",
5
5
  "author": "StepZen Ltd",
6
6
  "license": "MIT",
7
7
  "files": [
@@ -23,13 +23,14 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "debug": "^4.3.4",
26
- "node-fetch": "^3.3.2"
26
+ "node-fetch": "^2.6.9"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/chai": "^4.3.10",
30
30
  "@types/debug": "^4.1.7",
31
31
  "@types/license-checker": "^25.0.3",
32
32
  "@types/mocha": "^10.0.9",
33
+ "@types/node-fetch": "^2.6.2",
33
34
  "chai": "^4.3.10",
34
35
  "fancy-test": "^1.4.10",
35
36
  "glob": "^10.2.5",
@@ -45,5 +46,5 @@
45
46
  "--comment--": "workaround for CVE-2024-21538",
46
47
  "cross-spawn": "^7.0.6"
47
48
  },
48
- "gitHead": "83333044828d7a82d7dd0ad61a462be8eee23522"
49
+ "gitHead": "d85ee8d15b31eeb855167dab2ee1eea686300d5c"
49
50
  }
package/src/index.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  // Copyright IBM Corp. 2020, 2024
2
2
 
3
- import type {RequestInfo, RequestInit, Response} from 'node-fetch'
4
-
5
3
  import {Agent as HttpAgent} from 'node:http'
6
4
  import {Agent as HttpsAgent} from 'node:https'
7
- import fetch0 from 'node-fetch'
5
+ import fetchCJSModule from 'node-fetch'
6
+ import {RequestInfo, RequestInit, Response} from 'node-fetch'
8
7
 
9
8
  // workaround for https://github.com/steprz/stepzen-cli/issues/934
10
9
  const httpAgent = new HttpAgent({
@@ -20,7 +19,7 @@ const httpsAgent = new HttpsAgent({
20
19
  })
21
20
 
22
21
  const fetch = async (
23
- url: RequestInfo | URL,
22
+ url: RequestInfo,
24
23
  init?: RequestInit,
25
24
  ): Promise<Response> => {
26
25
  let urlstr
@@ -32,7 +31,7 @@ const fetch = async (
32
31
  urlstr = url.url
33
32
  }
34
33
 
35
- return fetch0(url, {
34
+ return fetchCJSModule.default(url, {
36
35
  agent: urlstr.startsWith('https:') ? httpsAgent : httpAgent,
37
36
  ...init,
38
37
  })