@arbidocs/sdk 0.3.106 → 0.3.108

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.
@@ -1009,6 +1009,15 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean):
1009
1009
  * Get parsed document content.
1010
1010
  */
1011
1011
  declare function getParsedContent(auth: AuthHeaders, docId: string, stage: string): Promise<Record<string, unknown>>;
1012
+ /**
1013
+ * Batch-fetch first-page thumbnails for many documents in one request.
1014
+ *
1015
+ * Returns a map of document external id → `data:image/webp;base64` URI, or
1016
+ * `null` when a document has no thumbnail (media, not yet generated, or not
1017
+ * accessible to the caller). Purpose-built for a gallery grid that loads a whole
1018
+ * window of tiles in a single call rather than one request per document.
1019
+ */
1020
+ declare function getThumbnails(auth: AuthHeaders, docIds: string[]): Promise<Record<string, string | null>>;
1012
1021
  /**
1013
1022
  * Upload a file. Uses raw fetch for multipart upload. The active workspace is
1014
1023
  * resolved server-side from the open session.
@@ -1133,6 +1142,7 @@ declare const documents_deleteDocuments: typeof deleteDocuments;
1133
1142
  declare const documents_downloadDocument: typeof downloadDocument;
1134
1143
  declare const documents_getDocuments: typeof getDocuments;
1135
1144
  declare const documents_getParsedContent: typeof getParsedContent;
1145
+ declare const documents_getThumbnails: typeof getThumbnails;
1136
1146
  declare const documents_listAll: typeof listAll;
1137
1147
  declare const documents_listDocuments: typeof listDocuments;
1138
1148
  declare const documents_listPaginated: typeof listPaginated;
@@ -1143,7 +1153,7 @@ declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
1143
1153
  declare const documents_uploadFiles: typeof uploadFiles;
1144
1154
  declare const documents_uploadUrl: typeof uploadUrl;
1145
1155
  declare namespace documents {
1146
- 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 };
1156
+ 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_getThumbnails as getThumbnails, 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 };
1147
1157
  }
1148
1158
 
1149
1159
  /**
@@ -2192,6 +2202,7 @@ declare class Arbi {
2192
2202
  }) => Promise<UploadResult>;
2193
2203
  download: (docId: string) => Promise<Response>;
2194
2204
  getParsedContent: (docId: string, stage: string) => Promise<Record<string, unknown>>;
2205
+ getThumbnails: (docIds: string[]) => Promise<Record<string, string | null>>;
2195
2206
  };
2196
2207
  readonly conversations: {
2197
2208
  list: () => Promise<{
@@ -2846,6 +2857,7 @@ declare class Arbi {
2846
2857
  DEEP_RESEARCH_ENABLED: boolean;
2847
2858
  SUGGESTED_QUERIES: boolean;
2848
2859
  ARTIFACTS_ENABLED: boolean;
2860
+ IMAGE_ENABLED: boolean;
2849
2861
  VISION_ENABLED: boolean;
2850
2862
  CONVERSATION_SEARCH_ENABLED: boolean;
2851
2863
  PERSONAL_AGENT: boolean;
@@ -2974,6 +2986,12 @@ declare class Arbi {
2974
2986
  MAX_PAGES_PER_CALL: number;
2975
2987
  IMAGE_MAX_DIMENSION: number;
2976
2988
  };
2989
+ ImageGen: {
2990
+ API_TYPE: "local" | "remote";
2991
+ ENABLE_THINKING: boolean;
2992
+ MODEL_NAME: string;
2993
+ TEMPERATURE: number;
2994
+ };
2977
2995
  CodeAgent: {
2978
2996
  API_TYPE: "local" | "remote";
2979
2997
  ENABLE_THINKING: boolean;
@@ -3071,6 +3089,7 @@ declare class Arbi {
3071
3089
  DEEP_RESEARCH_ENABLED: boolean;
3072
3090
  SUGGESTED_QUERIES: boolean;
3073
3091
  ARTIFACTS_ENABLED: boolean;
3092
+ IMAGE_ENABLED: boolean;
3074
3093
  VISION_ENABLED: boolean;
3075
3094
  CONVERSATION_SEARCH_ENABLED: boolean;
3076
3095
  MEMORY_ENABLED: boolean;
@@ -3264,6 +3283,7 @@ declare class Arbi {
3264
3283
  DEEP_RESEARCH_ENABLED: boolean;
3265
3284
  SUGGESTED_QUERIES: boolean;
3266
3285
  ARTIFACTS_ENABLED: boolean;
3286
+ IMAGE_ENABLED: boolean;
3267
3287
  VISION_ENABLED: boolean;
3268
3288
  CONVERSATION_SEARCH_ENABLED: boolean;
3269
3289
  PERSONAL_AGENT: boolean;
@@ -3392,6 +3412,12 @@ declare class Arbi {
3392
3412
  MAX_PAGES_PER_CALL: number;
3393
3413
  IMAGE_MAX_DIMENSION: number;
3394
3414
  };
3415
+ ImageGen: {
3416
+ API_TYPE: "local" | "remote";
3417
+ ENABLE_THINKING: boolean;
3418
+ MODEL_NAME: string;
3419
+ TEMPERATURE: number;
3420
+ };
3395
3421
  CodeAgent: {
3396
3422
  API_TYPE: "local" | "remote";
3397
3423
  ENABLE_THINKING: boolean;
@@ -3489,6 +3515,7 @@ declare class Arbi {
3489
3515
  DEEP_RESEARCH_ENABLED: boolean;
3490
3516
  SUGGESTED_QUERIES: boolean;
3491
3517
  ARTIFACTS_ENABLED: boolean;
3518
+ IMAGE_ENABLED: boolean;
3492
3519
  VISION_ENABLED: boolean;
3493
3520
  CONVERSATION_SEARCH_ENABLED: boolean;
3494
3521
  MEMORY_ENABLED: boolean;
@@ -4793,6 +4820,7 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4793
4820
  DEEP_RESEARCH_ENABLED: boolean;
4794
4821
  SUGGESTED_QUERIES: boolean;
4795
4822
  ARTIFACTS_ENABLED: boolean;
4823
+ IMAGE_ENABLED: boolean;
4796
4824
  VISION_ENABLED: boolean;
4797
4825
  CONVERSATION_SEARCH_ENABLED: boolean;
4798
4826
  PERSONAL_AGENT: boolean;
@@ -4921,6 +4949,12 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4921
4949
  MAX_PAGES_PER_CALL: number;
4922
4950
  IMAGE_MAX_DIMENSION: number;
4923
4951
  };
4952
+ ImageGen: {
4953
+ API_TYPE: "local" | "remote";
4954
+ ENABLE_THINKING: boolean;
4955
+ MODEL_NAME: string;
4956
+ TEMPERATURE: number;
4957
+ };
4924
4958
  CodeAgent: {
4925
4959
  API_TYPE: "local" | "remote";
4926
4960
  ENABLE_THINKING: boolean;
@@ -5018,6 +5052,7 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
5018
5052
  DEEP_RESEARCH_ENABLED: boolean;
5019
5053
  SUGGESTED_QUERIES: boolean;
5020
5054
  ARTIFACTS_ENABLED: boolean;
5055
+ IMAGE_ENABLED: boolean;
5021
5056
  VISION_ENABLED: boolean;
5022
5057
  CONVERSATION_SEARCH_ENABLED: boolean;
5023
5058
  MEMORY_ENABLED: boolean;
@@ -1009,6 +1009,15 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean):
1009
1009
  * Get parsed document content.
1010
1010
  */
1011
1011
  declare function getParsedContent(auth: AuthHeaders, docId: string, stage: string): Promise<Record<string, unknown>>;
1012
+ /**
1013
+ * Batch-fetch first-page thumbnails for many documents in one request.
1014
+ *
1015
+ * Returns a map of document external id → `data:image/webp;base64` URI, or
1016
+ * `null` when a document has no thumbnail (media, not yet generated, or not
1017
+ * accessible to the caller). Purpose-built for a gallery grid that loads a whole
1018
+ * window of tiles in a single call rather than one request per document.
1019
+ */
1020
+ declare function getThumbnails(auth: AuthHeaders, docIds: string[]): Promise<Record<string, string | null>>;
1012
1021
  /**
1013
1022
  * Upload a file. Uses raw fetch for multipart upload. The active workspace is
1014
1023
  * resolved server-side from the open session.
@@ -1133,6 +1142,7 @@ declare const documents_deleteDocuments: typeof deleteDocuments;
1133
1142
  declare const documents_downloadDocument: typeof downloadDocument;
1134
1143
  declare const documents_getDocuments: typeof getDocuments;
1135
1144
  declare const documents_getParsedContent: typeof getParsedContent;
1145
+ declare const documents_getThumbnails: typeof getThumbnails;
1136
1146
  declare const documents_listAll: typeof listAll;
1137
1147
  declare const documents_listDocuments: typeof listDocuments;
1138
1148
  declare const documents_listPaginated: typeof listPaginated;
@@ -1143,7 +1153,7 @@ declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
1143
1153
  declare const documents_uploadFiles: typeof uploadFiles;
1144
1154
  declare const documents_uploadUrl: typeof uploadUrl;
1145
1155
  declare namespace documents {
1146
- 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 };
1156
+ 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_getThumbnails as getThumbnails, 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 };
1147
1157
  }
1148
1158
 
1149
1159
  /**
@@ -2192,6 +2202,7 @@ declare class Arbi {
2192
2202
  }) => Promise<UploadResult>;
2193
2203
  download: (docId: string) => Promise<Response>;
2194
2204
  getParsedContent: (docId: string, stage: string) => Promise<Record<string, unknown>>;
2205
+ getThumbnails: (docIds: string[]) => Promise<Record<string, string | null>>;
2195
2206
  };
2196
2207
  readonly conversations: {
2197
2208
  list: () => Promise<{
@@ -2846,6 +2857,7 @@ declare class Arbi {
2846
2857
  DEEP_RESEARCH_ENABLED: boolean;
2847
2858
  SUGGESTED_QUERIES: boolean;
2848
2859
  ARTIFACTS_ENABLED: boolean;
2860
+ IMAGE_ENABLED: boolean;
2849
2861
  VISION_ENABLED: boolean;
2850
2862
  CONVERSATION_SEARCH_ENABLED: boolean;
2851
2863
  PERSONAL_AGENT: boolean;
@@ -2974,6 +2986,12 @@ declare class Arbi {
2974
2986
  MAX_PAGES_PER_CALL: number;
2975
2987
  IMAGE_MAX_DIMENSION: number;
2976
2988
  };
2989
+ ImageGen: {
2990
+ API_TYPE: "local" | "remote";
2991
+ ENABLE_THINKING: boolean;
2992
+ MODEL_NAME: string;
2993
+ TEMPERATURE: number;
2994
+ };
2977
2995
  CodeAgent: {
2978
2996
  API_TYPE: "local" | "remote";
2979
2997
  ENABLE_THINKING: boolean;
@@ -3071,6 +3089,7 @@ declare class Arbi {
3071
3089
  DEEP_RESEARCH_ENABLED: boolean;
3072
3090
  SUGGESTED_QUERIES: boolean;
3073
3091
  ARTIFACTS_ENABLED: boolean;
3092
+ IMAGE_ENABLED: boolean;
3074
3093
  VISION_ENABLED: boolean;
3075
3094
  CONVERSATION_SEARCH_ENABLED: boolean;
3076
3095
  MEMORY_ENABLED: boolean;
@@ -3264,6 +3283,7 @@ declare class Arbi {
3264
3283
  DEEP_RESEARCH_ENABLED: boolean;
3265
3284
  SUGGESTED_QUERIES: boolean;
3266
3285
  ARTIFACTS_ENABLED: boolean;
3286
+ IMAGE_ENABLED: boolean;
3267
3287
  VISION_ENABLED: boolean;
3268
3288
  CONVERSATION_SEARCH_ENABLED: boolean;
3269
3289
  PERSONAL_AGENT: boolean;
@@ -3392,6 +3412,12 @@ declare class Arbi {
3392
3412
  MAX_PAGES_PER_CALL: number;
3393
3413
  IMAGE_MAX_DIMENSION: number;
3394
3414
  };
3415
+ ImageGen: {
3416
+ API_TYPE: "local" | "remote";
3417
+ ENABLE_THINKING: boolean;
3418
+ MODEL_NAME: string;
3419
+ TEMPERATURE: number;
3420
+ };
3395
3421
  CodeAgent: {
3396
3422
  API_TYPE: "local" | "remote";
3397
3423
  ENABLE_THINKING: boolean;
@@ -3489,6 +3515,7 @@ declare class Arbi {
3489
3515
  DEEP_RESEARCH_ENABLED: boolean;
3490
3516
  SUGGESTED_QUERIES: boolean;
3491
3517
  ARTIFACTS_ENABLED: boolean;
3518
+ IMAGE_ENABLED: boolean;
3492
3519
  VISION_ENABLED: boolean;
3493
3520
  CONVERSATION_SEARCH_ENABLED: boolean;
3494
3521
  MEMORY_ENABLED: boolean;
@@ -4793,6 +4820,7 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4793
4820
  DEEP_RESEARCH_ENABLED: boolean;
4794
4821
  SUGGESTED_QUERIES: boolean;
4795
4822
  ARTIFACTS_ENABLED: boolean;
4823
+ IMAGE_ENABLED: boolean;
4796
4824
  VISION_ENABLED: boolean;
4797
4825
  CONVERSATION_SEARCH_ENABLED: boolean;
4798
4826
  PERSONAL_AGENT: boolean;
@@ -4921,6 +4949,12 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4921
4949
  MAX_PAGES_PER_CALL: number;
4922
4950
  IMAGE_MAX_DIMENSION: number;
4923
4951
  };
4952
+ ImageGen: {
4953
+ API_TYPE: "local" | "remote";
4954
+ ENABLE_THINKING: boolean;
4955
+ MODEL_NAME: string;
4956
+ TEMPERATURE: number;
4957
+ };
4924
4958
  CodeAgent: {
4925
4959
  API_TYPE: "local" | "remote";
4926
4960
  ENABLE_THINKING: boolean;
@@ -5018,6 +5052,7 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
5018
5052
  DEEP_RESEARCH_ENABLED: boolean;
5019
5053
  SUGGESTED_QUERIES: boolean;
5020
5054
  ARTIFACTS_ENABLED: boolean;
5055
+ IMAGE_ENABLED: boolean;
5021
5056
  VISION_ENABLED: boolean;
5022
5057
  CONVERSATION_SEARCH_ENABLED: boolean;
5023
5058
  MEMORY_ENABLED: boolean;
package/dist/browser.cjs CHANGED
@@ -4240,6 +4240,7 @@ __export(documents_exports, {
4240
4240
  downloadDocument: () => downloadDocument,
4241
4241
  getDocuments: () => getDocuments,
4242
4242
  getParsedContent: () => getParsedContent,
4243
+ getThumbnails: () => getThumbnails,
4243
4244
  listAll: () => listAll,
4244
4245
  listDocuments: () => listDocuments,
4245
4246
  listPaginated: () => listPaginated,
@@ -4414,6 +4415,18 @@ async function getParsedContent(auth, docId, stage) {
4414
4415
  });
4415
4416
  return res.json();
4416
4417
  }
4418
+ async function getThumbnails(auth, docIds) {
4419
+ if (docIds.length === 0) return {};
4420
+ const res = await authenticatedFetch({
4421
+ ...auth,
4422
+ path: `/v1/document/thumbnails`,
4423
+ method: "POST",
4424
+ headers: { "Content-Type": "application/json" },
4425
+ body: JSON.stringify({ document_ext_ids: docIds })
4426
+ });
4427
+ const json = await res.json();
4428
+ return json.thumbnails ?? {};
4429
+ }
4417
4430
  async function uploadFile(auth, fileData, fileName, options) {
4418
4431
  const formData = new FormData();
4419
4432
  formData.append("files", fileData, fileName);
@@ -5649,7 +5662,8 @@ var Arbi = class {
5649
5662
  );
5650
5663
  },
5651
5664
  download: (docId) => downloadDocument(this.getAuthHeaders(), docId),
5652
- getParsedContent: (docId, stage) => getParsedContent(this.getAuthHeaders(), docId, stage)
5665
+ getParsedContent: (docId, stage) => getParsedContent(this.getAuthHeaders(), docId, stage),
5666
+ getThumbnails: (docIds) => getThumbnails(this.getAuthHeaders(), docIds)
5653
5667
  };
5654
5668
  // ── Conversations ─────────────────────────────────────────────────────
5655
5669
  conversations = {