@arbidocs/sdk 0.3.46 → 0.3.48
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/{browser-HVCa8Ph5.d.cts → browser-EMgd4bP4.d.cts} +72 -18
- package/dist/{browser-HVCa8Ph5.d.ts → browser-EMgd4bP4.d.ts} +72 -18
- package/dist/browser.cjs +148 -38
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +148 -39
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +146 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +146 -84
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -605,10 +605,17 @@ type DocumentListFields = 'full' | 'lite';
|
|
|
605
605
|
*/
|
|
606
606
|
interface ListPaginatedOptions {
|
|
607
607
|
/**
|
|
608
|
-
* Number of documents per page.
|
|
608
|
+
* Number of documents per page (applies to every page after the first).
|
|
609
609
|
* @default 5000
|
|
610
610
|
*/
|
|
611
611
|
pageSize?: number;
|
|
612
|
+
/**
|
|
613
|
+
* Size of the first page only. When set, the initial request uses this
|
|
614
|
+
* smaller limit so the caller can render something on screen before the
|
|
615
|
+
* full `pageSize`-sized pages stream in. Subsequent pages fall back to
|
|
616
|
+
* `pageSize`. When unset, every page uses `pageSize`.
|
|
617
|
+
*/
|
|
618
|
+
firstPageSize?: number;
|
|
612
619
|
/**
|
|
613
620
|
* Sort order for pagination.
|
|
614
621
|
* @default 'id_asc'
|
|
@@ -629,7 +636,7 @@ interface ListPaginatedOptions {
|
|
|
629
636
|
* Number of pages kept in flight concurrently. A higher value hides more
|
|
630
637
|
* backend + network latency between pages but increases peak backend load
|
|
631
638
|
* and memory for not-yet-consumed pages. Clamped to `[1, MAX_PAGES]`.
|
|
632
|
-
* @default
|
|
639
|
+
* @default 1
|
|
633
640
|
*/
|
|
634
641
|
lookahead?: number;
|
|
635
642
|
}
|
|
@@ -729,11 +736,16 @@ declare function listDocuments(arbi: ArbiClient): Promise<{
|
|
|
729
736
|
*
|
|
730
737
|
* Uses `limit`/`offset` pagination. A FIFO queue of up to `lookahead` requests
|
|
731
738
|
* is kept in flight: as soon as a page is awaited off the queue the next
|
|
732
|
-
* request is enqueued, so the backend is continuously working on the next
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
*
|
|
739
|
+
* request is enqueued, so the backend is continuously working on the next
|
|
740
|
+
* page while the consumer processes the current one. The default of 1 keeps
|
|
741
|
+
* one page in flight at a time (classic sequential pagination). Raise it when
|
|
742
|
+
* you want to pipeline — each extra slot adds one more concurrent backend
|
|
743
|
+
* scan and one more not-yet-consumed page held in memory.
|
|
744
|
+
*
|
|
745
|
+
* Pair `firstPageSize` with a larger `pageSize` when you need the initial
|
|
746
|
+
* page on screen fast: e.g. `firstPageSize: 500, pageSize: 2000` renders the
|
|
747
|
+
* first 500 rows in a fifth of the time of a single 2500-row request, then
|
|
748
|
+
* streams in 2000-row pages after.
|
|
737
749
|
*
|
|
738
750
|
* Iteration stops at the first short page (length < `pageSize`) — in-flight
|
|
739
751
|
* requests past that point are discarded. `MAX_PAGES` is a hard cap on the
|
|
@@ -867,7 +879,12 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
|
|
|
867
879
|
title?: string | null | undefined;
|
|
868
880
|
} | null | undefined;
|
|
869
881
|
}[]>;
|
|
870
|
-
|
|
882
|
+
/**
|
|
883
|
+
* Kick off a URL-based document ingestion. The active workspace is resolved
|
|
884
|
+
* server-side from the open session — there is no ``workspace_ext_id`` query
|
|
885
|
+
* param on this endpoint.
|
|
886
|
+
*/
|
|
887
|
+
declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean): Promise<{
|
|
871
888
|
doc_ext_ids?: string[] | undefined;
|
|
872
889
|
batch_id?: string | null | undefined;
|
|
873
890
|
skipped?: {
|
|
@@ -880,13 +897,15 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], workspaceId: string
|
|
|
880
897
|
*/
|
|
881
898
|
declare function getParsedContent(auth: AuthHeaders, docId: string, stage: string): Promise<Record<string, unknown>>;
|
|
882
899
|
/**
|
|
883
|
-
* Upload a file
|
|
900
|
+
* Upload a file. Uses raw fetch for multipart upload. The active workspace is
|
|
901
|
+
* resolved server-side from the open session.
|
|
884
902
|
*/
|
|
885
|
-
declare function uploadFile$1(auth: AuthHeaders,
|
|
903
|
+
declare function uploadFile$1(auth: AuthHeaders, fileData: Blob, fileName: string, options?: UploadOptions): Promise<UploadResult>;
|
|
886
904
|
/**
|
|
887
|
-
* Upload multiple files in a single FormData request with an optional folder
|
|
905
|
+
* Upload multiple files in a single FormData request with an optional folder
|
|
906
|
+
* parameter. Workspace is resolved from the session, same as ``uploadFile``.
|
|
888
907
|
*/
|
|
889
|
-
declare function uploadFiles(auth: AuthHeaders,
|
|
908
|
+
declare function uploadFiles(auth: AuthHeaders, files: Array<{
|
|
890
909
|
data: Blob;
|
|
891
910
|
name: string;
|
|
892
911
|
}>, options?: UploadOptions): Promise<UploadResult>;
|
|
@@ -915,6 +934,22 @@ interface UploadDirectOptions {
|
|
|
915
934
|
tagExtId?: string;
|
|
916
935
|
/** Expiry for presigned PUT URLs, in seconds. Defaults to server default (1h). */
|
|
917
936
|
presignExpiresIn?: number;
|
|
937
|
+
/**
|
|
938
|
+
* Fired as each file's ciphertext is uploaded. In the browser this yields
|
|
939
|
+
* byte-level progress (XMLHttpRequest upload.progress); in Node this fires
|
|
940
|
+
* once per file with `loaded === total` after each PUT completes.
|
|
941
|
+
*
|
|
942
|
+
* - `fileIndex` indexes into the `files` array passed to the helper.
|
|
943
|
+
* - `fileName` is the corresponding `DirectUploadFile.name`.
|
|
944
|
+
* - `loaded` / `total` are bytes of the *ciphertext* (= raw + 40).
|
|
945
|
+
*/
|
|
946
|
+
onBytesProgress?: (progress: DirectUploadProgress) => void;
|
|
947
|
+
}
|
|
948
|
+
interface DirectUploadProgress {
|
|
949
|
+
fileIndex: number;
|
|
950
|
+
fileName: string;
|
|
951
|
+
loaded: number;
|
|
952
|
+
total: number;
|
|
918
953
|
}
|
|
919
954
|
interface UploadDirectResult {
|
|
920
955
|
/** Doc ext IDs that were committed and will process through the parse pipeline. */
|
|
@@ -927,6 +962,23 @@ interface UploadDirectResult {
|
|
|
927
962
|
*/
|
|
928
963
|
skipped: SkippedFile[];
|
|
929
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* Structural subset of ``ArbiClient`` that ``uploadDocumentsDirect`` actually
|
|
967
|
+
* uses. The helper only needs the openapi-fetch client, so consumers that don't
|
|
968
|
+
* have a full ``ArbiClient`` (e.g. the React frontend, which wires openapi-fetch
|
|
969
|
+
* through its own middleware) can pass ``{ fetch }`` directly without a cast.
|
|
970
|
+
*/
|
|
971
|
+
type DirectUploadClient = Pick<ArbiClient, 'fetch'>;
|
|
972
|
+
/**
|
|
973
|
+
* Minimal extension → MIME mapping to avoid a `mime-types` dep.
|
|
974
|
+
*
|
|
975
|
+
* Browser callers don't usually need this — a File's `.type` is already
|
|
976
|
+
* populated by the browser — but CLI/Node callers construct Blobs from raw
|
|
977
|
+
* bytes and must set the MIME explicitly, otherwise multipart parts land as
|
|
978
|
+
* `application/octet-stream`. Exported for both consumers so the mapping
|
|
979
|
+
* lives in one place.
|
|
980
|
+
*/
|
|
981
|
+
declare function mimeFromName(name: string): string | undefined;
|
|
930
982
|
/**
|
|
931
983
|
* Upload files via the direct-to-MinIO flow (SecretBox on the client,
|
|
932
984
|
* presigned PUT to nginx→MinIO, then commit).
|
|
@@ -947,9 +999,11 @@ interface UploadDirectResult {
|
|
|
947
999
|
* callers that want to upload files from disk should use the wrapper in
|
|
948
1000
|
* ``documents-node`` which reads ``fs`` into the ``data`` field.
|
|
949
1001
|
*/
|
|
950
|
-
declare function uploadDocumentsDirect(arbi:
|
|
1002
|
+
declare function uploadDocumentsDirect(arbi: DirectUploadClient, workspaceKey: Uint8Array, files: DirectUploadFile[], options?: UploadDirectOptions): Promise<UploadDirectResult>;
|
|
951
1003
|
|
|
1004
|
+
type documents_DirectUploadClient = DirectUploadClient;
|
|
952
1005
|
type documents_DirectUploadFile = DirectUploadFile;
|
|
1006
|
+
type documents_DirectUploadProgress = DirectUploadProgress;
|
|
953
1007
|
type documents_DocumentListFields = DocumentListFields;
|
|
954
1008
|
type documents_DocumentListOrder = DocumentListOrder;
|
|
955
1009
|
type documents_ListAllOptions = ListAllOptions;
|
|
@@ -969,13 +1023,14 @@ declare const documents_getParsedContent: typeof getParsedContent;
|
|
|
969
1023
|
declare const documents_listAll: typeof listAll;
|
|
970
1024
|
declare const documents_listDocuments: typeof listDocuments;
|
|
971
1025
|
declare const documents_listPaginated: typeof listPaginated;
|
|
1026
|
+
declare const documents_mimeFromName: typeof mimeFromName;
|
|
972
1027
|
declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
|
|
973
1028
|
declare const documents_updateDocuments: typeof updateDocuments;
|
|
974
1029
|
declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
|
|
975
1030
|
declare const documents_uploadFiles: typeof uploadFiles;
|
|
976
1031
|
declare const documents_uploadUrl: typeof uploadUrl;
|
|
977
1032
|
declare namespace documents {
|
|
978
|
-
export { type documents_DirectUploadFile as DirectUploadFile, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
|
|
1033
|
+
export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_mimeFromName as mimeFromName, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
|
|
979
1034
|
}
|
|
980
1035
|
|
|
981
1036
|
/**
|
|
@@ -1790,7 +1845,7 @@ declare class Arbi {
|
|
|
1790
1845
|
title?: string | null | undefined;
|
|
1791
1846
|
} | null | undefined;
|
|
1792
1847
|
}[]>;
|
|
1793
|
-
uploadUrl: (urls: string[], shared?: boolean
|
|
1848
|
+
uploadUrl: (urls: string[], shared?: boolean) => Promise<{
|
|
1794
1849
|
doc_ext_ids?: string[] | undefined;
|
|
1795
1850
|
batch_id?: string | null | undefined;
|
|
1796
1851
|
skipped?: {
|
|
@@ -1799,7 +1854,6 @@ declare class Arbi {
|
|
|
1799
1854
|
}[] | undefined;
|
|
1800
1855
|
}>;
|
|
1801
1856
|
uploadFile: (fileData: Blob, fileName: string, options?: {
|
|
1802
|
-
workspaceId?: string;
|
|
1803
1857
|
folder?: string;
|
|
1804
1858
|
}) => Promise<UploadResult>;
|
|
1805
1859
|
download: (docId: string) => Promise<Response>;
|
|
@@ -2376,6 +2430,7 @@ declare class Arbi {
|
|
|
2376
2430
|
show_templates: boolean;
|
|
2377
2431
|
show_pa_mode: boolean;
|
|
2378
2432
|
show_agent_sessions: boolean;
|
|
2433
|
+
use_s3_direct_upload: boolean;
|
|
2379
2434
|
hide_online_status: boolean;
|
|
2380
2435
|
muted_users: string[];
|
|
2381
2436
|
premium_model?: string | null | undefined;
|
|
@@ -2569,7 +2624,6 @@ declare class Arbi {
|
|
|
2569
2624
|
};
|
|
2570
2625
|
Chunker: {
|
|
2571
2626
|
MAX_CHUNK_TOKENS: number;
|
|
2572
|
-
TOKENIZER_TYPE: "tiktoken" | "huggingface";
|
|
2573
2627
|
TOKENIZER_NAME: string;
|
|
2574
2628
|
};
|
|
2575
2629
|
Embedder: {
|
|
@@ -3662,6 +3716,7 @@ declare function getSettings(arbi: ArbiClient): Promise<{
|
|
|
3662
3716
|
show_templates: boolean;
|
|
3663
3717
|
show_pa_mode: boolean;
|
|
3664
3718
|
show_agent_sessions: boolean;
|
|
3719
|
+
use_s3_direct_upload: boolean;
|
|
3665
3720
|
hide_online_status: boolean;
|
|
3666
3721
|
muted_users: string[];
|
|
3667
3722
|
premium_model?: string | null | undefined;
|
|
@@ -3865,7 +3920,6 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
|
|
|
3865
3920
|
};
|
|
3866
3921
|
Chunker: {
|
|
3867
3922
|
MAX_CHUNK_TOKENS: number;
|
|
3868
|
-
TOKENIZER_TYPE: "tiktoken" | "huggingface";
|
|
3869
3923
|
TOKENIZER_NAME: string;
|
|
3870
3924
|
};
|
|
3871
3925
|
Embedder: {
|
|
@@ -605,10 +605,17 @@ type DocumentListFields = 'full' | 'lite';
|
|
|
605
605
|
*/
|
|
606
606
|
interface ListPaginatedOptions {
|
|
607
607
|
/**
|
|
608
|
-
* Number of documents per page.
|
|
608
|
+
* Number of documents per page (applies to every page after the first).
|
|
609
609
|
* @default 5000
|
|
610
610
|
*/
|
|
611
611
|
pageSize?: number;
|
|
612
|
+
/**
|
|
613
|
+
* Size of the first page only. When set, the initial request uses this
|
|
614
|
+
* smaller limit so the caller can render something on screen before the
|
|
615
|
+
* full `pageSize`-sized pages stream in. Subsequent pages fall back to
|
|
616
|
+
* `pageSize`. When unset, every page uses `pageSize`.
|
|
617
|
+
*/
|
|
618
|
+
firstPageSize?: number;
|
|
612
619
|
/**
|
|
613
620
|
* Sort order for pagination.
|
|
614
621
|
* @default 'id_asc'
|
|
@@ -629,7 +636,7 @@ interface ListPaginatedOptions {
|
|
|
629
636
|
* Number of pages kept in flight concurrently. A higher value hides more
|
|
630
637
|
* backend + network latency between pages but increases peak backend load
|
|
631
638
|
* and memory for not-yet-consumed pages. Clamped to `[1, MAX_PAGES]`.
|
|
632
|
-
* @default
|
|
639
|
+
* @default 1
|
|
633
640
|
*/
|
|
634
641
|
lookahead?: number;
|
|
635
642
|
}
|
|
@@ -729,11 +736,16 @@ declare function listDocuments(arbi: ArbiClient): Promise<{
|
|
|
729
736
|
*
|
|
730
737
|
* Uses `limit`/`offset` pagination. A FIFO queue of up to `lookahead` requests
|
|
731
738
|
* is kept in flight: as soon as a page is awaited off the queue the next
|
|
732
|
-
* request is enqueued, so the backend is continuously working on the next
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
*
|
|
739
|
+
* request is enqueued, so the backend is continuously working on the next
|
|
740
|
+
* page while the consumer processes the current one. The default of 1 keeps
|
|
741
|
+
* one page in flight at a time (classic sequential pagination). Raise it when
|
|
742
|
+
* you want to pipeline — each extra slot adds one more concurrent backend
|
|
743
|
+
* scan and one more not-yet-consumed page held in memory.
|
|
744
|
+
*
|
|
745
|
+
* Pair `firstPageSize` with a larger `pageSize` when you need the initial
|
|
746
|
+
* page on screen fast: e.g. `firstPageSize: 500, pageSize: 2000` renders the
|
|
747
|
+
* first 500 rows in a fifth of the time of a single 2500-row request, then
|
|
748
|
+
* streams in 2000-row pages after.
|
|
737
749
|
*
|
|
738
750
|
* Iteration stops at the first short page (length < `pageSize`) — in-flight
|
|
739
751
|
* requests past that point are discarded. `MAX_PAGES` is a hard cap on the
|
|
@@ -867,7 +879,12 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
|
|
|
867
879
|
title?: string | null | undefined;
|
|
868
880
|
} | null | undefined;
|
|
869
881
|
}[]>;
|
|
870
|
-
|
|
882
|
+
/**
|
|
883
|
+
* Kick off a URL-based document ingestion. The active workspace is resolved
|
|
884
|
+
* server-side from the open session — there is no ``workspace_ext_id`` query
|
|
885
|
+
* param on this endpoint.
|
|
886
|
+
*/
|
|
887
|
+
declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean): Promise<{
|
|
871
888
|
doc_ext_ids?: string[] | undefined;
|
|
872
889
|
batch_id?: string | null | undefined;
|
|
873
890
|
skipped?: {
|
|
@@ -880,13 +897,15 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], workspaceId: string
|
|
|
880
897
|
*/
|
|
881
898
|
declare function getParsedContent(auth: AuthHeaders, docId: string, stage: string): Promise<Record<string, unknown>>;
|
|
882
899
|
/**
|
|
883
|
-
* Upload a file
|
|
900
|
+
* Upload a file. Uses raw fetch for multipart upload. The active workspace is
|
|
901
|
+
* resolved server-side from the open session.
|
|
884
902
|
*/
|
|
885
|
-
declare function uploadFile$1(auth: AuthHeaders,
|
|
903
|
+
declare function uploadFile$1(auth: AuthHeaders, fileData: Blob, fileName: string, options?: UploadOptions): Promise<UploadResult>;
|
|
886
904
|
/**
|
|
887
|
-
* Upload multiple files in a single FormData request with an optional folder
|
|
905
|
+
* Upload multiple files in a single FormData request with an optional folder
|
|
906
|
+
* parameter. Workspace is resolved from the session, same as ``uploadFile``.
|
|
888
907
|
*/
|
|
889
|
-
declare function uploadFiles(auth: AuthHeaders,
|
|
908
|
+
declare function uploadFiles(auth: AuthHeaders, files: Array<{
|
|
890
909
|
data: Blob;
|
|
891
910
|
name: string;
|
|
892
911
|
}>, options?: UploadOptions): Promise<UploadResult>;
|
|
@@ -915,6 +934,22 @@ interface UploadDirectOptions {
|
|
|
915
934
|
tagExtId?: string;
|
|
916
935
|
/** Expiry for presigned PUT URLs, in seconds. Defaults to server default (1h). */
|
|
917
936
|
presignExpiresIn?: number;
|
|
937
|
+
/**
|
|
938
|
+
* Fired as each file's ciphertext is uploaded. In the browser this yields
|
|
939
|
+
* byte-level progress (XMLHttpRequest upload.progress); in Node this fires
|
|
940
|
+
* once per file with `loaded === total` after each PUT completes.
|
|
941
|
+
*
|
|
942
|
+
* - `fileIndex` indexes into the `files` array passed to the helper.
|
|
943
|
+
* - `fileName` is the corresponding `DirectUploadFile.name`.
|
|
944
|
+
* - `loaded` / `total` are bytes of the *ciphertext* (= raw + 40).
|
|
945
|
+
*/
|
|
946
|
+
onBytesProgress?: (progress: DirectUploadProgress) => void;
|
|
947
|
+
}
|
|
948
|
+
interface DirectUploadProgress {
|
|
949
|
+
fileIndex: number;
|
|
950
|
+
fileName: string;
|
|
951
|
+
loaded: number;
|
|
952
|
+
total: number;
|
|
918
953
|
}
|
|
919
954
|
interface UploadDirectResult {
|
|
920
955
|
/** Doc ext IDs that were committed and will process through the parse pipeline. */
|
|
@@ -927,6 +962,23 @@ interface UploadDirectResult {
|
|
|
927
962
|
*/
|
|
928
963
|
skipped: SkippedFile[];
|
|
929
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* Structural subset of ``ArbiClient`` that ``uploadDocumentsDirect`` actually
|
|
967
|
+
* uses. The helper only needs the openapi-fetch client, so consumers that don't
|
|
968
|
+
* have a full ``ArbiClient`` (e.g. the React frontend, which wires openapi-fetch
|
|
969
|
+
* through its own middleware) can pass ``{ fetch }`` directly without a cast.
|
|
970
|
+
*/
|
|
971
|
+
type DirectUploadClient = Pick<ArbiClient, 'fetch'>;
|
|
972
|
+
/**
|
|
973
|
+
* Minimal extension → MIME mapping to avoid a `mime-types` dep.
|
|
974
|
+
*
|
|
975
|
+
* Browser callers don't usually need this — a File's `.type` is already
|
|
976
|
+
* populated by the browser — but CLI/Node callers construct Blobs from raw
|
|
977
|
+
* bytes and must set the MIME explicitly, otherwise multipart parts land as
|
|
978
|
+
* `application/octet-stream`. Exported for both consumers so the mapping
|
|
979
|
+
* lives in one place.
|
|
980
|
+
*/
|
|
981
|
+
declare function mimeFromName(name: string): string | undefined;
|
|
930
982
|
/**
|
|
931
983
|
* Upload files via the direct-to-MinIO flow (SecretBox on the client,
|
|
932
984
|
* presigned PUT to nginx→MinIO, then commit).
|
|
@@ -947,9 +999,11 @@ interface UploadDirectResult {
|
|
|
947
999
|
* callers that want to upload files from disk should use the wrapper in
|
|
948
1000
|
* ``documents-node`` which reads ``fs`` into the ``data`` field.
|
|
949
1001
|
*/
|
|
950
|
-
declare function uploadDocumentsDirect(arbi:
|
|
1002
|
+
declare function uploadDocumentsDirect(arbi: DirectUploadClient, workspaceKey: Uint8Array, files: DirectUploadFile[], options?: UploadDirectOptions): Promise<UploadDirectResult>;
|
|
951
1003
|
|
|
1004
|
+
type documents_DirectUploadClient = DirectUploadClient;
|
|
952
1005
|
type documents_DirectUploadFile = DirectUploadFile;
|
|
1006
|
+
type documents_DirectUploadProgress = DirectUploadProgress;
|
|
953
1007
|
type documents_DocumentListFields = DocumentListFields;
|
|
954
1008
|
type documents_DocumentListOrder = DocumentListOrder;
|
|
955
1009
|
type documents_ListAllOptions = ListAllOptions;
|
|
@@ -969,13 +1023,14 @@ declare const documents_getParsedContent: typeof getParsedContent;
|
|
|
969
1023
|
declare const documents_listAll: typeof listAll;
|
|
970
1024
|
declare const documents_listDocuments: typeof listDocuments;
|
|
971
1025
|
declare const documents_listPaginated: typeof listPaginated;
|
|
1026
|
+
declare const documents_mimeFromName: typeof mimeFromName;
|
|
972
1027
|
declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
|
|
973
1028
|
declare const documents_updateDocuments: typeof updateDocuments;
|
|
974
1029
|
declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
|
|
975
1030
|
declare const documents_uploadFiles: typeof uploadFiles;
|
|
976
1031
|
declare const documents_uploadUrl: typeof uploadUrl;
|
|
977
1032
|
declare namespace documents {
|
|
978
|
-
export { type documents_DirectUploadFile as DirectUploadFile, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
|
|
1033
|
+
export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_mimeFromName as mimeFromName, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
|
|
979
1034
|
}
|
|
980
1035
|
|
|
981
1036
|
/**
|
|
@@ -1790,7 +1845,7 @@ declare class Arbi {
|
|
|
1790
1845
|
title?: string | null | undefined;
|
|
1791
1846
|
} | null | undefined;
|
|
1792
1847
|
}[]>;
|
|
1793
|
-
uploadUrl: (urls: string[], shared?: boolean
|
|
1848
|
+
uploadUrl: (urls: string[], shared?: boolean) => Promise<{
|
|
1794
1849
|
doc_ext_ids?: string[] | undefined;
|
|
1795
1850
|
batch_id?: string | null | undefined;
|
|
1796
1851
|
skipped?: {
|
|
@@ -1799,7 +1854,6 @@ declare class Arbi {
|
|
|
1799
1854
|
}[] | undefined;
|
|
1800
1855
|
}>;
|
|
1801
1856
|
uploadFile: (fileData: Blob, fileName: string, options?: {
|
|
1802
|
-
workspaceId?: string;
|
|
1803
1857
|
folder?: string;
|
|
1804
1858
|
}) => Promise<UploadResult>;
|
|
1805
1859
|
download: (docId: string) => Promise<Response>;
|
|
@@ -2376,6 +2430,7 @@ declare class Arbi {
|
|
|
2376
2430
|
show_templates: boolean;
|
|
2377
2431
|
show_pa_mode: boolean;
|
|
2378
2432
|
show_agent_sessions: boolean;
|
|
2433
|
+
use_s3_direct_upload: boolean;
|
|
2379
2434
|
hide_online_status: boolean;
|
|
2380
2435
|
muted_users: string[];
|
|
2381
2436
|
premium_model?: string | null | undefined;
|
|
@@ -2569,7 +2624,6 @@ declare class Arbi {
|
|
|
2569
2624
|
};
|
|
2570
2625
|
Chunker: {
|
|
2571
2626
|
MAX_CHUNK_TOKENS: number;
|
|
2572
|
-
TOKENIZER_TYPE: "tiktoken" | "huggingface";
|
|
2573
2627
|
TOKENIZER_NAME: string;
|
|
2574
2628
|
};
|
|
2575
2629
|
Embedder: {
|
|
@@ -3662,6 +3716,7 @@ declare function getSettings(arbi: ArbiClient): Promise<{
|
|
|
3662
3716
|
show_templates: boolean;
|
|
3663
3717
|
show_pa_mode: boolean;
|
|
3664
3718
|
show_agent_sessions: boolean;
|
|
3719
|
+
use_s3_direct_upload: boolean;
|
|
3665
3720
|
hide_online_status: boolean;
|
|
3666
3721
|
muted_users: string[];
|
|
3667
3722
|
premium_model?: string | null | undefined;
|
|
@@ -3865,7 +3920,6 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
|
|
|
3865
3920
|
};
|
|
3866
3921
|
Chunker: {
|
|
3867
3922
|
MAX_CHUNK_TOKENS: number;
|
|
3868
|
-
TOKENIZER_TYPE: "tiktoken" | "huggingface";
|
|
3869
3923
|
TOKENIZER_NAME: string;
|
|
3870
3924
|
};
|
|
3871
3925
|
Embedder: {
|