@mixedbread/sdk 0.1.0-alpha.10
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/CHANGELOG.md +230 -0
- package/LICENSE +201 -0
- package/README.md +360 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +915 -0
- package/core.js.map +1 -0
- package/core.mjs +883 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +169 -0
- package/index.d.ts +169 -0
- package/index.d.ts.map +1 -0
- package/index.js +175 -0
- package/index.js.map +1 -0
- package/index.mjs +132 -0
- package/index.mjs.map +1 -0
- package/lib/polling.d.ts +48 -0
- package/lib/polling.d.ts.map +1 -0
- package/lib/polling.js +75 -0
- package/lib/polling.js.map +1 -0
- package/lib/polling.mjs +71 -0
- package/lib/polling.mjs.map +1 -0
- package/package.json +124 -0
- package/pagination.d.ts +30 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +45 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +41 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/embeddings.d.ts +177 -0
- package/resources/embeddings.d.ts.map +1 -0
- package/resources/embeddings.js +20 -0
- package/resources/embeddings.js.map +1 -0
- package/resources/embeddings.mjs +16 -0
- package/resources/embeddings.mjs.map +1 -0
- package/resources/extractions/content.d.ts +33 -0
- package/resources/extractions/content.d.ts.map +1 -0
- package/resources/extractions/content.js +19 -0
- package/resources/extractions/content.js.map +1 -0
- package/resources/extractions/content.mjs +15 -0
- package/resources/extractions/content.mjs.map +1 -0
- package/resources/extractions/extractions.d.ts +18 -0
- package/resources/extractions/extractions.d.ts.map +1 -0
- package/resources/extractions/extractions.js +47 -0
- package/resources/extractions/extractions.js.map +1 -0
- package/resources/extractions/extractions.mjs +20 -0
- package/resources/extractions/extractions.mjs.map +1 -0
- package/resources/extractions/index.d.ts +5 -0
- package/resources/extractions/index.d.ts.map +1 -0
- package/resources/extractions/index.js +13 -0
- package/resources/extractions/index.js.map +1 -0
- package/resources/extractions/index.mjs +6 -0
- package/resources/extractions/index.mjs.map +1 -0
- package/resources/extractions/jobs.d.ts +84 -0
- package/resources/extractions/jobs.d.ts.map +1 -0
- package/resources/extractions/jobs.js +29 -0
- package/resources/extractions/jobs.js.map +1 -0
- package/resources/extractions/jobs.mjs +25 -0
- package/resources/extractions/jobs.mjs.map +1 -0
- package/resources/extractions/schema.d.ts +85 -0
- package/resources/extractions/schema.d.ts.map +1 -0
- package/resources/extractions/schema.js +39 -0
- package/resources/extractions/schema.js.map +1 -0
- package/resources/extractions/schema.mjs +35 -0
- package/resources/extractions/schema.mjs.map +1 -0
- package/resources/files.d.ts +125 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +99 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +71 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.ts +8 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +32 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/parsing/index.d.ts +3 -0
- package/resources/parsing/index.d.ts.map +1 -0
- package/resources/parsing/index.js +10 -0
- package/resources/parsing/index.js.map +1 -0
- package/resources/parsing/index.mjs +4 -0
- package/resources/parsing/index.mjs.map +1 -0
- package/resources/parsing/jobs.d.ts +290 -0
- package/resources/parsing/jobs.d.ts.map +1 -0
- package/resources/parsing/jobs.js +147 -0
- package/resources/parsing/jobs.js.map +1 -0
- package/resources/parsing/jobs.mjs +119 -0
- package/resources/parsing/jobs.mjs.map +1 -0
- package/resources/parsing/parsing.d.ts +10 -0
- package/resources/parsing/parsing.d.ts.map +1 -0
- package/resources/parsing/parsing.js +40 -0
- package/resources/parsing/parsing.js.map +1 -0
- package/resources/parsing/parsing.mjs +13 -0
- package/resources/parsing/parsing.mjs.map +1 -0
- package/resources/shared.d.ts +35 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/top-level.d.ts +165 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/resources/vector-stores/files.d.ts +284 -0
- package/resources/vector-stores/files.d.ts.map +1 -0
- package/resources/vector-stores/files.js +167 -0
- package/resources/vector-stores/files.js.map +1 -0
- package/resources/vector-stores/files.mjs +139 -0
- package/resources/vector-stores/files.mjs.map +1 -0
- package/resources/vector-stores/index.d.ts +3 -0
- package/resources/vector-stores/index.d.ts.map +1 -0
- package/resources/vector-stores/index.js +11 -0
- package/resources/vector-stores/index.js.map +1 -0
- package/resources/vector-stores/index.mjs +4 -0
- package/resources/vector-stores/index.mjs.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +425 -0
- package/resources/vector-stores/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores/vector-stores.js +121 -0
- package/resources/vector-stores/vector-stores.js.map +1 -0
- package/resources/vector-stores/vector-stores.mjs +93 -0
- package/resources/vector-stores/vector-stores.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +346 -0
- package/src/lib/.keep +4 -0
- package/src/lib/polling.ts +115 -0
- package/src/pagination.ts +82 -0
- package/src/resource.ts +11 -0
- package/src/resources/embeddings.ts +248 -0
- package/src/resources/extractions/content.ts +42 -0
- package/src/resources/extractions/extractions.ts +47 -0
- package/src/resources/extractions/index.ts +14 -0
- package/src/resources/extractions/jobs.ts +105 -0
- package/src/resources/extractions/schema.ts +111 -0
- package/src/resources/files.ts +181 -0
- package/src/resources/index.ts +39 -0
- package/src/resources/parsing/index.ts +12 -0
- package/src/resources/parsing/jobs.ts +453 -0
- package/src/resources/parsing/parsing.ts +32 -0
- package/src/resources/shared.ts +41 -0
- package/src/resources/top-level.ts +231 -0
- package/src/resources/vector-stores/files.ts +439 -0
- package/src/resources/vector-stores/index.ts +31 -0
- package/src/resources/vector-stores/vector-stores.ts +592 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
package/shims/node.d.ts
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
import * as types from "../_shims/node-types.js";
|
6
|
+
declare module '../_shims/manual-types' {
|
7
|
+
namespace manual {
|
8
|
+
type Agent = types.Agent;
|
9
|
+
export import fetch = types.fetch;
|
10
|
+
type Request = types.Request;
|
11
|
+
type RequestInfo = types.RequestInfo;
|
12
|
+
type RequestInit = types.RequestInit;
|
13
|
+
type Response = types.Response;
|
14
|
+
type ResponseInit = types.ResponseInit;
|
15
|
+
type ResponseType = types.ResponseType;
|
16
|
+
type BodyInit = types.BodyInit;
|
17
|
+
type Headers = types.Headers;
|
18
|
+
type HeadersInit = types.HeadersInit;
|
19
|
+
type BlobPropertyBag = types.BlobPropertyBag;
|
20
|
+
type FilePropertyBag = types.FilePropertyBag;
|
21
|
+
type FileFromPathOptions = types.FileFromPathOptions;
|
22
|
+
export import FormData = types.FormData;
|
23
|
+
export import File = types.File;
|
24
|
+
export import Blob = types.Blob;
|
25
|
+
type Readable = types.Readable;
|
26
|
+
type FsReadStream = types.FsReadStream;
|
27
|
+
export import ReadableStream = types.ReadableStream;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
//# sourceMappingURL=node.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":";;;;AACA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAK9C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,MAAM,CAAC;QAEtB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAEhC,MAAM,QAAQ,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE5D,MAAM,QAAQ,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAExC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,MAAM,QAAQ,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KACrD;CACF"}
|
package/shims/node.js
ADDED
@@ -0,0 +1,31 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
// @ts-ignore
|
27
|
+
const types = __importStar(require("../_shims/node-types.js"));
|
28
|
+
const registry_1 = require("../_shims/registry.js");
|
29
|
+
const node_runtime_1 = require("../_shims/node-runtime.js");
|
30
|
+
(0, registry_1.setShims)((0, node_runtime_1.getRuntime)());
|
31
|
+
//# sourceMappingURL=node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,+DAA8C;AAC9C,oDAA8C;AAC9C,4DAAoD;AACpD,IAAA,mBAAQ,EAAC,IAAA,yBAAU,GAAE,CAAC,CAAC"}
|
package/shims/node.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node.mjs","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":"OACO,KAAK,KAAK;OACV,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE;AACrB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC"}
|
package/shims/web.d.ts
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
import * as types from "../_shims/web-types.js";
|
2
|
+
declare module '../_shims/manual-types' {
|
3
|
+
namespace manual {
|
4
|
+
type Agent = types.Agent;
|
5
|
+
export import fetch = types.fetch;
|
6
|
+
type Request = types.Request;
|
7
|
+
type RequestInfo = types.RequestInfo;
|
8
|
+
type RequestInit = types.RequestInit;
|
9
|
+
type Response = types.Response;
|
10
|
+
type ResponseInit = types.ResponseInit;
|
11
|
+
type ResponseType = types.ResponseType;
|
12
|
+
type BodyInit = types.BodyInit;
|
13
|
+
type Headers = types.Headers;
|
14
|
+
type HeadersInit = types.HeadersInit;
|
15
|
+
type BlobPropertyBag = types.BlobPropertyBag;
|
16
|
+
type FilePropertyBag = types.FilePropertyBag;
|
17
|
+
type FileFromPathOptions = types.FileFromPathOptions;
|
18
|
+
export import FormData = types.FormData;
|
19
|
+
export import File = types.File;
|
20
|
+
export import Blob = types.Blob;
|
21
|
+
type Readable = types.Readable;
|
22
|
+
type FsReadStream = types.FsReadStream;
|
23
|
+
export import ReadableStream = types.ReadableStream;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
//# sourceMappingURL=web.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAK7C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,MAAM,CAAC;QAEtB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAEhC,MAAM,QAAQ,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE5D,MAAM,QAAQ,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAExC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,MAAM,QAAQ,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KACrD;CACF"}
|
package/shims/web.js
ADDED
@@ -0,0 +1,31 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
// @ts-ignore
|
27
|
+
const types = __importStar(require("../_shims/web-types.js"));
|
28
|
+
const registry_1 = require("../_shims/registry.js");
|
29
|
+
const web_runtime_1 = require("../_shims/web-runtime.js");
|
30
|
+
(0, registry_1.setShims)((0, web_runtime_1.getRuntime)({ manuallyImported: true }));
|
31
|
+
//# sourceMappingURL=web.js.map
|
package/shims/web.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,8DAA6C;AAC7C,oDAA8C;AAC9C,0DAAmD;AACnD,IAAA,mBAAQ,EAAC,IAAA,wBAAU,EAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
|
package/shims/web.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"web.mjs","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":"OACO,KAAK,KAAK;OACV,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE;AACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# 👋 Wondering what everything in here does?
|
2
|
+
|
3
|
+
`@mixedbread/sdk` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
|
4
|
+
edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
|
5
|
+
|
6
|
+
To do this, `@mixedbread/sdk` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
|
7
|
+
|
8
|
+
It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
|
9
|
+
automatically select the correct shims for each environment. However, conditional exports are a fairly new
|
10
|
+
feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
|
11
|
+
|
12
|
+
setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
|
13
|
+
Unfortunately that's still the default setting, and it can result in errors like
|
14
|
+
getting the wrong raw `Response` type from `.asResponse()`, for example.
|
15
|
+
|
16
|
+
The user can work around these issues by manually importing one of:
|
17
|
+
|
18
|
+
- `import '@mixedbread/sdk/shims/node'`
|
19
|
+
- `import '@mixedbread/sdk/shims/web'`
|
20
|
+
|
21
|
+
All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
|
22
|
+
|
23
|
+
### How it works - Runtime
|
24
|
+
|
25
|
+
Runtime shims get installed by calling `setShims` exported by `@mixedbread/sdk/_shims/registry`.
|
26
|
+
|
27
|
+
Manually importing `@mixedbread/sdk/shims/node` or `@mixedbread/sdk/shims/web`, calls `setShims` with the respective runtime shims.
|
28
|
+
|
29
|
+
All client code imports shims from `@mixedbread/sdk/_shims/index`, which:
|
30
|
+
|
31
|
+
- checks if shims have been set manually
|
32
|
+
- if not, calls `setShims` with the shims from `@mixedbread/sdk/_shims/auto/runtime`
|
33
|
+
- re-exports the installed shims from `@mixedbread/sdk/_shims/registry`.
|
34
|
+
|
35
|
+
`@mixedbread/sdk/_shims/auto/runtime` exports web runtime shims.
|
36
|
+
If the `node` export condition is set, the export map replaces it with `@mixedbread/sdk/_shims/auto/runtime-node`.
|
37
|
+
|
38
|
+
### How it works - Type time
|
39
|
+
|
40
|
+
All client code imports shim types from `@mixedbread/sdk/_shims/index`, which selects the manual types from `@mixedbread/sdk/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@mixedbread/sdk/_shims/auto/types`.
|
41
|
+
|
42
|
+
`@mixedbread/sdk/_shims/manual-types` exports an empty namespace.
|
43
|
+
Manually importing `@mixedbread/sdk/shims/node` or `@mixedbread/sdk/shims/web` merges declarations into this empty namespace, so they get picked up by `@mixedbread/sdk/_shims/index`.
|
44
|
+
|
45
|
+
`@mixedbread/sdk/_shims/auto/types` exports web type definitions.
|
46
|
+
If the `node` export condition is set, the export map replaces it with `@mixedbread/sdk/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
export type Agent = any;
|
5
|
+
|
6
|
+
// @ts-ignore
|
7
|
+
declare const _fetch: typeof fetch;
|
8
|
+
export { _fetch as fetch };
|
9
|
+
|
10
|
+
// @ts-ignore
|
11
|
+
type _Request = Request;
|
12
|
+
export { _Request as Request };
|
13
|
+
|
14
|
+
// @ts-ignore
|
15
|
+
type _RequestInfo = RequestInfo;
|
16
|
+
export { type _RequestInfo as RequestInfo };
|
17
|
+
|
18
|
+
// @ts-ignore
|
19
|
+
type _RequestInit = RequestInit;
|
20
|
+
export { type _RequestInit as RequestInit };
|
21
|
+
|
22
|
+
// @ts-ignore
|
23
|
+
type _Response = Response;
|
24
|
+
export { _Response as Response };
|
25
|
+
|
26
|
+
// @ts-ignore
|
27
|
+
type _ResponseInit = ResponseInit;
|
28
|
+
export { type _ResponseInit as ResponseInit };
|
29
|
+
|
30
|
+
// @ts-ignore
|
31
|
+
type _ResponseType = ResponseType;
|
32
|
+
export { type _ResponseType as ResponseType };
|
33
|
+
|
34
|
+
// @ts-ignore
|
35
|
+
type _BodyInit = BodyInit;
|
36
|
+
export { type _BodyInit as BodyInit };
|
37
|
+
|
38
|
+
// @ts-ignore
|
39
|
+
type _Headers = Headers;
|
40
|
+
export { _Headers as Headers };
|
41
|
+
|
42
|
+
// @ts-ignore
|
43
|
+
type _HeadersInit = HeadersInit;
|
44
|
+
export { type _HeadersInit as HeadersInit };
|
45
|
+
|
46
|
+
type EndingType = 'native' | 'transparent';
|
47
|
+
|
48
|
+
export interface BlobPropertyBag {
|
49
|
+
endings?: EndingType;
|
50
|
+
type?: string;
|
51
|
+
}
|
52
|
+
|
53
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
54
|
+
lastModified?: number;
|
55
|
+
}
|
56
|
+
|
57
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
58
|
+
|
59
|
+
// @ts-ignore
|
60
|
+
type _FormData = FormData;
|
61
|
+
// @ts-ignore
|
62
|
+
declare const _FormData: typeof FormData;
|
63
|
+
export { _FormData as FormData };
|
64
|
+
|
65
|
+
// @ts-ignore
|
66
|
+
type _File = File;
|
67
|
+
// @ts-ignore
|
68
|
+
declare const _File: typeof File;
|
69
|
+
export { _File as File };
|
70
|
+
|
71
|
+
// @ts-ignore
|
72
|
+
type _Blob = Blob;
|
73
|
+
// @ts-ignore
|
74
|
+
declare const _Blob: typeof Blob;
|
75
|
+
export { _Blob as Blob };
|
76
|
+
|
77
|
+
export declare class Readable {
|
78
|
+
readable: boolean;
|
79
|
+
readonly readableEnded: boolean;
|
80
|
+
readonly readableFlowing: boolean | null;
|
81
|
+
readonly readableHighWaterMark: number;
|
82
|
+
readonly readableLength: number;
|
83
|
+
readonly readableObjectMode: boolean;
|
84
|
+
destroyed: boolean;
|
85
|
+
read(size?: number): any;
|
86
|
+
pause(): this;
|
87
|
+
resume(): this;
|
88
|
+
isPaused(): boolean;
|
89
|
+
destroy(error?: Error): this;
|
90
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
91
|
+
}
|
92
|
+
|
93
|
+
export declare class FsReadStream extends Readable {
|
94
|
+
path: {}; // node type is string | Buffer
|
95
|
+
}
|
96
|
+
|
97
|
+
// @ts-ignore
|
98
|
+
type _ReadableStream<R = any> = ReadableStream<R>;
|
99
|
+
// @ts-ignore
|
100
|
+
declare const _ReadableStream: typeof ReadableStream;
|
101
|
+
export { _ReadableStream as ReadableStream };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
import { type Shims } from './registry';
|
5
|
+
import { getRuntime as getWebRuntime } from './web-runtime';
|
6
|
+
import { ReadStream as FsReadStream } from 'node:fs';
|
7
|
+
|
8
|
+
export function getRuntime(): Shims {
|
9
|
+
const runtime = getWebRuntime();
|
10
|
+
function isFsReadStream(value: any): value is FsReadStream {
|
11
|
+
return value instanceof FsReadStream;
|
12
|
+
}
|
13
|
+
return { ...runtime, isFsReadStream };
|
14
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
import { manual } from './manual-types';
|
5
|
+
import * as auto from "./auto/types";
|
6
|
+
import { type RequestOptions } from '../core';
|
7
|
+
|
8
|
+
type SelectType<Manual, Auto> = unknown extends Manual ? Auto : Manual;
|
9
|
+
|
10
|
+
export const kind: string;
|
11
|
+
|
12
|
+
// @ts-ignore
|
13
|
+
export type Agent = SelectType<manual.Agent, auto.Agent>;
|
14
|
+
|
15
|
+
// @ts-ignore
|
16
|
+
export const fetch: SelectType<typeof manual.fetch, typeof auto.fetch>;
|
17
|
+
|
18
|
+
// @ts-ignore
|
19
|
+
export type Request = SelectType<manual.Request, auto.Request>;
|
20
|
+
// @ts-ignore
|
21
|
+
export type RequestInfo = SelectType<manual.RequestInfo, auto.RequestInfo>;
|
22
|
+
// @ts-ignore
|
23
|
+
export type RequestInit = SelectType<manual.RequestInit, auto.RequestInit>;
|
24
|
+
|
25
|
+
// @ts-ignore
|
26
|
+
export type Response = SelectType<manual.Response, auto.Response>;
|
27
|
+
// @ts-ignore
|
28
|
+
export type ResponseInit = SelectType<manual.ResponseInit, auto.ResponseInit>;
|
29
|
+
// @ts-ignore
|
30
|
+
export type ResponseType = SelectType<manual.ResponseType, auto.ResponseType>;
|
31
|
+
// @ts-ignore
|
32
|
+
export type BodyInit = SelectType<manual.BodyInit, auto.BodyInit>;
|
33
|
+
// @ts-ignore
|
34
|
+
export type Headers = SelectType<manual.Headers, auto.Headers>;
|
35
|
+
// @ts-ignore
|
36
|
+
export const Headers: SelectType<typeof manual.Headers, typeof auto.Headers>;
|
37
|
+
// @ts-ignore
|
38
|
+
export type HeadersInit = SelectType<manual.HeadersInit, auto.HeadersInit>;
|
39
|
+
|
40
|
+
// @ts-ignore
|
41
|
+
export type BlobPropertyBag = SelectType<manual.BlobPropertyBag, auto.BlobPropertyBag>;
|
42
|
+
// @ts-ignore
|
43
|
+
export type FilePropertyBag = SelectType<manual.FilePropertyBag, auto.FilePropertyBag>;
|
44
|
+
// @ts-ignore
|
45
|
+
export type FileFromPathOptions = SelectType<manual.FileFromPathOptions, auto.FileFromPathOptions>;
|
46
|
+
// @ts-ignore
|
47
|
+
export type FormData = SelectType<manual.FormData, auto.FormData>;
|
48
|
+
// @ts-ignore
|
49
|
+
export const FormData: SelectType<typeof manual.FormData, typeof auto.FormData>;
|
50
|
+
// @ts-ignore
|
51
|
+
export type File = SelectType<manual.File, auto.File>;
|
52
|
+
// @ts-ignore
|
53
|
+
export const File: SelectType<typeof manual.File, typeof auto.File>;
|
54
|
+
// @ts-ignore
|
55
|
+
export type Blob = SelectType<manual.Blob, auto.Blob>;
|
56
|
+
// @ts-ignore
|
57
|
+
export const Blob: SelectType<typeof manual.Blob, typeof auto.Blob>;
|
58
|
+
|
59
|
+
// @ts-ignore
|
60
|
+
export type Readable = SelectType<manual.Readable, auto.Readable>;
|
61
|
+
// @ts-ignore
|
62
|
+
export type FsReadStream = SelectType<manual.FsReadStream, auto.FsReadStream>;
|
63
|
+
// @ts-ignore
|
64
|
+
export type ReadableStream = SelectType<manual.ReadableStream, auto.ReadableStream>;
|
65
|
+
// @ts-ignore
|
66
|
+
export const ReadableStream: SelectType<typeof manual.ReadableStream, typeof auto.ReadableStream>;
|
67
|
+
|
68
|
+
export function getMultipartRequestOptions<T = Record<string, unknown>>(
|
69
|
+
form: FormData,
|
70
|
+
opts: RequestOptions<T>,
|
71
|
+
): Promise<RequestOptions<T>>;
|
72
|
+
|
73
|
+
export function getDefaultAgent(url: string): any;
|
74
|
+
|
75
|
+
// @ts-ignore
|
76
|
+
export type FileFromPathOptions = SelectType<manual.FileFromPathOptions, auto.FileFromPathOptions>;
|
77
|
+
|
78
|
+
export function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
|
79
|
+
export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
|
80
|
+
|
81
|
+
export function isFsReadStream(value: any): value is FsReadStream;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
const shims = require('./registry');
|
5
|
+
const auto = require('@mixedbread/sdk/_shims/auto/runtime');
|
6
|
+
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
7
|
+
for (const property of Object.keys(shims)) {
|
8
|
+
Object.defineProperty(exports, property, {
|
9
|
+
get() {
|
10
|
+
return shims[property];
|
11
|
+
},
|
12
|
+
});
|
13
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
import * as shims from './registry.mjs';
|
5
|
+
import * as auto from "./auto/runtime";
|
6
|
+
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
7
|
+
export * from './registry.mjs';
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
/**
|
5
|
+
* Types will get added to this namespace when you import one of the following:
|
6
|
+
*
|
7
|
+
* import '@mixedbread/sdk/shims/node'
|
8
|
+
* import '@mixedbread/sdk/shims/web'
|
9
|
+
*
|
10
|
+
* Importing more than one will cause type and runtime errors.
|
11
|
+
*/
|
12
|
+
export namespace manual {}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
import * as nf from 'node-fetch';
|
5
|
+
import * as fd from 'formdata-node';
|
6
|
+
import { type File, type FilePropertyBag } from 'formdata-node';
|
7
|
+
import KeepAliveAgent from 'agentkeepalive';
|
8
|
+
import { AbortController as AbortControllerPolyfill } from 'abort-controller';
|
9
|
+
import { ReadStream as FsReadStream } from 'node:fs';
|
10
|
+
import { type Agent } from 'node:http';
|
11
|
+
import { FormDataEncoder } from 'form-data-encoder';
|
12
|
+
import { Readable } from 'node:stream';
|
13
|
+
import { type RequestOptions } from '../core';
|
14
|
+
import { MultipartBody } from './MultipartBody';
|
15
|
+
import { type Shims } from './registry';
|
16
|
+
import { ReadableStream } from 'node:stream/web';
|
17
|
+
|
18
|
+
type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
19
|
+
|
20
|
+
let fileFromPathWarned = false;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* @deprecated use fs.createReadStream('./my/file.txt') instead
|
24
|
+
*/
|
25
|
+
async function fileFromPath(path: string): Promise<File>;
|
26
|
+
async function fileFromPath(path: string, filename?: string): Promise<File>;
|
27
|
+
async function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
|
28
|
+
async function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
|
29
|
+
async function fileFromPath(path: string, ...args: any[]): Promise<File> {
|
30
|
+
// this import fails in environments that don't handle export maps correctly, like old versions of Jest
|
31
|
+
const { fileFromPath: _fileFromPath } = await import('formdata-node/file-from-path');
|
32
|
+
|
33
|
+
if (!fileFromPathWarned) {
|
34
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
|
35
|
+
fileFromPathWarned = true;
|
36
|
+
}
|
37
|
+
// @ts-ignore
|
38
|
+
return await _fileFromPath(path, ...args);
|
39
|
+
}
|
40
|
+
|
41
|
+
const defaultHttpAgent: Agent = new KeepAliveAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
42
|
+
const defaultHttpsAgent: Agent = new KeepAliveAgent.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
43
|
+
|
44
|
+
async function getMultipartRequestOptions<T = Record<string, unknown>>(
|
45
|
+
form: fd.FormData,
|
46
|
+
opts: RequestOptions<T>,
|
47
|
+
): Promise<RequestOptions<T>> {
|
48
|
+
const encoder = new FormDataEncoder(form);
|
49
|
+
const readable = Readable.from(encoder);
|
50
|
+
const body = new MultipartBody(readable);
|
51
|
+
const headers = {
|
52
|
+
...opts.headers,
|
53
|
+
...encoder.headers,
|
54
|
+
'Content-Length': encoder.contentLength,
|
55
|
+
};
|
56
|
+
|
57
|
+
return { ...opts, body: body as any, headers };
|
58
|
+
}
|
59
|
+
|
60
|
+
export function getRuntime(): Shims {
|
61
|
+
// Polyfill global object if needed.
|
62
|
+
if (typeof AbortController === 'undefined') {
|
63
|
+
// @ts-expect-error (the types are subtly different, but compatible in practice)
|
64
|
+
globalThis.AbortController = AbortControllerPolyfill;
|
65
|
+
}
|
66
|
+
return {
|
67
|
+
kind: 'node',
|
68
|
+
fetch: nf.default,
|
69
|
+
Request: nf.Request,
|
70
|
+
Response: nf.Response,
|
71
|
+
Headers: nf.Headers,
|
72
|
+
FormData: fd.FormData,
|
73
|
+
Blob: fd.Blob,
|
74
|
+
File: fd.File,
|
75
|
+
ReadableStream,
|
76
|
+
getMultipartRequestOptions,
|
77
|
+
getDefaultAgent: (url: string): Agent => (url.startsWith('https') ? defaultHttpsAgent : defaultHttpAgent),
|
78
|
+
fileFromPath,
|
79
|
+
isFsReadStream: (value: any): value is FsReadStream => value instanceof FsReadStream,
|
80
|
+
};
|
81
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/**
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
3
|
+
*/
|
4
|
+
import * as nf from 'node-fetch';
|
5
|
+
import * as fd from 'formdata-node';
|
6
|
+
|
7
|
+
export { type Agent } from 'node:http';
|
8
|
+
export { type Readable } from 'node:stream';
|
9
|
+
export { type ReadStream as FsReadStream } from 'node:fs';
|
10
|
+
export { ReadableStream } from 'node:stream/web';
|
11
|
+
|
12
|
+
export const fetch: typeof nf.default;
|
13
|
+
|
14
|
+
export type Request = nf.Request;
|
15
|
+
export type RequestInfo = nf.RequestInfo;
|
16
|
+
export type RequestInit = nf.RequestInit;
|
17
|
+
|
18
|
+
export type Response = nf.Response;
|
19
|
+
export type ResponseInit = nf.ResponseInit;
|
20
|
+
export type ResponseType = nf.ResponseType;
|
21
|
+
export type BodyInit = nf.BodyInit;
|
22
|
+
export type Headers = nf.Headers;
|
23
|
+
export type HeadersInit = nf.HeadersInit;
|
24
|
+
|
25
|
+
type EndingType = 'native' | 'transparent';
|
26
|
+
export interface BlobPropertyBag {
|
27
|
+
endings?: EndingType;
|
28
|
+
type?: string;
|
29
|
+
}
|
30
|
+
|
31
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
32
|
+
lastModified?: number;
|
33
|
+
}
|
34
|
+
|
35
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
36
|
+
|
37
|
+
export type FormData = fd.FormData;
|
38
|
+
export const FormData: typeof fd.FormData;
|
39
|
+
export type File = fd.File;
|
40
|
+
export const File: typeof fd.File;
|
41
|
+
export type Blob = fd.Blob;
|
42
|
+
export const Blob: typeof fd.Blob;
|