@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
@@ -0,0 +1,99 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
16
|
+
}) : function(o, v) {
|
17
|
+
o["default"] = v;
|
18
|
+
});
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
20
|
+
if (mod && mod.__esModule) return mod;
|
21
|
+
var result = {};
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
23
|
+
__setModuleDefault(result, mod);
|
24
|
+
return result;
|
25
|
+
};
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
27
|
+
exports.FileObjectsLimitOffset = exports.Files = void 0;
|
28
|
+
const resource_1 = require("../resource.js");
|
29
|
+
const core_1 = require("../core.js");
|
30
|
+
const Core = __importStar(require("../core.js"));
|
31
|
+
const pagination_1 = require("../pagination.js");
|
32
|
+
class Files extends resource_1.APIResource {
|
33
|
+
/**
|
34
|
+
* Upload a new file.
|
35
|
+
*
|
36
|
+
* Args: file: The file to upload.
|
37
|
+
*
|
38
|
+
* Returns: FileResponse: The response containing the details of the uploaded file.
|
39
|
+
*/
|
40
|
+
create(body, options) {
|
41
|
+
return this._client.post('/v1/files', Core.multipartFormRequestOptions({ body, ...options }));
|
42
|
+
}
|
43
|
+
/**
|
44
|
+
* Retrieve details of a specific file by its ID.
|
45
|
+
*
|
46
|
+
* Args: file_id: The ID of the file to retrieve.
|
47
|
+
*
|
48
|
+
* Returns: FileResponse: The response containing the file details.
|
49
|
+
*/
|
50
|
+
retrieve(fileId, options) {
|
51
|
+
return this._client.get(`/v1/files/${fileId}`, options);
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* Update the details of a specific file.
|
55
|
+
*
|
56
|
+
* Args: file_id: The ID of the file to update. file: The new details for the file.
|
57
|
+
*
|
58
|
+
* Returns: FileObject: The updated file details.
|
59
|
+
*/
|
60
|
+
update(fileId, body, options) {
|
61
|
+
return this._client.post(`/v1/files/${fileId}`, Core.multipartFormRequestOptions({ body, ...options }));
|
62
|
+
}
|
63
|
+
list(query = {}, options) {
|
64
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
65
|
+
return this.list({}, query);
|
66
|
+
}
|
67
|
+
return this._client.getAPIList('/v1/files', FileObjectsLimitOffset, { query, ...options });
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Delete a specific file by its ID.
|
71
|
+
*
|
72
|
+
* Args: file_id: The ID of the file to delete.
|
73
|
+
*
|
74
|
+
* Returns: FileDeleted: The response containing the details of the deleted file.
|
75
|
+
*/
|
76
|
+
delete(fileId, options) {
|
77
|
+
return this._client.delete(`/v1/files/${fileId}`, options);
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* Download a specific file by its ID.
|
81
|
+
*
|
82
|
+
* Args: file_id: The ID of the file to download.
|
83
|
+
*
|
84
|
+
* Returns: FileStreamResponse: The response containing the file to be downloaded.
|
85
|
+
*/
|
86
|
+
content(fileId, options) {
|
87
|
+
return this._client.get(`/v1/files/${fileId}/content`, {
|
88
|
+
...options,
|
89
|
+
headers: { Accept: 'application/octet-stream', ...options?.headers },
|
90
|
+
__binaryResponse: true,
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}
|
94
|
+
exports.Files = Files;
|
95
|
+
class FileObjectsLimitOffset extends pagination_1.LimitOffset {
|
96
|
+
}
|
97
|
+
exports.FileObjectsLimitOffset = FileObjectsLimitOffset;
|
98
|
+
Files.FileObjectsLimitOffset = FileObjectsLimitOffset;
|
99
|
+
//# sourceMappingURL=files.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"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,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,MAAc,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,UAAU,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YACpE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAjFD,sBAiFC;AAED,MAAa,sBAAuB,SAAQ,wBAAuB;CAAG;AAAtE,wDAAsE;AA8EtE,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,CAAC"}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
import { APIResource } from "../resource.mjs";
|
3
|
+
import { isRequestOptions } from "../core.mjs";
|
4
|
+
import * as Core from "../core.mjs";
|
5
|
+
import { LimitOffset } from "../pagination.mjs";
|
6
|
+
export class Files extends APIResource {
|
7
|
+
/**
|
8
|
+
* Upload a new file.
|
9
|
+
*
|
10
|
+
* Args: file: The file to upload.
|
11
|
+
*
|
12
|
+
* Returns: FileResponse: The response containing the details of the uploaded file.
|
13
|
+
*/
|
14
|
+
create(body, options) {
|
15
|
+
return this._client.post('/v1/files', Core.multipartFormRequestOptions({ body, ...options }));
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Retrieve details of a specific file by its ID.
|
19
|
+
*
|
20
|
+
* Args: file_id: The ID of the file to retrieve.
|
21
|
+
*
|
22
|
+
* Returns: FileResponse: The response containing the file details.
|
23
|
+
*/
|
24
|
+
retrieve(fileId, options) {
|
25
|
+
return this._client.get(`/v1/files/${fileId}`, options);
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Update the details of a specific file.
|
29
|
+
*
|
30
|
+
* Args: file_id: The ID of the file to update. file: The new details for the file.
|
31
|
+
*
|
32
|
+
* Returns: FileObject: The updated file details.
|
33
|
+
*/
|
34
|
+
update(fileId, body, options) {
|
35
|
+
return this._client.post(`/v1/files/${fileId}`, Core.multipartFormRequestOptions({ body, ...options }));
|
36
|
+
}
|
37
|
+
list(query = {}, options) {
|
38
|
+
if (isRequestOptions(query)) {
|
39
|
+
return this.list({}, query);
|
40
|
+
}
|
41
|
+
return this._client.getAPIList('/v1/files', FileObjectsLimitOffset, { query, ...options });
|
42
|
+
}
|
43
|
+
/**
|
44
|
+
* Delete a specific file by its ID.
|
45
|
+
*
|
46
|
+
* Args: file_id: The ID of the file to delete.
|
47
|
+
*
|
48
|
+
* Returns: FileDeleted: The response containing the details of the deleted file.
|
49
|
+
*/
|
50
|
+
delete(fileId, options) {
|
51
|
+
return this._client.delete(`/v1/files/${fileId}`, options);
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* Download a specific file by its ID.
|
55
|
+
*
|
56
|
+
* Args: file_id: The ID of the file to download.
|
57
|
+
*
|
58
|
+
* Returns: FileStreamResponse: The response containing the file to be downloaded.
|
59
|
+
*/
|
60
|
+
content(fileId, options) {
|
61
|
+
return this._client.get(`/v1/files/${fileId}/content`, {
|
62
|
+
...options,
|
63
|
+
headers: { Accept: 'application/octet-stream', ...options?.headers },
|
64
|
+
__binaryResponse: true,
|
65
|
+
});
|
66
|
+
}
|
67
|
+
}
|
68
|
+
export class FileObjectsLimitOffset extends LimitOffset {
|
69
|
+
}
|
70
|
+
Files.FileObjectsLimitOffset = FileObjectsLimitOffset;
|
71
|
+
//# sourceMappingURL=files.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OACpB,KAAK,IAAI;OACT,EAAE,WAAW,EAA0B;AAG9C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;OAMG;IACH,MAAM,CAAC,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AAO,EAAE;YACpE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,WAAuB;CAAG;AA8EtE,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,CAAC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from "./shared.js";
|
2
|
+
export { Embeddings, type Embedding, type EmbeddingCreateResponse, type EmbeddingCreateParams, } from "./embeddings.js";
|
3
|
+
export { Extractions } from "./extractions/extractions.js";
|
4
|
+
export { FileObjectsLimitOffset, Files, type FileObject, type FileDeleteResponse, type FileCreateParams, type FileUpdateParams, type FileListParams, } from "./files.js";
|
5
|
+
export { Parsing } from "./parsing/parsing.js";
|
6
|
+
export { VectorStoresLimitOffset, VectorStores, type ExpiresAfter, type FileCounts, type ScoredVectorStoreChunk, type VectorStore, type VectorStoreChunkSearchOptions, type VectorStoreFileSearchOptions, type VectorStoreDeleteResponse, type VectorStoreQuestionAnsweringResponse, type VectorStoreSearchResponse, type VectorStoreCreateParams, type VectorStoreUpdateParams, type VectorStoreListParams, type VectorStoreQuestionAnsweringParams, type VectorStoreSearchParams, } from "./vector-stores/vector-stores.js";
|
7
|
+
export { type InfoResponse, type RerankResponse, type EmbedParams, type RerankParams } from "./top-level.js";
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,UAAU,EACV,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,kCAAkC,EACvC,KAAK,uBAAuB,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
16
|
+
};
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
exports.VectorStores = exports.VectorStoresLimitOffset = exports.Parsing = exports.Files = exports.FileObjectsLimitOffset = exports.Extractions = exports.Embeddings = void 0;
|
19
|
+
__exportStar(require("./shared.js"), exports);
|
20
|
+
var embeddings_1 = require("./embeddings.js");
|
21
|
+
Object.defineProperty(exports, "Embeddings", { enumerable: true, get: function () { return embeddings_1.Embeddings; } });
|
22
|
+
var extractions_1 = require("./extractions/extractions.js");
|
23
|
+
Object.defineProperty(exports, "Extractions", { enumerable: true, get: function () { return extractions_1.Extractions; } });
|
24
|
+
var files_1 = require("./files.js");
|
25
|
+
Object.defineProperty(exports, "FileObjectsLimitOffset", { enumerable: true, get: function () { return files_1.FileObjectsLimitOffset; } });
|
26
|
+
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
|
27
|
+
var parsing_1 = require("./parsing/parsing.js");
|
28
|
+
Object.defineProperty(exports, "Parsing", { enumerable: true, get: function () { return parsing_1.Parsing; } });
|
29
|
+
var vector_stores_1 = require("./vector-stores/vector-stores.js");
|
30
|
+
Object.defineProperty(exports, "VectorStoresLimitOffset", { enumerable: true, get: function () { return vector_stores_1.VectorStoresLimitOffset; } });
|
31
|
+
Object.defineProperty(exports, "VectorStores", { enumerable: true, get: function () { return vector_stores_1.VectorStores; } });
|
32
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;AAEtF,8CAAyB;AACzB,8CAKsB;AAJpB,wGAAA,UAAU,OAAA;AAKZ,4DAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,oCAQiB;AAPf,+GAAA,sBAAsB,OAAA;AACtB,8FAAA,KAAK,OAAA;AAOP,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,kEAiBuC;AAhBrC,wHAAA,uBAAuB,OAAA;AACvB,6GAAA,YAAY,OAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
export * from "./shared.mjs";
|
3
|
+
export { Embeddings, } from "./embeddings.mjs";
|
4
|
+
export { Extractions } from "./extractions/extractions.mjs";
|
5
|
+
export { FileObjectsLimitOffset, Files, } from "./files.mjs";
|
6
|
+
export { Parsing } from "./parsing/parsing.mjs";
|
7
|
+
export { VectorStoresLimitOffset, VectorStores, } from "./vector-stores/vector-stores.mjs";
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,UAAU,GAIX;OACM,EAAE,WAAW,EAAE;OACf,EACL,sBAAsB,EACtB,KAAK,GAMN;OACM,EAAE,OAAO,EAAE;OACX,EACL,uBAAuB,EACvB,YAAY,GAeb"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/parsing/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.Parsing = exports.Jobs = exports.JobListResponsesLimitOffset = void 0;
|
5
|
+
var jobs_1 = require("./jobs.js");
|
6
|
+
Object.defineProperty(exports, "JobListResponsesLimitOffset", { enumerable: true, get: function () { return jobs_1.JobListResponsesLimitOffset; } });
|
7
|
+
Object.defineProperty(exports, "Jobs", { enumerable: true, get: function () { return jobs_1.Jobs; } });
|
8
|
+
var parsing_1 = require("./parsing.js");
|
9
|
+
Object.defineProperty(exports, "Parsing", { enumerable: true, get: function () { return parsing_1.Parsing; } });
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/parsing/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAQgB;AAPd,mHAAA,2BAA2B,OAAA;AAC3B,4FAAA,IAAI,OAAA;AAON,wCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/parsing/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,2BAA2B,EAC3B,IAAI,GAML;OACM,EAAE,OAAO,EAAE"}
|
@@ -0,0 +1,290 @@
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
2
|
+
import * as Core from "../../core.js";
|
3
|
+
import { LimitOffset, type LimitOffsetParams } from "../../pagination.js";
|
4
|
+
import { Uploadable } from "../../uploads.js";
|
5
|
+
export declare class Jobs extends APIResource {
|
6
|
+
/**
|
7
|
+
* Start a parse job for the provided file.
|
8
|
+
*
|
9
|
+
* Args: params: The parameters for creating a parse job.
|
10
|
+
*
|
11
|
+
* Returns: The created parsing job.
|
12
|
+
*/
|
13
|
+
create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<ParsingJob>;
|
14
|
+
/**
|
15
|
+
* Get detailed information about a specific parse job.
|
16
|
+
*
|
17
|
+
* Args: job_id: The ID of the parse job.
|
18
|
+
*
|
19
|
+
* Returns: Detailed information about the parse job.
|
20
|
+
*/
|
21
|
+
retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<ParsingJob>;
|
22
|
+
/**
|
23
|
+
* List parsing jobs with pagination.
|
24
|
+
*
|
25
|
+
* Args: limit: The number of items to return. offset: The number of items to skip.
|
26
|
+
*
|
27
|
+
* Returns: List of parsing jobs with pagination.
|
28
|
+
*/
|
29
|
+
list(query?: JobListParams, options?: Core.RequestOptions): Core.PagePromise<JobListResponsesLimitOffset, JobListResponse>;
|
30
|
+
list(options?: Core.RequestOptions): Core.PagePromise<JobListResponsesLimitOffset, JobListResponse>;
|
31
|
+
/**
|
32
|
+
* Delete a specific parse job.
|
33
|
+
*
|
34
|
+
* Args: job_id: The ID of the parse job to delete.
|
35
|
+
*
|
36
|
+
* Returns: The deleted parsing job.
|
37
|
+
*/
|
38
|
+
delete(jobId: string, options?: Core.RequestOptions): Core.APIPromise<JobDeleteResponse>;
|
39
|
+
/**
|
40
|
+
* Cancel a specific parse job.
|
41
|
+
*
|
42
|
+
* Args: job_id: The ID of the parse job to cancel.
|
43
|
+
*
|
44
|
+
* Returns: The cancelled parsing job.
|
45
|
+
*/
|
46
|
+
cancel(jobId: string, options?: Core.RequestOptions): Core.APIPromise<ParsingJob>;
|
47
|
+
/**
|
48
|
+
* Poll for a job's status until it reaches a terminal state.
|
49
|
+
*
|
50
|
+
* @param jobId - The ID of the job to poll
|
51
|
+
* @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
|
52
|
+
* @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
|
53
|
+
* @param options - Additional request options
|
54
|
+
* @returns The job object once it reaches a terminal state
|
55
|
+
*/
|
56
|
+
poll(jobId: string, pollIntervalMs?: number, pollTimeoutMs?: number, options?: Core.RequestOptions): Promise<ParsingJob>;
|
57
|
+
/**
|
58
|
+
* Create a parsing job and wait for it to complete.
|
59
|
+
*
|
60
|
+
* @param body - Parameters for creating a parse job
|
61
|
+
* @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
|
62
|
+
* @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
|
63
|
+
* @param options - Additional request options
|
64
|
+
* @returns The job object once it reaches a terminal state
|
65
|
+
*/
|
66
|
+
createAndPoll(body: JobCreateParams, pollIntervalMs?: number, pollTimeoutMs?: number, options?: Core.RequestOptions): Promise<ParsingJob>;
|
67
|
+
/**
|
68
|
+
* Upload a file to the files API and then create a parsing job for it.
|
69
|
+
* Note the job will be asynchronously processed.
|
70
|
+
*
|
71
|
+
* @param file - The file to upload
|
72
|
+
* @param body - Additional parameters for creating a parse job
|
73
|
+
* @param options - Additional request options
|
74
|
+
* @returns The created parsing job
|
75
|
+
*/
|
76
|
+
upload(file: Uploadable, body?: Omit<JobCreateParams, 'file_id'>, options?: Core.RequestOptions): Promise<ParsingJob>;
|
77
|
+
/**
|
78
|
+
* Upload a file and create a parsing job, then poll until processing is complete.
|
79
|
+
*
|
80
|
+
* @param file - The file to upload
|
81
|
+
* @param body - Additional parameters for creating a parse job
|
82
|
+
* @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
|
83
|
+
* @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
|
84
|
+
* @param options - Additional request options
|
85
|
+
* @returns The job object once it reaches a terminal state
|
86
|
+
*/
|
87
|
+
uploadAndPoll(file: Uploadable, body?: Omit<JobCreateParams, 'file_id'>, pollIntervalMs?: number, pollTimeoutMs?: number, options?: Core.RequestOptions): Promise<ParsingJob>;
|
88
|
+
}
|
89
|
+
export declare class JobListResponsesLimitOffset extends LimitOffset<JobListResponse> {
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* A job for parsing documents with its current state and result.
|
93
|
+
*/
|
94
|
+
export interface ParsingJob {
|
95
|
+
/**
|
96
|
+
* The ID of the job
|
97
|
+
*/
|
98
|
+
id: string;
|
99
|
+
/**
|
100
|
+
* The ID of the file to parse
|
101
|
+
*/
|
102
|
+
file_id: string;
|
103
|
+
/**
|
104
|
+
* The status of the job
|
105
|
+
*/
|
106
|
+
status: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
107
|
+
/**
|
108
|
+
* The error of the job
|
109
|
+
*/
|
110
|
+
error?: unknown;
|
111
|
+
/**
|
112
|
+
* Result of document parsing operation.
|
113
|
+
*/
|
114
|
+
result?: ParsingJob.Result | null;
|
115
|
+
/**
|
116
|
+
* The started time of the job
|
117
|
+
*/
|
118
|
+
started_at?: string | null;
|
119
|
+
/**
|
120
|
+
* The finished time of the job
|
121
|
+
*/
|
122
|
+
finished_at?: string | null;
|
123
|
+
/**
|
124
|
+
* The creation time of the job
|
125
|
+
*/
|
126
|
+
created_at?: string;
|
127
|
+
/**
|
128
|
+
* The updated time of the job
|
129
|
+
*/
|
130
|
+
updated_at?: string | null;
|
131
|
+
/**
|
132
|
+
* The type of the object
|
133
|
+
*/
|
134
|
+
object?: 'parsing_job';
|
135
|
+
}
|
136
|
+
export declare namespace ParsingJob {
|
137
|
+
/**
|
138
|
+
* Result of document parsing operation.
|
139
|
+
*/
|
140
|
+
interface Result {
|
141
|
+
/**
|
142
|
+
* The strategy used for chunking the document
|
143
|
+
*/
|
144
|
+
chunking_strategy: 'page';
|
145
|
+
/**
|
146
|
+
* The format of the returned content
|
147
|
+
*/
|
148
|
+
return_format: 'html' | 'markdown' | 'plain';
|
149
|
+
/**
|
150
|
+
* The types of elements extracted
|
151
|
+
*/
|
152
|
+
element_types: Array<'caption' | 'footnote' | 'formula' | 'list-item' | 'page-footer' | 'page-header' | 'picture' | 'section-header' | 'table' | 'text' | 'title'>;
|
153
|
+
/**
|
154
|
+
* List of extracted chunks from the document
|
155
|
+
*/
|
156
|
+
chunks: Array<Result.Chunk>;
|
157
|
+
/**
|
158
|
+
* List of (width, height) tuples for each page
|
159
|
+
*/
|
160
|
+
page_sizes?: Array<Array<unknown>>;
|
161
|
+
}
|
162
|
+
namespace Result {
|
163
|
+
/**
|
164
|
+
* A chunk of text extracted from a document page.
|
165
|
+
*/
|
166
|
+
interface Chunk {
|
167
|
+
/**
|
168
|
+
* The full content of the chunk
|
169
|
+
*/
|
170
|
+
content: string;
|
171
|
+
/**
|
172
|
+
* The content to be used for embedding
|
173
|
+
*/
|
174
|
+
content_to_embed: string;
|
175
|
+
/**
|
176
|
+
* List of elements contained in this chunk
|
177
|
+
*/
|
178
|
+
elements: Array<Chunk.Element>;
|
179
|
+
}
|
180
|
+
namespace Chunk {
|
181
|
+
/**
|
182
|
+
* Represents an extracted element from a document with its content and metadata.
|
183
|
+
*/
|
184
|
+
interface Element {
|
185
|
+
/**
|
186
|
+
* The type of the extracted element
|
187
|
+
*/
|
188
|
+
type: 'caption' | 'footnote' | 'formula' | 'list-item' | 'page-footer' | 'page-header' | 'picture' | 'section-header' | 'table' | 'text' | 'title';
|
189
|
+
/**
|
190
|
+
* The confidence score of the extraction
|
191
|
+
*/
|
192
|
+
confidence: number;
|
193
|
+
/**
|
194
|
+
* The bounding box coordinates [x1, y1, x2, y2]
|
195
|
+
*/
|
196
|
+
bbox: Array<unknown>;
|
197
|
+
/**
|
198
|
+
* The page number where the element was found
|
199
|
+
*/
|
200
|
+
page: number;
|
201
|
+
/**
|
202
|
+
* The full content of the extracted element
|
203
|
+
*/
|
204
|
+
content: string;
|
205
|
+
/**
|
206
|
+
* A brief summary of the element's content
|
207
|
+
*/
|
208
|
+
summary?: string | null;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}
|
213
|
+
/**
|
214
|
+
* A parsing job item for list responses, omitting result and error fields.
|
215
|
+
*/
|
216
|
+
export interface JobListResponse {
|
217
|
+
/**
|
218
|
+
* The ID of the job
|
219
|
+
*/
|
220
|
+
id: string;
|
221
|
+
/**
|
222
|
+
* The ID of the file to parse
|
223
|
+
*/
|
224
|
+
file_id: string;
|
225
|
+
/**
|
226
|
+
* The status of the job
|
227
|
+
*/
|
228
|
+
status: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
229
|
+
/**
|
230
|
+
* The started time of the job
|
231
|
+
*/
|
232
|
+
started_at?: string | null;
|
233
|
+
/**
|
234
|
+
* The finished time of the job
|
235
|
+
*/
|
236
|
+
finished_at?: string | null;
|
237
|
+
/**
|
238
|
+
* The creation time of the job
|
239
|
+
*/
|
240
|
+
created_at?: string;
|
241
|
+
/**
|
242
|
+
* The updated time of the job
|
243
|
+
*/
|
244
|
+
updated_at?: string | null;
|
245
|
+
/**
|
246
|
+
* The type of the object
|
247
|
+
*/
|
248
|
+
object?: 'parsing_job';
|
249
|
+
}
|
250
|
+
/**
|
251
|
+
* A deleted parsing job.
|
252
|
+
*/
|
253
|
+
export interface JobDeleteResponse {
|
254
|
+
/**
|
255
|
+
* The ID of the deleted job
|
256
|
+
*/
|
257
|
+
id: string;
|
258
|
+
/**
|
259
|
+
* Whether the job was deleted
|
260
|
+
*/
|
261
|
+
deleted?: boolean;
|
262
|
+
/**
|
263
|
+
* The type of the object
|
264
|
+
*/
|
265
|
+
object?: 'parsing_job';
|
266
|
+
}
|
267
|
+
export interface JobCreateParams {
|
268
|
+
/**
|
269
|
+
* The ID of the file to parse
|
270
|
+
*/
|
271
|
+
file_id: string;
|
272
|
+
/**
|
273
|
+
* The elements to extract from the document
|
274
|
+
*/
|
275
|
+
element_types?: Array<'caption' | 'footnote' | 'formula' | 'list-item' | 'page-footer' | 'page-header' | 'picture' | 'section-header' | 'table' | 'text' | 'title'> | null;
|
276
|
+
/**
|
277
|
+
* The strategy to use for chunking the content
|
278
|
+
*/
|
279
|
+
chunking_strategy?: 'page';
|
280
|
+
/**
|
281
|
+
* The format of the returned content
|
282
|
+
*/
|
283
|
+
return_format?: 'html' | 'markdown' | 'plain';
|
284
|
+
}
|
285
|
+
export interface JobListParams extends LimitOffsetParams {
|
286
|
+
}
|
287
|
+
export declare namespace Jobs {
|
288
|
+
export { type ParsingJob as ParsingJob, type JobListResponse as JobListResponse, type JobDeleteResponse as JobDeleteResponse, JobListResponsesLimitOffset as JobListResponsesLimitOffset, type JobCreateParams as JobCreateParams, type JobListParams as JobListParams, };
|
289
|
+
}
|
290
|
+
//# sourceMappingURL=jobs.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/resources/parsing/jobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,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