@gpt-platform/client 0.1.4 → 0.2.1

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,54 +1,3 @@
1
- /**
2
- * Options for streaming requests
3
- */
4
- interface StreamOptions {
5
- /**
6
- * Signal to abort the stream
7
- */
8
- signal?: AbortSignal;
9
- /**
10
- * Callback for handling errors
11
- */
12
- onError?: (error: Error) => void;
13
- /**
14
- * Maximum stream duration in milliseconds (default: 5 minutes)
15
- * Prevents DoS via infinite streams
16
- */
17
- timeout?: number;
18
- /**
19
- * Maximum number of chunks to process (default: 10000)
20
- * Prevents memory exhaustion via malicious streams
21
- */
22
- maxChunks?: number;
23
- /**
24
- * Maximum buffer size in bytes (default: 10MB)
25
- * Prevents unbounded memory growth
26
- */
27
- maxBufferSize?: number;
28
- }
29
- /**
30
- * Parse Server-Sent Events (SSE) stream into typed chunks
31
- * Security: Enforces timeout, chunk count, and buffer size limits to prevent DoS
32
- */
33
- declare function streamSSE<T = unknown>(response: Response, options?: StreamOptions): AsyncIterableIterator<T>;
34
- /**
35
- * Stream AI thread messages with Server-Sent Events
36
- */
37
- interface StreamMessageChunk {
38
- type: "content" | "done" | "error";
39
- content?: string;
40
- error?: string;
41
- metadata?: Record<string, unknown>;
42
- }
43
- /**
44
- * Parse streaming message response
45
- */
46
- declare function streamMessage(response: Response, options?: StreamOptions): AsyncIterableIterator<StreamMessageChunk>;
47
- /**
48
- * Collect full message from stream chunks
49
- */
50
- declare function collectStreamedMessage(stream: AsyncIterableIterator<StreamMessageChunk>): Promise<string>;
51
-
52
1
  /**
53
2
  * A "Resource object" representing a scheduling_participant
54
3
  */
@@ -479,6 +428,66 @@ type SchedulingEvent = {
479
428
  };
480
429
  type: string;
481
430
  };
431
+ /**
432
+ * A "Resource object" representing a training_session
433
+ */
434
+ type TrainingSession = {
435
+ /**
436
+ * An attributes object for a training_session
437
+ */
438
+ attributes?: {
439
+ /**
440
+ * Field included by default.
441
+ */
442
+ confirmations_count: number;
443
+ /**
444
+ * Field included by default.
445
+ */
446
+ corrections_count: number;
447
+ /**
448
+ * Denormalized filename from the source document. Field included by default.
449
+ */
450
+ document_filename?: string | null | unknown;
451
+ /**
452
+ * Field included by default.
453
+ */
454
+ document_id: string;
455
+ /**
456
+ * Async calculated score of how much this session improved the model. Field included by default.
457
+ */
458
+ impact_score?: number | null | unknown;
459
+ /**
460
+ * Field included by default.
461
+ */
462
+ inserted_at: unknown;
463
+ /**
464
+ * Field included by default.
465
+ */
466
+ reverted_at?: unknown;
467
+ /**
468
+ * Field included by default.
469
+ */
470
+ status?: "queued" | "processing" | "completed" | "failed" | "reverted" | unknown;
471
+ /**
472
+ * Field included by default.
473
+ */
474
+ training_note?: string | null | unknown;
475
+ /**
476
+ * Field included by default.
477
+ */
478
+ updated_at: unknown;
479
+ user_email?: string | null | unknown;
480
+ user_name?: string | null | unknown;
481
+ };
482
+ id: string;
483
+ /**
484
+ * A relationships object for a training_session
485
+ */
486
+ relationships?: {
487
+ [key: string]: never;
488
+ };
489
+ type: string;
490
+ };
482
491
  /**
483
492
  * A "Resource object" representing a user_profile
484
493
  */
@@ -860,6 +869,92 @@ type PaymentMethod = {
860
869
  };
861
870
  type: string;
862
871
  };
872
+ /**
873
+ * A "Resource object" representing a watcher_event
874
+ */
875
+ type WatcherEvent = {
876
+ /**
877
+ * An attributes object for a watcher_event
878
+ */
879
+ attributes?: {
880
+ /**
881
+ * Field included by default.
882
+ */
883
+ claim_id?: string | null | unknown;
884
+ /**
885
+ * Field included by default.
886
+ */
887
+ cloud_storage_path?: string | null | unknown;
888
+ /**
889
+ * Field included by default.
890
+ */
891
+ created_at: unknown;
892
+ /**
893
+ * Field included by default.
894
+ */
895
+ destination_path?: string | null | unknown;
896
+ /**
897
+ * Field included by default.
898
+ */
899
+ document_id?: string | null | unknown;
900
+ /**
901
+ * Field included by default.
902
+ */
903
+ error_message?: string | null | unknown;
904
+ /**
905
+ * Field included by default.
906
+ */
907
+ event_type: "detected" | "skipped" | "claimed" | "uploading" | "uploaded" | "moved" | "error";
908
+ /**
909
+ * Field included by default.
910
+ */
911
+ file_hash?: string | null | unknown;
912
+ /**
913
+ * Field included by default.
914
+ */
915
+ file_name: string;
916
+ /**
917
+ * Field included by default.
918
+ */
919
+ file_path: string;
920
+ /**
921
+ * Field included by default.
922
+ */
923
+ file_size?: number | null | unknown;
924
+ /**
925
+ * Field included by default.
926
+ */
927
+ machine_id?: string | null | unknown;
928
+ /**
929
+ * Field included by default.
930
+ */
931
+ machine_name?: string | null | unknown;
932
+ /**
933
+ * Field included by default.
934
+ */
935
+ retry_count?: number | null | unknown;
936
+ /**
937
+ * Field included by default.
938
+ */
939
+ skip_reason?: string | null | unknown;
940
+ /**
941
+ * Field included by default.
942
+ */
943
+ source: "local" | "cloud";
944
+ /**
945
+ * Field included by default.
946
+ */
947
+ workspace_id: string;
948
+ };
949
+ id: string;
950
+ /**
951
+ * A relationships object for a watcher_event
952
+ */
953
+ relationships?: {
954
+ [key: string]: never;
955
+ };
956
+ type: string;
957
+ };
863
958
  /**
864
959
  * A "Resource object" representing a plan
865
960
  */
@@ -1019,7 +1114,7 @@ type Application = {
1019
1114
  /**
1020
1115
  * Which OAuth providers are enabled for this app. Field included by default.
1021
1116
  */
1022
- enabled_providers?: Array<"google" | "github" | "salesforce"> | null | unknown;
1117
+ enabled_providers?: Array<"google" | "github" | "salesforce" | "microsoft"> | null | unknown;
1023
1118
  /**
1024
1119
  * Custom GitHub OAuth client ID (optional). Field included by default.
1025
1120
  */
@@ -1036,6 +1131,14 @@ type Application = {
1036
1131
  * Custom Google OAuth client secret (optional). Field included by default.
1037
1132
  */
1038
1133
  google_client_secret?: string | null | unknown;
1134
+ /**
1135
+ * Custom Microsoft OAuth client ID (optional). Field included by default.
1136
+ */
1137
+ microsoft_client_id?: string | null | unknown;
1138
+ /**
1139
+ * Custom Microsoft OAuth client secret (optional). Field included by default.
1140
+ */
1141
+ microsoft_client_secret?: string | null | unknown;
1039
1142
  } | null | unknown;
1040
1143
  /**
1041
1144
  * When true, password registration withholds JWT until email is verified. Field included by default.
@@ -1457,6 +1560,12 @@ type ExtractionResult = {
1457
1560
  * Field included by default.
1458
1561
  */
1459
1562
  processing_time_ms?: number | null | unknown;
1563
+ /**
1564
+ * Tabular row data for CSV/spreadsheet extractions. Each element is a JSON object keyed by column name.
1565
+ */
1566
+ rows?: Array<{
1567
+ [key: string]: unknown;
1568
+ }> | null | unknown;
1460
1569
  schema_id?: string | null | unknown;
1461
1570
  /**
1462
1571
  * Schema revision number used for this extraction. Field included by default.
@@ -1498,6 +1607,80 @@ type ExtractionResult = {
1498
1607
  };
1499
1608
  type: string;
1500
1609
  };
1610
+ /**
1611
+ * A "Resource object" representing a watcher_claim
1612
+ */
1613
+ type WatcherClaim = {
1614
+ /**
1615
+ * An attributes object for a watcher_claim
1616
+ */
1617
+ attributes?: {
1618
+ /**
1619
+ * Field included by default.
1620
+ */
1621
+ claimed_at: unknown;
1622
+ /**
1623
+ * Field included by default.
1624
+ */
1625
+ completed_at?: unknown;
1626
+ /**
1627
+ * Field included by default.
1628
+ */
1629
+ document_id?: string | null | unknown;
1630
+ /**
1631
+ * Field included by default.
1632
+ */
1633
+ error_message?: string | null | unknown;
1634
+ /**
1635
+ * Field included by default.
1636
+ */
1637
+ expires_at: unknown;
1638
+ /**
1639
+ * Field included by default.
1640
+ */
1641
+ file_hash: string;
1642
+ /**
1643
+ * Field included by default.
1644
+ */
1645
+ file_name: string;
1646
+ /**
1647
+ * Field included by default.
1648
+ */
1649
+ file_path: string;
1650
+ /**
1651
+ * Field included by default.
1652
+ */
1653
+ file_size?: number | null | unknown;
1654
+ /**
1655
+ * Field included by default.
1656
+ */
1657
+ machine_id: string;
1658
+ /**
1659
+ * Field included by default.
1660
+ */
1661
+ machine_name: string;
1662
+ /**
1663
+ * Field included by default.
1664
+ */
1665
+ retry_count: number;
1666
+ /**
1667
+ * Field included by default.
1668
+ */
1669
+ status: "claimed" | "processing" | "completed" | "failed" | "expired" | "document_deleted";
1670
+ /**
1671
+ * Field included by default.
1672
+ */
1673
+ workspace_id: string;
1674
+ };
1675
+ id: string;
1676
+ /**
1677
+ * A relationships object for a watcher_claim
1678
+ */
1679
+ relationships?: {
1680
+ [key: string]: never;
1681
+ };
1682
+ type: string;
1683
+ };
1501
1684
  /**
1502
1685
  * A "Resource object" representing a tenant
1503
1686
  */
@@ -1564,6 +1747,7 @@ type Tenant = {
1564
1747
  * Tenant-set overage ceiling in bytes. nil = use plan max. Field included by default.
1565
1748
  */
1566
1749
  storage_spending_cap_bytes?: number | null | unknown;
1750
+ storage_used_bytes?: number | null | unknown;
1567
1751
  /**
1568
1752
  * Cost in credits for training on a single document. Field included by default.
1569
1753
  */
@@ -2113,59 +2297,150 @@ type WebhookDelivery = {
2113
2297
  type: string;
2114
2298
  };
2115
2299
  /**
2116
- * A "Resource object" representing a scheduling_booking
2300
+ * A "Resource object" representing a voice_session
2117
2301
  */
2118
- type SchedulingBooking = {
2302
+ type VoiceSession = {
2119
2303
  /**
2120
- * An attributes object for a scheduling_booking
2304
+ * An attributes object for a voice_session
2121
2305
  */
2122
2306
  attributes?: {
2123
2307
  /**
2124
- * Field included by default.
2308
+ * Agent handling this session. Field included by default.
2125
2309
  */
2126
- _hp_field?: string | null | unknown;
2310
+ agent_id?: string | null | unknown;
2127
2311
  /**
2128
2312
  * Field included by default.
2129
2313
  */
2130
- booked_by_user_id?: string | null | unknown;
2314
+ duration_seconds?: number | null | unknown;
2131
2315
  /**
2132
2316
  * Field included by default.
2133
2317
  */
2134
- booker_contact_id?: string | null | unknown;
2318
+ ended_at?: unknown;
2135
2319
  /**
2136
- * Field included by default.
2320
+ * Timestamp when transcript finalization was dispatched. Field included by default.
2137
2321
  */
2138
- booker_email: string;
2322
+ finalized_at?: unknown;
2139
2323
  /**
2140
2324
  * Field included by default.
2141
2325
  */
2142
- booker_name: string;
2326
+ inserted_at: unknown;
2143
2327
  /**
2144
- * Field included by default.
2328
+ * LiveKit room name for the session. Field included by default.
2145
2329
  */
2146
- booker_phone?: string | null | unknown;
2330
+ livekit_room?: string | null | unknown;
2147
2331
  /**
2148
- * Field included by default.
2332
+ * LiveKit JWT for immediate room connection.
2333
+ *
2334
+ * **One-time delivery only.** This field is populated in the `POST /voice/sessions` create
2335
+ * response and is null in ALL subsequent read operations (GET, list). The token is
2336
+ * injected in-memory by the `:start` after_action and is NEVER written to the database
2337
+ * (enforced by a database CHECK constraint). Clients must capture it from the create response
2338
+ * — it cannot be retrieved after that point.
2339
+ * . Field included by default.
2149
2340
  */
2150
- booker_timezone?: string | null | unknown;
2341
+ livekit_token?: string | null | unknown;
2151
2342
  /**
2152
2343
  * Field included by default.
2153
2344
  */
2154
- cancellation_reason?: string | null | unknown;
2345
+ metadata?: {
2346
+ [key: string]: unknown;
2347
+ } | null | unknown;
2155
2348
  /**
2156
2349
  * Field included by default.
2157
2350
  */
2158
- cancelled_at?: unknown;
2351
+ session_type: "push_to_talk" | "bidirectional" | "telephony";
2159
2352
  /**
2160
2353
  * Field included by default.
2161
2354
  */
2162
- cancelled_by?: "booker" | "organizer" | "system" | unknown;
2355
+ status: "active" | "ended" | "failed" | "timed_out";
2163
2356
  /**
2164
- * Field included by default.
2357
+ * Accumulated STT minutes for billing. Field included by default.
2165
2358
  */
2166
- confirmed_at?: unknown;
2359
+ stt_minutes?: number | null | unknown;
2167
2360
  /**
2168
- * Field included by default.
2361
+ * Chat thread linked to this session. Field included by default.
2362
+ */
2363
+ thread_id?: string | null | unknown;
2364
+ /**
2365
+ * Accumulated TTS characters for billing. Field included by default.
2366
+ */
2367
+ tts_characters?: number | null | unknown;
2368
+ /**
2369
+ * Field included by default.
2370
+ */
2371
+ updated_at: unknown;
2372
+ /**
2373
+ * Field included by default.
2374
+ */
2375
+ user_id: string;
2376
+ /**
2377
+ * Field included by default.
2378
+ */
2379
+ workspace_id: string;
2380
+ };
2381
+ id: string;
2382
+ /**
2383
+ * A relationships object for a voice_session
2384
+ */
2385
+ relationships?: {
2386
+ [key: string]: never;
2387
+ };
2388
+ type: string;
2389
+ };
2390
+ /**
2391
+ * A "Resource object" representing a scheduling_booking
2392
+ */
2393
+ type SchedulingBooking = {
2394
+ /**
2395
+ * An attributes object for a scheduling_booking
2396
+ */
2397
+ attributes?: {
2398
+ /**
2399
+ * Field included by default.
2400
+ */
2401
+ _hp_field?: string | null | unknown;
2402
+ /**
2403
+ * Field included by default.
2404
+ */
2405
+ booked_by_user_id?: string | null | unknown;
2406
+ /**
2407
+ * Field included by default.
2408
+ */
2409
+ booker_contact_id?: string | null | unknown;
2410
+ /**
2411
+ * Field included by default.
2412
+ */
2413
+ booker_email: string;
2414
+ /**
2415
+ * Field included by default.
2416
+ */
2417
+ booker_name: string;
2418
+ /**
2419
+ * Field included by default.
2420
+ */
2421
+ booker_phone?: string | null | unknown;
2422
+ /**
2423
+ * Field included by default.
2424
+ */
2425
+ booker_timezone?: string | null | unknown;
2426
+ /**
2427
+ * Field included by default.
2428
+ */
2429
+ cancellation_reason?: string | null | unknown;
2430
+ /**
2431
+ * Field included by default.
2432
+ */
2433
+ cancelled_at?: unknown;
2434
+ /**
2435
+ * Field included by default.
2436
+ */
2437
+ cancelled_by?: "booker" | "organizer" | "system" | unknown;
2438
+ /**
2439
+ * Field included by default.
2440
+ */
2441
+ confirmed_at?: unknown;
2442
+ /**
2443
+ * Field included by default.
2169
2444
  */
2170
2445
  event_id?: string | null | unknown;
2171
2446
  /**
@@ -2236,44 +2511,117 @@ type ExtractionBatch = {
2236
2511
  type: string;
2237
2512
  };
2238
2513
  /**
2239
- * A "Resource object" representing a bucket
2514
+ * A "Resource object" representing a workspace-membership
2240
2515
  */
2241
- type Bucket = {
2516
+ type WorkspaceMembership = {
2242
2517
  /**
2243
- * An attributes object for a bucket
2518
+ * An attributes object for a workspace-membership
2244
2519
  */
2245
2520
  attributes?: {
2246
2521
  /**
2247
2522
  * Field included by default.
2248
2523
  */
2249
- name: string;
2524
+ created_at: unknown;
2525
+ /**
2526
+ * For inherited members, describes the org role
2527
+ */
2528
+ inherited_from?: string | null | unknown;
2529
+ /**
2530
+ * Last time user accessed this workspace. Field included by default.
2531
+ */
2532
+ last_visited_at?: unknown;
2533
+ /**
2534
+ * Workspace permissions in format {app}:{resource}:{action}:{scope}. Field included by default.
2535
+ */
2536
+ permissions: Array<string>;
2537
+ /**
2538
+ * ISV-defined member profile data (NPI, credentials, etc.). Field included by default.
2539
+ */
2540
+ profile_attributes?: {
2541
+ [key: string]: unknown;
2542
+ } | null | unknown;
2543
+ /**
2544
+ * Effective role: admin, editor, or viewer
2545
+ */
2546
+ role?: string | null | unknown;
2547
+ role_label?: string | null | unknown;
2548
+ /**
2549
+ * How user got access: :direct (explicit invite) or :inherited (org role)
2550
+ */
2551
+ source?: string | null | unknown;
2250
2552
  /**
2251
2553
  * Field included by default.
2252
2554
  */
2253
- region?: string | null | unknown;
2254
- storage_used?: number | null | unknown;
2555
+ updated_at: unknown;
2255
2556
  /**
2256
2557
  * Field included by default.
2257
2558
  */
2258
- type: "public" | "private" | "processing";
2559
+ user_id: string;
2560
+ /**
2561
+ * Field included by default.
2562
+ */
2563
+ workspace_id: string;
2259
2564
  };
2260
2565
  id: string;
2261
2566
  /**
2262
- * A relationships object for a bucket
2567
+ * A relationships object for a workspace-membership
2263
2568
  */
2264
2569
  relationships?: {
2265
- objects?: {
2570
+ user?: {
2266
2571
  /**
2267
- * Relationship data for objects
2572
+ * An identifier for user
2268
2573
  */
2269
- data?: Array<{
2574
+ data?: {
2270
2575
  id: string;
2271
2576
  meta?: {
2272
2577
  [key: string]: unknown;
2273
2578
  };
2274
2579
  type: string;
2275
- }>;
2580
+ } | null;
2276
2581
  };
2582
+ workspace?: {
2583
+ /**
2584
+ * An identifier for workspace
2585
+ */
2586
+ data?: {
2587
+ id: string;
2588
+ meta?: {
2589
+ [key: string]: unknown;
2590
+ };
2591
+ type: string;
2592
+ } | null;
2593
+ };
2594
+ };
2595
+ type: string;
2596
+ };
2597
+ /**
2598
+ * A "Resource object" representing a bucket
2599
+ */
2600
+ type Bucket = {
2601
+ /**
2602
+ * An attributes object for a bucket
2603
+ */
2604
+ attributes?: {
2605
+ /**
2606
+ * Field included by default.
2607
+ */
2608
+ name: string;
2609
+ /**
2610
+ * Field included by default.
2611
+ */
2612
+ region?: string | null | unknown;
2613
+ storage_used?: number | null | unknown;
2614
+ /**
2615
+ * Field included by default.
2616
+ */
2617
+ type: "public" | "private" | "processing";
2618
+ };
2619
+ id: string;
2620
+ /**
2621
+ * A relationships object for a bucket
2622
+ */
2623
+ relationships?: {
2624
+ [key: string]: never;
2277
2625
  };
2278
2626
  type: string;
2279
2627
  };
@@ -2784,7 +3132,7 @@ type ExtractionDocument = {
2784
3132
  */
2785
3133
  char_count?: number | null | unknown;
2786
3134
  /**
2787
- * The S3 bucket where this document is stored. Set during upload/begin_upload.
3135
+ * DEPRECATED. The S3 bucket where this document is stored. Use storage_file_id instead.
2788
3136
  */
2789
3137
  bucket_name?: string | null | unknown;
2790
3138
  deleted_at?: unknown;
@@ -3533,13 +3881,11 @@ declare class BrowserApiKeyError extends Error {
3533
3881
  constructor();
3534
3882
  }
3535
3883
 
3536
- /**
3537
- * The API version this SDK was built against.
3538
- * This is the default version sent in all requests.
3539
- * Override per-client via the `apiVersion` config option.
3540
- */
3541
- declare const DEFAULT_API_VERSION = "2025-12-03";
3542
- declare const SDK_VERSION: string;
3884
+ /** SDK version — updated automatically by mix update.sdks */
3885
+ declare const SDK_VERSION = "0.2.1";
3886
+ /** Default API version sent in every request — updated automatically by mix update.sdks */
3887
+ declare const DEFAULT_API_VERSION = "2026-02-25";
3888
+
3543
3889
  /** Security configuration options */
3544
3890
  interface SecurityConfig {
3545
3891
  /**
@@ -3614,8 +3960,20 @@ interface BaseClientConfig {
3614
3960
  */
3615
3961
  defaultHeaders?: Record<string, string>;
3616
3962
  /**
3617
- * Workspace ID to include as a query parameter in every request.
3618
- * Used for multi-tenant workspace scoping.
3963
+ * Default workspace ID appended as `?workspace_id=` to every request that
3964
+ * doesn't already carry one.
3965
+ *
3966
+ * **When to use:**
3967
+ * - Server-side service clients where ALL operations target a single known
3968
+ * workspace (e.g., a background job scoped to one tenant's workspace).
3969
+ *
3970
+ * **When NOT to use:**
3971
+ * - Single-workspace apps (`workspace_mode: "single"`): the platform
3972
+ * auto-resolves the default workspace — this field is unnecessary.
3973
+ * - Multi-workspace apps with per-user routing: set `workspace_id` on the
3974
+ * API key itself via the platform dashboard instead. The key-level
3975
+ * `workspace_id` takes precedence and correctly scopes each key to its
3976
+ * own workspace without leaking across users.
3619
3977
  */
3620
3978
  workspaceId?: string;
3621
3979
  /**
@@ -3693,102 +4051,653 @@ declare abstract class BaseClient {
3693
4051
  }
3694
4052
 
3695
4053
  /**
3696
- * GPT Core Client SDK
3697
- *
3698
- * The main entry point for interacting with the GPT Core API.
3699
- * Provides a namespaced, type-safe interface for all API operations.
3700
- *
3701
- * @example
3702
- * ```typescript
3703
- * import { GptClient } from '@gpt-platform/client';
3704
- *
3705
- * const client = new GptClient({
3706
- * baseUrl: 'https://api.gpt-core.com',
3707
- * apiKey: 'sk_app_...',
3708
- * });
3709
- *
3710
- * // Authentication
3711
- * const user = await client.identity.me();
3712
- *
3713
- * // Workspaces
3714
- * const workspaces = await client.platform.workspaces.mine();
3715
- *
3716
- * // AI Search
3717
- * const results = await client.ai.search('quarterly earnings');
3718
- *
3719
- * // Documents
3720
- * const docs = await client.extraction.documents.list();
3721
- * ```
4054
+ * Options for streaming requests
3722
4055
  */
3723
- declare class GptClient extends BaseClient {
3724
- /** Agent creation, versioning, training, and testing */
3725
- readonly agents: {
3726
- list: (options?: {
3727
- page?: number;
3728
- pageSize?: number;
3729
- } & RequestOptions) => Promise<Agent[]>;
3730
- listAll: (options?: RequestOptions) => Promise<Agent[]>;
3731
- delete: (id: string, options?: RequestOptions) => Promise<true>;
3732
- get: (id: string, options?: RequestOptions) => Promise<Agent>;
3733
- create: (name: string, promptTemplate: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Agent>;
3734
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Agent>;
3735
- test: (id: string, options?: RequestOptions) => Promise<Agent>;
3736
- validate: (id: string, options?: RequestOptions) => Promise<Agent>;
3737
- clone: (id: string, options?: RequestOptions) => Promise<Agent>;
3738
- export: (id: string, options?: RequestOptions) => Promise<Agent>;
3739
- analyzeTraining: (id: string, options?: RequestOptions) => Promise<Agent>;
3740
- teach: (id: string, options?: RequestOptions) => Promise<Agent>;
3741
- publishVersion: (id: string, options?: RequestOptions) => Promise<Agent>;
3742
- restoreVersion: (id: string, options?: RequestOptions) => Promise<Agent>;
3743
- stats: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
3744
- versions: {
3745
- list: (options?: {
3746
- page?: number;
3747
- pageSize?: number;
3748
- } & RequestOptions) => Promise<AgentVersion[]>;
3749
- listAll: (options?: RequestOptions) => Promise<AgentVersion[]>;
3750
- get: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
3751
- delete: (id: string, options?: RequestOptions) => Promise<true>;
3752
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<AgentVersion>;
3753
- addSystemField: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
3754
- removeSystemField: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
3755
- setSystemFields: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
3756
- };
3757
- training: {
3758
- delete: (id: string, options?: RequestOptions) => Promise<true>;
3759
- list: (options?: {
3760
- page?: number;
3761
- pageSize?: number;
3762
- } & RequestOptions) => Promise<TrainingExample[]>;
3763
- listAll: (options?: RequestOptions) => Promise<TrainingExample[]>;
3764
- get: (id: string, options?: RequestOptions) => Promise<TrainingExample>;
3765
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
3766
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
3767
- };
3768
- };
3769
- /** Semantic search, embeddings, and AI conversations */
3770
- readonly ai: {
3771
- search: (query: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
3772
- searchAdvanced: (query: string, params?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
3773
- embed: (text: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
3774
- conversations: {
3775
- list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
3776
- create: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
3777
- };
3778
- messages: {
3779
- list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
3780
- stream: (conversationId: string, body: Record<string, unknown>, options?: RequestOptions, streamOptions?: StreamOptions) => Promise<AsyncIterableIterator<StreamMessageChunk>>;
3781
- send: (_conversationId: string, body: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
3782
- };
3783
- };
3784
- /** Wallet, plans, transactions, and payment methods */
3785
- readonly billing: {
3786
- wallet: {
3787
- get: (options?: RequestOptions) => Promise<Record<string, unknown>>;
3788
- };
3789
- plans: {
3790
- list: (options?: {
3791
- page?: number;
4056
+ interface StreamOptions {
4057
+ /**
4058
+ * Signal to abort the stream
4059
+ */
4060
+ signal?: AbortSignal;
4061
+ /**
4062
+ * Callback for handling errors
4063
+ */
4064
+ onError?: (error: Error) => void;
4065
+ /**
4066
+ * Maximum stream duration in milliseconds (default: 5 minutes)
4067
+ * Prevents DoS via infinite streams
4068
+ */
4069
+ timeout?: number;
4070
+ /**
4071
+ * Maximum number of chunks to process (default: 10000)
4072
+ * Prevents memory exhaustion via malicious streams
4073
+ */
4074
+ maxChunks?: number;
4075
+ /**
4076
+ * Maximum buffer size in bytes (default: 10MB)
4077
+ * Prevents unbounded memory growth
4078
+ */
4079
+ maxBufferSize?: number;
4080
+ }
4081
+ /**
4082
+ * Parse Server-Sent Events (SSE) stream into typed chunks
4083
+ * Security: Enforces timeout, chunk count, and buffer size limits to prevent DoS
4084
+ */
4085
+ declare function streamSSE<T = unknown>(response: Response, options?: StreamOptions): AsyncIterableIterator<T>;
4086
+ /**
4087
+ * Stream AI thread messages with Server-Sent Events
4088
+ */
4089
+ interface StreamMessageChunk {
4090
+ type: "content" | "done" | "error";
4091
+ content?: string;
4092
+ error?: string;
4093
+ metadata?: Record<string, unknown>;
4094
+ }
4095
+ /**
4096
+ * Parse streaming message response
4097
+ */
4098
+ declare function streamMessage(response: Response, options?: StreamOptions): AsyncIterableIterator<StreamMessageChunk>;
4099
+ /**
4100
+ * Collect full message from stream chunks
4101
+ */
4102
+ declare function collectStreamedMessage(stream: AsyncIterableIterator<StreamMessageChunk>): Promise<string>;
4103
+
4104
+ /**
4105
+ * JSON:API pagination links
4106
+ */
4107
+ interface PaginationLinks {
4108
+ self?: string;
4109
+ first?: string;
4110
+ last?: string;
4111
+ prev?: string | null;
4112
+ next?: string | null;
4113
+ }
4114
+ /**
4115
+ * JSON:API response with pagination
4116
+ */
4117
+ interface PaginatedResponse<T> {
4118
+ data: T[];
4119
+ links?: PaginationLinks;
4120
+ meta?: {
4121
+ total_count?: number;
4122
+ page_count?: number;
4123
+ current_page?: number;
4124
+ };
4125
+ }
4126
+ /**
4127
+ * Options for paginated requests
4128
+ */
4129
+ interface PaginationOptions {
4130
+ /**
4131
+ * Page size (number of items per page)
4132
+ */
4133
+ pageSize?: number;
4134
+ /**
4135
+ * Maximum total items to fetch (default: unlimited for paginateAll, 10000 for paginateToArray)
4136
+ */
4137
+ limit?: number;
4138
+ /**
4139
+ * Maximum number of pages to fetch (default: 500)
4140
+ * Safety limit to prevent infinite pagination loops
4141
+ */
4142
+ maxPages?: number;
4143
+ /**
4144
+ * Optional logger for warnings. If not provided, falls back to console.
4145
+ */
4146
+ logger?: {
4147
+ warn: (...args: unknown[]) => void;
4148
+ };
4149
+ }
4150
+ /**
4151
+ * Async iterator for paginated results.
4152
+ * Security: Enforces max pages limit to prevent infinite pagination loops.
4153
+ */
4154
+ declare function paginateAll<T>(fetcher: (page: number, pageSize: number) => Promise<PaginatedResponse<T>>, options?: PaginationOptions): AsyncIterableIterator<T>;
4155
+ /**
4156
+ * Helper to collect all paginated results into an array
4157
+ * Security: Enforces default limit to prevent DoS via infinite pagination
4158
+ */
4159
+ declare function paginateToArray<T>(fetcher: (page: number, pageSize: number) => Promise<PaginatedResponse<T>>, options?: PaginationOptions): Promise<T[]>;
4160
+
4161
+ /**
4162
+ * Build headers for SDK requests.
4163
+ * Merges base headers with per-request overrides and idempotency keys.
4164
+ */
4165
+ declare function buildHeaders(getHeaders: () => Record<string, string>, options?: RequestOptions): Record<string, string>;
4166
+ /**
4167
+ * RequestBuilder provides a type-safe way to execute SDK requests
4168
+ * with consistent header merging, error handling, retry, and unwrapping.
4169
+ */
4170
+ declare class RequestBuilder {
4171
+ private clientInstance;
4172
+ private getHeaders;
4173
+ private unwrap;
4174
+ private requestWithRetry;
4175
+ constructor(clientInstance: Client, getHeaders: () => Record<string, string>, unwrap: <T>(d: unknown) => T, requestWithRetry: <T>(fn: () => Promise<T>) => Promise<T>);
4176
+ /**
4177
+ * Execute a generated SDK function with full middleware pipeline.
4178
+ * Handles headers, retry, unwrapping, and error conversion.
4179
+ */
4180
+ execute<TResponse>(fn: (...args: any[]) => Promise<any>, params: Record<string, unknown>, options?: RequestOptions): Promise<TResponse>;
4181
+ /**
4182
+ * Execute a delete operation that returns true on success.
4183
+ */
4184
+ executeDelete(fn: (...args: any[]) => Promise<any>, params: Record<string, unknown>, options?: RequestOptions): Promise<true>;
4185
+ /**
4186
+ * Execute a raw GET request to a custom (non-generated) endpoint.
4187
+ * Used for endpoints implemented as custom Phoenix controllers.
4188
+ */
4189
+ rawGet<TResponse>(url: string, options?: RequestOptions): Promise<TResponse>;
4190
+ /**
4191
+ * Execute a raw multipart/form-data POST request.
4192
+ * Used for file upload endpoints (custom Phoenix controllers).
4193
+ * Content-Type is omitted from headers so the browser sets the correct
4194
+ * multipart boundary automatically from the FormData body.
4195
+ */
4196
+ rawPostMultipart<TResponse>(url: string, body: FormData, options?: RequestOptions): Promise<TResponse>;
4197
+ /**
4198
+ * Execute a raw POST request to a custom (non-generated) endpoint.
4199
+ * Used for endpoints implemented as custom Phoenix controllers.
4200
+ */
4201
+ rawPost<TResponse>(url: string, body?: unknown, options?: RequestOptions): Promise<TResponse>;
4202
+ /**
4203
+ * Create a paginated fetcher function for listAll operations.
4204
+ * Encapsulates the pattern of calling a generated SDK function with pagination params.
4205
+ *
4206
+ * @param fn - The generated SDK function (e.g., getAgents)
4207
+ * @param queryBuilder - Function that builds the query object with page params
4208
+ * @param options - Request options (headers, signal, etc.)
4209
+ * @returns A fetcher function for use with paginateToArray
4210
+ */
4211
+ createPaginatedFetcher<T>(fn: (...args: any[]) => Promise<any>, queryBuilder: (page: number, pageSize: number) => Record<string, unknown>, options?: RequestOptions): (page: number, pageSize: number) => Promise<PaginatedResponse<T>>;
4212
+ /**
4213
+ * Make a streaming POST request through the client instance,
4214
+ * ensuring all interceptors (auth, events, API version, etc.) fire.
4215
+ *
4216
+ * Uses the client's `post()` method with `parseAs: 'stream'` so the
4217
+ * request/response interceptors execute, then wraps the stream body
4218
+ * into an SSE message iterator.
4219
+ */
4220
+ streamRequest(url: string, body: unknown, options?: RequestOptions, streamOptions?: StreamOptions): Promise<AsyncIterableIterator<StreamMessageChunk>>;
4221
+ /**
4222
+ * Make a streaming GET request through the client instance.
4223
+ * Used for subscribing to SSE event streams (e.g., execution streaming).
4224
+ */
4225
+ streamGetRequest(url: string, options?: RequestOptions, streamOptions?: StreamOptions): Promise<AsyncIterableIterator<StreamMessageChunk>>;
4226
+ }
4227
+
4228
+ /**
4229
+ * Response from the voice transcription endpoint.
4230
+ * Not a JSON:API resource — this is a plain object response from the
4231
+ * custom VoiceTranscribeController.
4232
+ */
4233
+ interface VoiceTranscribeResult {
4234
+ transcript: string;
4235
+ language_detected: string;
4236
+ duration_seconds: number;
4237
+ processing_seconds: number;
4238
+ segments: Array<{
4239
+ text: string;
4240
+ start: number;
4241
+ end: number;
4242
+ confidence?: number;
4243
+ }>;
4244
+ phi_mode?: string;
4245
+ phi_entity_count?: number;
4246
+ /** Present when phi_mode is "tokenize". Contains token→original value mappings. */
4247
+ phi_map?: Record<string, string>;
4248
+ /** Advisory: "contains_plaintext_phi" when phi_map is returned in plaintext. */
4249
+ phi_map_sensitivity?: string;
4250
+ /** Present when phi_mode is "tokenize_encrypt". Base64-encoded ciphertext+tag. */
4251
+ phi_map_encrypted?: string;
4252
+ /** Present when phi_mode is "tokenize_encrypt". Base64-encoded 12-byte GCM nonce. */
4253
+ phi_map_nonce?: string;
4254
+ }
4255
+ /**
4256
+ * Voice namespace for transcription, TTS, and voice sessions.
4257
+ */
4258
+ declare function createVoiceNamespace(rb: RequestBuilder): {
4259
+ /**
4260
+ * Transcribe an audio file via the voice transcription endpoint.
4261
+ * Accepts File or Blob. Supported formats: mp3, ogg, wav, m4a, webm, flac, aac.
4262
+ *
4263
+ * @param audio - Audio file to transcribe (max 200 MB)
4264
+ * @param params - Optional transcription parameters
4265
+ * @param options - Request options (signal, headers, etc.)
4266
+ */
4267
+ transcribe: (audio: File | Blob, params?: {
4268
+ language?: string;
4269
+ modelSize?: "tiny" | "base" | "small" | "medium" | "large";
4270
+ phiMode?: "none" | "tokenize" | "tokenize_encrypt";
4271
+ /** Base64-encoded 32 bytes. Required when phiMode is not "none". */
4272
+ phiKey?: string;
4273
+ }, options?: RequestOptions) => Promise<VoiceTranscribeResult>;
4274
+ /**
4275
+ * Sessions — voice session management
4276
+ */
4277
+ sessions: {
4278
+ /** List voice sessions with pagination */
4279
+ list: (options?: {
4280
+ page?: number;
4281
+ pageSize?: number;
4282
+ } & RequestOptions) => Promise<VoiceSession[]>;
4283
+ /** Get a session by ID */
4284
+ get: (id: string, options?: RequestOptions) => Promise<VoiceSession>;
4285
+ /** List my voice sessions */
4286
+ listMine: (options?: {
4287
+ page?: number;
4288
+ pageSize?: number;
4289
+ } & RequestOptions) => Promise<VoiceSession[]>;
4290
+ /** List sessions by workspace */
4291
+ listByWorkspace: (workspaceId: string, options?: {
4292
+ page?: number;
4293
+ pageSize?: number;
4294
+ } & RequestOptions) => Promise<VoiceSession[]>;
4295
+ /**
4296
+ * Start a new voice session with LiveKit room provisioning.
4297
+ *
4298
+ * @param params - Session parameters
4299
+ * @param params.phiKey - AES-256 encryption key for PHI (Protected Health
4300
+ * Information), encoded as Base64 (32 raw bytes). Required when
4301
+ * `phiMode` is `"tokenize_encrypt"`.
4302
+ * @param options - Request options
4303
+ *
4304
+ * @remarks
4305
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
4306
+ * - Transmitted over HTTPS only — never send over plain HTTP.
4307
+ * - Do not log, store in `localStorage`, or include in error reports.
4308
+ * - Treat it with the same care as a password or private key.
4309
+ * - The server never persists this key; it is used only within the
4310
+ * lifetime of the request.
4311
+ */
4312
+ start: (params?: {
4313
+ threadId?: string;
4314
+ blueprintId?: string;
4315
+ blueprintMode?: "chat" | "extraction" | "both";
4316
+ phiMode?: "none" | "tokenize" | "tokenize_encrypt";
4317
+ phiKey?: string;
4318
+ patientId?: string;
4319
+ }, options?: RequestOptions) => Promise<VoiceSession>;
4320
+ /** End a voice session and release the LiveKit room */
4321
+ stop: (id: string, options?: RequestOptions) => Promise<VoiceSession>;
4322
+ /**
4323
+ * Dispatch the accumulated session transcript to the blueprint or chat
4324
+ * pipeline. The transcript may contain PHI (Protected Health Information)
4325
+ * depending on the session's `phiMode`.
4326
+ *
4327
+ * @param id - Voice session ID
4328
+ * @param params - Finalization parameters
4329
+ * @param params.phiKey - AES-256 encryption key for PHI, encoded as
4330
+ * Base64 (32 raw bytes). Overrides the key supplied at session start.
4331
+ * Required when `phiMode` is `"tokenize_encrypt"`.
4332
+ * @param options - Request options
4333
+ *
4334
+ * @remarks
4335
+ * **Security — transcript PHI:** The finalized transcript submitted to
4336
+ * this endpoint may contain Protected Health Information. Ensure the
4337
+ * request is made over HTTPS only.
4338
+ *
4339
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
4340
+ * - Transmitted over HTTPS only — never send over plain HTTP.
4341
+ * - Do not log, store in `localStorage`, or include in error reports.
4342
+ * - Treat it with the same care as a password or private key.
4343
+ * - The server never persists this key; it is used only within the
4344
+ * lifetime of the request.
4345
+ */
4346
+ finalize: (id: string, params?: {
4347
+ blueprintId?: string;
4348
+ phiMode?: "none" | "tokenize" | "tokenize_encrypt";
4349
+ phiKey?: string;
4350
+ patientId?: string;
4351
+ }, options?: RequestOptions) => Promise<VoiceSession>;
4352
+ };
4353
+ };
4354
+
4355
+ type OAuthProvider = "google" | "github" | "microsoft";
4356
+ interface OAuthSignInOptions {
4357
+ /** Application ID (app_id) — required to scope the OAuth flow to your ISV application */
4358
+ appId: string;
4359
+ /**
4360
+ * URL to redirect to after OAuth completes. Must be in your application's
4361
+ * allowed callback URLs. If omitted, uses the application's default callback URL.
4362
+ */
4363
+ redirectUrl?: string;
4364
+ }
4365
+ declare function createIdentityNamespace(rb: RequestBuilder, baseUrl?: string): {
4366
+ /** Login with email and password — returns a token object */
4367
+ login: (email: string, password: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4368
+ /** Register a new user account */
4369
+ register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4370
+ /** Get the currently authenticated user */
4371
+ me: (options?: RequestOptions) => Promise<User>;
4372
+ /** Get the current user profile (alias for me()) */
4373
+ profile: (options?: RequestOptions) => Promise<User>;
4374
+ list: (options?: {
4375
+ page?: number;
4376
+ pageSize?: number;
4377
+ } & RequestOptions) => Promise<User[]>;
4378
+ listAll: (options?: RequestOptions) => Promise<User[]>;
4379
+ get: (id: string, options?: RequestOptions) => Promise<User>;
4380
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<User>;
4381
+ /** Resend confirmation email to an unconfirmed user */
4382
+ resendConfirmation: (options?: RequestOptions) => Promise<User>;
4383
+ /** Confirm an email address using the token from the confirmation email */
4384
+ confirmEmail: (email: string, confirmationToken: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4385
+ /** Request a magic link sign-in email */
4386
+ requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4387
+ /**
4388
+ * Request a password reset email — always returns success to prevent email enumeration.
4389
+ * The user will receive an email with a reset token if the account exists.
4390
+ */
4391
+ requestPasswordReset: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4392
+ /** Sign in using a token from a magic link email */
4393
+ signInWithMagicLink: (token: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4394
+ /** Reset a password using the token from a password reset email */
4395
+ resetPasswordWithToken: (token: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4396
+ /** Change password for the currently authenticated user */
4397
+ changePassword: (currentPassword: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4398
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4399
+ tokens: {
4400
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Token>;
4401
+ };
4402
+ profiles: {
4403
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4404
+ list: (options?: {
4405
+ page?: number;
4406
+ pageSize?: number;
4407
+ } & RequestOptions) => Promise<UserProfile[]>;
4408
+ listAll: (options?: RequestOptions) => Promise<UserProfile[]>;
4409
+ get: (id: string, options?: RequestOptions) => Promise<UserProfile>;
4410
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<UserProfile>;
4411
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<UserProfile>;
4412
+ };
4413
+ /**
4414
+ * Social OAuth sign-in (Google, GitHub, Microsoft).
4415
+ *
4416
+ * This is a browser-redirect flow — the backend redirects the user's browser
4417
+ * to the provider, then back to your `redirectUrl` with `?token=JWT` appended.
4418
+ *
4419
+ * @example
4420
+ * ```typescript
4421
+ * // Get the URL and redirect manually
4422
+ * const url = client.identity.oauth.getAuthorizationUrl('google', {
4423
+ * appId: 'your-app-id',
4424
+ * redirectUrl: 'https://yourapp.com/auth/callback',
4425
+ * });
4426
+ * window.location.href = url;
4427
+ *
4428
+ * // Or use the convenience helper (browser only)
4429
+ * client.identity.oauth.signIn('google', {
4430
+ * appId: 'your-app-id',
4431
+ * redirectUrl: 'https://yourapp.com/auth/callback',
4432
+ * });
4433
+ *
4434
+ * // On your callback page, extract the token:
4435
+ * const token = new URLSearchParams(window.location.search).get('token');
4436
+ * ```
4437
+ */
4438
+ oauth: {
4439
+ /**
4440
+ * Build the authorization URL for the given OAuth provider.
4441
+ * Navigate the user's browser to this URL to begin the sign-in flow.
4442
+ */
4443
+ getAuthorizationUrl(provider: OAuthProvider, options: OAuthSignInOptions): string;
4444
+ /**
4445
+ * Redirect the browser to the OAuth sign-in page for the given provider.
4446
+ * Only works in browser environments (sets `window.location.href`).
4447
+ *
4448
+ * After the user authenticates, they are redirected back to `redirectUrl`
4449
+ * with a `?token=JWT` query parameter containing their session token.
4450
+ */
4451
+ signIn(provider: OAuthProvider, options: OAuthSignInOptions): void;
4452
+ };
4453
+ apiKeys: {
4454
+ list: (options?: {
4455
+ page?: number;
4456
+ pageSize?: number;
4457
+ } & RequestOptions) => Promise<ApiKey[]>;
4458
+ listAll: (options?: RequestOptions) => Promise<ApiKey[]>;
4459
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4460
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ApiKey>;
4461
+ create: (name: string, options?: RequestOptions) => Promise<ApiKey>;
4462
+ get: (id: string, options?: RequestOptions) => Promise<ApiKey>;
4463
+ /** Revoke an API key (permanently disables it) */
4464
+ revoke: (id: string, options?: RequestOptions) => Promise<ApiKey>;
4465
+ /** Rotate an API key (generates a new secret) */
4466
+ rotate: (id: string, options?: RequestOptions) => Promise<ApiKey>;
4467
+ /** Allocate credits to an API key */
4468
+ allocate: (id: string, amount: number, description: string, options?: RequestOptions) => Promise<ApiKey>;
4469
+ };
4470
+ };
4471
+
4472
+ /**
4473
+ * A single attribute filter predicate for server-side JSONB row filtering.
4474
+ * Operators: eq, not_eq, contains, in, lt, gt, not_null
4475
+ */
4476
+ interface AttributeFilter {
4477
+ /** The column name to filter on */
4478
+ field: string;
4479
+ /** Comparison operator */
4480
+ op: "eq" | "not_eq" | "contains" | "in" | "lt" | "gt" | "not_null";
4481
+ /** The comparison value. Not required for `not_null`. For `in`, must be an array. */
4482
+ value?: unknown;
4483
+ }
4484
+ /** Parameters for `results.query()` */
4485
+ interface ExtractionRowQueryParams {
4486
+ /** Filter predicates applied server-side (AND semantics). Empty array returns all rows. */
4487
+ filters: AttributeFilter[];
4488
+ /** Maximum rows to return. Defaults to 1000. Server enforces max 5000. */
4489
+ limit?: number;
4490
+ /** Zero-based row offset for pagination. Defaults to 0. */
4491
+ offset?: number;
4492
+ }
4493
+ /** Response from `results.query()` */
4494
+ interface ExtractionRowQueryResult {
4495
+ /** Matching rows (up to `limit` rows) */
4496
+ rows: Record<string, unknown>[];
4497
+ /** Total number of rows in the result (before filtering) */
4498
+ total: number;
4499
+ /** Number of rows that matched the filters */
4500
+ filtered: number;
4501
+ /** The effective limit used */
4502
+ limit: number;
4503
+ /** The effective offset used */
4504
+ offset: number;
4505
+ }
4506
+ declare function createExtractionNamespace(rb: RequestBuilder): {
4507
+ documents: {
4508
+ list: (options?: {
4509
+ page?: number;
4510
+ pageSize?: number;
4511
+ } & RequestOptions) => Promise<ExtractionDocument[]>;
4512
+ listAll: (options?: RequestOptions) => Promise<ExtractionDocument[]>;
4513
+ get: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4514
+ view: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4515
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4516
+ bulkDelete: (ids: string[], options?: RequestOptions) => Promise<Record<string, unknown>>;
4517
+ reprocess: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4518
+ bulkReprocess: (documentIds: string[], options?: RequestOptions) => Promise<Record<string, unknown>>;
4519
+ cancel: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4520
+ status: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4521
+ beginUpload: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
4522
+ /** Dedup-aware upload: returns existing document if file_hash matches, otherwise creates new */
4523
+ findOrBeginUpload: (attrs?: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
4524
+ finishUpload: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4525
+ stats: (options?: RequestOptions) => Promise<Record<string, unknown>>;
4526
+ dismiss: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4527
+ updateVerification: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
4528
+ dismissAllTrained: (workspaceId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4529
+ listByWorkspace: (workspaceId: string, options?: {
4530
+ page?: number;
4531
+ pageSize?: number;
4532
+ } & RequestOptions) => Promise<ExtractionDocument[]>;
4533
+ upload: (file: File | Blob, options?: RequestOptions) => Promise<ExtractionDocument>;
4534
+ presignedUpload: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4535
+ };
4536
+ results: {
4537
+ list: (options?: {
4538
+ page?: number;
4539
+ pageSize?: number;
4540
+ } & RequestOptions) => Promise<ExtractionResult[]>;
4541
+ listAll: (options?: RequestOptions) => Promise<ExtractionResult[]>;
4542
+ get: (id: string, options?: RequestOptions) => Promise<ExtractionResult>;
4543
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
4544
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4545
+ byDocument: (documentId: string, options?: RequestOptions) => Promise<ExtractionResult[]>;
4546
+ regenerate: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
4547
+ saveCorrections: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
4548
+ listByWorkspace: (workspaceId: string, options?: {
4549
+ page?: number;
4550
+ pageSize?: number;
4551
+ } & RequestOptions) => Promise<ExtractionResult[]>;
4552
+ /**
4553
+ * Query rows in an ExtractionResult server-side.
4554
+ *
4555
+ * Applies AttributeFilter predicates against the `rows` JSONB array
4556
+ * using a PostgreSQL lateral join. Suitable for datasets with 10K+ rows.
4557
+ * Empty `filters` array returns all rows (paginated by `limit`/`offset`).
4558
+ *
4559
+ * @example
4560
+ * const result = await client.extraction.results.query(resultId, {
4561
+ * filters: [
4562
+ * { field: 'wellness_score', op: 'gt', value: 75 },
4563
+ * { field: 'enrolled', op: 'eq', value: 'true' },
4564
+ * ],
4565
+ * limit: 100,
4566
+ * offset: 0,
4567
+ * });
4568
+ * console.log(`${result.filtered} of ${result.total} rows match`);
4569
+ */
4570
+ query: (resultId: string, params: ExtractionRowQueryParams, options?: RequestOptions) => Promise<ExtractionRowQueryResult>;
4571
+ };
4572
+ batches: {
4573
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionBatch>;
4574
+ get: (id: string, options?: RequestOptions) => Promise<ExtractionBatch>;
4575
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4576
+ listByWorkspace: (workspaceId: string, options?: {
4577
+ page?: number;
4578
+ pageSize?: number;
4579
+ } & RequestOptions) => Promise<ExtractionBatch[]>;
4580
+ };
4581
+ exports: {
4582
+ list: (workspaceId: string, options?: {
4583
+ page?: number;
4584
+ pageSize?: number;
4585
+ } & RequestOptions) => Promise<Record<string, unknown>[]>;
4586
+ create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4587
+ };
4588
+ schemaDiscoveries: {
4589
+ create: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4590
+ get: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4591
+ };
4592
+ fieldTemplates: {
4593
+ list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
4594
+ get: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4595
+ create: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4596
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4597
+ };
4598
+ fieldMappings: {
4599
+ get: (workspaceId: string, documentId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4600
+ create: (workspaceId: string, documentId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4601
+ };
4602
+ };
4603
+
4604
+ /**
4605
+ * GPT Core Client SDK
4606
+ *
4607
+ * The main entry point for interacting with the GPT Core API.
4608
+ * Provides a namespaced, type-safe interface for all API operations.
4609
+ *
4610
+ * @example
4611
+ * ```typescript
4612
+ * import { GptClient } from '@gpt-platform/client';
4613
+ *
4614
+ * const client = new GptClient({
4615
+ * baseUrl: 'https://api.gpt-core.com',
4616
+ * apiKey: 'sk_app_...',
4617
+ * });
4618
+ *
4619
+ * // Authentication
4620
+ * const user = await client.identity.me();
4621
+ *
4622
+ * // Workspaces
4623
+ * const workspaces = await client.platform.workspaces.mine();
4624
+ *
4625
+ * // AI Search
4626
+ * const results = await client.ai.search('quarterly earnings');
4627
+ *
4628
+ * // Documents
4629
+ * const docs = await client.extraction.documents.list();
4630
+ * ```
4631
+ */
4632
+ declare class GptClient extends BaseClient {
4633
+ /** Agent creation, versioning, training, and testing */
4634
+ readonly agents: {
4635
+ list: (options?: {
4636
+ page?: number;
4637
+ pageSize?: number;
4638
+ } & RequestOptions) => Promise<Agent[]>;
4639
+ listAll: (options?: RequestOptions) => Promise<Agent[]>;
4640
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4641
+ get: (id: string, options?: RequestOptions) => Promise<Agent>;
4642
+ create: (name: string, promptTemplate: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Agent>;
4643
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Agent>;
4644
+ test: (id: string, options?: RequestOptions) => Promise<Agent>;
4645
+ validate: (id: string, options?: RequestOptions) => Promise<Agent>;
4646
+ clone: (id: string, options?: RequestOptions) => Promise<Agent>;
4647
+ export: (id: string, options?: RequestOptions) => Promise<Agent>;
4648
+ analyzeTraining: (id: string, options?: RequestOptions) => Promise<Agent>;
4649
+ teach: (id: string, options?: RequestOptions) => Promise<Agent>;
4650
+ publishVersion: (id: string, options?: RequestOptions) => Promise<Agent>;
4651
+ restoreVersion: (id: string, options?: RequestOptions) => Promise<Agent>;
4652
+ stats: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4653
+ versions: {
4654
+ list: (options?: {
4655
+ page?: number;
4656
+ pageSize?: number;
4657
+ } & RequestOptions) => Promise<AgentVersion[]>;
4658
+ listAll: (options?: RequestOptions) => Promise<AgentVersion[]>;
4659
+ get: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
4660
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4661
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<AgentVersion>;
4662
+ addSystemField: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
4663
+ removeSystemField: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
4664
+ setSystemFields: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
4665
+ };
4666
+ training: {
4667
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4668
+ list: (options?: {
4669
+ page?: number;
4670
+ pageSize?: number;
4671
+ } & RequestOptions) => Promise<TrainingExample[]>;
4672
+ listAll: (options?: RequestOptions) => Promise<TrainingExample[]>;
4673
+ get: (id: string, options?: RequestOptions) => Promise<TrainingExample>;
4674
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
4675
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
4676
+ };
4677
+ };
4678
+ /** Semantic search, embeddings, and AI conversations */
4679
+ readonly ai: {
4680
+ search: (query: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4681
+ searchAdvanced: (query: string, params?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4682
+ embed: (text: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4683
+ conversations: {
4684
+ list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
4685
+ create: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4686
+ };
4687
+ messages: {
4688
+ list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
4689
+ stream: (conversationId: string, body: Record<string, unknown>, options?: RequestOptions, streamOptions?: StreamOptions) => Promise<AsyncIterableIterator<StreamMessageChunk>>;
4690
+ send: (_conversationId: string, body: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4691
+ };
4692
+ };
4693
+ /** Wallet, plans, transactions, and payment methods */
4694
+ readonly billing: {
4695
+ wallet: {
4696
+ get: (options?: RequestOptions) => Promise<Record<string, unknown>>;
4697
+ };
4698
+ plans: {
4699
+ list: (options?: {
4700
+ page?: number;
3792
4701
  pageSize?: number;
3793
4702
  } & RequestOptions) => Promise<Plan[]>;
3794
4703
  listAll: (options?: RequestOptions) => Promise<Plan[]>;
@@ -3797,9 +4706,7 @@ declare class GptClient extends BaseClient {
3797
4706
  transactions: {
3798
4707
  list: (options?: {
3799
4708
  page?: number;
3800
- pageSize
3801
- /** Notification logs, methods, and preferences */
3802
- ?: number;
4709
+ pageSize?: number;
3803
4710
  } & RequestOptions) => Promise<Transaction[]>;
3804
4711
  listAll: (options?: RequestOptions) => Promise<Transaction[]>;
3805
4712
  get: (id: string, options?: RequestOptions) => Promise<Transaction>;
@@ -3907,6 +4814,7 @@ declare class GptClient extends BaseClient {
3907
4814
  page?: number;
3908
4815
  pageSize?: number;
3909
4816
  } & RequestOptions) => Promise<ExtractionResult[]>;
4817
+ query: (resultId: string, params: ExtractionRowQueryParams, options?: RequestOptions) => Promise<ExtractionRowQueryResult>;
3910
4818
  };
3911
4819
  batches: {
3912
4820
  create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionBatch>;
@@ -3953,6 +4861,12 @@ declare class GptClient extends BaseClient {
3953
4861
  get: (id: string, options?: RequestOptions) => Promise<User>;
3954
4862
  create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<User>;
3955
4863
  resendConfirmation: (options?: RequestOptions) => Promise<User>;
4864
+ confirmEmail: (email: string, confirmationToken: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4865
+ requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4866
+ requestPasswordReset: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4867
+ signInWithMagicLink: (token: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4868
+ resetPasswordWithToken: (token: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4869
+ changePassword: (currentPassword: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
3956
4870
  delete: (id: string, options?: RequestOptions) => Promise<true>;
3957
4871
  tokens: {
3958
4872
  create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Token>;
@@ -3968,6 +4882,10 @@ declare class GptClient extends BaseClient {
3968
4882
  create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<UserProfile>;
3969
4883
  update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<UserProfile>;
3970
4884
  };
4885
+ oauth: {
4886
+ getAuthorizationUrl(provider: OAuthProvider, options: OAuthSignInOptions): string;
4887
+ signIn(provider: OAuthProvider, options: OAuthSignInOptions): void;
4888
+ };
3971
4889
  apiKeys: {
3972
4890
  list: (options?: {
3973
4891
  page?: number;
@@ -4043,6 +4961,75 @@ declare class GptClient extends BaseClient {
4043
4961
  create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
4044
4962
  update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
4045
4963
  };
4964
+ workspaceMembers: {
4965
+ list: (workspaceId: string, options?: {
4966
+ page?: number;
4967
+ pageSize?: number;
4968
+ } & RequestOptions) => Promise<WorkspaceMembership[]>;
4969
+ get: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<WorkspaceMembership>;
4970
+ create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
4971
+ update: (workspaceId: string, memberId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
4972
+ updateProfile: (workspaceId: string, memberId: string, profileAttrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
4973
+ remove: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<true>;
4974
+ };
4975
+ };
4976
+ /** Event types, scheduled events, bookings, participants, and calendar sync */
4977
+ readonly scheduling: {
4978
+ eventTypes: {
4979
+ list: (options?: {
4980
+ page?: number;
4981
+ pageSize?: number;
4982
+ } & RequestOptions) => Promise<SchedulingEventType[]>;
4983
+ listAll: (options?: RequestOptions) => Promise<SchedulingEventType[]>;
4984
+ get: (id: string, options?: RequestOptions) => Promise<SchedulingEventType>;
4985
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEventType>;
4986
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEventType>;
4987
+ };
4988
+ events: {
4989
+ list: (options?: {
4990
+ page?: number;
4991
+ pageSize?: number;
4992
+ } & RequestOptions) => Promise<SchedulingEvent[]>;
4993
+ listAll: (options?: RequestOptions) => Promise<SchedulingEvent[]>;
4994
+ get: (id: string, options?: RequestOptions) => Promise<SchedulingEvent>;
4995
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEvent>;
4996
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEvent>;
4997
+ };
4998
+ participants: {
4999
+ list: (options?: {
5000
+ page?: number;
5001
+ pageSize?: number;
5002
+ } & RequestOptions) => Promise<SchedulingParticipant[]>;
5003
+ listAll: (options?: RequestOptions) => Promise<SchedulingParticipant[]>;
5004
+ get: (id: string, options?: RequestOptions) => Promise<SchedulingParticipant>;
5005
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingParticipant>;
5006
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingParticipant>;
5007
+ };
5008
+ bookings: {
5009
+ list: (options?: {
5010
+ page?: number;
5011
+ pageSize?: number;
5012
+ } & RequestOptions) => Promise<SchedulingBooking[]>;
5013
+ listAll: (options?: RequestOptions) => Promise<SchedulingBooking[]>;
5014
+ get: (id: string, options?: RequestOptions) => Promise<SchedulingBooking>;
5015
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
5016
+ confirm: (id: string, options?: RequestOptions) => Promise<SchedulingBooking>;
5017
+ cancel: (id: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
5018
+ reschedule: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
5019
+ };
5020
+ calendarSyncs: {
5021
+ list: (options?: {
5022
+ page?: number;
5023
+ pageSize?: number;
5024
+ } & RequestOptions) => Promise<SchedulingCalendarSync[]>;
5025
+ listAll: (options?: RequestOptions) => Promise<SchedulingCalendarSync[]>;
5026
+ get: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
5027
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
5028
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
5029
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
5030
+ pause: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
5031
+ resume: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
5032
+ };
4046
5033
  };
4047
5034
  /** Full-text, semantic, and saved search operations */
4048
5035
  readonly search: {
@@ -4059,10 +5046,6 @@ declare class GptClient extends BaseClient {
4059
5046
  /** Bucket and object management, presigned URLs */
4060
5047
  readonly storage: {
4061
5048
  signUpload: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4062
- signDownload: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4063
- objects: {
4064
- list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
4065
- };
4066
5049
  buckets: {
4067
5050
  list: (options?: {
4068
5051
  page?: number;
@@ -4097,92 +5080,129 @@ declare class GptClient extends BaseClient {
4097
5080
  stream: (threadId: string, body: Record<string, unknown>, options?: RequestOptions, streamOptions?: StreamOptions) => Promise<AsyncIterableIterator<StreamMessageChunk>>;
4098
5081
  };
4099
5082
  };
4100
- /** Webhook configuration, testing, and delivery management */
4101
- readonly webhooks: {
4102
- configs: {
5083
+ /** Training examples and sessions */
5084
+ readonly training: {
5085
+ examples: {
4103
5086
  delete: (id: string, options?: RequestOptions) => Promise<true>;
4104
5087
  list: (options?: {
4105
5088
  page?: number;
4106
5089
  pageSize?: number;
4107
- } & RequestOptions) => Promise<WebhookConfig[]>;
4108
- listAll: (options?: RequestOptions) => Promise<WebhookConfig[]>;
4109
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookConfig>;
4110
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookConfig>;
4111
- test: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
4112
- bulkEnable: (options?: RequestOptions) => Promise<WebhookConfig>;
4113
- bulkDisable: (options?: RequestOptions) => Promise<WebhookConfig>;
4114
- replay: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
4115
- get: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
4116
- rotateSecret: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
5090
+ } & RequestOptions) => Promise<TrainingExample[]>;
5091
+ listAll: (options?: RequestOptions) => Promise<TrainingExample[]>;
5092
+ get: (id: string, options?: RequestOptions) => Promise<TrainingExample>;
5093
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
5094
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
5095
+ bulkCreate: (options?: RequestOptions) => Promise<TrainingExample>;
5096
+ bulkDestroy: (options?: RequestOptions) => Promise<TrainingExample>;
5097
+ searchByVector: (options?: RequestOptions) => Promise<TrainingExample>;
4117
5098
  };
4118
- deliveries: {
4119
- list: (options?: {
5099
+ sessions: {
5100
+ listAgentsSessions: (options?: {
4120
5101
  page?: number;
4121
5102
  pageSize?: number;
4122
- } & RequestOptions) => Promise<WebhookDelivery[]>;
4123
- listAll: (options?: RequestOptions) => Promise<WebhookDelivery[]>;
4124
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookDelivery>;
4125
- retry: (options?: RequestOptions) => Promise<WebhookDelivery>;
4126
- bulkRetry: (options?: RequestOptions) => Promise<WebhookDelivery>;
4127
- get: (id: string, options?: RequestOptions) => Promise<WebhookDelivery>;
5103
+ } & RequestOptions) => Promise<TrainingSession[]>;
5104
+ listAllAgentsSessions: (options?: RequestOptions) => Promise<TrainingSession[]>;
5105
+ get: (id: string, options?: RequestOptions) => Promise<TrainingSession>;
5106
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingSession>;
5107
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
5108
+ update: (agentId: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingSession>;
4128
5109
  };
4129
5110
  };
4130
- /** Event types, scheduled events, bookings, participants, and calendar sync */
4131
- readonly scheduling: {
4132
- eventTypes: {
5111
+ /** Voice transcription, TTS, and real-time voice session management */
5112
+ readonly voice: {
5113
+ transcribe: (audio: File | Blob, params?: {
5114
+ language?: string;
5115
+ modelSize?: "tiny" | "base" | "small" | "medium" | "large";
5116
+ phiMode?: "none" | "tokenize" | "tokenize_encrypt";
5117
+ phiKey?: string;
5118
+ }, options?: RequestOptions) => Promise<VoiceTranscribeResult>;
5119
+ sessions: {
4133
5120
  list: (options?: {
4134
5121
  page?: number;
4135
5122
  pageSize?: number;
4136
- } & RequestOptions) => Promise<SchedulingEventType[]>;
4137
- listAll: (options?: RequestOptions) => Promise<SchedulingEventType[]>;
4138
- get: (id: string, options?: RequestOptions) => Promise<SchedulingEventType>;
4139
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEventType>;
4140
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEventType>;
5123
+ } & RequestOptions) => Promise<VoiceSession[]>;
5124
+ get: (id: string, options?: RequestOptions) => Promise<VoiceSession>;
5125
+ listMine: (options?: {
5126
+ page?: number;
5127
+ pageSize?: number;
5128
+ } & RequestOptions) => Promise<VoiceSession[]>;
5129
+ listByWorkspace: (workspaceId: string, options?: {
5130
+ page?: number;
5131
+ pageSize?: number;
5132
+ } & RequestOptions) => Promise<VoiceSession[]>;
5133
+ start: (params?: {
5134
+ threadId?: string;
5135
+ blueprintId?: string;
5136
+ blueprintMode?: "chat" | "extraction" | "both";
5137
+ phiMode?: "none" | "tokenize" | "tokenize_encrypt";
5138
+ phiKey?: string;
5139
+ patientId?: string;
5140
+ }, options?: RequestOptions) => Promise<VoiceSession>;
5141
+ stop: (id: string, options?: RequestOptions) => Promise<VoiceSession>;
5142
+ finalize: (id: string, params?: {
5143
+ blueprintId?: string;
5144
+ phiMode?: "none" | "tokenize" | "tokenize_encrypt";
5145
+ phiKey?: string;
5146
+ patientId?: string;
5147
+ }, options?: RequestOptions) => Promise<VoiceSession>;
4141
5148
  };
4142
- events: {
5149
+ };
5150
+ /** File watcher claims and event management */
5151
+ readonly watcher: {
5152
+ claims: {
4143
5153
  list: (options?: {
4144
5154
  page?: number;
4145
5155
  pageSize?: number;
4146
- } & RequestOptions) => Promise<SchedulingEvent[]>;
4147
- listAll: (options?: RequestOptions) => Promise<SchedulingEvent[]>;
4148
- get: (id: string, options?: RequestOptions) => Promise<SchedulingEvent>;
4149
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEvent>;
4150
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEvent>;
5156
+ } & RequestOptions) => Promise<WatcherClaim[]>;
5157
+ listAll: (options?: RequestOptions) => Promise<WatcherClaim[]>;
5158
+ claim: (options?: RequestOptions) => Promise<WatcherClaim>;
5159
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WatcherClaim>;
5160
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WatcherClaim>;
5161
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
5162
+ registerCompleted: (options?: RequestOptions) => Promise<WatcherClaim>;
5163
+ readStatus: (options?: RequestOptions) => Promise<WatcherClaim>;
5164
+ get: (id: string, options?: RequestOptions) => Promise<WatcherClaim>;
4151
5165
  };
4152
- participants: {
5166
+ events: {
5167
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WatcherEvent>;
4153
5168
  list: (options?: {
4154
5169
  page?: number;
4155
5170
  pageSize?: number;
4156
- } & RequestOptions) => Promise<SchedulingParticipant[]>;
4157
- listAll: (options?: RequestOptions) => Promise<SchedulingParticipant[]>;
4158
- get: (id: string, options?: RequestOptions) => Promise<SchedulingParticipant>;
4159
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingParticipant>;
4160
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingParticipant>;
5171
+ } & RequestOptions) => Promise<WatcherEvent[]>;
5172
+ listAll: (options?: RequestOptions) => Promise<WatcherEvent[]>;
5173
+ delete: (options?: RequestOptions) => Promise<true>;
5174
+ batchCreate: (options?: RequestOptions) => Promise<WatcherEvent>;
5175
+ get: (id: string, options?: RequestOptions) => Promise<WatcherEvent>;
4161
5176
  };
4162
- bookings: {
5177
+ };
5178
+ /** Webhook configuration, testing, and delivery management */
5179
+ readonly webhooks: {
5180
+ configs: {
5181
+ delete: (id: string, options?: RequestOptions) => Promise<true>;
4163
5182
  list: (options?: {
4164
5183
  page?: number;
4165
5184
  pageSize?: number;
4166
- } & RequestOptions) => Promise<SchedulingBooking[]>;
4167
- listAll: (options?: RequestOptions) => Promise<SchedulingBooking[]>;
4168
- get: (id: string, options?: RequestOptions) => Promise<SchedulingBooking>;
4169
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
4170
- confirm: (id: string, options?: RequestOptions) => Promise<SchedulingBooking>;
4171
- cancel: (id: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
4172
- reschedule: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
5185
+ } & RequestOptions) => Promise<WebhookConfig[]>;
5186
+ listAll: (options?: RequestOptions) => Promise<WebhookConfig[]>;
5187
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookConfig>;
5188
+ update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookConfig>;
5189
+ test: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
5190
+ bulkEnable: (options?: RequestOptions) => Promise<WebhookConfig>;
5191
+ bulkDisable: (options?: RequestOptions) => Promise<WebhookConfig>;
5192
+ replay: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
5193
+ get: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
5194
+ rotateSecret: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
4173
5195
  };
4174
- calendarSyncs: {
5196
+ deliveries: {
4175
5197
  list: (options?: {
4176
5198
  page?: number;
4177
5199
  pageSize?: number;
4178
- } & RequestOptions) => Promise<SchedulingCalendarSync[]>;
4179
- listAll: (options?: RequestOptions) => Promise<SchedulingCalendarSync[]>;
4180
- get: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
4181
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
4182
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
4183
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4184
- pause: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
4185
- resume: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
5200
+ } & RequestOptions) => Promise<WebhookDelivery[]>;
5201
+ listAll: (options?: RequestOptions) => Promise<WebhookDelivery[]>;
5202
+ create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookDelivery>;
5203
+ retry: (options?: RequestOptions) => Promise<WebhookDelivery>;
5204
+ bulkRetry: (options?: RequestOptions) => Promise<WebhookDelivery>;
5205
+ get: (id: string, options?: RequestOptions) => Promise<WebhookDelivery>;
4186
5206
  };
4187
5207
  };
4188
5208
  constructor(config?: BaseClientConfig);
@@ -4211,123 +5231,6 @@ declare class GptClient extends BaseClient {
4211
5231
  on<K extends keyof SdkEvents>(event: K, handler: (event: SdkEvents[K]) => void): () => void;
4212
5232
  }
4213
5233
 
4214
- /**
4215
- * JSON:API pagination links
4216
- */
4217
- interface PaginationLinks {
4218
- self?: string;
4219
- first?: string;
4220
- last?: string;
4221
- prev?: string | null;
4222
- next?: string | null;
4223
- }
4224
- /**
4225
- * JSON:API response with pagination
4226
- */
4227
- interface PaginatedResponse<T> {
4228
- data: T[];
4229
- links?: PaginationLinks;
4230
- meta?: {
4231
- total_count?: number;
4232
- page_count?: number;
4233
- current_page?: number;
4234
- };
4235
- }
4236
- /**
4237
- * Options for paginated requests
4238
- */
4239
- interface PaginationOptions {
4240
- /**
4241
- * Page size (number of items per page)
4242
- */
4243
- pageSize?: number;
4244
- /**
4245
- * Maximum total items to fetch (default: unlimited for paginateAll, 10000 for paginateToArray)
4246
- */
4247
- limit?: number;
4248
- /**
4249
- * Maximum number of pages to fetch (default: 500)
4250
- * Safety limit to prevent infinite pagination loops
4251
- */
4252
- maxPages?: number;
4253
- /**
4254
- * Optional logger for warnings. If not provided, falls back to console.
4255
- */
4256
- logger?: {
4257
- warn: (...args: unknown[]) => void;
4258
- };
4259
- }
4260
- /**
4261
- * Async iterator for paginated results.
4262
- * Security: Enforces max pages limit to prevent infinite pagination loops.
4263
- */
4264
- declare function paginateAll<T>(fetcher: (page: number, pageSize: number) => Promise<PaginatedResponse<T>>, options?: PaginationOptions): AsyncIterableIterator<T>;
4265
- /**
4266
- * Helper to collect all paginated results into an array
4267
- * Security: Enforces default limit to prevent DoS via infinite pagination
4268
- */
4269
- declare function paginateToArray<T>(fetcher: (page: number, pageSize: number) => Promise<PaginatedResponse<T>>, options?: PaginationOptions): Promise<T[]>;
4270
-
4271
- /**
4272
- * Build headers for SDK requests.
4273
- * Merges base headers with per-request overrides and idempotency keys.
4274
- */
4275
- declare function buildHeaders(getHeaders: () => Record<string, string>, options?: RequestOptions): Record<string, string>;
4276
- /**
4277
- * RequestBuilder provides a type-safe way to execute SDK requests
4278
- * with consistent header merging, error handling, retry, and unwrapping.
4279
- */
4280
- declare class RequestBuilder {
4281
- private clientInstance;
4282
- private getHeaders;
4283
- private unwrap;
4284
- private requestWithRetry;
4285
- constructor(clientInstance: Client, getHeaders: () => Record<string, string>, unwrap: <T>(d: unknown) => T, requestWithRetry: <T>(fn: () => Promise<T>) => Promise<T>);
4286
- /**
4287
- * Execute a generated SDK function with full middleware pipeline.
4288
- * Handles headers, retry, unwrapping, and error conversion.
4289
- */
4290
- execute<TResponse>(fn: (...args: any[]) => Promise<any>, params: Record<string, unknown>, options?: RequestOptions): Promise<TResponse>;
4291
- /**
4292
- * Execute a delete operation that returns true on success.
4293
- */
4294
- executeDelete(fn: (...args: any[]) => Promise<any>, params: Record<string, unknown>, options?: RequestOptions): Promise<true>;
4295
- /**
4296
- * Execute a raw GET request to a custom (non-generated) endpoint.
4297
- * Used for endpoints implemented as custom Phoenix controllers.
4298
- */
4299
- rawGet<TResponse>(url: string, options?: RequestOptions): Promise<TResponse>;
4300
- /**
4301
- * Execute a raw POST request to a custom (non-generated) endpoint.
4302
- * Used for endpoints implemented as custom Phoenix controllers.
4303
- */
4304
- rawPost<TResponse>(url: string, body?: unknown, options?: RequestOptions): Promise<TResponse>;
4305
- /**
4306
- * Create a paginated fetcher function for listAll operations.
4307
- * Encapsulates the pattern of calling a generated SDK function with pagination params.
4308
- *
4309
- * @param fn - The generated SDK function (e.g., getAgents)
4310
- * @param queryBuilder - Function that builds the query object with page params
4311
- * @param options - Request options (headers, signal, etc.)
4312
- * @returns A fetcher function for use with paginateToArray
4313
- */
4314
- createPaginatedFetcher<T>(fn: (...args: any[]) => Promise<any>, queryBuilder: (page: number, pageSize: number) => Record<string, unknown>, options?: RequestOptions): (page: number, pageSize: number) => Promise<PaginatedResponse<T>>;
4315
- /**
4316
- * Make a streaming POST request through the client instance,
4317
- * ensuring all interceptors (auth, events, API version, etc.) fire.
4318
- *
4319
- * Uses the client's `post()` method with `parseAs: 'stream'` so the
4320
- * request/response interceptors execute, then wraps the stream body
4321
- * into an SSE message iterator.
4322
- */
4323
- streamRequest(url: string, body: unknown, options?: RequestOptions, streamOptions?: StreamOptions): Promise<AsyncIterableIterator<StreamMessageChunk>>;
4324
- /**
4325
- * Make a streaming GET request through the client instance.
4326
- * Used for subscribing to SSE event streams (e.g., execution streaming).
4327
- */
4328
- streamGetRequest(url: string, options?: RequestOptions, streamOptions?: StreamOptions): Promise<AsyncIterableIterator<StreamMessageChunk>>;
4329
- }
4330
-
4331
5234
  /**
4332
5235
  * Webhook signature verification for GPT Core webhooks.
4333
5236
  *
@@ -4463,137 +5366,6 @@ declare function createSearchNamespace(rb: RequestBuilder): {
4463
5366
  };
4464
5367
  };
4465
5368
 
4466
- declare function createIdentityNamespace(rb: RequestBuilder): {
4467
- /** Login with email and password — returns a token object */
4468
- login: (email: string, password: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4469
- /** Register a new user account */
4470
- register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4471
- /** Get the currently authenticated user */
4472
- me: (options?: RequestOptions) => Promise<User>;
4473
- /** Get the current user profile (alias for me()) */
4474
- profile: (options?: RequestOptions) => Promise<User>;
4475
- list: (options?: {
4476
- page?: number;
4477
- pageSize?: number;
4478
- } & RequestOptions) => Promise<User[]>;
4479
- listAll: (options?: RequestOptions) => Promise<User[]>;
4480
- get: (id: string, options?: RequestOptions) => Promise<User>;
4481
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<User>;
4482
- /** Resend confirmation email to an unconfirmed user */
4483
- resendConfirmation: (options?: RequestOptions) => Promise<User>;
4484
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4485
- tokens: {
4486
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Token>;
4487
- };
4488
- profiles: {
4489
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4490
- list: (options?: {
4491
- page?: number;
4492
- pageSize?: number;
4493
- } & RequestOptions) => Promise<UserProfile[]>;
4494
- listAll: (options?: RequestOptions) => Promise<UserProfile[]>;
4495
- get: (id: string, options?: RequestOptions) => Promise<UserProfile>;
4496
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<UserProfile>;
4497
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<UserProfile>;
4498
- };
4499
- apiKeys: {
4500
- list: (options?: {
4501
- page?: number;
4502
- pageSize?: number;
4503
- } & RequestOptions) => Promise<ApiKey[]>;
4504
- listAll: (options?: RequestOptions) => Promise<ApiKey[]>;
4505
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4506
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ApiKey>;
4507
- create: (name: string, options?: RequestOptions) => Promise<ApiKey>;
4508
- get: (id: string, options?: RequestOptions) => Promise<ApiKey>;
4509
- /** Revoke an API key (permanently disables it) */
4510
- revoke: (id: string, options?: RequestOptions) => Promise<ApiKey>;
4511
- /** Rotate an API key (generates a new secret) */
4512
- rotate: (id: string, options?: RequestOptions) => Promise<ApiKey>;
4513
- /** Allocate credits to an API key */
4514
- allocate: (id: string, amount: number, description: string, options?: RequestOptions) => Promise<ApiKey>;
4515
- };
4516
- };
4517
-
4518
- declare function createExtractionNamespace(rb: RequestBuilder): {
4519
- documents: {
4520
- list: (options?: {
4521
- page?: number;
4522
- pageSize?: number;
4523
- } & RequestOptions) => Promise<ExtractionDocument[]>;
4524
- listAll: (options?: RequestOptions) => Promise<ExtractionDocument[]>;
4525
- get: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4526
- view: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4527
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4528
- bulkDelete: (ids: string[], options?: RequestOptions) => Promise<Record<string, unknown>>;
4529
- reprocess: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4530
- bulkReprocess: (documentIds: string[], options?: RequestOptions) => Promise<Record<string, unknown>>;
4531
- cancel: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4532
- status: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4533
- beginUpload: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
4534
- /** Dedup-aware upload: returns existing document if file_hash matches, otherwise creates new */
4535
- findOrBeginUpload: (attrs?: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
4536
- finishUpload: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4537
- stats: (options?: RequestOptions) => Promise<Record<string, unknown>>;
4538
- dismiss: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
4539
- updateVerification: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
4540
- dismissAllTrained: (workspaceId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4541
- listByWorkspace: (workspaceId: string, options?: {
4542
- page?: number;
4543
- pageSize?: number;
4544
- } & RequestOptions) => Promise<ExtractionDocument[]>;
4545
- upload: (file: File | Blob, options?: RequestOptions) => Promise<ExtractionDocument>;
4546
- presignedUpload: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4547
- };
4548
- results: {
4549
- list: (options?: {
4550
- page?: number;
4551
- pageSize?: number;
4552
- } & RequestOptions) => Promise<ExtractionResult[]>;
4553
- listAll: (options?: RequestOptions) => Promise<ExtractionResult[]>;
4554
- get: (id: string, options?: RequestOptions) => Promise<ExtractionResult>;
4555
- update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
4556
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4557
- byDocument: (documentId: string, options?: RequestOptions) => Promise<ExtractionResult[]>;
4558
- regenerate: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
4559
- saveCorrections: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
4560
- listByWorkspace: (workspaceId: string, options?: {
4561
- page?: number;
4562
- pageSize?: number;
4563
- } & RequestOptions) => Promise<ExtractionResult[]>;
4564
- };
4565
- batches: {
4566
- create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionBatch>;
4567
- get: (id: string, options?: RequestOptions) => Promise<ExtractionBatch>;
4568
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4569
- listByWorkspace: (workspaceId: string, options?: {
4570
- page?: number;
4571
- pageSize?: number;
4572
- } & RequestOptions) => Promise<ExtractionBatch[]>;
4573
- };
4574
- exports: {
4575
- list: (workspaceId: string, options?: {
4576
- page?: number;
4577
- pageSize?: number;
4578
- } & RequestOptions) => Promise<Record<string, unknown>[]>;
4579
- create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4580
- };
4581
- schemaDiscoveries: {
4582
- create: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4583
- get: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4584
- };
4585
- fieldTemplates: {
4586
- list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
4587
- get: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4588
- create: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4589
- delete: (id: string, options?: RequestOptions) => Promise<true>;
4590
- };
4591
- fieldMappings: {
4592
- get: (workspaceId: string, documentId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
4593
- create: (workspaceId: string, documentId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4594
- };
4595
- };
4596
-
4597
5369
  declare function createBillingNamespace(rb: RequestBuilder): {
4598
5370
  wallet: {
4599
5371
  /** Get the current workspace wallet balance and details */
@@ -4733,12 +5505,6 @@ declare function createAgentsNamespace(rb: RequestBuilder): {
4733
5505
  declare function createStorageNamespace(rb: RequestBuilder): {
4734
5506
  /** Generate a presigned upload URL for direct-to-storage uploads */
4735
5507
  signUpload: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4736
- /** Generate a presigned download URL for accessing stored objects */
4737
- signDownload: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
4738
- objects: {
4739
- /** List storage objects */
4740
- list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
4741
- };
4742
5508
  buckets: {
4743
5509
  list: (options?: {
4744
5510
  page?: number;
@@ -4843,6 +5609,23 @@ declare function createPlatformNamespace(rb: RequestBuilder): {
4843
5609
  create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
4844
5610
  update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
4845
5611
  };
5612
+ workspaceMembers: {
5613
+ /** List members of a workspace */
5614
+ list: (workspaceId: string, options?: {
5615
+ page?: number;
5616
+ pageSize?: number;
5617
+ } & RequestOptions) => Promise<WorkspaceMembership[]>;
5618
+ /** Get a specific workspace member by workspace and user ID */
5619
+ get: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<WorkspaceMembership>;
5620
+ /** Add a user to a workspace */
5621
+ create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
5622
+ /** Update workspace member permissions or role */
5623
+ update: (workspaceId: string, memberId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
5624
+ /** Update workspace member profile attributes (G9) */
5625
+ updateProfile: (workspaceId: string, memberId: string, profileAttrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
5626
+ /** Remove a user from a workspace */
5627
+ remove: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<true>;
5628
+ };
4846
5629
  };
4847
5630
 
4848
5631
  declare function createWebhooksNamespace(rb: RequestBuilder): {
@@ -5032,5 +5815,6 @@ type AiAPI = ReturnType<typeof createAiNamespace>;
5032
5815
  type PlatformAPI = ReturnType<typeof createPlatformNamespace>;
5033
5816
  type WebhooksAPI = ReturnType<typeof createWebhooksNamespace>;
5034
5817
  type SchedulingAPI = ReturnType<typeof createSchedulingNamespace>;
5818
+ type VoiceAPI = ReturnType<typeof createVoiceNamespace>;
5035
5819
 
5036
- export { API_KEY_PREFIXES, type AgentsAPI, type AiAPI, type ApiKey, type AppInfo, AuthenticationError, AuthorizationError, type BaseClientConfig, type BillingAPI, BrowserApiKeyError, type CommunicationAPI, ConflictError, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type ExtractionAPI, GptClient, GptCoreError, type IdentityAPI, InsecureConnectionError, LOG_LEVELS, type LogLevel, type Logger, NetworkError, NotFoundError, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PlatformAPI, RateLimitError, RequestBuilder, type RequestOptions, type RetryConfig, RetryTimeoutError, SDK_VERSION, type SchedulingAPI, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SecurityConfig, ServerError, type StorageAPI, type StreamMessageChunk, type StreamOptions, type Tenant, type ThreadsAPI, TimeoutError, type User, ValidationError, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
5820
+ export { API_KEY_PREFIXES, type AgentsAPI, type AiAPI, type ApiKey, type AppInfo, AuthenticationError, AuthorizationError, type BaseClientConfig, type BillingAPI, BrowserApiKeyError, type CommunicationAPI, ConflictError, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type ExtractionAPI, GptClient, GptCoreError, type IdentityAPI, InsecureConnectionError, LOG_LEVELS, type LogLevel, type Logger, NetworkError, NotFoundError, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PlatformAPI, RateLimitError, RequestBuilder, type RequestOptions, type RetryConfig, RetryTimeoutError, SDK_VERSION, type SchedulingAPI, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SecurityConfig, ServerError, type StorageAPI, type StreamMessageChunk, type StreamOptions, type Tenant, type ThreadsAPI, TimeoutError, type User, ValidationError, type VoiceAPI, type VoiceTranscribeResult, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };