@voiceflow/fetch 1.6.0 → 1.7.0

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.
@@ -0,0 +1,11 @@
1
+ import * as undici from 'undici';
2
+ import type { ClientConfiguration } from './client-configuration.interface';
3
+ import { FetchClient as BaseFetchClient } from './fetch.client';
4
+ export * from './client-configuration.interface';
5
+ export * from './fetch.interface';
6
+ export * from './http-method.enum';
7
+ export * from './request-options.interface';
8
+ export declare class FetchClient extends BaseFetchClient<undici.RequestInit, URL | undici.Request, undici.Response> {
9
+ constructor(config?: ClientConfiguration);
10
+ }
11
+ //# sourceMappingURL=main.undici.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.undici.d.ts","sourceRoot":"","sources":["../../src/main.undici.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAE5C,qBAAa,WAAY,SAAQ,eAAe,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC;gBAC7F,MAAM,GAAE,mBAAwB;CAG7C"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FetchClient = void 0;
30
+ const undici = __importStar(require("undici"));
31
+ const fetch_client_1 = require("./fetch.client");
32
+ __exportStar(require("./client-configuration.interface"), exports);
33
+ __exportStar(require("./fetch.interface"), exports);
34
+ __exportStar(require("./http-method.enum"), exports);
35
+ __exportStar(require("./request-options.interface"), exports);
36
+ class FetchClient extends fetch_client_1.FetchClient {
37
+ constructor(config = {}) {
38
+ super(undici.fetch, config);
39
+ }
40
+ }
41
+ exports.FetchClient = FetchClient;
@@ -0,0 +1,11 @@
1
+ import * as undici from 'undici';
2
+ import type { ClientConfiguration } from './client-configuration.interface.js';
3
+ import { FetchClient as BaseFetchClient } from './fetch.client.js';
4
+ export * from './client-configuration.interface.js';
5
+ export * from './fetch.interface.js';
6
+ export * from './http-method.enum.js';
7
+ export * from './request-options.interface.js';
8
+ export declare class FetchClient extends BaseFetchClient<undici.RequestInit, URL | undici.Request, undici.Response> {
9
+ constructor(config?: ClientConfiguration);
10
+ }
11
+ //# sourceMappingURL=main.undici.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.undici.d.ts","sourceRoot":"","sources":["../../src/main.undici.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAE5C,qBAAa,WAAY,SAAQ,eAAe,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC;gBAC7F,MAAM,GAAE,mBAAwB;CAG7C"}
@@ -0,0 +1,11 @@
1
+ import * as undici from 'undici';
2
+ import { FetchClient as BaseFetchClient } from './fetch.client.js';
3
+ export * from './client-configuration.interface.js';
4
+ export * from './fetch.interface.js';
5
+ export * from './http-method.enum.js';
6
+ export * from './request-options.interface.js';
7
+ export class FetchClient extends BaseFetchClient {
8
+ constructor(config = {}) {
9
+ super(undici.fetch, config);
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceflow/fetch",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Voiceflow fetch wrapper and error handling for SDKs",
5
5
  "keywords": [
6
6
  "voiceflow"
@@ -15,9 +15,27 @@
15
15
  },
16
16
  "license": "ISC",
17
17
  "author": "Voiceflow",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./build/cjs/main.d.ts",
21
+ "import": "./build/esm/main.js",
22
+ "default": "./build/cjs/main.js"
23
+ },
24
+ "./undici": {
25
+ "types": "./build/cjs/main.undici.d.ts",
26
+ "import": "./build/esm/main.undici.js",
27
+ "default": "./build/cjs/main.undici.js"
28
+ }
29
+ },
18
30
  "main": "build/cjs/main.js",
19
- "module": "build/esm/main.js",
20
31
  "types": "build/cjs/main.d.ts",
32
+ "typesVersions": {
33
+ "*": {
34
+ "undici": [
35
+ "./build/cjs/main.undici.d.ts"
36
+ ]
37
+ }
38
+ },
21
39
  "files": [
22
40
  "build"
23
41
  ],
@@ -38,7 +56,7 @@
38
56
  "test:unit": "yarn g:vitest run --coverage"
39
57
  },
40
58
  "devDependencies": {
41
- "@voiceflow/exception": "1.6.0",
59
+ "@voiceflow/exception": "1.6.1",
42
60
  "fetch-mock": "9.11.0",
43
61
  "jest-environment-jsdom": "29.7.0",
44
62
  "jest-fetch-mock": "3.0.3",
@@ -46,7 +64,13 @@
46
64
  "vitest-fetch-mock": "0.2.2"
47
65
  },
48
66
  "peerDependencies": {
49
- "@voiceflow/exception": "^"
67
+ "@voiceflow/exception": "^",
68
+ "undici": "^5"
69
+ },
70
+ "peerDependenciesMeta": {
71
+ "undici": {
72
+ "optional": true
73
+ }
50
74
  },
51
75
  "volta": {
52
76
  "extends": "../../package.json"
@@ -54,5 +78,5 @@
54
78
  "publishConfig": {
55
79
  "access": "public"
56
80
  },
57
- "gitHead": "82c3c81b9012f5e64c4bec3cd031af220ad26572"
81
+ "gitHead": "6848d9b5729e1414190ae7ff19bccf9ac4f354ba"
58
82
  }