@proofhound/api-client 0.1.13 → 0.1.14
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/dist/dataset-import.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { CreateDatasetImportDto, DatasetImportBatchDto } from '@proofhound/shared';
|
|
1
|
+
import type { CreateDatasetImportDto, CreateRawDatasetImportDto, DatasetImportBatchDto, DatasetRawUploadSessionDto } from '@proofhound/shared';
|
|
2
2
|
export declare const datasetImportClient: {
|
|
3
3
|
getDatasetImport: (projectId: string, importId: string) => Promise<{
|
|
4
4
|
id: string;
|
|
5
5
|
projectId: string;
|
|
6
6
|
datasetId: string | null;
|
|
7
|
+
importMode: "batch" | "raw_object";
|
|
7
8
|
name: string;
|
|
8
9
|
description: string | null;
|
|
9
10
|
fileName: string;
|
|
@@ -15,10 +16,15 @@ export declare const datasetImportClient: {
|
|
|
15
16
|
createdAt: string;
|
|
16
17
|
updatedAt: string;
|
|
17
18
|
}>;
|
|
19
|
+
getRawImportCapabilities: (_projectId: string) => Promise<{
|
|
20
|
+
supported: boolean;
|
|
21
|
+
maxBytes: number;
|
|
22
|
+
}>;
|
|
18
23
|
createDatasetImport: (projectId: string, body: CreateDatasetImportDto) => Promise<{
|
|
19
24
|
id: string;
|
|
20
25
|
projectId: string;
|
|
21
26
|
datasetId: string | null;
|
|
27
|
+
importMode: "batch" | "raw_object";
|
|
22
28
|
name: string;
|
|
23
29
|
description: string | null;
|
|
24
30
|
fileName: string;
|
|
@@ -30,6 +36,34 @@ export declare const datasetImportClient: {
|
|
|
30
36
|
createdAt: string;
|
|
31
37
|
updatedAt: string;
|
|
32
38
|
}>;
|
|
39
|
+
createRawDatasetImport: (projectId: string, body: CreateRawDatasetImportDto) => Promise<{
|
|
40
|
+
import: {
|
|
41
|
+
id: string;
|
|
42
|
+
projectId: string;
|
|
43
|
+
datasetId: string | null;
|
|
44
|
+
importMode: "batch" | "raw_object";
|
|
45
|
+
name: string;
|
|
46
|
+
description: string | null;
|
|
47
|
+
fileName: string;
|
|
48
|
+
fileSizeBytes: number;
|
|
49
|
+
sourceFormat: "csv" | "jsonl" | "tsv";
|
|
50
|
+
declaredTotalRows: number | null;
|
|
51
|
+
receivedRows: number;
|
|
52
|
+
status: "importing" | "ready";
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
};
|
|
56
|
+
uploadSession: {
|
|
57
|
+
sessionId: string;
|
|
58
|
+
url: string;
|
|
59
|
+
expiresAt: string;
|
|
60
|
+
headers?: Record<string, string> | undefined;
|
|
61
|
+
};
|
|
62
|
+
maxBytes: number;
|
|
63
|
+
}>;
|
|
64
|
+
uploadRawDatasetFile: (uploadSession: DatasetRawUploadSessionDto, file: Blob, options?: {
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
}) => Promise<void>;
|
|
33
67
|
appendDatasetImportBatch: (projectId: string, importId: string, body: DatasetImportBatchDto) => Promise<{
|
|
34
68
|
importId: string;
|
|
35
69
|
receivedRows: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-import.d.ts","sourceRoot":"","sources":["../src/dataset-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACtB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"dataset-import.d.ts","sourceRoot":"","sources":["../src/dataset-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACtB,yBAAyB,EAEzB,qBAAqB,EAIrB,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,mBAAmB;kCACA,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;2CAEf,MAAM;;;;qCAEZ,MAAM,QAAQ,sBAAsB;;;;;;;;;;;;;;;;wCAEjC,MAAM,QAAQ,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;0CAG1D,0BAA0B,QACnC,IAAI,YACA;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE;0CAYE,MAAM,YAAY,MAAM,QAAQ,qBAAqB;;;;uCAExD,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAE3B,MAAM,YAAY,MAAM;0CAKlB,MAAM,YAAY,MAAM,KAAG,OAAO;CAIzE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC"}
|
package/dist/dataset-import.js
CHANGED
|
@@ -5,13 +5,22 @@ const http_1 = require("./http");
|
|
|
5
5
|
const public_env_1 = require("./public-env");
|
|
6
6
|
exports.datasetImportClient = {
|
|
7
7
|
getDatasetImport: (projectId, importId) => http_1.httpClient.get(`/dataset-imports/${importId}`).then((r) => r.data),
|
|
8
|
+
getRawImportCapabilities: (_projectId) => http_1.httpClient.get(`/dataset-imports/raw/capabilities`).then((r) => r.data),
|
|
8
9
|
createDatasetImport: (projectId, body) => http_1.httpClient.post(`/dataset-imports`, body).then((r) => r.data),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
createRawDatasetImport: (projectId, body) => http_1.httpClient.post(`/dataset-imports/raw`, body).then((r) => r.data),
|
|
11
|
+
uploadRawDatasetFile: async (uploadSession, file, options) => {
|
|
12
|
+
const response = await fetch(uploadSession.url, {
|
|
13
|
+
method: 'PUT',
|
|
14
|
+
headers: uploadSession.headers,
|
|
15
|
+
body: file,
|
|
16
|
+
signal: options?.signal,
|
|
17
|
+
});
|
|
18
|
+
if (!response.ok) {
|
|
19
|
+
throw new Error(`dataset_raw_upload_failed:${response.status}`);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
appendDatasetImportBatch: (projectId, importId, body) => http_1.httpClient.post(`/dataset-imports/${importId}/batch`, body).then((r) => r.data),
|
|
23
|
+
completeDatasetImport: (projectId, importId) => http_1.httpClient.post(`/dataset-imports/${importId}/complete`, {}).then((r) => r.data),
|
|
15
24
|
abortDatasetImport: (projectId, importId) => http_1.httpClient.post(`/dataset-imports/${importId}/abort`, {}).then(() => undefined),
|
|
16
25
|
// Fire-and-forget abort that survives page unload (tab close / refresh), where a normal fetch is
|
|
17
26
|
// cancelled by the browser. Auth rides the same trusted-header / LOCAL_ACTOR path as other UI calls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-import.js","sourceRoot":"","sources":["../src/dataset-import.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dataset-import.js","sourceRoot":"","sources":["../src/dataset-import.ts"],"names":[],"mappings":";;;AAWA,iCAAoC;AACpC,6CAAgD;AAEnC,QAAA,mBAAmB,GAAG;IACjC,gBAAgB,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACxD,iBAAU,CAAC,GAAG,CAAuB,oBAAoB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1F,wBAAwB,EAAE,CAAC,UAAkB,EAAE,EAAE,CAC/C,iBAAU,CAAC,GAAG,CAAkC,mCAAmC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1G,mBAAmB,EAAE,CAAC,SAAiB,EAAE,IAA4B,EAAE,EAAE,CACvE,iBAAU,CAAC,IAAI,CAAuB,kBAAkB,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrF,sBAAsB,EAAE,CAAC,SAAiB,EAAE,IAA+B,EAAE,EAAE,CAC7E,iBAAU,CAAC,IAAI,CAAoC,sBAAsB,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACtG,oBAAoB,EAAE,KAAK,EACzB,aAAyC,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AAG,IAAA,6BAAgB,GAAE,oBAAoB,QAAQ,QAAQ,CAAC,CAAC;IACzF,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proofhound/api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Frontend C1 layer: HTTP client, split by resource",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.16.1",
|
|
13
13
|
"zod": "^4.4.3",
|
|
14
|
-
"@proofhound/shared": "0.1.
|
|
14
|
+
"@proofhound/shared": "0.1.14"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/node": "^24.12.4",
|