@djangocfg/ext-knowbase 1.0.9 → 1.0.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/dist/config.cjs +1 -1
- package/dist/config.js +1 -1
- package/dist/hooks.cjs +65 -13
- package/dist/hooks.d.cts +6 -5
- package/dist/hooks.d.ts +6 -5
- package/dist/hooks.js +66 -15
- package/dist/index.cjs +65 -13
- package/dist/index.d.cts +81 -25
- package/dist/index.d.ts +81 -25
- package/dist/index.js +66 -15
- package/package.json +7 -7
- package/src/api/generated/ext_knowbase/CLAUDE.md +2 -9
- package/src/api/generated/ext_knowbase/_utils/fetchers/ext_knowbase__knowbase.ts +2 -1
- package/src/api/generated/ext_knowbase/_utils/hooks/ext_knowbase__knowbase.ts +2 -1
- package/src/api/generated/ext_knowbase/_utils/schemas/ArchiveSearchResult.schema.ts +3 -3
- package/src/api/generated/ext_knowbase/_utils/schemas/CfgKnowbaseSystemArchivesCreateRequest.schema.ts +20 -0
- package/src/api/generated/ext_knowbase/_utils/schemas/DocumentArchive.schema.ts +1 -1
- package/src/api/generated/ext_knowbase/_utils/schemas/DocumentArchiveDetail.schema.ts +1 -1
- package/src/api/generated/ext_knowbase/_utils/schemas/index.ts +1 -0
- package/src/api/generated/ext_knowbase/api-instance.ts +61 -13
- package/src/api/generated/ext_knowbase/client.ts +23 -2
- package/src/api/generated/ext_knowbase/ext_knowbase__knowbase/client.ts +9 -2
- package/src/api/generated/ext_knowbase/ext_knowbase__knowbase/models.ts +13 -0
- package/src/api/generated/ext_knowbase/http.ts +8 -2
- package/src/api/generated/ext_knowbase/index.ts +3 -1
- package/src/api/index.ts +6 -1
- package/src/contexts/knowbase/DocumentsContext.tsx +4 -2
- package/src/contexts/knowbase/types.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -673,6 +673,18 @@ interface PaginatedDocumentArchiveListList$1 {
|
|
|
673
673
|
/** Array of items for current page */
|
|
674
674
|
results: Array<DocumentArchiveList$1>;
|
|
675
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
*
|
|
678
|
+
* Request model (no read-only fields).
|
|
679
|
+
*/
|
|
680
|
+
interface CfgKnowbaseSystemArchivesCreateRequest$1 {
|
|
681
|
+
file?: File | Blob;
|
|
682
|
+
title?: string;
|
|
683
|
+
description?: string;
|
|
684
|
+
category_ids?: Array<string>;
|
|
685
|
+
is_public?: boolean;
|
|
686
|
+
process_immediately?: boolean;
|
|
687
|
+
}
|
|
676
688
|
/**
|
|
677
689
|
* Archive processing result serializer.
|
|
678
690
|
*
|
|
@@ -1332,7 +1344,7 @@ interface ArchiveSearchResult$1 {
|
|
|
1332
1344
|
}
|
|
1333
1345
|
|
|
1334
1346
|
declare namespace models {
|
|
1335
|
-
export type { ArchiveItem$1 as ArchiveItem, ArchiveItemChunk$1 as ArchiveItemChunk, ArchiveItemChunkDetail$1 as ArchiveItemChunkDetail, ArchiveItemChunkRequest$1 as ArchiveItemChunkRequest, ArchiveItemDetail$1 as ArchiveItemDetail, ArchiveItemRequest$1 as ArchiveItemRequest, ArchiveProcessingResult$1 as ArchiveProcessingResult, ArchiveSearchRequestRequest$1 as ArchiveSearchRequestRequest, ArchiveSearchResult$1 as ArchiveSearchResult, ArchiveStatistics$1 as ArchiveStatistics, ChatHistory$1 as ChatHistory, ChatMessage$2 as ChatMessage, ChatQueryRequest$1 as ChatQueryRequest, ChatResponse$1 as ChatResponse, ChatResponseRequest$1 as ChatResponseRequest, ChatSession$1 as ChatSession, ChatSessionCreateRequest$1 as ChatSessionCreateRequest, ChatSessionRequest$1 as ChatSessionRequest, ChatSource$2 as ChatSource, ChatSourceRequest$1 as ChatSourceRequest, ChunkRevectorizationRequestRequest$1 as ChunkRevectorizationRequestRequest, Document$1 as Document, DocumentArchive$1 as DocumentArchive, DocumentArchiveDetail$1 as DocumentArchiveDetail, DocumentArchiveList$1 as DocumentArchiveList, DocumentArchiveRequest$1 as DocumentArchiveRequest, DocumentCategory$1 as DocumentCategory, DocumentCreateRequest$1 as DocumentCreateRequest, DocumentProcessingStatus$1 as DocumentProcessingStatus, DocumentRequest$1 as DocumentRequest, DocumentStats$1 as DocumentStats, PaginatedArchiveItemChunkList$1 as PaginatedArchiveItemChunkList, PaginatedArchiveItemList$1 as PaginatedArchiveItemList, PaginatedArchiveSearchResultList$1 as PaginatedArchiveSearchResultList, PaginatedChatResponseList$1 as PaginatedChatResponseList, PaginatedChatSessionList$1 as PaginatedChatSessionList, PaginatedDocumentArchiveListList$1 as PaginatedDocumentArchiveListList, PaginatedDocumentList$1 as PaginatedDocumentList, PaginatedPublicCategoryList$1 as PaginatedPublicCategoryList, PaginatedPublicDocumentListList$1 as PaginatedPublicDocumentListList, PatchedArchiveItemChunkRequest$1 as PatchedArchiveItemChunkRequest, PatchedArchiveItemRequest$1 as PatchedArchiveItemRequest, PatchedChatResponseRequest$1 as PatchedChatResponseRequest, PatchedChatSessionRequest$1 as PatchedChatSessionRequest, PatchedDocumentArchiveRequest$1 as PatchedDocumentArchiveRequest, PatchedDocumentRequest$1 as PatchedDocumentRequest, PublicCategory$1 as PublicCategory, PublicDocument$1 as PublicDocument, PublicDocumentList$1 as PublicDocumentList, VectorizationResult$1 as VectorizationResult, VectorizationStatistics$1 as VectorizationStatistics };
|
|
1347
|
+
export type { ArchiveItem$1 as ArchiveItem, ArchiveItemChunk$1 as ArchiveItemChunk, ArchiveItemChunkDetail$1 as ArchiveItemChunkDetail, ArchiveItemChunkRequest$1 as ArchiveItemChunkRequest, ArchiveItemDetail$1 as ArchiveItemDetail, ArchiveItemRequest$1 as ArchiveItemRequest, ArchiveProcessingResult$1 as ArchiveProcessingResult, ArchiveSearchRequestRequest$1 as ArchiveSearchRequestRequest, ArchiveSearchResult$1 as ArchiveSearchResult, ArchiveStatistics$1 as ArchiveStatistics, CfgKnowbaseSystemArchivesCreateRequest$1 as CfgKnowbaseSystemArchivesCreateRequest, ChatHistory$1 as ChatHistory, ChatMessage$2 as ChatMessage, ChatQueryRequest$1 as ChatQueryRequest, ChatResponse$1 as ChatResponse, ChatResponseRequest$1 as ChatResponseRequest, ChatSession$1 as ChatSession, ChatSessionCreateRequest$1 as ChatSessionCreateRequest, ChatSessionRequest$1 as ChatSessionRequest, ChatSource$2 as ChatSource, ChatSourceRequest$1 as ChatSourceRequest, ChunkRevectorizationRequestRequest$1 as ChunkRevectorizationRequestRequest, Document$1 as Document, DocumentArchive$1 as DocumentArchive, DocumentArchiveDetail$1 as DocumentArchiveDetail, DocumentArchiveList$1 as DocumentArchiveList, DocumentArchiveRequest$1 as DocumentArchiveRequest, DocumentCategory$1 as DocumentCategory, DocumentCreateRequest$1 as DocumentCreateRequest, DocumentProcessingStatus$1 as DocumentProcessingStatus, DocumentRequest$1 as DocumentRequest, DocumentStats$1 as DocumentStats, PaginatedArchiveItemChunkList$1 as PaginatedArchiveItemChunkList, PaginatedArchiveItemList$1 as PaginatedArchiveItemList, PaginatedArchiveSearchResultList$1 as PaginatedArchiveSearchResultList, PaginatedChatResponseList$1 as PaginatedChatResponseList, PaginatedChatSessionList$1 as PaginatedChatSessionList, PaginatedDocumentArchiveListList$1 as PaginatedDocumentArchiveListList, PaginatedDocumentList$1 as PaginatedDocumentList, PaginatedPublicCategoryList$1 as PaginatedPublicCategoryList, PaginatedPublicDocumentListList$1 as PaginatedPublicDocumentListList, PatchedArchiveItemChunkRequest$1 as PatchedArchiveItemChunkRequest, PatchedArchiveItemRequest$1 as PatchedArchiveItemRequest, PatchedChatResponseRequest$1 as PatchedChatResponseRequest, PatchedChatSessionRequest$1 as PatchedChatSessionRequest, PatchedDocumentArchiveRequest$1 as PatchedDocumentArchiveRequest, PatchedDocumentRequest$1 as PatchedDocumentRequest, PublicCategory$1 as PublicCategory, PublicDocument$1 as PublicDocument, PublicDocumentList$1 as PublicDocumentList, VectorizationResult$1 as VectorizationResult, VectorizationStatistics$1 as VectorizationStatistics };
|
|
1336
1348
|
}
|
|
1337
1349
|
|
|
1338
1350
|
/**
|
|
@@ -1501,7 +1513,7 @@ declare class ExtKnowbaseKnowbase {
|
|
|
1501
1513
|
*
|
|
1502
1514
|
* Upload archive file and process it synchronously
|
|
1503
1515
|
*/
|
|
1504
|
-
systemArchivesCreate(data:
|
|
1516
|
+
systemArchivesCreate(data: CfgKnowbaseSystemArchivesCreateRequest$1): Promise<ArchiveProcessingResult$1>;
|
|
1505
1517
|
/**
|
|
1506
1518
|
* Document archive management endpoints - Admin only.
|
|
1507
1519
|
*/
|
|
@@ -1641,6 +1653,8 @@ interface HttpRequest {
|
|
|
1641
1653
|
params?: Record<string, any>;
|
|
1642
1654
|
/** FormData for file uploads (multipart/form-data) */
|
|
1643
1655
|
formData?: FormData;
|
|
1656
|
+
/** Binary data for octet-stream uploads */
|
|
1657
|
+
binaryBody?: Blob | ArrayBuffer;
|
|
1644
1658
|
}
|
|
1645
1659
|
interface HttpResponse<T = any> {
|
|
1646
1660
|
data: T;
|
|
@@ -1893,11 +1907,13 @@ declare class APIClient {
|
|
|
1893
1907
|
private httpClient;
|
|
1894
1908
|
private logger;
|
|
1895
1909
|
private retryConfig;
|
|
1910
|
+
private tokenGetter;
|
|
1896
1911
|
ext_knowbase_knowbase: ExtKnowbaseKnowbase;
|
|
1897
1912
|
constructor(baseUrl: string, options?: {
|
|
1898
1913
|
httpClient?: HttpClientAdapter;
|
|
1899
1914
|
loggerConfig?: Partial<LoggerConfig>;
|
|
1900
1915
|
retryConfig?: RetryConfig;
|
|
1916
|
+
tokenGetter?: () => string | null;
|
|
1901
1917
|
});
|
|
1902
1918
|
/**
|
|
1903
1919
|
* Get CSRF token from cookies (for SessionAuthentication).
|
|
@@ -1905,6 +1921,15 @@ declare class APIClient {
|
|
|
1905
1921
|
* Returns null if cookie doesn't exist (JWT-only auth).
|
|
1906
1922
|
*/
|
|
1907
1923
|
getCsrfToken(): string | null;
|
|
1924
|
+
/**
|
|
1925
|
+
* Get the base URL for building streaming/download URLs.
|
|
1926
|
+
*/
|
|
1927
|
+
getBaseUrl(): string;
|
|
1928
|
+
/**
|
|
1929
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
1930
|
+
* Returns null if no token getter is configured or no token is available.
|
|
1931
|
+
*/
|
|
1932
|
+
getToken(): string | null;
|
|
1908
1933
|
/**
|
|
1909
1934
|
* Make HTTP request with Django CSRF and session handling.
|
|
1910
1935
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -1913,6 +1938,7 @@ declare class APIClient {
|
|
|
1913
1938
|
params?: Record<string, any>;
|
|
1914
1939
|
body?: any;
|
|
1915
1940
|
formData?: FormData;
|
|
1941
|
+
binaryBody?: Blob | ArrayBuffer;
|
|
1916
1942
|
headers?: Record<string, string>;
|
|
1917
1943
|
}): Promise<T>;
|
|
1918
1944
|
/**
|
|
@@ -2203,9 +2229,9 @@ declare const ArchiveSearchResultSchema: z.ZodObject<{
|
|
|
2203
2229
|
created_at: z.ZodISODateTime;
|
|
2204
2230
|
}, z.core.$strip>;
|
|
2205
2231
|
similarity_score: z.ZodNumber;
|
|
2206
|
-
context_summary: z.ZodRecord<z.ZodString, z.
|
|
2207
|
-
archive_info: z.ZodRecord<z.ZodString, z.
|
|
2208
|
-
item_info: z.ZodRecord<z.ZodString, z.
|
|
2232
|
+
context_summary: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
2233
|
+
archive_info: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
2234
|
+
item_info: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
2209
2235
|
}, z.core.$strip>;
|
|
2210
2236
|
/**
|
|
2211
2237
|
* Infer TypeScript type from Zod schema
|
|
@@ -2239,6 +2265,25 @@ declare const ArchiveStatisticsSchema: z.ZodObject<{
|
|
|
2239
2265
|
*/
|
|
2240
2266
|
type ArchiveStatistics = z.infer<typeof ArchiveStatisticsSchema>;
|
|
2241
2267
|
|
|
2268
|
+
/**
|
|
2269
|
+
* Zod schema for CfgKnowbaseSystemArchivesCreateRequest
|
|
2270
|
+
*
|
|
2271
|
+
* This schema provides runtime validation and type inference.
|
|
2272
|
+
* */
|
|
2273
|
+
|
|
2274
|
+
declare const CfgKnowbaseSystemArchivesCreateRequestSchema: z.ZodObject<{
|
|
2275
|
+
file: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>]>>;
|
|
2276
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2277
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2278
|
+
category_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2279
|
+
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
2280
|
+
process_immediately: z.ZodOptional<z.ZodBoolean>;
|
|
2281
|
+
}, z.core.$strip>;
|
|
2282
|
+
/**
|
|
2283
|
+
* Infer TypeScript type from Zod schema
|
|
2284
|
+
*/
|
|
2285
|
+
type CfgKnowbaseSystemArchivesCreateRequest = z.infer<typeof CfgKnowbaseSystemArchivesCreateRequestSchema>;
|
|
2286
|
+
|
|
2242
2287
|
/**
|
|
2243
2288
|
* Chat history response serializer.
|
|
2244
2289
|
*/
|
|
@@ -2548,7 +2593,7 @@ declare const DocumentArchiveSchema: z.ZodObject<{
|
|
|
2548
2593
|
created_at: z.ZodISODateTime;
|
|
2549
2594
|
}, z.core.$strip>>;
|
|
2550
2595
|
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
2551
|
-
archive_file: z.ZodURL
|
|
2596
|
+
archive_file: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
|
|
2552
2597
|
original_filename: z.ZodString;
|
|
2553
2598
|
file_size: z.ZodInt;
|
|
2554
2599
|
archive_type: z.ZodEnum<typeof DocumentArchiveArchiveType>;
|
|
@@ -2595,7 +2640,7 @@ declare const DocumentArchiveDetailSchema: z.ZodObject<{
|
|
|
2595
2640
|
created_at: z.ZodISODateTime;
|
|
2596
2641
|
}, z.core.$strip>>;
|
|
2597
2642
|
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
2598
|
-
archive_file: z.ZodURL
|
|
2643
|
+
archive_file: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
|
|
2599
2644
|
original_filename: z.ZodString;
|
|
2600
2645
|
file_size: z.ZodInt;
|
|
2601
2646
|
archive_type: z.ZodEnum<typeof DocumentArchiveDetailArchiveType>;
|
|
@@ -2907,9 +2952,9 @@ declare const PaginatedArchiveSearchResultListSchema: z.ZodObject<{
|
|
|
2907
2952
|
created_at: z.ZodISODateTime;
|
|
2908
2953
|
}, z.core.$strip>;
|
|
2909
2954
|
similarity_score: z.ZodNumber;
|
|
2910
|
-
context_summary: z.ZodRecord<z.ZodString, z.
|
|
2911
|
-
archive_info: z.ZodRecord<z.ZodString, z.
|
|
2912
|
-
item_info: z.ZodRecord<z.ZodString, z.
|
|
2955
|
+
context_summary: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
2956
|
+
archive_info: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
2957
|
+
item_info: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
2913
2958
|
}, z.core.$strip>>;
|
|
2914
2959
|
}, z.core.$strip>;
|
|
2915
2960
|
/**
|
|
@@ -3411,6 +3456,8 @@ type index$1_ArchiveSearchResult = ArchiveSearchResult;
|
|
|
3411
3456
|
declare const index$1_ArchiveSearchResultSchema: typeof ArchiveSearchResultSchema;
|
|
3412
3457
|
type index$1_ArchiveStatistics = ArchiveStatistics;
|
|
3413
3458
|
declare const index$1_ArchiveStatisticsSchema: typeof ArchiveStatisticsSchema;
|
|
3459
|
+
type index$1_CfgKnowbaseSystemArchivesCreateRequest = CfgKnowbaseSystemArchivesCreateRequest;
|
|
3460
|
+
declare const index$1_CfgKnowbaseSystemArchivesCreateRequestSchema: typeof CfgKnowbaseSystemArchivesCreateRequestSchema;
|
|
3414
3461
|
type index$1_ChatHistory = ChatHistory;
|
|
3415
3462
|
declare const index$1_ChatHistorySchema: typeof ChatHistorySchema;
|
|
3416
3463
|
declare const index$1_ChatMessageSchema: typeof ChatMessageSchema;
|
|
@@ -3494,7 +3541,7 @@ declare const index$1_VectorizationResultSchema: typeof VectorizationResultSchem
|
|
|
3494
3541
|
type index$1_VectorizationStatistics = VectorizationStatistics;
|
|
3495
3542
|
declare const index$1_VectorizationStatisticsSchema: typeof VectorizationStatisticsSchema;
|
|
3496
3543
|
declare namespace index$1 {
|
|
3497
|
-
export { type index$1_ArchiveItem as ArchiveItem, type index$1_ArchiveItemChunk as ArchiveItemChunk, type index$1_ArchiveItemChunkDetail as ArchiveItemChunkDetail, index$1_ArchiveItemChunkDetailSchema as ArchiveItemChunkDetailSchema, type index$1_ArchiveItemChunkRequest as ArchiveItemChunkRequest, index$1_ArchiveItemChunkRequestSchema as ArchiveItemChunkRequestSchema, index$1_ArchiveItemChunkSchema as ArchiveItemChunkSchema, type index$1_ArchiveItemDetail as ArchiveItemDetail, index$1_ArchiveItemDetailSchema as ArchiveItemDetailSchema, type index$1_ArchiveItemRequest as ArchiveItemRequest, index$1_ArchiveItemRequestSchema as ArchiveItemRequestSchema, index$1_ArchiveItemSchema as ArchiveItemSchema, type index$1_ArchiveProcessingResult as ArchiveProcessingResult, index$1_ArchiveProcessingResultSchema as ArchiveProcessingResultSchema, type index$1_ArchiveSearchRequestRequest as ArchiveSearchRequestRequest, index$1_ArchiveSearchRequestRequestSchema as ArchiveSearchRequestRequestSchema, type index$1_ArchiveSearchResult as ArchiveSearchResult, index$1_ArchiveSearchResultSchema as ArchiveSearchResultSchema, type index$1_ArchiveStatistics as ArchiveStatistics, index$1_ArchiveStatisticsSchema as ArchiveStatisticsSchema, type index$1_ChatHistory as ChatHistory, index$1_ChatHistorySchema as ChatHistorySchema, type ChatMessage$1 as ChatMessage, index$1_ChatMessageSchema as ChatMessageSchema, type index$1_ChatQueryRequest as ChatQueryRequest, index$1_ChatQueryRequestSchema as ChatQueryRequestSchema, type index$1_ChatResponse as ChatResponse, type index$1_ChatResponseRequest as ChatResponseRequest, index$1_ChatResponseRequestSchema as ChatResponseRequestSchema, index$1_ChatResponseSchema as ChatResponseSchema, type index$1_ChatSession as ChatSession, type index$1_ChatSessionCreateRequest as ChatSessionCreateRequest, index$1_ChatSessionCreateRequestSchema as ChatSessionCreateRequestSchema, type index$1_ChatSessionRequest as ChatSessionRequest, index$1_ChatSessionRequestSchema as ChatSessionRequestSchema, index$1_ChatSessionSchema as ChatSessionSchema, type ChatSource$1 as ChatSource, type index$1_ChatSourceRequest as ChatSourceRequest, index$1_ChatSourceRequestSchema as ChatSourceRequestSchema, index$1_ChatSourceSchema as ChatSourceSchema, type index$1_ChunkRevectorizationRequestRequest as ChunkRevectorizationRequestRequest, index$1_ChunkRevectorizationRequestRequestSchema as ChunkRevectorizationRequestRequestSchema, type index$1_Document as Document, type index$1_DocumentArchive as DocumentArchive, type index$1_DocumentArchiveDetail as DocumentArchiveDetail, index$1_DocumentArchiveDetailSchema as DocumentArchiveDetailSchema, type index$1_DocumentArchiveList as DocumentArchiveList, index$1_DocumentArchiveListSchema as DocumentArchiveListSchema, type index$1_DocumentArchiveRequest as DocumentArchiveRequest, index$1_DocumentArchiveRequestSchema as DocumentArchiveRequestSchema, index$1_DocumentArchiveSchema as DocumentArchiveSchema, type index$1_DocumentCategory as DocumentCategory, type index$1_DocumentCategoryRequest as DocumentCategoryRequest, index$1_DocumentCategoryRequestSchema as DocumentCategoryRequestSchema, index$1_DocumentCategorySchema as DocumentCategorySchema, type index$1_DocumentCreateRequest as DocumentCreateRequest, index$1_DocumentCreateRequestSchema as DocumentCreateRequestSchema, type index$1_DocumentProcessingStatus as DocumentProcessingStatus, index$1_DocumentProcessingStatusSchema as DocumentProcessingStatusSchema, type index$1_DocumentRequest as DocumentRequest, index$1_DocumentRequestSchema as DocumentRequestSchema, index$1_DocumentSchema as DocumentSchema, type index$1_DocumentStats as DocumentStats, index$1_DocumentStatsSchema as DocumentStatsSchema, type index$1_PaginatedArchiveItemChunkList as PaginatedArchiveItemChunkList, index$1_PaginatedArchiveItemChunkListSchema as PaginatedArchiveItemChunkListSchema, type index$1_PaginatedArchiveItemList as PaginatedArchiveItemList, index$1_PaginatedArchiveItemListSchema as PaginatedArchiveItemListSchema, type index$1_PaginatedArchiveSearchResultList as PaginatedArchiveSearchResultList, index$1_PaginatedArchiveSearchResultListSchema as PaginatedArchiveSearchResultListSchema, type index$1_PaginatedChatResponseList as PaginatedChatResponseList, index$1_PaginatedChatResponseListSchema as PaginatedChatResponseListSchema, type index$1_PaginatedChatSessionList as PaginatedChatSessionList, index$1_PaginatedChatSessionListSchema as PaginatedChatSessionListSchema, type index$1_PaginatedDocumentArchiveListList as PaginatedDocumentArchiveListList, index$1_PaginatedDocumentArchiveListListSchema as PaginatedDocumentArchiveListListSchema, type index$1_PaginatedDocumentList as PaginatedDocumentList, index$1_PaginatedDocumentListSchema as PaginatedDocumentListSchema, type index$1_PaginatedPublicCategoryList as PaginatedPublicCategoryList, index$1_PaginatedPublicCategoryListSchema as PaginatedPublicCategoryListSchema, type index$1_PaginatedPublicDocumentListList as PaginatedPublicDocumentListList, index$1_PaginatedPublicDocumentListListSchema as PaginatedPublicDocumentListListSchema, type index$1_PatchedArchiveItemChunkRequest as PatchedArchiveItemChunkRequest, index$1_PatchedArchiveItemChunkRequestSchema as PatchedArchiveItemChunkRequestSchema, type index$1_PatchedArchiveItemRequest as PatchedArchiveItemRequest, index$1_PatchedArchiveItemRequestSchema as PatchedArchiveItemRequestSchema, type index$1_PatchedChatResponseRequest as PatchedChatResponseRequest, index$1_PatchedChatResponseRequestSchema as PatchedChatResponseRequestSchema, type index$1_PatchedChatSessionRequest as PatchedChatSessionRequest, index$1_PatchedChatSessionRequestSchema as PatchedChatSessionRequestSchema, type index$1_PatchedDocumentArchiveRequest as PatchedDocumentArchiveRequest, index$1_PatchedDocumentArchiveRequestSchema as PatchedDocumentArchiveRequestSchema, type index$1_PatchedDocumentRequest as PatchedDocumentRequest, index$1_PatchedDocumentRequestSchema as PatchedDocumentRequestSchema, type index$1_PublicCategory as PublicCategory, index$1_PublicCategorySchema as PublicCategorySchema, type index$1_PublicDocument as PublicDocument, type index$1_PublicDocumentList as PublicDocumentList, index$1_PublicDocumentListSchema as PublicDocumentListSchema, index$1_PublicDocumentSchema as PublicDocumentSchema, type index$1_VectorizationResult as VectorizationResult, index$1_VectorizationResultSchema as VectorizationResultSchema, type index$1_VectorizationStatistics as VectorizationStatistics, index$1_VectorizationStatisticsSchema as VectorizationStatisticsSchema };
|
|
3544
|
+
export { type index$1_ArchiveItem as ArchiveItem, type index$1_ArchiveItemChunk as ArchiveItemChunk, type index$1_ArchiveItemChunkDetail as ArchiveItemChunkDetail, index$1_ArchiveItemChunkDetailSchema as ArchiveItemChunkDetailSchema, type index$1_ArchiveItemChunkRequest as ArchiveItemChunkRequest, index$1_ArchiveItemChunkRequestSchema as ArchiveItemChunkRequestSchema, index$1_ArchiveItemChunkSchema as ArchiveItemChunkSchema, type index$1_ArchiveItemDetail as ArchiveItemDetail, index$1_ArchiveItemDetailSchema as ArchiveItemDetailSchema, type index$1_ArchiveItemRequest as ArchiveItemRequest, index$1_ArchiveItemRequestSchema as ArchiveItemRequestSchema, index$1_ArchiveItemSchema as ArchiveItemSchema, type index$1_ArchiveProcessingResult as ArchiveProcessingResult, index$1_ArchiveProcessingResultSchema as ArchiveProcessingResultSchema, type index$1_ArchiveSearchRequestRequest as ArchiveSearchRequestRequest, index$1_ArchiveSearchRequestRequestSchema as ArchiveSearchRequestRequestSchema, type index$1_ArchiveSearchResult as ArchiveSearchResult, index$1_ArchiveSearchResultSchema as ArchiveSearchResultSchema, type index$1_ArchiveStatistics as ArchiveStatistics, index$1_ArchiveStatisticsSchema as ArchiveStatisticsSchema, type index$1_CfgKnowbaseSystemArchivesCreateRequest as CfgKnowbaseSystemArchivesCreateRequest, index$1_CfgKnowbaseSystemArchivesCreateRequestSchema as CfgKnowbaseSystemArchivesCreateRequestSchema, type index$1_ChatHistory as ChatHistory, index$1_ChatHistorySchema as ChatHistorySchema, type ChatMessage$1 as ChatMessage, index$1_ChatMessageSchema as ChatMessageSchema, type index$1_ChatQueryRequest as ChatQueryRequest, index$1_ChatQueryRequestSchema as ChatQueryRequestSchema, type index$1_ChatResponse as ChatResponse, type index$1_ChatResponseRequest as ChatResponseRequest, index$1_ChatResponseRequestSchema as ChatResponseRequestSchema, index$1_ChatResponseSchema as ChatResponseSchema, type index$1_ChatSession as ChatSession, type index$1_ChatSessionCreateRequest as ChatSessionCreateRequest, index$1_ChatSessionCreateRequestSchema as ChatSessionCreateRequestSchema, type index$1_ChatSessionRequest as ChatSessionRequest, index$1_ChatSessionRequestSchema as ChatSessionRequestSchema, index$1_ChatSessionSchema as ChatSessionSchema, type ChatSource$1 as ChatSource, type index$1_ChatSourceRequest as ChatSourceRequest, index$1_ChatSourceRequestSchema as ChatSourceRequestSchema, index$1_ChatSourceSchema as ChatSourceSchema, type index$1_ChunkRevectorizationRequestRequest as ChunkRevectorizationRequestRequest, index$1_ChunkRevectorizationRequestRequestSchema as ChunkRevectorizationRequestRequestSchema, type index$1_Document as Document, type index$1_DocumentArchive as DocumentArchive, type index$1_DocumentArchiveDetail as DocumentArchiveDetail, index$1_DocumentArchiveDetailSchema as DocumentArchiveDetailSchema, type index$1_DocumentArchiveList as DocumentArchiveList, index$1_DocumentArchiveListSchema as DocumentArchiveListSchema, type index$1_DocumentArchiveRequest as DocumentArchiveRequest, index$1_DocumentArchiveRequestSchema as DocumentArchiveRequestSchema, index$1_DocumentArchiveSchema as DocumentArchiveSchema, type index$1_DocumentCategory as DocumentCategory, type index$1_DocumentCategoryRequest as DocumentCategoryRequest, index$1_DocumentCategoryRequestSchema as DocumentCategoryRequestSchema, index$1_DocumentCategorySchema as DocumentCategorySchema, type index$1_DocumentCreateRequest as DocumentCreateRequest, index$1_DocumentCreateRequestSchema as DocumentCreateRequestSchema, type index$1_DocumentProcessingStatus as DocumentProcessingStatus, index$1_DocumentProcessingStatusSchema as DocumentProcessingStatusSchema, type index$1_DocumentRequest as DocumentRequest, index$1_DocumentRequestSchema as DocumentRequestSchema, index$1_DocumentSchema as DocumentSchema, type index$1_DocumentStats as DocumentStats, index$1_DocumentStatsSchema as DocumentStatsSchema, type index$1_PaginatedArchiveItemChunkList as PaginatedArchiveItemChunkList, index$1_PaginatedArchiveItemChunkListSchema as PaginatedArchiveItemChunkListSchema, type index$1_PaginatedArchiveItemList as PaginatedArchiveItemList, index$1_PaginatedArchiveItemListSchema as PaginatedArchiveItemListSchema, type index$1_PaginatedArchiveSearchResultList as PaginatedArchiveSearchResultList, index$1_PaginatedArchiveSearchResultListSchema as PaginatedArchiveSearchResultListSchema, type index$1_PaginatedChatResponseList as PaginatedChatResponseList, index$1_PaginatedChatResponseListSchema as PaginatedChatResponseListSchema, type index$1_PaginatedChatSessionList as PaginatedChatSessionList, index$1_PaginatedChatSessionListSchema as PaginatedChatSessionListSchema, type index$1_PaginatedDocumentArchiveListList as PaginatedDocumentArchiveListList, index$1_PaginatedDocumentArchiveListListSchema as PaginatedDocumentArchiveListListSchema, type index$1_PaginatedDocumentList as PaginatedDocumentList, index$1_PaginatedDocumentListSchema as PaginatedDocumentListSchema, type index$1_PaginatedPublicCategoryList as PaginatedPublicCategoryList, index$1_PaginatedPublicCategoryListSchema as PaginatedPublicCategoryListSchema, type index$1_PaginatedPublicDocumentListList as PaginatedPublicDocumentListList, index$1_PaginatedPublicDocumentListListSchema as PaginatedPublicDocumentListListSchema, type index$1_PatchedArchiveItemChunkRequest as PatchedArchiveItemChunkRequest, index$1_PatchedArchiveItemChunkRequestSchema as PatchedArchiveItemChunkRequestSchema, type index$1_PatchedArchiveItemRequest as PatchedArchiveItemRequest, index$1_PatchedArchiveItemRequestSchema as PatchedArchiveItemRequestSchema, type index$1_PatchedChatResponseRequest as PatchedChatResponseRequest, index$1_PatchedChatResponseRequestSchema as PatchedChatResponseRequestSchema, type index$1_PatchedChatSessionRequest as PatchedChatSessionRequest, index$1_PatchedChatSessionRequestSchema as PatchedChatSessionRequestSchema, type index$1_PatchedDocumentArchiveRequest as PatchedDocumentArchiveRequest, index$1_PatchedDocumentArchiveRequestSchema as PatchedDocumentArchiveRequestSchema, type index$1_PatchedDocumentRequest as PatchedDocumentRequest, index$1_PatchedDocumentRequestSchema as PatchedDocumentRequestSchema, type index$1_PublicCategory as PublicCategory, index$1_PublicCategorySchema as PublicCategorySchema, type index$1_PublicDocument as PublicDocument, type index$1_PublicDocumentList as PublicDocumentList, index$1_PublicDocumentListSchema as PublicDocumentListSchema, index$1_PublicDocumentSchema as PublicDocumentSchema, type index$1_VectorizationResult as VectorizationResult, index$1_VectorizationResultSchema as VectorizationResultSchema, type index$1_VectorizationStatistics as VectorizationStatistics, index$1_VectorizationStatisticsSchema as VectorizationStatisticsSchema };
|
|
3498
3545
|
}
|
|
3499
3546
|
|
|
3500
3547
|
/**
|
|
@@ -3807,7 +3854,7 @@ declare function getKnowbaseSystemArchivesList(params?: {
|
|
|
3807
3854
|
* @method POST
|
|
3808
3855
|
* @path /cfg/knowbase/system/archives/
|
|
3809
3856
|
*/
|
|
3810
|
-
declare function createKnowbaseSystemArchivesCreate(data:
|
|
3857
|
+
declare function createKnowbaseSystemArchivesCreate(data: CfgKnowbaseSystemArchivesCreateRequest, client?: any): Promise<ArchiveProcessingResult>;
|
|
3811
3858
|
/**
|
|
3812
3859
|
* API operation
|
|
3813
3860
|
*
|
|
@@ -4095,30 +4142,38 @@ declare namespace index {
|
|
|
4095
4142
|
}
|
|
4096
4143
|
|
|
4097
4144
|
/**
|
|
4098
|
-
* Global API Instance - Singleton configuration
|
|
4145
|
+
* Global API Instance - Singleton configuration with auto-configuration support
|
|
4099
4146
|
*
|
|
4100
|
-
* This module provides a global API instance that
|
|
4101
|
-
*
|
|
4147
|
+
* This module provides a global API instance that auto-configures from
|
|
4148
|
+
* environment variables or can be configured manually.
|
|
4102
4149
|
*
|
|
4103
|
-
*
|
|
4150
|
+
* AUTO-CONFIGURATION (recommended):
|
|
4151
|
+
* Set one of these environment variables and the API will auto-configure:
|
|
4152
|
+
* - NEXT_PUBLIC_API_URL (Next.js)
|
|
4153
|
+
* - VITE_API_URL (Vite)
|
|
4154
|
+
* - REACT_APP_API_URL (Create React App)
|
|
4155
|
+
* - API_URL (generic)
|
|
4156
|
+
*
|
|
4157
|
+
* Then just use fetchers and hooks directly:
|
|
4158
|
+
* ```typescript
|
|
4159
|
+
* import { getUsers } from './_utils/fetchers'
|
|
4160
|
+
* const users = await getUsers({ page: 1 })
|
|
4161
|
+
* ```
|
|
4162
|
+
*
|
|
4163
|
+
* MANUAL CONFIGURATION:
|
|
4104
4164
|
* ```typescript
|
|
4105
|
-
* // Configure once (e.g., in your app entry point)
|
|
4106
4165
|
* import { configureAPI } from './api-instance'
|
|
4107
4166
|
*
|
|
4108
4167
|
* configureAPI({
|
|
4109
4168
|
* baseUrl: 'https://api.example.com',
|
|
4110
4169
|
* token: 'your-jwt-token'
|
|
4111
4170
|
* })
|
|
4112
|
-
*
|
|
4113
|
-
* // Then use fetchers and hooks anywhere without configuration
|
|
4114
|
-
* import { getUsers } from './fetchers'
|
|
4115
|
-
* const users = await getUsers({ page: 1 })
|
|
4116
4171
|
* ```
|
|
4117
4172
|
*
|
|
4118
4173
|
* For SSR or multiple instances:
|
|
4119
4174
|
* ```typescript
|
|
4120
4175
|
* import { API } from './index'
|
|
4121
|
-
* import { getUsers } from './fetchers'
|
|
4176
|
+
* import { getUsers } from './_utils/fetchers'
|
|
4122
4177
|
*
|
|
4123
4178
|
* const api = new API('https://api.example.com')
|
|
4124
4179
|
* const users = await getUsers({ page: 1 }, api)
|
|
@@ -4127,11 +4182,12 @@ declare namespace index {
|
|
|
4127
4182
|
|
|
4128
4183
|
/**
|
|
4129
4184
|
* Get the global API instance
|
|
4130
|
-
*
|
|
4185
|
+
* Auto-configures from environment variables on first call if not manually configured.
|
|
4186
|
+
* @throws Error if API is not configured and no env variable is set
|
|
4131
4187
|
*/
|
|
4132
4188
|
declare function getAPIInstance(): API;
|
|
4133
4189
|
/**
|
|
4134
|
-
* Check if API is configured
|
|
4190
|
+
* Check if API is configured (or can be auto-configured)
|
|
4135
4191
|
*/
|
|
4136
4192
|
declare function isAPIConfigured(): boolean;
|
|
4137
4193
|
/**
|
|
@@ -4401,4 +4457,4 @@ interface SessionListProps {
|
|
|
4401
4457
|
*/
|
|
4402
4458
|
declare const extensionConfig: _djangocfg_ext_base.ExtensionMetadata;
|
|
4403
4459
|
|
|
4404
|
-
export { API, APIClient, APIError, APILogger, type APIOptions, type ArchiveItem, type ArchiveItemChunk, type ArchiveItemChunkDetail, ArchiveItemChunkDetailSchema, type ArchiveItemChunkRequest, ArchiveItemChunkRequestSchema, ArchiveItemChunkSchema, type ArchiveItemDetail, ArchiveItemDetailSchema, type ArchiveItemRequest, ArchiveItemRequestSchema, ArchiveItemSchema, type ArchiveProcessingResult, ArchiveProcessingResultSchema, type ArchiveSearchRequestRequest, ArchiveSearchRequestRequestSchema, type ArchiveSearchResult, ArchiveSearchResultSchema, type ArchiveStatistics, ArchiveStatisticsSchema, type ChatHistory, ChatHistorySchema, type ChatMessage$1 as ChatMessage, ChatMessageSchema, type ChatMessageWithSources, type ChatQueryRequest, ChatQueryRequestSchema, type ChatResponse, type ChatResponseRequest, ChatResponseRequestSchema, ChatResponseSchema, type ChatSession, type ChatSessionCreateRequest, ChatSessionCreateRequestSchema, type ChatSessionRequest, ChatSessionRequestSchema, ChatSessionSchema, type ChatSource$1 as ChatSource, type ChatSourceRequest, ChatSourceRequestSchema, ChatSourceSchema, type ChatUIState, type ChatWidgetProps, type ChunkRevectorizationRequestRequest, ChunkRevectorizationRequestRequestSchema, CookieStorageAdapter, DEFAULT_RETRY_CONFIG, type Document, type DocumentArchive, type DocumentArchiveDetail, DocumentArchiveDetailSchema, type DocumentArchiveList, DocumentArchiveListSchema, type DocumentArchiveRequest, DocumentArchiveRequestSchema, DocumentArchiveSchema, type DocumentCategory, type DocumentCategoryRequest, DocumentCategoryRequestSchema, DocumentCategorySchema, type DocumentCreateRequest, DocumentCreateRequestSchema, type DocumentProcessingStatus, DocumentProcessingStatusSchema, type DocumentRequest, DocumentRequestSchema, DocumentSchema, type DocumentStats, DocumentStatsSchema, GeneratedEnums as Enums, type ErrorLog, models as ExtKnowbaseKnowbaseTypes, type FailedAttemptInfo, FetchAdapter, index as Fetchers, type HttpClientAdapter, type HttpRequest, type HttpResponse, LocalStorageAdapter, type LoggerConfig, MemoryStorageAdapter, type MessageInputProps, type MessageListProps, NetworkError, type PaginatedArchiveItemChunkList, PaginatedArchiveItemChunkListSchema, type PaginatedArchiveItemList, PaginatedArchiveItemListSchema, type PaginatedArchiveSearchResultList, PaginatedArchiveSearchResultListSchema, type PaginatedChatResponseList, PaginatedChatResponseListSchema, type PaginatedChatSessionList, PaginatedChatSessionListSchema, type PaginatedDocumentArchiveListList, PaginatedDocumentArchiveListListSchema, type PaginatedDocumentList, PaginatedDocumentListSchema, type PaginatedPublicCategoryList, PaginatedPublicCategoryListSchema, type PaginatedPublicDocumentListList, PaginatedPublicDocumentListListSchema, type PatchedArchiveItemChunkRequest, PatchedArchiveItemChunkRequestSchema, type PatchedArchiveItemRequest, PatchedArchiveItemRequestSchema, type PatchedChatResponseRequest, PatchedChatResponseRequestSchema, type PatchedChatSessionRequest, PatchedChatSessionRequestSchema, type PatchedDocumentArchiveRequest, PatchedDocumentArchiveRequestSchema, type PatchedDocumentRequest, PatchedDocumentRequestSchema, type PublicCategory, PublicCategorySchema, type PublicDocument, type PublicDocumentList, PublicDocumentListSchema, PublicDocumentSchema, REFRESH_TOKEN_KEY, type RequestLog, type ResponseLog, type RetryConfig, index$1 as Schemas, type SessionListProps, type StorageAdapter, TOKEN_KEY, type ValidationErrorDetail, type ValidationErrorEvent, type VectorizationResult, VectorizationResultSchema, type VectorizationStatistics, VectorizationStatisticsSchema, apiKnowbase, clearAPITokens, configureAPI, createKnowbaseAdminChatCreate, createKnowbaseAdminChatQueryCreate, createKnowbaseAdminDocumentsCreate, createKnowbaseAdminDocumentsReprocessCreate, createKnowbaseAdminSessionsActivateCreate, createKnowbaseAdminSessionsArchiveCreate, createKnowbaseAdminSessionsCreate, createKnowbaseSystemArchivesCreate, createKnowbaseSystemArchivesRevectorizeCreate, createKnowbaseSystemArchivesSearchCreate, createKnowbaseSystemChunksCreate, createKnowbaseSystemChunksVectorizeCreate, createKnowbaseSystemItemsCreate, deleteKnowbaseAdminChatDestroy, deleteKnowbaseAdminDocumentsDestroy, deleteKnowbaseAdminSessionsDestroy, deleteKnowbaseSystemArchivesDestroy, deleteKnowbaseSystemChunksDestroy, deleteKnowbaseSystemItemsDestroy, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getKnowbaseAdminChatHistoryRetrieve, getKnowbaseAdminChatList, getKnowbaseAdminChatRetrieve, getKnowbaseAdminDocumentsList, getKnowbaseAdminDocumentsRetrieve, getKnowbaseAdminDocumentsStatsRetrieve, getKnowbaseAdminDocumentsStatusRetrieve, getKnowbaseAdminSessionsList, getKnowbaseAdminSessionsRetrieve, getKnowbaseCategoriesList, getKnowbaseCategoriesRetrieve, getKnowbaseDocumentsList, getKnowbaseDocumentsRetrieve, getKnowbaseSystemArchivesFileTreeRetrieve, getKnowbaseSystemArchivesItemsList, getKnowbaseSystemArchivesList, getKnowbaseSystemArchivesRetrieve, getKnowbaseSystemArchivesStatisticsRetrieve, getKnowbaseSystemArchivesVectorizationStatsRetrieve, getKnowbaseSystemChunksContextRetrieve, getKnowbaseSystemChunksList, getKnowbaseSystemChunksRetrieve, getKnowbaseSystemItemsChunksList, getKnowbaseSystemItemsContentRetrieve, getKnowbaseSystemItemsList, getKnowbaseSystemItemsRetrieve, isAPIConfigured, onValidationError, partialUpdateKnowbaseAdminChatPartialUpdate, partialUpdateKnowbaseAdminDocumentsPartialUpdate, partialUpdateKnowbaseAdminSessionsPartialUpdate, partialUpdateKnowbaseSystemArchivesPartialUpdate, partialUpdateKnowbaseSystemChunksPartialUpdate, partialUpdateKnowbaseSystemItemsPartialUpdate, reconfigureAPI, resetAPI, shouldRetry, updateKnowbaseAdminChatUpdate, updateKnowbaseAdminDocumentsUpdate, updateKnowbaseAdminSessionsUpdate, updateKnowbaseSystemArchivesUpdate, updateKnowbaseSystemChunksUpdate, updateKnowbaseSystemItemsUpdate, withRetry };
|
|
4460
|
+
export { API, APIClient, APIError, APILogger, type APIOptions, type ArchiveItem, type ArchiveItemChunk, type ArchiveItemChunkDetail, ArchiveItemChunkDetailSchema, type ArchiveItemChunkRequest, ArchiveItemChunkRequestSchema, ArchiveItemChunkSchema, type ArchiveItemDetail, ArchiveItemDetailSchema, type ArchiveItemRequest, ArchiveItemRequestSchema, ArchiveItemSchema, type ArchiveProcessingResult, ArchiveProcessingResultSchema, type ArchiveSearchRequestRequest, ArchiveSearchRequestRequestSchema, type ArchiveSearchResult, ArchiveSearchResultSchema, type ArchiveStatistics, ArchiveStatisticsSchema, type CfgKnowbaseSystemArchivesCreateRequest, CfgKnowbaseSystemArchivesCreateRequestSchema, type ChatHistory, ChatHistorySchema, type ChatMessage$1 as ChatMessage, ChatMessageSchema, type ChatMessageWithSources, type ChatQueryRequest, ChatQueryRequestSchema, type ChatResponse, type ChatResponseRequest, ChatResponseRequestSchema, ChatResponseSchema, type ChatSession, type ChatSessionCreateRequest, ChatSessionCreateRequestSchema, type ChatSessionRequest, ChatSessionRequestSchema, ChatSessionSchema, type ChatSource$1 as ChatSource, type ChatSourceRequest, ChatSourceRequestSchema, ChatSourceSchema, type ChatUIState, type ChatWidgetProps, type ChunkRevectorizationRequestRequest, ChunkRevectorizationRequestRequestSchema, CookieStorageAdapter, DEFAULT_RETRY_CONFIG, type Document, type DocumentArchive, type DocumentArchiveDetail, DocumentArchiveDetailSchema, type DocumentArchiveList, DocumentArchiveListSchema, type DocumentArchiveRequest, DocumentArchiveRequestSchema, DocumentArchiveSchema, type DocumentCategory, type DocumentCategoryRequest, DocumentCategoryRequestSchema, DocumentCategorySchema, type DocumentCreateRequest, DocumentCreateRequestSchema, type DocumentProcessingStatus, DocumentProcessingStatusSchema, type DocumentRequest, DocumentRequestSchema, DocumentSchema, type DocumentStats, DocumentStatsSchema, GeneratedEnums as Enums, type ErrorLog, models as ExtKnowbaseKnowbaseTypes, type FailedAttemptInfo, FetchAdapter, index as Fetchers, type HttpClientAdapter, type HttpRequest, type HttpResponse, LocalStorageAdapter, type LoggerConfig, MemoryStorageAdapter, type MessageInputProps, type MessageListProps, NetworkError, type PaginatedArchiveItemChunkList, PaginatedArchiveItemChunkListSchema, type PaginatedArchiveItemList, PaginatedArchiveItemListSchema, type PaginatedArchiveSearchResultList, PaginatedArchiveSearchResultListSchema, type PaginatedChatResponseList, PaginatedChatResponseListSchema, type PaginatedChatSessionList, PaginatedChatSessionListSchema, type PaginatedDocumentArchiveListList, PaginatedDocumentArchiveListListSchema, type PaginatedDocumentList, PaginatedDocumentListSchema, type PaginatedPublicCategoryList, PaginatedPublicCategoryListSchema, type PaginatedPublicDocumentListList, PaginatedPublicDocumentListListSchema, type PatchedArchiveItemChunkRequest, PatchedArchiveItemChunkRequestSchema, type PatchedArchiveItemRequest, PatchedArchiveItemRequestSchema, type PatchedChatResponseRequest, PatchedChatResponseRequestSchema, type PatchedChatSessionRequest, PatchedChatSessionRequestSchema, type PatchedDocumentArchiveRequest, PatchedDocumentArchiveRequestSchema, type PatchedDocumentRequest, PatchedDocumentRequestSchema, type PublicCategory, PublicCategorySchema, type PublicDocument, type PublicDocumentList, PublicDocumentListSchema, PublicDocumentSchema, REFRESH_TOKEN_KEY, type RequestLog, type ResponseLog, type RetryConfig, index$1 as Schemas, type SessionListProps, type StorageAdapter, TOKEN_KEY, type ValidationErrorDetail, type ValidationErrorEvent, type VectorizationResult, VectorizationResultSchema, type VectorizationStatistics, VectorizationStatisticsSchema, apiKnowbase, clearAPITokens, configureAPI, createKnowbaseAdminChatCreate, createKnowbaseAdminChatQueryCreate, createKnowbaseAdminDocumentsCreate, createKnowbaseAdminDocumentsReprocessCreate, createKnowbaseAdminSessionsActivateCreate, createKnowbaseAdminSessionsArchiveCreate, createKnowbaseAdminSessionsCreate, createKnowbaseSystemArchivesCreate, createKnowbaseSystemArchivesRevectorizeCreate, createKnowbaseSystemArchivesSearchCreate, createKnowbaseSystemChunksCreate, createKnowbaseSystemChunksVectorizeCreate, createKnowbaseSystemItemsCreate, deleteKnowbaseAdminChatDestroy, deleteKnowbaseAdminDocumentsDestroy, deleteKnowbaseAdminSessionsDestroy, deleteKnowbaseSystemArchivesDestroy, deleteKnowbaseSystemChunksDestroy, deleteKnowbaseSystemItemsDestroy, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getKnowbaseAdminChatHistoryRetrieve, getKnowbaseAdminChatList, getKnowbaseAdminChatRetrieve, getKnowbaseAdminDocumentsList, getKnowbaseAdminDocumentsRetrieve, getKnowbaseAdminDocumentsStatsRetrieve, getKnowbaseAdminDocumentsStatusRetrieve, getKnowbaseAdminSessionsList, getKnowbaseAdminSessionsRetrieve, getKnowbaseCategoriesList, getKnowbaseCategoriesRetrieve, getKnowbaseDocumentsList, getKnowbaseDocumentsRetrieve, getKnowbaseSystemArchivesFileTreeRetrieve, getKnowbaseSystemArchivesItemsList, getKnowbaseSystemArchivesList, getKnowbaseSystemArchivesRetrieve, getKnowbaseSystemArchivesStatisticsRetrieve, getKnowbaseSystemArchivesVectorizationStatsRetrieve, getKnowbaseSystemChunksContextRetrieve, getKnowbaseSystemChunksList, getKnowbaseSystemChunksRetrieve, getKnowbaseSystemItemsChunksList, getKnowbaseSystemItemsContentRetrieve, getKnowbaseSystemItemsList, getKnowbaseSystemItemsRetrieve, isAPIConfigured, onValidationError, partialUpdateKnowbaseAdminChatPartialUpdate, partialUpdateKnowbaseAdminDocumentsPartialUpdate, partialUpdateKnowbaseAdminSessionsPartialUpdate, partialUpdateKnowbaseSystemArchivesPartialUpdate, partialUpdateKnowbaseSystemChunksPartialUpdate, partialUpdateKnowbaseSystemItemsPartialUpdate, reconfigureAPI, resetAPI, shouldRetry, updateKnowbaseAdminChatUpdate, updateKnowbaseAdminDocumentsUpdate, updateKnowbaseAdminSessionsUpdate, updateKnowbaseSystemArchivesUpdate, updateKnowbaseSystemChunksUpdate, updateKnowbaseSystemItemsUpdate, withRetry };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createConsola, consola } from 'consola';
|
|
2
2
|
import pRetry, { AbortError } from 'p-retry';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { createExtensionAPI } from '@djangocfg/ext-base/api';
|
|
4
|
+
import { initializeExtensionAPI, createExtensionAPI } from '@djangocfg/ext-base/api';
|
|
5
5
|
import 'swr';
|
|
6
6
|
import { createExtensionConfig } from '@djangocfg/ext-base';
|
|
7
7
|
|
|
@@ -309,7 +309,14 @@ var ExtKnowbaseKnowbase = class {
|
|
|
309
309
|
* Upload archive file and process it synchronously
|
|
310
310
|
*/
|
|
311
311
|
async systemArchivesCreate(data) {
|
|
312
|
-
const
|
|
312
|
+
const formData = new FormData();
|
|
313
|
+
formData.append("file", data.file);
|
|
314
|
+
if (data.title !== void 0) formData.append("title", String(data.title));
|
|
315
|
+
if (data.description !== void 0) formData.append("description", String(data.description));
|
|
316
|
+
if (data.category_ids !== void 0) formData.append("category_ids", String(data.category_ids));
|
|
317
|
+
if (data.is_public !== void 0) formData.append("is_public", String(data.is_public));
|
|
318
|
+
if (data.process_immediately !== void 0) formData.append("process_immediately", String(data.process_immediately));
|
|
319
|
+
const response = await this.client.request("POST", "/cfg/knowbase/system/archives/", { formData });
|
|
313
320
|
return response;
|
|
314
321
|
}
|
|
315
322
|
/**
|
|
@@ -576,7 +583,7 @@ var models_exports = {};
|
|
|
576
583
|
// src/api/generated/ext_knowbase/http.ts
|
|
577
584
|
var FetchAdapter = class {
|
|
578
585
|
async request(request) {
|
|
579
|
-
const { method, url, headers, body, params, formData } = request;
|
|
586
|
+
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
580
587
|
let finalUrl = url;
|
|
581
588
|
if (params) {
|
|
582
589
|
const searchParams = new URLSearchParams();
|
|
@@ -594,6 +601,9 @@ var FetchAdapter = class {
|
|
|
594
601
|
let requestBody;
|
|
595
602
|
if (formData) {
|
|
596
603
|
requestBody = formData;
|
|
604
|
+
} else if (binaryBody) {
|
|
605
|
+
finalHeaders["Content-Type"] = "application/octet-stream";
|
|
606
|
+
requestBody = binaryBody;
|
|
597
607
|
} else if (body) {
|
|
598
608
|
finalHeaders["Content-Type"] = "application/json";
|
|
599
609
|
requestBody = JSON.stringify(body);
|
|
@@ -918,11 +928,13 @@ var APIClient = class {
|
|
|
918
928
|
httpClient;
|
|
919
929
|
logger = null;
|
|
920
930
|
retryConfig = null;
|
|
931
|
+
tokenGetter = null;
|
|
921
932
|
// Sub-clients
|
|
922
933
|
ext_knowbase_knowbase;
|
|
923
934
|
constructor(baseUrl, options) {
|
|
924
935
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
925
936
|
this.httpClient = options?.httpClient || new FetchAdapter();
|
|
937
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
926
938
|
if (options?.loggerConfig !== void 0) {
|
|
927
939
|
this.logger = new APILogger(options.loggerConfig);
|
|
928
940
|
}
|
|
@@ -945,6 +957,19 @@ var APIClient = class {
|
|
|
945
957
|
}
|
|
946
958
|
return null;
|
|
947
959
|
}
|
|
960
|
+
/**
|
|
961
|
+
* Get the base URL for building streaming/download URLs.
|
|
962
|
+
*/
|
|
963
|
+
getBaseUrl() {
|
|
964
|
+
return this.baseUrl;
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
968
|
+
* Returns null if no token getter is configured or no token is available.
|
|
969
|
+
*/
|
|
970
|
+
getToken() {
|
|
971
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
972
|
+
}
|
|
948
973
|
/**
|
|
949
974
|
* Make HTTP request with Django CSRF and session handling.
|
|
950
975
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -975,7 +1000,7 @@ var APIClient = class {
|
|
|
975
1000
|
const headers = {
|
|
976
1001
|
...options?.headers || {}
|
|
977
1002
|
};
|
|
978
|
-
if (!options?.formData && !headers["Content-Type"]) {
|
|
1003
|
+
if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
|
|
979
1004
|
headers["Content-Type"] = "application/json";
|
|
980
1005
|
}
|
|
981
1006
|
if (this.logger) {
|
|
@@ -994,7 +1019,8 @@ var APIClient = class {
|
|
|
994
1019
|
headers,
|
|
995
1020
|
params: options?.params,
|
|
996
1021
|
body: options?.body,
|
|
997
|
-
formData: options?.formData
|
|
1022
|
+
formData: options?.formData,
|
|
1023
|
+
binaryBody: options?.binaryBody
|
|
998
1024
|
});
|
|
999
1025
|
const duration = Date.now() - startTime;
|
|
1000
1026
|
if (response.status >= 400) {
|
|
@@ -1378,6 +1404,7 @@ __export(schemas_exports, {
|
|
|
1378
1404
|
ArchiveSearchRequestRequestSchema: () => ArchiveSearchRequestRequestSchema,
|
|
1379
1405
|
ArchiveSearchResultSchema: () => ArchiveSearchResultSchema,
|
|
1380
1406
|
ArchiveStatisticsSchema: () => ArchiveStatisticsSchema,
|
|
1407
|
+
CfgKnowbaseSystemArchivesCreateRequestSchema: () => CfgKnowbaseSystemArchivesCreateRequestSchema,
|
|
1381
1408
|
ChatHistorySchema: () => ChatHistorySchema,
|
|
1382
1409
|
ChatMessageSchema: () => ChatMessageSchema,
|
|
1383
1410
|
ChatQueryRequestSchema: () => ChatQueryRequestSchema,
|
|
@@ -1513,9 +1540,9 @@ var ArchiveSearchRequestRequestSchema = z.object({
|
|
|
1513
1540
|
var ArchiveSearchResultSchema = z.object({
|
|
1514
1541
|
chunk: ArchiveItemChunkSchema,
|
|
1515
1542
|
similarity_score: z.number(),
|
|
1516
|
-
context_summary: z.record(z.string(), z.
|
|
1517
|
-
archive_info: z.record(z.string(), z.
|
|
1518
|
-
item_info: z.record(z.string(), z.
|
|
1543
|
+
context_summary: z.record(z.string(), z.any()),
|
|
1544
|
+
archive_info: z.record(z.string(), z.any()),
|
|
1545
|
+
item_info: z.record(z.string(), z.any())
|
|
1519
1546
|
});
|
|
1520
1547
|
var ArchiveStatisticsSchema = z.object({
|
|
1521
1548
|
total_archives: z.int(),
|
|
@@ -1529,6 +1556,14 @@ var ArchiveStatisticsSchema = z.object({
|
|
|
1529
1556
|
avg_items_per_archive: z.number(),
|
|
1530
1557
|
avg_chunks_per_archive: z.number()
|
|
1531
1558
|
});
|
|
1559
|
+
var CfgKnowbaseSystemArchivesCreateRequestSchema = z.object({
|
|
1560
|
+
file: z.union([z.instanceof(File), z.instanceof(Blob)]).optional(),
|
|
1561
|
+
title: z.string().optional(),
|
|
1562
|
+
description: z.string().optional(),
|
|
1563
|
+
category_ids: z.array(z.string()).optional(),
|
|
1564
|
+
is_public: z.boolean().optional(),
|
|
1565
|
+
process_immediately: z.boolean().optional()
|
|
1566
|
+
});
|
|
1532
1567
|
var ChatMessageSchema = z.object({
|
|
1533
1568
|
id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
1534
1569
|
role: z.nativeEnum(ChatMessageRole),
|
|
@@ -1647,7 +1682,7 @@ var DocumentArchiveSchema = z.object({
|
|
|
1647
1682
|
description: z.string().optional(),
|
|
1648
1683
|
categories: z.array(DocumentCategorySchema),
|
|
1649
1684
|
is_public: z.boolean().optional(),
|
|
1650
|
-
archive_file: z.url(),
|
|
1685
|
+
archive_file: z.union([z.url(), z.literal("")]),
|
|
1651
1686
|
original_filename: z.string(),
|
|
1652
1687
|
file_size: z.int(),
|
|
1653
1688
|
archive_type: z.nativeEnum(DocumentArchiveArchiveType),
|
|
@@ -1673,7 +1708,7 @@ var DocumentArchiveDetailSchema = z.object({
|
|
|
1673
1708
|
description: z.string().optional(),
|
|
1674
1709
|
categories: z.array(DocumentCategorySchema),
|
|
1675
1710
|
is_public: z.boolean().optional(),
|
|
1676
|
-
archive_file: z.url(),
|
|
1711
|
+
archive_file: z.union([z.url(), z.literal("")]),
|
|
1677
1712
|
original_filename: z.string(),
|
|
1678
1713
|
file_size: z.int(),
|
|
1679
1714
|
archive_type: z.nativeEnum(DocumentArchiveDetailArchiveType),
|
|
@@ -2043,15 +2078,28 @@ __export(fetchers_exports, {
|
|
|
2043
2078
|
|
|
2044
2079
|
// src/api/generated/ext_knowbase/api-instance.ts
|
|
2045
2080
|
var globalAPI = null;
|
|
2081
|
+
var autoConfigAttempted = false;
|
|
2082
|
+
function tryAutoConfigureFromEnv() {
|
|
2083
|
+
if (autoConfigAttempted) return;
|
|
2084
|
+
autoConfigAttempted = true;
|
|
2085
|
+
if (globalAPI) return;
|
|
2086
|
+
if (typeof process === "undefined" || !process.env) return;
|
|
2087
|
+
const baseUrl = process.env.NEXT_PUBLIC_API_URL || process.env.VITE_API_URL || process.env.REACT_APP_API_URL || process.env.API_URL;
|
|
2088
|
+
if (baseUrl) {
|
|
2089
|
+
globalAPI = new API(baseUrl);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2046
2092
|
function getAPIInstance() {
|
|
2093
|
+
tryAutoConfigureFromEnv();
|
|
2047
2094
|
if (!globalAPI) {
|
|
2048
2095
|
throw new Error(
|
|
2049
|
-
'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })'
|
|
2096
|
+
'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })\n\nOr set environment variable: NEXT_PUBLIC_API_URL, VITE_API_URL, or REACT_APP_API_URL'
|
|
2050
2097
|
);
|
|
2051
2098
|
}
|
|
2052
2099
|
return globalAPI;
|
|
2053
2100
|
}
|
|
2054
2101
|
function isAPIConfigured() {
|
|
2102
|
+
tryAutoConfigureFromEnv();
|
|
2055
2103
|
return globalAPI !== null;
|
|
2056
2104
|
}
|
|
2057
2105
|
function configureAPI(config) {
|
|
@@ -4202,7 +4250,8 @@ var API = class {
|
|
|
4202
4250
|
this._loadTokensFromStorage();
|
|
4203
4251
|
this._client = new APIClient(this.baseUrl, {
|
|
4204
4252
|
retryConfig: this.options?.retryConfig,
|
|
4205
|
-
loggerConfig: this.options?.loggerConfig
|
|
4253
|
+
loggerConfig: this.options?.loggerConfig,
|
|
4254
|
+
tokenGetter: () => this.getToken()
|
|
4206
4255
|
});
|
|
4207
4256
|
this._injectAuthHeader();
|
|
4208
4257
|
this.ext_knowbase_knowbase = this._client.ext_knowbase_knowbase;
|
|
@@ -4214,7 +4263,8 @@ var API = class {
|
|
|
4214
4263
|
_reinitClients() {
|
|
4215
4264
|
this._client = new APIClient(this.baseUrl, {
|
|
4216
4265
|
retryConfig: this.options?.retryConfig,
|
|
4217
|
-
loggerConfig: this.options?.loggerConfig
|
|
4266
|
+
loggerConfig: this.options?.loggerConfig,
|
|
4267
|
+
tokenGetter: () => this.getToken()
|
|
4218
4268
|
});
|
|
4219
4269
|
this._injectAuthHeader();
|
|
4220
4270
|
this.ext_knowbase_knowbase = this._client.ext_knowbase_knowbase;
|
|
@@ -4307,12 +4357,13 @@ var API = class {
|
|
|
4307
4357
|
};
|
|
4308
4358
|
|
|
4309
4359
|
// src/api/index.ts
|
|
4360
|
+
initializeExtensionAPI(configureAPI);
|
|
4310
4361
|
var apiKnowbase = createExtensionAPI(API);
|
|
4311
4362
|
|
|
4312
4363
|
// package.json
|
|
4313
4364
|
var package_default = {
|
|
4314
4365
|
name: "@djangocfg/ext-knowbase",
|
|
4315
|
-
version: "1.0.
|
|
4366
|
+
version: "1.0.10",
|
|
4316
4367
|
description: "Knowledge base and chat extension for DjangoCFG",
|
|
4317
4368
|
keywords: [
|
|
4318
4369
|
"django",
|
|
@@ -4437,4 +4488,4 @@ export default function DocsPage() {
|
|
|
4437
4488
|
]
|
|
4438
4489
|
});
|
|
4439
4490
|
|
|
4440
|
-
export { API, APIClient, APIError, APILogger, ArchiveItemChunkDetailSchema, ArchiveItemChunkRequestSchema, ArchiveItemChunkSchema, ArchiveItemDetailSchema, ArchiveItemRequestSchema, ArchiveItemSchema, ArchiveProcessingResultSchema, ArchiveSearchRequestRequestSchema, ArchiveSearchResultSchema, ArchiveStatisticsSchema, ChatHistorySchema, ChatMessageSchema, ChatQueryRequestSchema, ChatResponseRequestSchema, ChatResponseSchema, ChatSessionCreateRequestSchema, ChatSessionRequestSchema, ChatSessionSchema, ChatSourceRequestSchema, ChatSourceSchema, ChunkRevectorizationRequestRequestSchema, CookieStorageAdapter, DEFAULT_RETRY_CONFIG, DocumentArchiveDetailSchema, DocumentArchiveListSchema, DocumentArchiveRequestSchema, DocumentArchiveSchema, DocumentCategoryRequestSchema, DocumentCategorySchema, DocumentCreateRequestSchema, DocumentProcessingStatusSchema, DocumentRequestSchema, DocumentSchema, DocumentStatsSchema, enums_exports as Enums, models_exports as ExtKnowbaseKnowbaseTypes, FetchAdapter, fetchers_exports as Fetchers, LocalStorageAdapter, MemoryStorageAdapter, NetworkError, PaginatedArchiveItemChunkListSchema, PaginatedArchiveItemListSchema, PaginatedArchiveSearchResultListSchema, PaginatedChatResponseListSchema, PaginatedChatSessionListSchema, PaginatedDocumentArchiveListListSchema, PaginatedDocumentListSchema, PaginatedPublicCategoryListSchema, PaginatedPublicDocumentListListSchema, PatchedArchiveItemChunkRequestSchema, PatchedArchiveItemRequestSchema, PatchedChatResponseRequestSchema, PatchedChatSessionRequestSchema, PatchedDocumentArchiveRequestSchema, PatchedDocumentRequestSchema, PublicCategorySchema, PublicDocumentListSchema, PublicDocumentSchema, REFRESH_TOKEN_KEY, schemas_exports as Schemas, TOKEN_KEY, VectorizationResultSchema, VectorizationStatisticsSchema, apiKnowbase, clearAPITokens, configureAPI, createKnowbaseAdminChatCreate, createKnowbaseAdminChatQueryCreate, createKnowbaseAdminDocumentsCreate, createKnowbaseAdminDocumentsReprocessCreate, createKnowbaseAdminSessionsActivateCreate, createKnowbaseAdminSessionsArchiveCreate, createKnowbaseAdminSessionsCreate, createKnowbaseSystemArchivesCreate, createKnowbaseSystemArchivesRevectorizeCreate, createKnowbaseSystemArchivesSearchCreate, createKnowbaseSystemChunksCreate, createKnowbaseSystemChunksVectorizeCreate, createKnowbaseSystemItemsCreate, deleteKnowbaseAdminChatDestroy, deleteKnowbaseAdminDocumentsDestroy, deleteKnowbaseAdminSessionsDestroy, deleteKnowbaseSystemArchivesDestroy, deleteKnowbaseSystemChunksDestroy, deleteKnowbaseSystemItemsDestroy, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getKnowbaseAdminChatHistoryRetrieve, getKnowbaseAdminChatList, getKnowbaseAdminChatRetrieve, getKnowbaseAdminDocumentsList, getKnowbaseAdminDocumentsRetrieve, getKnowbaseAdminDocumentsStatsRetrieve, getKnowbaseAdminDocumentsStatusRetrieve, getKnowbaseAdminSessionsList, getKnowbaseAdminSessionsRetrieve, getKnowbaseCategoriesList, getKnowbaseCategoriesRetrieve, getKnowbaseDocumentsList, getKnowbaseDocumentsRetrieve, getKnowbaseSystemArchivesFileTreeRetrieve, getKnowbaseSystemArchivesItemsList, getKnowbaseSystemArchivesList, getKnowbaseSystemArchivesRetrieve, getKnowbaseSystemArchivesStatisticsRetrieve, getKnowbaseSystemArchivesVectorizationStatsRetrieve, getKnowbaseSystemChunksContextRetrieve, getKnowbaseSystemChunksList, getKnowbaseSystemChunksRetrieve, getKnowbaseSystemItemsChunksList, getKnowbaseSystemItemsContentRetrieve, getKnowbaseSystemItemsList, getKnowbaseSystemItemsRetrieve, isAPIConfigured, onValidationError, partialUpdateKnowbaseAdminChatPartialUpdate, partialUpdateKnowbaseAdminDocumentsPartialUpdate, partialUpdateKnowbaseAdminSessionsPartialUpdate, partialUpdateKnowbaseSystemArchivesPartialUpdate, partialUpdateKnowbaseSystemChunksPartialUpdate, partialUpdateKnowbaseSystemItemsPartialUpdate, reconfigureAPI, resetAPI, shouldRetry, updateKnowbaseAdminChatUpdate, updateKnowbaseAdminDocumentsUpdate, updateKnowbaseAdminSessionsUpdate, updateKnowbaseSystemArchivesUpdate, updateKnowbaseSystemChunksUpdate, updateKnowbaseSystemItemsUpdate, withRetry };
|
|
4491
|
+
export { API, APIClient, APIError, APILogger, ArchiveItemChunkDetailSchema, ArchiveItemChunkRequestSchema, ArchiveItemChunkSchema, ArchiveItemDetailSchema, ArchiveItemRequestSchema, ArchiveItemSchema, ArchiveProcessingResultSchema, ArchiveSearchRequestRequestSchema, ArchiveSearchResultSchema, ArchiveStatisticsSchema, CfgKnowbaseSystemArchivesCreateRequestSchema, ChatHistorySchema, ChatMessageSchema, ChatQueryRequestSchema, ChatResponseRequestSchema, ChatResponseSchema, ChatSessionCreateRequestSchema, ChatSessionRequestSchema, ChatSessionSchema, ChatSourceRequestSchema, ChatSourceSchema, ChunkRevectorizationRequestRequestSchema, CookieStorageAdapter, DEFAULT_RETRY_CONFIG, DocumentArchiveDetailSchema, DocumentArchiveListSchema, DocumentArchiveRequestSchema, DocumentArchiveSchema, DocumentCategoryRequestSchema, DocumentCategorySchema, DocumentCreateRequestSchema, DocumentProcessingStatusSchema, DocumentRequestSchema, DocumentSchema, DocumentStatsSchema, enums_exports as Enums, models_exports as ExtKnowbaseKnowbaseTypes, FetchAdapter, fetchers_exports as Fetchers, LocalStorageAdapter, MemoryStorageAdapter, NetworkError, PaginatedArchiveItemChunkListSchema, PaginatedArchiveItemListSchema, PaginatedArchiveSearchResultListSchema, PaginatedChatResponseListSchema, PaginatedChatSessionListSchema, PaginatedDocumentArchiveListListSchema, PaginatedDocumentListSchema, PaginatedPublicCategoryListSchema, PaginatedPublicDocumentListListSchema, PatchedArchiveItemChunkRequestSchema, PatchedArchiveItemRequestSchema, PatchedChatResponseRequestSchema, PatchedChatSessionRequestSchema, PatchedDocumentArchiveRequestSchema, PatchedDocumentRequestSchema, PublicCategorySchema, PublicDocumentListSchema, PublicDocumentSchema, REFRESH_TOKEN_KEY, schemas_exports as Schemas, TOKEN_KEY, VectorizationResultSchema, VectorizationStatisticsSchema, apiKnowbase, clearAPITokens, configureAPI, createKnowbaseAdminChatCreate, createKnowbaseAdminChatQueryCreate, createKnowbaseAdminDocumentsCreate, createKnowbaseAdminDocumentsReprocessCreate, createKnowbaseAdminSessionsActivateCreate, createKnowbaseAdminSessionsArchiveCreate, createKnowbaseAdminSessionsCreate, createKnowbaseSystemArchivesCreate, createKnowbaseSystemArchivesRevectorizeCreate, createKnowbaseSystemArchivesSearchCreate, createKnowbaseSystemChunksCreate, createKnowbaseSystemChunksVectorizeCreate, createKnowbaseSystemItemsCreate, deleteKnowbaseAdminChatDestroy, deleteKnowbaseAdminDocumentsDestroy, deleteKnowbaseAdminSessionsDestroy, deleteKnowbaseSystemArchivesDestroy, deleteKnowbaseSystemChunksDestroy, deleteKnowbaseSystemItemsDestroy, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getKnowbaseAdminChatHistoryRetrieve, getKnowbaseAdminChatList, getKnowbaseAdminChatRetrieve, getKnowbaseAdminDocumentsList, getKnowbaseAdminDocumentsRetrieve, getKnowbaseAdminDocumentsStatsRetrieve, getKnowbaseAdminDocumentsStatusRetrieve, getKnowbaseAdminSessionsList, getKnowbaseAdminSessionsRetrieve, getKnowbaseCategoriesList, getKnowbaseCategoriesRetrieve, getKnowbaseDocumentsList, getKnowbaseDocumentsRetrieve, getKnowbaseSystemArchivesFileTreeRetrieve, getKnowbaseSystemArchivesItemsList, getKnowbaseSystemArchivesList, getKnowbaseSystemArchivesRetrieve, getKnowbaseSystemArchivesStatisticsRetrieve, getKnowbaseSystemArchivesVectorizationStatsRetrieve, getKnowbaseSystemChunksContextRetrieve, getKnowbaseSystemChunksList, getKnowbaseSystemChunksRetrieve, getKnowbaseSystemItemsChunksList, getKnowbaseSystemItemsContentRetrieve, getKnowbaseSystemItemsList, getKnowbaseSystemItemsRetrieve, isAPIConfigured, onValidationError, partialUpdateKnowbaseAdminChatPartialUpdate, partialUpdateKnowbaseAdminDocumentsPartialUpdate, partialUpdateKnowbaseAdminSessionsPartialUpdate, partialUpdateKnowbaseSystemArchivesPartialUpdate, partialUpdateKnowbaseSystemChunksPartialUpdate, partialUpdateKnowbaseSystemItemsPartialUpdate, reconfigureAPI, resetAPI, shouldRetry, updateKnowbaseAdminChatUpdate, updateKnowbaseAdminDocumentsUpdate, updateKnowbaseAdminSessionsUpdate, updateKnowbaseSystemArchivesUpdate, updateKnowbaseSystemChunksUpdate, updateKnowbaseSystemItemsUpdate, withRetry };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/ext-knowbase",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Knowledge base and chat extension for DjangoCFG",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"django",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"check": "tsc --noEmit"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@djangocfg/api": "^2.1.
|
|
62
|
+
"@djangocfg/api": "^2.1.107",
|
|
63
63
|
"@djangocfg/ext-base": "^1.0.8",
|
|
64
|
-
"@djangocfg/ui-core": "^2.1.
|
|
65
|
-
"@djangocfg/ui-nextjs": "^2.1.
|
|
64
|
+
"@djangocfg/ui-core": "^2.1.107",
|
|
65
|
+
"@djangocfg/ui-nextjs": "^2.1.107",
|
|
66
66
|
"consola": "^3.4.2",
|
|
67
67
|
"lucide-react": "^0.545.0",
|
|
68
68
|
"next": "^15.5.7",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"moment": "^2.30.1"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@djangocfg/api": "^2.1.
|
|
78
|
+
"@djangocfg/api": "^2.1.107",
|
|
79
79
|
"@djangocfg/ext-base": "^1.0.8",
|
|
80
|
-
"@djangocfg/ui-core": "^2.1.
|
|
81
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
80
|
+
"@djangocfg/ui-core": "^2.1.107",
|
|
81
|
+
"@djangocfg/typescript-config": "^2.1.107",
|
|
82
82
|
"@types/node": "^24.7.2",
|
|
83
83
|
"@types/react": "^19.0.0",
|
|
84
84
|
"consola": "^3.4.2",
|
|
@@ -12,7 +12,7 @@ python manage.py generate_client --groups ext_knowbase --typescript
|
|
|
12
12
|
|---|---|
|
|
13
13
|
| Version | 3.0.3 |
|
|
14
14
|
| Operations | 57 |
|
|
15
|
-
| Schemas |
|
|
15
|
+
| Schemas | 53 |
|
|
16
16
|
|
|
17
17
|
## Resources
|
|
18
18
|
|
|
@@ -53,12 +53,5 @@ openapi_client = OpenAPIClientConfig(
|
|
|
53
53
|
)
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
**Copy to Next.js** (if `nextjs_admin` configured):
|
|
57
|
-
```python
|
|
58
|
-
nextjs_admin = NextJsAdminConfig(
|
|
59
|
-
project_path="../frontend/apps/...",
|
|
60
|
-
api_output_path="app/_lib/api/generated",
|
|
61
|
-
)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
56
|
@see https://djangocfg.com/docs/features/api-generation
|
|
57
|
+
|
|
@@ -40,6 +40,7 @@ import { ArchiveItemRequestSchema, type ArchiveItemRequest } from '../schemas/Ar
|
|
|
40
40
|
import { ArchiveProcessingResultSchema, type ArchiveProcessingResult } from '../schemas/ArchiveProcessingResult.schema'
|
|
41
41
|
import { ArchiveSearchRequestRequestSchema, type ArchiveSearchRequestRequest } from '../schemas/ArchiveSearchRequestRequest.schema'
|
|
42
42
|
import { ArchiveStatisticsSchema, type ArchiveStatistics } from '../schemas/ArchiveStatistics.schema'
|
|
43
|
+
import { CfgKnowbaseSystemArchivesCreateRequestSchema, type CfgKnowbaseSystemArchivesCreateRequest } from '../schemas/CfgKnowbaseSystemArchivesCreateRequest.schema'
|
|
43
44
|
import { ChatHistorySchema, type ChatHistory } from '../schemas/ChatHistory.schema'
|
|
44
45
|
import { ChatQueryRequestSchema, type ChatQueryRequest } from '../schemas/ChatQueryRequest.schema'
|
|
45
46
|
import { ChatResponseSchema, type ChatResponse } from '../schemas/ChatResponse.schema'
|
|
@@ -1664,7 +1665,7 @@ export async function getKnowbaseSystemArchivesList( params?: { page?: number;
|
|
|
1664
1665
|
* @method POST
|
|
1665
1666
|
* @path /cfg/knowbase/system/archives/
|
|
1666
1667
|
*/
|
|
1667
|
-
export async function createKnowbaseSystemArchivesCreate( data:
|
|
1668
|
+
export async function createKnowbaseSystemArchivesCreate( data: CfgKnowbaseSystemArchivesCreateRequest, client?: any
|
|
1668
1669
|
): Promise<ArchiveProcessingResult> {
|
|
1669
1670
|
const api = client || getAPIInstance()
|
|
1670
1671
|
const response = await api.ext_knowbase_knowbase.systemArchivesCreate(data)
|
|
@@ -30,6 +30,7 @@ import type { ArchiveItemRequest } from '../schemas/ArchiveItemRequest.schema'
|
|
|
30
30
|
import type { ArchiveProcessingResult } from '../schemas/ArchiveProcessingResult.schema'
|
|
31
31
|
import type { ArchiveSearchRequestRequest } from '../schemas/ArchiveSearchRequestRequest.schema'
|
|
32
32
|
import type { ArchiveStatistics } from '../schemas/ArchiveStatistics.schema'
|
|
33
|
+
import type { CfgKnowbaseSystemArchivesCreateRequest } from '../schemas/CfgKnowbaseSystemArchivesCreateRequest.schema'
|
|
33
34
|
import type { ChatHistory } from '../schemas/ChatHistory.schema'
|
|
34
35
|
import type { ChatQueryRequest } from '../schemas/ChatQueryRequest.schema'
|
|
35
36
|
import type { ChatResponse } from '../schemas/ChatResponse.schema'
|
|
@@ -563,7 +564,7 @@ export function useKnowbaseSystemArchivesList(params?: { page?: number; page_siz
|
|
|
563
564
|
export function useCreateKnowbaseSystemArchivesCreate() {
|
|
564
565
|
const { mutate } = useSWRConfig()
|
|
565
566
|
|
|
566
|
-
return async (data:
|
|
567
|
+
return async (data: CfgKnowbaseSystemArchivesCreateRequest, client?: API): Promise<ArchiveProcessingResult> => {
|
|
567
568
|
const result = await Fetchers.createKnowbaseSystemArchivesCreate(data, client)
|
|
568
569
|
// Revalidate related queries
|
|
569
570
|
mutate('cfg-knowbase-system-archives')
|
|
@@ -13,9 +13,9 @@ import { ArchiveItemChunkSchema } from './ArchiveItemChunk.schema'
|
|
|
13
13
|
export const ArchiveSearchResultSchema = z.object({
|
|
14
14
|
chunk: ArchiveItemChunkSchema,
|
|
15
15
|
similarity_score: z.number(),
|
|
16
|
-
context_summary: z.record(z.string(), z.
|
|
17
|
-
archive_info: z.record(z.string(), z.
|
|
18
|
-
item_info: z.record(z.string(), z.
|
|
16
|
+
context_summary: z.record(z.string(), z.any()),
|
|
17
|
+
archive_info: z.record(z.string(), z.any()),
|
|
18
|
+
item_info: z.record(z.string(), z.any()),
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
/**
|