@docrouter/sdk 0.1.0 → 0.2.0

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/index.d.mts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
 
3
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
4
+ [key: string]: JsonValue;
5
+ };
3
6
  interface DocRouterConfig {
4
7
  baseURL: string;
5
8
  token?: string;
@@ -84,8 +87,8 @@ interface Document {
84
87
  }
85
88
  interface UploadDocument {
86
89
  name: string;
87
- content: ArrayBuffer | Buffer | Uint8Array;
88
- type: string;
90
+ content: string;
91
+ tag_ids?: string[];
89
92
  metadata?: Record<string, string>;
90
93
  }
91
94
  interface UploadDocumentsParams {
@@ -141,6 +144,30 @@ interface ListDocumentsResponse {
141
144
  total_count: number;
142
145
  skip: number;
143
146
  }
147
+ interface OCRGeometry {
148
+ BoundingBox: {
149
+ Width: number;
150
+ Height: number;
151
+ Left: number;
152
+ Top: number;
153
+ };
154
+ Polygon: Array<{
155
+ X: number;
156
+ Y: number;
157
+ }>;
158
+ }
159
+ interface OCRBlock {
160
+ BlockType: 'PAGE' | 'LINE' | 'WORD';
161
+ Confidence: number;
162
+ Text?: string;
163
+ Geometry: OCRGeometry;
164
+ Id: string;
165
+ Relationships?: Array<{
166
+ Type: string;
167
+ Ids: string[];
168
+ }>;
169
+ Page: number;
170
+ }
144
171
  interface GetOCRBlocksParams {
145
172
  documentId: string;
146
173
  }
@@ -158,34 +185,44 @@ interface GetOCRMetadataResponse {
158
185
  created_at: string;
159
186
  updated_at: string;
160
187
  }
161
- interface LLMChatMessage {
162
- role: 'system' | 'user' | 'assistant';
188
+ interface LLMMessage {
189
+ role: "system" | "user" | "assistant";
163
190
  content: string;
164
191
  }
165
192
  interface LLMChatRequest {
166
- messages: LLMChatMessage[];
167
- model?: string;
168
- temperature?: number;
193
+ model: string;
194
+ messages: LLMMessage[];
169
195
  max_tokens?: number;
196
+ temperature?: number;
170
197
  stream?: boolean;
171
198
  }
172
- interface LLMChatResponse {
173
- message: LLMChatMessage;
174
- usage?: {
175
- prompt_tokens: number;
176
- completion_tokens: number;
177
- total_tokens: number;
199
+ interface LLMChatChoice {
200
+ index: number;
201
+ message: {
202
+ role: "assistant";
203
+ content: string;
178
204
  };
205
+ finish_reason: string;
206
+ }
207
+ interface LLMChatUsage {
208
+ prompt_tokens: number;
209
+ completion_tokens: number;
210
+ total_tokens: number;
211
+ }
212
+ interface LLMChatResponse {
213
+ id: string;
214
+ object: "chat.completion";
215
+ created: number;
216
+ model: string;
217
+ choices: LLMChatChoice[];
218
+ usage: LLMChatUsage;
179
219
  }
180
220
  interface LLMChatStreamChunk {
181
- type: 'chunk';
182
- content: string;
221
+ chunk: string;
183
222
  done: boolean;
184
223
  }
185
224
  interface LLMChatStreamError {
186
- type: 'error';
187
225
  error: string;
188
- done: true;
189
226
  }
190
227
  interface ListLLMModelsParams {
191
228
  providerName?: string;
@@ -193,25 +230,33 @@ interface ListLLMModelsParams {
193
230
  llmEnabled?: boolean;
194
231
  }
195
232
  interface LLMModel {
196
- id: string;
197
- name: string;
198
- provider: string;
199
- enabled: boolean;
233
+ litellm_model: string;
234
+ litellm_provider: string;
235
+ max_input_tokens: number;
236
+ max_output_tokens: number;
237
+ input_cost_per_token: number;
238
+ output_cost_per_token: number;
200
239
  }
201
240
  interface ListLLMModelsResponse {
202
241
  models: LLMModel[];
203
242
  }
243
+ interface LLMProvider {
244
+ name: string;
245
+ display_name: string;
246
+ litellm_provider: string;
247
+ litellm_models_enabled: string[];
248
+ litellm_models_available: string[];
249
+ enabled: boolean;
250
+ token: string | null;
251
+ token_created_at: string | null;
252
+ }
204
253
  interface ListLLMProvidersResponse {
205
- providers: Array<{
206
- name: string;
207
- enabled: boolean;
208
- configured: boolean;
209
- }>;
254
+ providers: LLMProvider[];
210
255
  }
211
256
  interface SetLLMProviderConfigRequest {
212
- api_key?: string;
213
- base_url?: string;
214
- enabled?: boolean;
257
+ litellm_models_enabled: string[] | null;
258
+ enabled: boolean | null;
259
+ token: string | null;
215
260
  }
216
261
  interface RunLLMParams {
217
262
  documentId: string;
@@ -228,7 +273,13 @@ interface GetLLMResultParams {
228
273
  fallback?: boolean;
229
274
  }
230
275
  interface GetLLMResultResponse {
231
- result: Record<string, unknown>;
276
+ prompt_revid: string;
277
+ prompt_id: string;
278
+ prompt_version: number;
279
+ document_id: string;
280
+ llm_result: Record<string, JsonValue>;
281
+ updated_llm_result: Record<string, JsonValue>;
282
+ is_edited: boolean;
232
283
  is_verified: boolean;
233
284
  created_at: string;
234
285
  updated_at: string;
@@ -240,10 +291,13 @@ interface DeleteLLMResultParams {
240
291
  interface User {
241
292
  id: string;
242
293
  email: string;
243
- name: string;
294
+ name: string | null;
244
295
  role: string;
296
+ email_verified: boolean | null;
245
297
  created_at: string;
246
298
  updated_at: string;
299
+ has_password: boolean;
300
+ has_seen_tour: boolean;
247
301
  }
248
302
  interface UserCreate {
249
303
  email: string;
@@ -254,9 +308,9 @@ interface UserUpdate {
254
308
  name?: string;
255
309
  email?: string;
256
310
  password?: string;
257
- }
258
- interface UserResponse {
259
- user: User;
311
+ role?: string;
312
+ email_verified?: boolean;
313
+ has_seen_tour?: boolean;
260
314
  }
261
315
  interface ListUsersParams {
262
316
  skip?: number;
@@ -274,6 +328,7 @@ interface Tag {
274
328
  id: string;
275
329
  name: string;
276
330
  color: string;
331
+ description?: string;
277
332
  created_at: string;
278
333
  updated_at: string;
279
334
  }
@@ -297,59 +352,46 @@ interface UpdateTagParams {
297
352
  interface DeleteTagParams {
298
353
  tagId: string;
299
354
  }
300
- interface PortalSessionResponse {
301
- url: string;
302
- }
303
- interface SubscriptionResponse {
304
- id: string;
305
- status: string;
306
- current_period_start: string;
307
- current_period_end: string;
308
- plan_id: string;
309
- }
310
- interface UsageResponse {
311
- credits_used: number;
312
- credits_remaining: number;
313
- period_start: string;
314
- period_end: string;
315
- }
316
355
  interface CreditConfig {
317
- cost_per_credit: number;
318
- credits_per_dollar: number;
356
+ price_per_credit: number;
357
+ currency: string;
358
+ min_cost: number;
359
+ max_cost: number;
319
360
  }
320
361
  interface CreditUpdateResponse {
321
362
  credits_added: number;
322
363
  new_balance: number;
323
364
  }
324
- interface UsageRangeRequest {
325
- start_date: string;
326
- end_date: string;
365
+ interface FormResponseFormat {
366
+ json_formio?: object | null;
367
+ json_formio_mapping?: Record<string, FieldMapping>;
327
368
  }
328
- interface UsageRangeResponse {
329
- usage: Array<{
330
- date: string;
331
- credits_used: number;
332
- }>;
369
+ interface FieldMappingSource {
370
+ promptRevId: string;
371
+ promptName: string;
372
+ schemaFieldPath: string;
373
+ schemaFieldName: string;
374
+ schemaFieldType: string;
375
+ }
376
+ interface FieldMapping {
377
+ sources: FieldMappingSource[];
378
+ mappingType: 'direct' | 'concatenated' | 'calculated' | 'conditional';
379
+ concatenationSeparator?: string;
333
380
  }
334
381
  interface Form {
335
382
  form_revid: string;
336
383
  form_id: string;
337
384
  form_version: number;
338
385
  name: string;
339
- response_format: {
340
- json_formio?: Array<Record<string, unknown>>;
341
- json_formio_mapping?: Record<string, Record<string, unknown>>;
342
- };
386
+ response_format: FormResponseFormat;
343
387
  created_at: string;
344
388
  created_by: string;
389
+ tag_ids?: string[];
345
390
  }
346
391
  interface CreateFormParams {
347
392
  organizationId: string;
348
393
  name: string;
349
- response_format: {
350
- json_formio?: Array<Record<string, unknown>>;
351
- json_formio_mapping?: Record<string, Record<string, unknown>>;
352
- };
394
+ response_format: FormResponseFormat;
353
395
  }
354
396
  interface ListFormsParams {
355
397
  organizationId: string;
@@ -369,7 +411,7 @@ interface GetFormParams {
369
411
  interface UpdateFormParams {
370
412
  organizationId: string;
371
413
  formId: string;
372
- form: Partial<Omit<Form, 'id' | 'created_at' | 'updated_at'>>;
414
+ form: Partial<Omit<Form, 'form_revid' | 'form_id' | 'form_version' | 'created_at' | 'created_by'>>;
373
415
  }
374
416
  interface DeleteFormParams {
375
417
  organizationId: string;
@@ -402,15 +444,21 @@ interface DeleteFormSubmissionParams {
402
444
  formRevId: string;
403
445
  }
404
446
  interface Prompt {
405
- id: string;
447
+ prompt_revid: string;
448
+ prompt_id: string;
449
+ prompt_version: number;
406
450
  name: string;
407
451
  content: string;
452
+ schema_id?: string;
453
+ schema_version?: number;
454
+ tag_ids?: string[];
455
+ model?: string;
408
456
  created_at: string;
409
- updated_at: string;
457
+ created_by: string;
410
458
  }
411
459
  interface CreatePromptParams {
412
460
  organizationId: string;
413
- prompt: Omit<Prompt, 'id' | 'created_at' | 'updated_at'>;
461
+ prompt: Omit<Prompt, 'prompt_revid' | 'prompt_id' | 'prompt_version' | 'created_at' | 'created_by'>;
414
462
  }
415
463
  interface ListPromptsParams {
416
464
  organizationId: string;
@@ -432,65 +480,50 @@ interface GetPromptParams {
432
480
  interface UpdatePromptParams {
433
481
  organizationId: string;
434
482
  promptId: string;
435
- prompt: Partial<Omit<Prompt, 'id' | 'created_at' | 'updated_at'>>;
483
+ prompt: Partial<Omit<Prompt, 'prompt_revid' | 'prompt_id' | 'prompt_version' | 'created_at' | 'created_by'>>;
436
484
  }
437
485
  interface DeletePromptParams {
438
486
  organizationId: string;
439
487
  promptId: string;
440
488
  }
441
- interface Flow {
442
- id: string;
443
- name: string;
444
- definition: Record<string, unknown>;
445
- created_at: string;
446
- updated_at: string;
447
- }
448
- interface CreateFlowParams {
449
- organizationId: string;
450
- flow: Omit<Flow, 'id' | 'created_at' | 'updated_at'>;
451
- }
452
- interface UpdateFlowParams {
453
- organizationId: string;
454
- flowId: string;
455
- flow: Partial<Omit<Flow, 'id' | 'created_at' | 'updated_at'>>;
456
- }
457
- interface ListFlowsParams {
458
- organizationId: string;
459
- skip?: number;
460
- limit?: number;
461
- }
462
- interface ListFlowsResponse {
463
- flows: Flow[];
464
- total_count: number;
465
- skip: number;
466
- }
467
- interface GetFlowParams {
468
- organizationId: string;
469
- flowId: string;
470
- }
471
- interface DeleteFlowParams {
472
- organizationId: string;
473
- flowId: string;
489
+ interface SchemaProperty {
490
+ type: 'string' | 'integer' | 'number' | 'boolean' | 'array' | 'object';
491
+ description?: string;
492
+ items?: SchemaProperty;
493
+ properties?: Record<string, SchemaProperty>;
494
+ additionalProperties?: boolean;
495
+ required?: string[];
496
+ }
497
+ interface SchemaResponseFormat {
498
+ type: 'json_schema';
499
+ json_schema: {
500
+ name: string;
501
+ schema: {
502
+ type: 'object';
503
+ properties: Record<string, SchemaProperty>;
504
+ required: string[];
505
+ additionalProperties: boolean;
506
+ };
507
+ strict: boolean;
508
+ };
474
509
  }
475
510
  interface Schema {
476
511
  schema_revid: string;
477
512
  schema_id: string;
478
513
  schema_version: number;
479
514
  name: string;
480
- response_format: {
481
- type: 'json_schema';
482
- json_schema: Record<string, unknown>;
483
- };
515
+ response_format: SchemaResponseFormat;
484
516
  created_at: string;
485
517
  created_by: string;
486
518
  }
519
+ interface SchemaConfig {
520
+ name: string;
521
+ response_format: SchemaResponseFormat;
522
+ }
487
523
  interface CreateSchemaParams {
488
524
  organizationId: string;
489
525
  name: string;
490
- response_format: {
491
- type: 'json_schema';
492
- json_schema: Record<string, unknown>;
493
- };
526
+ response_format: SchemaResponseFormat;
494
527
  }
495
528
  interface ListSchemasParams {
496
529
  organizationId: string;
@@ -510,7 +543,7 @@ interface GetSchemaParams {
510
543
  interface UpdateSchemaParams {
511
544
  organizationId: string;
512
545
  schemaId: string;
513
- schema: Partial<Omit<Schema, 'id' | 'created_at' | 'updated_at'>>;
546
+ schema: Partial<Omit<Schema, 'schema_revid' | 'schema_id' | 'schema_version' | 'created_at' | 'created_by'>>;
514
547
  }
515
548
  interface DeleteSchemaParams {
516
549
  organizationId: string;
@@ -520,13 +553,15 @@ interface InvitationResponse {
520
553
  id: string;
521
554
  email: string;
522
555
  organization_id: string;
556
+ organization_name?: string;
523
557
  role: string;
558
+ user_exists?: boolean;
524
559
  created_at: string;
525
560
  expires_at: string;
526
561
  }
527
562
  interface CreateInvitationRequest {
528
563
  email: string;
529
- organization_id: string;
564
+ organization_id?: string;
530
565
  role: string;
531
566
  }
532
567
  interface ListInvitationsParams {
@@ -542,10 +577,79 @@ interface AcceptInvitationRequest {
542
577
  name: string;
543
578
  password: string;
544
579
  }
580
+ interface PortalSessionResponse {
581
+ url: string;
582
+ }
583
+ interface PortalSessionResponse {
584
+ payment_portal_url: string;
585
+ stripe_enabled: boolean;
586
+ }
587
+ interface SubscriptionPlan {
588
+ plan_id: string;
589
+ name: string;
590
+ base_price: number;
591
+ included_spus: number;
592
+ features: string[];
593
+ currency: string;
594
+ interval: string;
595
+ }
596
+ interface SubscriptionResponse {
597
+ plans: SubscriptionPlan[];
598
+ current_plan: string | null;
599
+ subscription_status: string | null;
600
+ cancel_at_period_end: boolean;
601
+ current_period_start: number | null;
602
+ current_period_end: number | null;
603
+ stripe_enabled: boolean;
604
+ stripe_payments_portal_enabled: boolean;
605
+ }
606
+ interface UsageData {
607
+ subscription_type: string | null;
608
+ usage_unit: string;
609
+ period_metered_usage: number;
610
+ total_metered_usage: number;
611
+ remaining_included: number;
612
+ purchased_credits: number;
613
+ purchased_credits_used: number;
614
+ purchased_credits_remaining: number;
615
+ granted_credits: number;
616
+ granted_credits_used: number;
617
+ granted_credits_remaining: number;
618
+ period_start: number | null;
619
+ period_end: number | null;
620
+ }
621
+ interface UsageResponse {
622
+ usage_source: string;
623
+ data: UsageData;
624
+ }
625
+ interface UsageRangeRequest {
626
+ start_date: string;
627
+ end_date: string;
628
+ }
629
+ interface UsageRangeRequest {
630
+ start_date: string;
631
+ end_date: string;
632
+ }
633
+ interface UsageDataPoint {
634
+ date: string;
635
+ spus: number;
636
+ operation: string;
637
+ source: string;
638
+ }
639
+ interface UsageRangeResponse {
640
+ usage: Array<{
641
+ date: string;
642
+ credits_used: number;
643
+ }>;
644
+ }
645
+ interface UsageRangeResponse {
646
+ data_points: UsageDataPoint[];
647
+ total_spus: number;
648
+ }
545
649
  interface AWSConfig {
546
650
  access_key_id: string;
547
651
  secret_access_key: string;
548
- region: string;
652
+ s3_bucket_name: string;
549
653
  created_at: string;
550
654
  }
551
655
 
@@ -565,7 +669,7 @@ declare class HttpClient {
565
669
  put<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
566
670
  delete<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
567
671
  request<T = unknown>(config: AxiosRequestConfig): Promise<T>;
568
- stream(url: string, data: unknown, onChunk: (chunk: unknown) => void, onError?: (error: Error) => void, abortSignal?: AbortSignal): Promise<void>;
672
+ stream(url: string, data: unknown, onChunk: (chunk: LLMChatStreamChunk | LLMChatStreamError) => void, onError?: (error: Error) => void, abortSignal?: AbortSignal): Promise<void>;
569
673
  updateToken(token: string): void;
570
674
  updateTokenProvider(provider: () => Promise<string>): void;
571
675
  }
@@ -593,26 +697,63 @@ declare class DocRouterAccount {
593
697
  createOrganization(organization: CreateOrganizationRequest): Promise<Organization>;
594
698
  updateOrganization(organizationId: string, update: UpdateOrganizationRequest): Promise<Organization>;
595
699
  deleteOrganization(organizationId: string): Promise<unknown>;
596
- createAccountToken(request: CreateTokenRequest): Promise<unknown>;
597
- getAccountTokens(): Promise<ListAccessTokensResponse | unknown>;
598
- deleteAccountToken(tokenId: string): Promise<unknown>;
599
- createOrganizationToken(request: CreateTokenRequest, organizationId: string): Promise<unknown>;
600
- getOrganizationTokens(organizationId: string): Promise<unknown>;
601
- deleteOrganizationToken(tokenId: string, organizationId: string): Promise<unknown>;
700
+ createAccountToken(request: CreateTokenRequest): Promise<AccessToken>;
701
+ getAccountTokens(): Promise<AccessToken[]>;
702
+ deleteAccountToken(tokenId: string): Promise<void>;
703
+ createOrganizationToken(request: CreateTokenRequest, organizationId: string): Promise<AccessToken>;
704
+ getOrganizationTokens(organizationId: string): Promise<AccessToken[]>;
705
+ deleteOrganizationToken(tokenId: string, organizationId: string): Promise<void>;
602
706
  listLLMModels(params: ListLLMModelsParams): Promise<ListLLMModelsResponse>;
603
707
  listLLMProviders(): Promise<ListLLMProvidersResponse>;
604
708
  setLLMProviderConfig(providerName: string, request: SetLLMProviderConfigRequest): Promise<SetLLMProviderConfigRequest>;
605
709
  listUsers(params?: ListUsersParams): Promise<ListUsersResponse>;
606
- getUser(userId: string): Promise<UserResponse>;
607
- createUser(user: UserCreate): Promise<UserResponse>;
608
- updateUser(userId: string, update: UserUpdate): Promise<UserResponse>;
710
+ getUser(userId: string): Promise<User>;
711
+ createUser(user: UserCreate): Promise<User>;
712
+ updateUser(userId: string, update: UserUpdate): Promise<User>;
609
713
  deleteUser(userId: string): Promise<void>;
610
714
  sendVerificationEmail(userId: string): Promise<unknown>;
611
715
  sendRegistrationVerificationEmail(userId: string): Promise<unknown>;
612
716
  verifyEmail(token: string): Promise<unknown>;
613
- createAWSConfig(config: Omit<AWSConfig, 'created_at'>): Promise<unknown>;
614
- getAWSConfig(): Promise<unknown>;
615
- deleteAWSConfig(): Promise<unknown>;
717
+ createAWSConfig(config: Omit<AWSConfig, 'created_at'>): Promise<AWSConfig>;
718
+ getAWSConfig(): Promise<AWSConfig>;
719
+ deleteAWSConfig(): Promise<void>;
720
+ createInvitation(invitation: CreateInvitationRequest): Promise<InvitationResponse>;
721
+ getInvitations(params?: ListInvitationsParams): Promise<ListInvitationsResponse>;
722
+ getInvitation(token: string): Promise<InvitationResponse>;
723
+ acceptInvitation(token: string, data: AcceptInvitationRequest): Promise<{
724
+ message: string;
725
+ }>;
726
+ getCustomerPortal(orgId: string): Promise<PortalSessionResponse>;
727
+ getSubscription(orgId: string): Promise<SubscriptionResponse>;
728
+ activateSubscription(orgId: string): Promise<{
729
+ status: string;
730
+ message: string;
731
+ }>;
732
+ cancelSubscription(orgId: string): Promise<{
733
+ status: string;
734
+ message: string;
735
+ }>;
736
+ getCurrentUsage(orgId: string): Promise<UsageResponse>;
737
+ addCredits(orgId: string, amount: number): Promise<CreditUpdateResponse>;
738
+ getCreditConfig(orgId: string): Promise<CreditConfig>;
739
+ purchaseCredits(orgId: string, request: {
740
+ credits: number;
741
+ success_url: string;
742
+ cancel_url: string;
743
+ }): Promise<{
744
+ checkout_url: string;
745
+ session_id: string;
746
+ }>;
747
+ getUsageRange(orgId: string, request: UsageRangeRequest): Promise<UsageRangeResponse>;
748
+ createCheckoutSession(orgId: string, planId: string): Promise<PortalSessionResponse>;
749
+ /**
750
+ * Run LLM chat (account level)
751
+ */
752
+ runLLMChat(request: LLMChatRequest): Promise<LLMChatResponse>;
753
+ /**
754
+ * Run LLM chat with streaming (account level)
755
+ */
756
+ runLLMChatStream(request: LLMChatRequest, onChunk: (chunk: LLMChatStreamChunk | LLMChatStreamError) => void, onError?: (error: Error) => void, abortSignal?: AbortSignal): Promise<void>;
616
757
  /**
617
758
  * Get the current HTTP client (for advanced usage)
618
759
  */
@@ -634,8 +775,8 @@ declare class DocRouterOrg {
634
775
  uploadDocuments(params: {
635
776
  documents: Array<{
636
777
  name: string;
637
- content: ArrayBuffer | Buffer | Uint8Array;
638
- type: string;
778
+ content: string;
779
+ tag_ids?: string[];
639
780
  metadata?: Record<string, string>;
640
781
  }>;
641
782
  }): Promise<UploadDocumentsResponse>;
@@ -661,11 +802,11 @@ declare class DocRouterOrg {
661
802
  }): Promise<unknown>;
662
803
  getOCRBlocks(params: {
663
804
  documentId: string;
664
- }): Promise<unknown>;
805
+ }): Promise<OCRBlock[]>;
665
806
  getOCRText(params: {
666
807
  documentId: string;
667
808
  pageNum?: number;
668
- }): Promise<unknown>;
809
+ }): Promise<string>;
669
810
  getOCRMetadata(params: {
670
811
  documentId: string;
671
812
  }): Promise<GetOCRMetadataResponse>;
@@ -682,9 +823,9 @@ declare class DocRouterOrg {
682
823
  updateLLMResult({ documentId, promptId, result, isVerified }: {
683
824
  documentId: string;
684
825
  promptId: string;
685
- result: Record<string, unknown>;
826
+ result: Record<string, JsonValue>;
686
827
  isVerified?: boolean;
687
- }): Promise<unknown>;
828
+ }): Promise<GetLLMResultResponse>;
688
829
  deleteLLMResult(params: {
689
830
  documentId: string;
690
831
  promptId: string;
@@ -692,6 +833,13 @@ declare class DocRouterOrg {
692
833
  downloadAllLLMResults(params: {
693
834
  documentId: string;
694
835
  }): Promise<unknown>;
836
+ createPrompt(params: Omit<CreatePromptParams, 'organizationId'>): Promise<Prompt>;
837
+ listPrompts(params?: Omit<ListPromptsParams, 'organizationId'>): Promise<ListPromptsResponse>;
838
+ getPrompt(params: Omit<GetPromptParams, 'organizationId'>): Promise<Prompt>;
839
+ updatePrompt(params: Omit<UpdatePromptParams, 'organizationId'>): Promise<Prompt>;
840
+ deletePrompt(params: Omit<DeletePromptParams, 'organizationId'>): Promise<{
841
+ message: string;
842
+ }>;
695
843
  createTag(params: {
696
844
  tag: Omit<Tag, 'id' | 'created_at' | 'updated_at'>;
697
845
  }): Promise<Tag>;
@@ -722,13 +870,6 @@ declare class DocRouterOrg {
722
870
  submitForm(params: Omit<SubmitFormParams, 'organizationId'>): Promise<FormSubmission>;
723
871
  getFormSubmission(params: Omit<GetFormSubmissionParams, 'organizationId'>): Promise<FormSubmission | null>;
724
872
  deleteFormSubmission(params: Omit<DeleteFormSubmissionParams, 'organizationId'>): Promise<void>;
725
- createPrompt(params: Omit<CreatePromptParams, 'organizationId'>): Promise<Prompt>;
726
- listPrompts(params: Omit<ListPromptsParams, 'organizationId'>): Promise<ListPromptsResponse>;
727
- getPrompt(params: Omit<GetPromptParams, 'organizationId'>): Promise<Prompt>;
728
- updatePrompt(params: Omit<UpdatePromptParams, 'organizationId'>): Promise<Prompt>;
729
- deletePrompt(params: Omit<DeletePromptParams, 'organizationId'>): Promise<{
730
- message: string;
731
- }>;
732
873
  createSchema(schema: Omit<CreateSchemaParams, 'organizationId'>): Promise<Schema>;
733
874
  listSchemas(params: Omit<ListSchemasParams, 'organizationId'>): Promise<ListSchemasResponse>;
734
875
  getSchema(params: Omit<GetSchemaParams, 'organizationId'>): Promise<Schema>;
@@ -743,11 +884,6 @@ declare class DocRouterOrg {
743
884
  valid: boolean;
744
885
  errors?: string[];
745
886
  }>;
746
- createFlow(params: Omit<CreateFlowParams, 'organizationId'>): Promise<Flow>;
747
- updateFlow(params: Omit<UpdateFlowParams, 'organizationId'>): Promise<Flow>;
748
- listFlows(params?: Omit<ListFlowsParams, 'organizationId'>): Promise<ListFlowsResponse>;
749
- getFlow(params: Omit<GetFlowParams, 'organizationId'>): Promise<Flow>;
750
- deleteFlow(params: Omit<DeleteFlowParams, 'organizationId'>): Promise<void>;
751
887
  getCustomerPortal(): Promise<PortalSessionResponse>;
752
888
  getSubscription(): Promise<SubscriptionResponse>;
753
889
  activateSubscription(): Promise<{
@@ -768,30 +904,12 @@ declare class DocRouterOrg {
768
904
  }): Promise<unknown>;
769
905
  getUsageRange(request: UsageRangeRequest): Promise<UsageRangeResponse>;
770
906
  createCheckoutSession(planId: string): Promise<PortalSessionResponse>;
771
- runLLMChat(request: {
772
- messages: Array<{
773
- role: 'system' | 'user' | 'assistant';
774
- content: string;
775
- }>;
776
- model?: string;
777
- temperature?: number;
778
- max_tokens?: number;
779
- stream?: boolean;
780
- }): Promise<unknown>;
781
- runLLMChatStream(request: {
782
- messages: Array<{
783
- role: 'system' | 'user' | 'assistant';
784
- content: string;
785
- }>;
786
- model?: string;
787
- temperature?: number;
788
- max_tokens?: number;
789
- stream?: boolean;
790
- }, onChunk: (chunk: unknown) => void, onError?: (error: Error) => void, abortSignal?: AbortSignal): Promise<void>;
907
+ runLLMChat(request: LLMChatRequest): Promise<LLMChatResponse>;
908
+ runLLMChatStream(request: LLMChatRequest, onChunk: (chunk: LLMChatStreamChunk | LLMChatStreamError) => void, onError?: (error: Error) => void, abortSignal?: AbortSignal): Promise<void>;
791
909
  /**
792
910
  * Get the current HTTP client (for advanced usage)
793
911
  */
794
912
  getHttpClient(): HttpClient;
795
913
  }
796
914
 
797
- export { type AWSConfig, type AcceptInvitationRequest, type AccessToken, type ApiError, type CreateFlowParams, type CreateFormParams, type CreateInvitationRequest, type CreateOrganizationRequest, type CreatePromptParams, type CreateSchemaParams, type CreateTagParams, type CreateTokenRequest, type CreditConfig, type CreditUpdateResponse, type DeleteDocumentParams, type DeleteFlowParams, type DeleteFormParams, type DeleteFormSubmissionParams, type DeleteLLMResultParams, type DeletePromptParams, type DeleteSchemaParams, type DeleteTagParams, DocRouterAccount, type DocRouterAccountConfig, type DocRouterConfig, DocRouterOrg, type DocRouterOrgConfig, type Document, type Flow, type Form, type FormSubmission, type GetDocumentParams, type GetDocumentResponse, type GetFlowParams, type GetFormParams, type GetFormSubmissionParams, type GetLLMResultParams, type GetLLMResultResponse, type GetOCRBlocksParams, type GetOCRMetadataParams, type GetOCRMetadataResponse, type GetOCRTextParams, type GetPromptParams, type GetSchemaParams, HttpClient, type InvitationResponse, type LLMChatMessage, type LLMChatRequest, type LLMChatResponse, type LLMChatStreamChunk, type LLMChatStreamError, type LLMModel, type ListAccessTokensResponse, type ListDocumentsParams, type ListDocumentsResponse, type ListFlowsParams, type ListFlowsResponse, type ListFormsParams, type ListFormsResponse, type ListInvitationsParams, type ListInvitationsResponse, type ListLLMModelsParams, type ListLLMModelsResponse, type ListLLMProvidersResponse, type ListOrganizationsResponse, type ListPromptsParams, type ListPromptsResponse, type ListSchemasParams, type ListSchemasResponse, type ListTagsParams, type ListTagsResponse, type ListUsersParams, type ListUsersResponse, type Organization, type OrganizationMember, type OrganizationType, type PortalSessionResponse, type Prompt, type RunLLMParams, type RunLLMResponse, type Schema, type SetLLMProviderConfigRequest, type SubmitFormParams, type SubscriptionResponse, type Tag, type UpdateDocumentParams, type UpdateFlowParams, type UpdateFormParams, type UpdateOrganizationRequest, type UpdatePromptParams, type UpdateSchemaParams, type UpdateTagParams, type UploadDocument, type UploadDocumentsParams, type UploadDocumentsResponse, type UploadedDocument, type UsageRangeRequest, type UsageRangeResponse, type UsageResponse, type User, type UserCreate, type UserResponse, type UserUpdate };
915
+ export { type AWSConfig, type AcceptInvitationRequest, type AccessToken, type ApiError, type CreateFormParams, type CreateInvitationRequest, type CreateOrganizationRequest, type CreatePromptParams, type CreateSchemaParams, type CreateTagParams, type CreateTokenRequest, type CreditConfig, type CreditUpdateResponse, type DeleteDocumentParams, type DeleteFormParams, type DeleteFormSubmissionParams, type DeleteLLMResultParams, type DeletePromptParams, type DeleteSchemaParams, type DeleteTagParams, DocRouterAccount, type DocRouterAccountConfig, type DocRouterConfig, DocRouterOrg, type DocRouterOrgConfig, type Document, type FieldMapping, type FieldMappingSource, type Form, type FormResponseFormat, type FormSubmission, type GetDocumentParams, type GetDocumentResponse, type GetFormParams, type GetFormSubmissionParams, type GetLLMResultParams, type GetLLMResultResponse, type GetOCRBlocksParams, type GetOCRMetadataParams, type GetOCRMetadataResponse, type GetOCRTextParams, type GetPromptParams, type GetSchemaParams, HttpClient, type InvitationResponse, type JsonValue, type LLMChatChoice, type LLMChatRequest, type LLMChatResponse, type LLMChatStreamChunk, type LLMChatStreamError, type LLMChatUsage, type LLMMessage, type LLMModel, type LLMProvider, type ListAccessTokensResponse, type ListDocumentsParams, type ListDocumentsResponse, type ListFormsParams, type ListFormsResponse, type ListInvitationsParams, type ListInvitationsResponse, type ListLLMModelsParams, type ListLLMModelsResponse, type ListLLMProvidersResponse, type ListOrganizationsResponse, type ListPromptsParams, type ListPromptsResponse, type ListSchemasParams, type ListSchemasResponse, type ListTagsParams, type ListTagsResponse, type ListUsersParams, type ListUsersResponse, type OCRBlock, type OCRGeometry, type Organization, type OrganizationMember, type OrganizationType, type PortalSessionResponse, type Prompt, type RunLLMParams, type RunLLMResponse, type Schema, type SchemaConfig, type SchemaProperty, type SchemaResponseFormat, type SetLLMProviderConfigRequest, type SubmitFormParams, type SubscriptionPlan, type SubscriptionResponse, type Tag, type UpdateDocumentParams, type UpdateFormParams, type UpdateOrganizationRequest, type UpdatePromptParams, type UpdateSchemaParams, type UpdateTagParams, type UploadDocument, type UploadDocumentsParams, type UploadDocumentsResponse, type UploadedDocument, type UsageData, type UsageDataPoint, type UsageRangeRequest, type UsageRangeResponse, type UsageResponse, type User, type UserCreate, type UserUpdate };