@robosystems/client 0.2.42 → 0.2.43

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.
@@ -2396,12 +2396,75 @@ export type DetailedTransactionsResponse = {
2396
2396
  [key: string]: string;
2397
2397
  };
2398
2398
  };
2399
+ /**
2400
+ * DocumentDetailResponse
2401
+ *
2402
+ * Full document detail with raw content.
2403
+ */
2404
+ export type DocumentDetailResponse = {
2405
+ /**
2406
+ * Id
2407
+ */
2408
+ id: string;
2409
+ /**
2410
+ * Graph Id
2411
+ */
2412
+ graph_id: string;
2413
+ /**
2414
+ * User Id
2415
+ */
2416
+ user_id: string;
2417
+ /**
2418
+ * Title
2419
+ */
2420
+ title: string;
2421
+ /**
2422
+ * Content
2423
+ */
2424
+ content: string;
2425
+ /**
2426
+ * Tags
2427
+ */
2428
+ tags?: Array<string> | null;
2429
+ /**
2430
+ * Folder
2431
+ */
2432
+ folder?: string | null;
2433
+ /**
2434
+ * External Id
2435
+ */
2436
+ external_id?: string | null;
2437
+ /**
2438
+ * Source Type
2439
+ */
2440
+ source_type: string;
2441
+ /**
2442
+ * Source Provider
2443
+ */
2444
+ source_provider?: string | null;
2445
+ /**
2446
+ * Sections Indexed
2447
+ */
2448
+ sections_indexed: number;
2449
+ /**
2450
+ * Created At
2451
+ */
2452
+ created_at: string;
2453
+ /**
2454
+ * Updated At
2455
+ */
2456
+ updated_at: string;
2457
+ };
2399
2458
  /**
2400
2459
  * DocumentListItem
2401
2460
  *
2402
2461
  * A document in the document list.
2403
2462
  */
2404
2463
  export type DocumentListItem = {
2464
+ /**
2465
+ * Id
2466
+ */
2467
+ id: string;
2405
2468
  /**
2406
2469
  * Document Title
2407
2470
  */
@@ -2423,9 +2486,13 @@ export type DocumentListItem = {
2423
2486
  */
2424
2487
  tags?: Array<string> | null;
2425
2488
  /**
2426
- * Last Indexed
2489
+ * Created At
2490
+ */
2491
+ created_at: string;
2492
+ /**
2493
+ * Updated At
2427
2494
  */
2428
- last_indexed?: string | null;
2495
+ updated_at: string;
2429
2496
  };
2430
2497
  /**
2431
2498
  * DocumentListResponse
@@ -2537,6 +2604,29 @@ export type DocumentSection = {
2537
2604
  */
2538
2605
  folder?: string | null;
2539
2606
  };
2607
+ /**
2608
+ * DocumentUpdateRequest
2609
+ *
2610
+ * Update a document's metadata and/or content.
2611
+ */
2612
+ export type DocumentUpdateRequest = {
2613
+ /**
2614
+ * Title
2615
+ */
2616
+ title?: string | null;
2617
+ /**
2618
+ * Content
2619
+ */
2620
+ content?: string | null;
2621
+ /**
2622
+ * Tags
2623
+ */
2624
+ tags?: Array<string> | null;
2625
+ /**
2626
+ * Folder
2627
+ */
2628
+ folder?: string | null;
2629
+ };
2540
2630
  /**
2541
2631
  * DocumentUploadRequest
2542
2632
  *
@@ -2580,6 +2670,10 @@ export type DocumentUploadRequest = {
2580
2670
  * Response from document upload.
2581
2671
  */
2582
2672
  export type DocumentUploadResponse = {
2673
+ /**
2674
+ * Id
2675
+ */
2676
+ id: string;
2583
2677
  /**
2584
2678
  * Document Id
2585
2679
  */
@@ -11098,32 +11192,36 @@ export type UploadDocumentResponses = {
11098
11192
  200: DocumentUploadResponse;
11099
11193
  };
11100
11194
  export type UploadDocumentResponse = UploadDocumentResponses[keyof UploadDocumentResponses];
11101
- export type UploadDocumentsBulkData = {
11102
- body: BulkDocumentUploadRequest;
11195
+ export type DeleteDocumentData = {
11196
+ body?: never;
11103
11197
  path: {
11104
11198
  /**
11105
11199
  * Graph Id
11106
11200
  */
11107
11201
  graph_id: string;
11202
+ /**
11203
+ * Document Id
11204
+ */
11205
+ document_id: string;
11108
11206
  };
11109
11207
  query?: never;
11110
- url: '/v1/graphs/{graph_id}/documents/bulk';
11208
+ url: '/v1/graphs/{graph_id}/documents/{document_id}';
11111
11209
  };
11112
- export type UploadDocumentsBulkErrors = {
11210
+ export type DeleteDocumentErrors = {
11113
11211
  /**
11114
11212
  * Validation Error
11115
11213
  */
11116
11214
  422: HttpValidationError;
11117
11215
  };
11118
- export type UploadDocumentsBulkError = UploadDocumentsBulkErrors[keyof UploadDocumentsBulkErrors];
11119
- export type UploadDocumentsBulkResponses = {
11216
+ export type DeleteDocumentError = DeleteDocumentErrors[keyof DeleteDocumentErrors];
11217
+ export type DeleteDocumentResponses = {
11120
11218
  /**
11121
11219
  * Successful Response
11122
11220
  */
11123
- 200: BulkDocumentUploadResponse;
11221
+ 204: void;
11124
11222
  };
11125
- export type UploadDocumentsBulkResponse = UploadDocumentsBulkResponses[keyof UploadDocumentsBulkResponses];
11126
- export type DeleteDocumentData = {
11223
+ export type DeleteDocumentResponse = DeleteDocumentResponses[keyof DeleteDocumentResponses];
11224
+ export type GetDocumentData = {
11127
11225
  body?: never;
11128
11226
  path: {
11129
11227
  /**
@@ -11138,20 +11236,74 @@ export type DeleteDocumentData = {
11138
11236
  query?: never;
11139
11237
  url: '/v1/graphs/{graph_id}/documents/{document_id}';
11140
11238
  };
11141
- export type DeleteDocumentErrors = {
11239
+ export type GetDocumentErrors = {
11142
11240
  /**
11143
11241
  * Validation Error
11144
11242
  */
11145
11243
  422: HttpValidationError;
11146
11244
  };
11147
- export type DeleteDocumentError = DeleteDocumentErrors[keyof DeleteDocumentErrors];
11148
- export type DeleteDocumentResponses = {
11245
+ export type GetDocumentError = GetDocumentErrors[keyof GetDocumentErrors];
11246
+ export type GetDocumentResponses = {
11149
11247
  /**
11150
11248
  * Successful Response
11151
11249
  */
11152
- 204: void;
11250
+ 200: DocumentDetailResponse;
11153
11251
  };
11154
- export type DeleteDocumentResponse = DeleteDocumentResponses[keyof DeleteDocumentResponses];
11252
+ export type GetDocumentResponse = GetDocumentResponses[keyof GetDocumentResponses];
11253
+ export type UpdateDocumentData = {
11254
+ body: DocumentUpdateRequest;
11255
+ path: {
11256
+ /**
11257
+ * Graph Id
11258
+ */
11259
+ graph_id: string;
11260
+ /**
11261
+ * Document Id
11262
+ */
11263
+ document_id: string;
11264
+ };
11265
+ query?: never;
11266
+ url: '/v1/graphs/{graph_id}/documents/{document_id}';
11267
+ };
11268
+ export type UpdateDocumentErrors = {
11269
+ /**
11270
+ * Validation Error
11271
+ */
11272
+ 422: HttpValidationError;
11273
+ };
11274
+ export type UpdateDocumentError = UpdateDocumentErrors[keyof UpdateDocumentErrors];
11275
+ export type UpdateDocumentResponses = {
11276
+ /**
11277
+ * Successful Response
11278
+ */
11279
+ 200: DocumentUploadResponse;
11280
+ };
11281
+ export type UpdateDocumentResponse = UpdateDocumentResponses[keyof UpdateDocumentResponses];
11282
+ export type UploadDocumentsBulkData = {
11283
+ body: BulkDocumentUploadRequest;
11284
+ path: {
11285
+ /**
11286
+ * Graph Id
11287
+ */
11288
+ graph_id: string;
11289
+ };
11290
+ query?: never;
11291
+ url: '/v1/graphs/{graph_id}/documents/bulk';
11292
+ };
11293
+ export type UploadDocumentsBulkErrors = {
11294
+ /**
11295
+ * Validation Error
11296
+ */
11297
+ 422: HttpValidationError;
11298
+ };
11299
+ export type UploadDocumentsBulkError = UploadDocumentsBulkErrors[keyof UploadDocumentsBulkErrors];
11300
+ export type UploadDocumentsBulkResponses = {
11301
+ /**
11302
+ * Successful Response
11303
+ */
11304
+ 200: BulkDocumentUploadResponse;
11305
+ };
11306
+ export type UploadDocumentsBulkResponse = UploadDocumentsBulkResponses[keyof UploadDocumentsBulkResponses];
11155
11307
  export type GetMaterializationStatusData = {
11156
11308
  body?: never;
11157
11309
  path: {
package/sdk/types.gen.ts CHANGED
@@ -2466,12 +2466,76 @@ export type DetailedTransactionsResponse = {
2466
2466
  };
2467
2467
  };
2468
2468
 
2469
+ /**
2470
+ * DocumentDetailResponse
2471
+ *
2472
+ * Full document detail with raw content.
2473
+ */
2474
+ export type DocumentDetailResponse = {
2475
+ /**
2476
+ * Id
2477
+ */
2478
+ id: string;
2479
+ /**
2480
+ * Graph Id
2481
+ */
2482
+ graph_id: string;
2483
+ /**
2484
+ * User Id
2485
+ */
2486
+ user_id: string;
2487
+ /**
2488
+ * Title
2489
+ */
2490
+ title: string;
2491
+ /**
2492
+ * Content
2493
+ */
2494
+ content: string;
2495
+ /**
2496
+ * Tags
2497
+ */
2498
+ tags?: Array<string> | null;
2499
+ /**
2500
+ * Folder
2501
+ */
2502
+ folder?: string | null;
2503
+ /**
2504
+ * External Id
2505
+ */
2506
+ external_id?: string | null;
2507
+ /**
2508
+ * Source Type
2509
+ */
2510
+ source_type: string;
2511
+ /**
2512
+ * Source Provider
2513
+ */
2514
+ source_provider?: string | null;
2515
+ /**
2516
+ * Sections Indexed
2517
+ */
2518
+ sections_indexed: number;
2519
+ /**
2520
+ * Created At
2521
+ */
2522
+ created_at: string;
2523
+ /**
2524
+ * Updated At
2525
+ */
2526
+ updated_at: string;
2527
+ };
2528
+
2469
2529
  /**
2470
2530
  * DocumentListItem
2471
2531
  *
2472
2532
  * A document in the document list.
2473
2533
  */
2474
2534
  export type DocumentListItem = {
2535
+ /**
2536
+ * Id
2537
+ */
2538
+ id: string;
2475
2539
  /**
2476
2540
  * Document Title
2477
2541
  */
@@ -2493,9 +2557,13 @@ export type DocumentListItem = {
2493
2557
  */
2494
2558
  tags?: Array<string> | null;
2495
2559
  /**
2496
- * Last Indexed
2560
+ * Created At
2497
2561
  */
2498
- last_indexed?: string | null;
2562
+ created_at: string;
2563
+ /**
2564
+ * Updated At
2565
+ */
2566
+ updated_at: string;
2499
2567
  };
2500
2568
 
2501
2569
  /**
@@ -2610,6 +2678,30 @@ export type DocumentSection = {
2610
2678
  folder?: string | null;
2611
2679
  };
2612
2680
 
2681
+ /**
2682
+ * DocumentUpdateRequest
2683
+ *
2684
+ * Update a document's metadata and/or content.
2685
+ */
2686
+ export type DocumentUpdateRequest = {
2687
+ /**
2688
+ * Title
2689
+ */
2690
+ title?: string | null;
2691
+ /**
2692
+ * Content
2693
+ */
2694
+ content?: string | null;
2695
+ /**
2696
+ * Tags
2697
+ */
2698
+ tags?: Array<string> | null;
2699
+ /**
2700
+ * Folder
2701
+ */
2702
+ folder?: string | null;
2703
+ };
2704
+
2613
2705
  /**
2614
2706
  * DocumentUploadRequest
2615
2707
  *
@@ -2654,6 +2746,10 @@ export type DocumentUploadRequest = {
2654
2746
  * Response from document upload.
2655
2747
  */
2656
2748
  export type DocumentUploadResponse = {
2749
+ /**
2750
+ * Id
2751
+ */
2752
+ id: string;
2657
2753
  /**
2658
2754
  * Document Id
2659
2755
  */
@@ -11735,37 +11831,41 @@ export type UploadDocumentResponses = {
11735
11831
 
11736
11832
  export type UploadDocumentResponse = UploadDocumentResponses[keyof UploadDocumentResponses];
11737
11833
 
11738
- export type UploadDocumentsBulkData = {
11739
- body: BulkDocumentUploadRequest;
11834
+ export type DeleteDocumentData = {
11835
+ body?: never;
11740
11836
  path: {
11741
11837
  /**
11742
11838
  * Graph Id
11743
11839
  */
11744
11840
  graph_id: string;
11841
+ /**
11842
+ * Document Id
11843
+ */
11844
+ document_id: string;
11745
11845
  };
11746
11846
  query?: never;
11747
- url: '/v1/graphs/{graph_id}/documents/bulk';
11847
+ url: '/v1/graphs/{graph_id}/documents/{document_id}';
11748
11848
  };
11749
11849
 
11750
- export type UploadDocumentsBulkErrors = {
11850
+ export type DeleteDocumentErrors = {
11751
11851
  /**
11752
11852
  * Validation Error
11753
11853
  */
11754
11854
  422: HttpValidationError;
11755
11855
  };
11756
11856
 
11757
- export type UploadDocumentsBulkError = UploadDocumentsBulkErrors[keyof UploadDocumentsBulkErrors];
11857
+ export type DeleteDocumentError = DeleteDocumentErrors[keyof DeleteDocumentErrors];
11758
11858
 
11759
- export type UploadDocumentsBulkResponses = {
11859
+ export type DeleteDocumentResponses = {
11760
11860
  /**
11761
11861
  * Successful Response
11762
11862
  */
11763
- 200: BulkDocumentUploadResponse;
11863
+ 204: void;
11764
11864
  };
11765
11865
 
11766
- export type UploadDocumentsBulkResponse = UploadDocumentsBulkResponses[keyof UploadDocumentsBulkResponses];
11866
+ export type DeleteDocumentResponse = DeleteDocumentResponses[keyof DeleteDocumentResponses];
11767
11867
 
11768
- export type DeleteDocumentData = {
11868
+ export type GetDocumentData = {
11769
11869
  body?: never;
11770
11870
  path: {
11771
11871
  /**
@@ -11781,23 +11881,87 @@ export type DeleteDocumentData = {
11781
11881
  url: '/v1/graphs/{graph_id}/documents/{document_id}';
11782
11882
  };
11783
11883
 
11784
- export type DeleteDocumentErrors = {
11884
+ export type GetDocumentErrors = {
11785
11885
  /**
11786
11886
  * Validation Error
11787
11887
  */
11788
11888
  422: HttpValidationError;
11789
11889
  };
11790
11890
 
11791
- export type DeleteDocumentError = DeleteDocumentErrors[keyof DeleteDocumentErrors];
11891
+ export type GetDocumentError = GetDocumentErrors[keyof GetDocumentErrors];
11792
11892
 
11793
- export type DeleteDocumentResponses = {
11893
+ export type GetDocumentResponses = {
11794
11894
  /**
11795
11895
  * Successful Response
11796
11896
  */
11797
- 204: void;
11897
+ 200: DocumentDetailResponse;
11798
11898
  };
11799
11899
 
11800
- export type DeleteDocumentResponse = DeleteDocumentResponses[keyof DeleteDocumentResponses];
11900
+ export type GetDocumentResponse = GetDocumentResponses[keyof GetDocumentResponses];
11901
+
11902
+ export type UpdateDocumentData = {
11903
+ body: DocumentUpdateRequest;
11904
+ path: {
11905
+ /**
11906
+ * Graph Id
11907
+ */
11908
+ graph_id: string;
11909
+ /**
11910
+ * Document Id
11911
+ */
11912
+ document_id: string;
11913
+ };
11914
+ query?: never;
11915
+ url: '/v1/graphs/{graph_id}/documents/{document_id}';
11916
+ };
11917
+
11918
+ export type UpdateDocumentErrors = {
11919
+ /**
11920
+ * Validation Error
11921
+ */
11922
+ 422: HttpValidationError;
11923
+ };
11924
+
11925
+ export type UpdateDocumentError = UpdateDocumentErrors[keyof UpdateDocumentErrors];
11926
+
11927
+ export type UpdateDocumentResponses = {
11928
+ /**
11929
+ * Successful Response
11930
+ */
11931
+ 200: DocumentUploadResponse;
11932
+ };
11933
+
11934
+ export type UpdateDocumentResponse = UpdateDocumentResponses[keyof UpdateDocumentResponses];
11935
+
11936
+ export type UploadDocumentsBulkData = {
11937
+ body: BulkDocumentUploadRequest;
11938
+ path: {
11939
+ /**
11940
+ * Graph Id
11941
+ */
11942
+ graph_id: string;
11943
+ };
11944
+ query?: never;
11945
+ url: '/v1/graphs/{graph_id}/documents/bulk';
11946
+ };
11947
+
11948
+ export type UploadDocumentsBulkErrors = {
11949
+ /**
11950
+ * Validation Error
11951
+ */
11952
+ 422: HttpValidationError;
11953
+ };
11954
+
11955
+ export type UploadDocumentsBulkError = UploadDocumentsBulkErrors[keyof UploadDocumentsBulkErrors];
11956
+
11957
+ export type UploadDocumentsBulkResponses = {
11958
+ /**
11959
+ * Successful Response
11960
+ */
11961
+ 200: BulkDocumentUploadResponse;
11962
+ };
11963
+
11964
+ export type UploadDocumentsBulkResponse = UploadDocumentsBulkResponses[keyof UploadDocumentsBulkResponses];
11801
11965
 
11802
11966
  export type GetMaterializationStatusData = {
11803
11967
  body?: never;
@@ -1,4 +1,4 @@
1
- import type { BulkDocumentUploadResponse, DocumentListResponse, DocumentSection, DocumentUploadResponse, SearchResponse } from '../sdk/types.gen';
1
+ import type { BulkDocumentUploadResponse, DocumentDetailResponse, DocumentListResponse, DocumentSection, DocumentUploadResponse, SearchResponse } from '../sdk/types.gen';
2
2
  export interface DocumentSearchOptions {
3
3
  /** Filter by source type (xbrl_textblock, narrative_section, ixbrl_disclosure, uploaded_doc, memory) */
4
4
  sourceType?: string;
@@ -29,6 +29,16 @@ export interface DocumentUploadOptions {
29
29
  /** Optional external ID for upsert behavior */
30
30
  externalId?: string;
31
31
  }
32
+ export interface DocumentUpdateOptions {
33
+ /** Updated title */
34
+ title?: string;
35
+ /** Updated markdown content */
36
+ content?: string;
37
+ /** Updated tags (null to clear) */
38
+ tags?: string[] | null;
39
+ /** Updated folder (null to clear) */
40
+ folder?: string | null;
41
+ }
32
42
  export declare class DocumentClient {
33
43
  private config;
34
44
  constructor(config: {
@@ -44,6 +54,21 @@ export declare class DocumentClient {
44
54
  * into OpenSearch for full-text and semantic search.
45
55
  */
46
56
  upload(graphId: string, title: string, content: string, options?: DocumentUploadOptions): Promise<DocumentUploadResponse>;
57
+ /**
58
+ * Get a document with full content by ID.
59
+ *
60
+ * Returns the raw markdown content and metadata from PostgreSQL.
61
+ *
62
+ * @returns DocumentDetailResponse or null if not found.
63
+ */
64
+ get(graphId: string, documentId: string): Promise<DocumentDetailResponse | null>;
65
+ /**
66
+ * Update a document's content and/or metadata.
67
+ *
68
+ * Only provided fields are updated. Content is re-sectioned,
69
+ * re-embedded, and re-indexed in OpenSearch.
70
+ */
71
+ update(graphId: string, documentId: string, options: DocumentUpdateOptions): Promise<DocumentUploadResponse>;
47
72
  /**
48
73
  * Upload multiple markdown documents (max 50 per request).
49
74
  */
@@ -36,6 +36,46 @@ class DocumentClient {
36
36
  }
37
37
  return response.data;
38
38
  }
39
+ /**
40
+ * Get a document with full content by ID.
41
+ *
42
+ * Returns the raw markdown content and metadata from PostgreSQL.
43
+ *
44
+ * @returns DocumentDetailResponse or null if not found.
45
+ */
46
+ async get(graphId, documentId) {
47
+ const response = await (0, sdk_gen_1.getDocument)({
48
+ path: { graph_id: graphId, document_id: documentId },
49
+ });
50
+ if (response.response.status === 404) {
51
+ return null;
52
+ }
53
+ if (response.error) {
54
+ throw new Error(`Get document failed: ${JSON.stringify(response.error)}`);
55
+ }
56
+ return response.data;
57
+ }
58
+ /**
59
+ * Update a document's content and/or metadata.
60
+ *
61
+ * Only provided fields are updated. Content is re-sectioned,
62
+ * re-embedded, and re-indexed in OpenSearch.
63
+ */
64
+ async update(graphId, documentId, options) {
65
+ const response = await (0, sdk_gen_1.updateDocument)({
66
+ path: { graph_id: graphId, document_id: documentId },
67
+ body: {
68
+ title: options.title ?? undefined,
69
+ content: options.content ?? undefined,
70
+ tags: options.tags !== undefined ? options.tags : undefined,
71
+ folder: options.folder !== undefined ? options.folder : undefined,
72
+ },
73
+ });
74
+ if (response.error) {
75
+ throw new Error(`Update document failed: ${JSON.stringify(response.error)}`);
76
+ }
77
+ return response.data;
78
+ }
39
79
  /**
40
80
  * Upload multiple markdown documents (max 50 per request).
41
81
  */