@gpt-platform/client 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1187 -457
- package/dist/index.d.ts +1187 -457
- package/dist/index.js +1133 -304
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1133 -304
- package/dist/index.mjs.map +1 -1
- package/llms.txt +44 -10
- package/package.json +1 -1
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
|
|
2300
|
+
* A "Resource object" representing a voice_session
|
|
2117
2301
|
*/
|
|
2118
|
-
type
|
|
2302
|
+
type VoiceSession = {
|
|
2119
2303
|
/**
|
|
2120
|
-
* An attributes object for a
|
|
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
|
-
|
|
2310
|
+
agent_id?: string | null | unknown;
|
|
2127
2311
|
/**
|
|
2128
2312
|
* Field included by default.
|
|
2129
2313
|
*/
|
|
2130
|
-
|
|
2314
|
+
duration_seconds?: number | null | unknown;
|
|
2131
2315
|
/**
|
|
2132
2316
|
* Field included by default.
|
|
2133
2317
|
*/
|
|
2134
|
-
|
|
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
|
-
|
|
2322
|
+
finalized_at?: unknown;
|
|
2139
2323
|
/**
|
|
2140
2324
|
* Field included by default.
|
|
2141
2325
|
*/
|
|
2142
|
-
|
|
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
|
-
|
|
2330
|
+
livekit_room?: string | null | unknown;
|
|
2147
2331
|
/**
|
|
2148
|
-
*
|
|
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
|
-
|
|
2341
|
+
livekit_token?: string | null | unknown;
|
|
2151
2342
|
/**
|
|
2152
2343
|
* Field included by default.
|
|
2153
2344
|
*/
|
|
2154
|
-
|
|
2345
|
+
metadata?: {
|
|
2346
|
+
[key: string]: unknown;
|
|
2347
|
+
} | null | unknown;
|
|
2155
2348
|
/**
|
|
2156
2349
|
* Field included by default.
|
|
2157
2350
|
*/
|
|
2158
|
-
|
|
2351
|
+
session_type: "push_to_talk" | "bidirectional" | "telephony";
|
|
2159
2352
|
/**
|
|
2160
2353
|
* Field included by default.
|
|
2161
2354
|
*/
|
|
2162
|
-
|
|
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
|
-
|
|
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
|
|
2514
|
+
* A "Resource object" representing a workspace-membership
|
|
2240
2515
|
*/
|
|
2241
|
-
type
|
|
2516
|
+
type WorkspaceMembership = {
|
|
2242
2517
|
/**
|
|
2243
|
-
* An attributes object for a
|
|
2518
|
+
* An attributes object for a workspace-membership
|
|
2244
2519
|
*/
|
|
2245
2520
|
attributes?: {
|
|
2246
2521
|
/**
|
|
2247
2522
|
* Field included by default.
|
|
2248
2523
|
*/
|
|
2249
|
-
|
|
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
|
-
|
|
2254
|
-
storage_used?: number | null | unknown;
|
|
2555
|
+
updated_at: unknown;
|
|
2255
2556
|
/**
|
|
2256
2557
|
* Field included by default.
|
|
2257
2558
|
*/
|
|
2258
|
-
|
|
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
|
|
2567
|
+
* A relationships object for a workspace-membership
|
|
2263
2568
|
*/
|
|
2264
2569
|
relationships?: {
|
|
2265
|
-
|
|
2570
|
+
user?: {
|
|
2266
2571
|
/**
|
|
2267
|
-
*
|
|
2572
|
+
* An identifier for user
|
|
2268
2573
|
*/
|
|
2269
|
-
data?:
|
|
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.
|
|
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
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
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.0";
|
|
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
|
-
*
|
|
3618
|
-
*
|
|
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,536 @@ declare abstract class BaseClient {
|
|
|
3693
4051
|
}
|
|
3694
4052
|
|
|
3695
4053
|
/**
|
|
3696
|
-
*
|
|
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
|
-
|
|
3724
|
-
/**
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
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
|
+
/**
|
|
4356
|
+
* A single attribute filter predicate for server-side JSONB row filtering.
|
|
4357
|
+
* Operators: eq, not_eq, contains, in, lt, gt, not_null
|
|
4358
|
+
*/
|
|
4359
|
+
interface AttributeFilter {
|
|
4360
|
+
/** The column name to filter on */
|
|
4361
|
+
field: string;
|
|
4362
|
+
/** Comparison operator */
|
|
4363
|
+
op: "eq" | "not_eq" | "contains" | "in" | "lt" | "gt" | "not_null";
|
|
4364
|
+
/** The comparison value. Not required for `not_null`. For `in`, must be an array. */
|
|
4365
|
+
value?: unknown;
|
|
4366
|
+
}
|
|
4367
|
+
/** Parameters for `results.query()` */
|
|
4368
|
+
interface ExtractionRowQueryParams {
|
|
4369
|
+
/** Filter predicates applied server-side (AND semantics). Empty array returns all rows. */
|
|
4370
|
+
filters: AttributeFilter[];
|
|
4371
|
+
/** Maximum rows to return. Defaults to 1000. Server enforces max 5000. */
|
|
4372
|
+
limit?: number;
|
|
4373
|
+
/** Zero-based row offset for pagination. Defaults to 0. */
|
|
4374
|
+
offset?: number;
|
|
4375
|
+
}
|
|
4376
|
+
/** Response from `results.query()` */
|
|
4377
|
+
interface ExtractionRowQueryResult {
|
|
4378
|
+
/** Matching rows (up to `limit` rows) */
|
|
4379
|
+
rows: Record<string, unknown>[];
|
|
4380
|
+
/** Total number of rows in the result (before filtering) */
|
|
4381
|
+
total: number;
|
|
4382
|
+
/** Number of rows that matched the filters */
|
|
4383
|
+
filtered: number;
|
|
4384
|
+
/** The effective limit used */
|
|
4385
|
+
limit: number;
|
|
4386
|
+
/** The effective offset used */
|
|
4387
|
+
offset: number;
|
|
4388
|
+
}
|
|
4389
|
+
declare function createExtractionNamespace(rb: RequestBuilder): {
|
|
4390
|
+
documents: {
|
|
4391
|
+
list: (options?: {
|
|
4392
|
+
page?: number;
|
|
4393
|
+
pageSize?: number;
|
|
4394
|
+
} & RequestOptions) => Promise<ExtractionDocument[]>;
|
|
4395
|
+
listAll: (options?: RequestOptions) => Promise<ExtractionDocument[]>;
|
|
4396
|
+
get: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4397
|
+
view: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4398
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4399
|
+
bulkDelete: (ids: string[], options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4400
|
+
reprocess: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4401
|
+
bulkReprocess: (documentIds: string[], options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4402
|
+
cancel: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4403
|
+
status: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4404
|
+
beginUpload: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4405
|
+
/** Dedup-aware upload: returns existing document if file_hash matches, otherwise creates new */
|
|
4406
|
+
findOrBeginUpload: (attrs?: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4407
|
+
finishUpload: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4408
|
+
stats: (options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4409
|
+
dismiss: (id: string, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4410
|
+
updateVerification: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4411
|
+
dismissAllTrained: (workspaceId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4412
|
+
listByWorkspace: (workspaceId: string, options?: {
|
|
4413
|
+
page?: number;
|
|
4414
|
+
pageSize?: number;
|
|
4415
|
+
} & RequestOptions) => Promise<ExtractionDocument[]>;
|
|
4416
|
+
upload: (file: File | Blob, options?: RequestOptions) => Promise<ExtractionDocument>;
|
|
4417
|
+
presignedUpload: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4418
|
+
};
|
|
4419
|
+
results: {
|
|
4420
|
+
list: (options?: {
|
|
4421
|
+
page?: number;
|
|
4422
|
+
pageSize?: number;
|
|
4423
|
+
} & RequestOptions) => Promise<ExtractionResult[]>;
|
|
4424
|
+
listAll: (options?: RequestOptions) => Promise<ExtractionResult[]>;
|
|
4425
|
+
get: (id: string, options?: RequestOptions) => Promise<ExtractionResult>;
|
|
4426
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
|
|
4427
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4428
|
+
byDocument: (documentId: string, options?: RequestOptions) => Promise<ExtractionResult[]>;
|
|
4429
|
+
regenerate: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
|
|
4430
|
+
saveCorrections: (id: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionResult>;
|
|
4431
|
+
listByWorkspace: (workspaceId: string, options?: {
|
|
4432
|
+
page?: number;
|
|
4433
|
+
pageSize?: number;
|
|
4434
|
+
} & RequestOptions) => Promise<ExtractionResult[]>;
|
|
4435
|
+
/**
|
|
4436
|
+
* Query rows in an ExtractionResult server-side.
|
|
4437
|
+
*
|
|
4438
|
+
* Applies AttributeFilter predicates against the `rows` JSONB array
|
|
4439
|
+
* using a PostgreSQL lateral join. Suitable for datasets with 10K+ rows.
|
|
4440
|
+
* Empty `filters` array returns all rows (paginated by `limit`/`offset`).
|
|
4441
|
+
*
|
|
4442
|
+
* @example
|
|
4443
|
+
* const result = await client.extraction.results.query(resultId, {
|
|
4444
|
+
* filters: [
|
|
4445
|
+
* { field: 'wellness_score', op: 'gt', value: 75 },
|
|
4446
|
+
* { field: 'enrolled', op: 'eq', value: 'true' },
|
|
4447
|
+
* ],
|
|
4448
|
+
* limit: 100,
|
|
4449
|
+
* offset: 0,
|
|
4450
|
+
* });
|
|
4451
|
+
* console.log(`${result.filtered} of ${result.total} rows match`);
|
|
4452
|
+
*/
|
|
4453
|
+
query: (resultId: string, params: ExtractionRowQueryParams, options?: RequestOptions) => Promise<ExtractionRowQueryResult>;
|
|
4454
|
+
};
|
|
4455
|
+
batches: {
|
|
4456
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionBatch>;
|
|
4457
|
+
get: (id: string, options?: RequestOptions) => Promise<ExtractionBatch>;
|
|
4458
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4459
|
+
listByWorkspace: (workspaceId: string, options?: {
|
|
4460
|
+
page?: number;
|
|
4461
|
+
pageSize?: number;
|
|
4462
|
+
} & RequestOptions) => Promise<ExtractionBatch[]>;
|
|
4463
|
+
};
|
|
4464
|
+
exports: {
|
|
4465
|
+
list: (workspaceId: string, options?: {
|
|
4466
|
+
page?: number;
|
|
4467
|
+
pageSize?: number;
|
|
4468
|
+
} & RequestOptions) => Promise<Record<string, unknown>[]>;
|
|
4469
|
+
create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4470
|
+
};
|
|
4471
|
+
schemaDiscoveries: {
|
|
4472
|
+
create: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4473
|
+
get: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4474
|
+
};
|
|
4475
|
+
fieldTemplates: {
|
|
4476
|
+
list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
|
|
4477
|
+
get: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4478
|
+
create: (attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4479
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4480
|
+
};
|
|
4481
|
+
fieldMappings: {
|
|
4482
|
+
get: (workspaceId: string, documentId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4483
|
+
create: (workspaceId: string, documentId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4484
|
+
};
|
|
4485
|
+
};
|
|
4486
|
+
|
|
4487
|
+
/**
|
|
4488
|
+
* GPT Core Client SDK
|
|
4489
|
+
*
|
|
4490
|
+
* The main entry point for interacting with the GPT Core API.
|
|
4491
|
+
* Provides a namespaced, type-safe interface for all API operations.
|
|
4492
|
+
*
|
|
4493
|
+
* @example
|
|
4494
|
+
* ```typescript
|
|
4495
|
+
* import { GptClient } from '@gpt-platform/client';
|
|
4496
|
+
*
|
|
4497
|
+
* const client = new GptClient({
|
|
4498
|
+
* baseUrl: 'https://api.gpt-core.com',
|
|
4499
|
+
* apiKey: 'sk_app_...',
|
|
4500
|
+
* });
|
|
4501
|
+
*
|
|
4502
|
+
* // Authentication
|
|
4503
|
+
* const user = await client.identity.me();
|
|
4504
|
+
*
|
|
4505
|
+
* // Workspaces
|
|
4506
|
+
* const workspaces = await client.platform.workspaces.mine();
|
|
4507
|
+
*
|
|
4508
|
+
* // AI Search
|
|
4509
|
+
* const results = await client.ai.search('quarterly earnings');
|
|
4510
|
+
*
|
|
4511
|
+
* // Documents
|
|
4512
|
+
* const docs = await client.extraction.documents.list();
|
|
4513
|
+
* ```
|
|
4514
|
+
*/
|
|
4515
|
+
declare class GptClient extends BaseClient {
|
|
4516
|
+
/** Agent creation, versioning, training, and testing */
|
|
4517
|
+
readonly agents: {
|
|
4518
|
+
list: (options?: {
|
|
4519
|
+
page?: number;
|
|
4520
|
+
pageSize?: number;
|
|
4521
|
+
} & RequestOptions) => Promise<Agent[]>;
|
|
4522
|
+
listAll: (options?: RequestOptions) => Promise<Agent[]>;
|
|
4523
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4524
|
+
get: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4525
|
+
create: (name: string, promptTemplate: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Agent>;
|
|
4526
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Agent>;
|
|
4527
|
+
test: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4528
|
+
validate: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4529
|
+
clone: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4530
|
+
export: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4531
|
+
analyzeTraining: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4532
|
+
teach: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4533
|
+
publishVersion: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4534
|
+
restoreVersion: (id: string, options?: RequestOptions) => Promise<Agent>;
|
|
4535
|
+
stats: (id: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4536
|
+
versions: {
|
|
4537
|
+
list: (options?: {
|
|
4538
|
+
page?: number;
|
|
4539
|
+
pageSize?: number;
|
|
4540
|
+
} & RequestOptions) => Promise<AgentVersion[]>;
|
|
4541
|
+
listAll: (options?: RequestOptions) => Promise<AgentVersion[]>;
|
|
4542
|
+
get: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
|
|
4543
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4544
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<AgentVersion>;
|
|
4545
|
+
addSystemField: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
|
|
4546
|
+
removeSystemField: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
|
|
4547
|
+
setSystemFields: (id: string, options?: RequestOptions) => Promise<AgentVersion>;
|
|
4548
|
+
};
|
|
4549
|
+
training: {
|
|
4550
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4551
|
+
list: (options?: {
|
|
4552
|
+
page?: number;
|
|
4553
|
+
pageSize?: number;
|
|
4554
|
+
} & RequestOptions) => Promise<TrainingExample[]>;
|
|
4555
|
+
listAll: (options?: RequestOptions) => Promise<TrainingExample[]>;
|
|
4556
|
+
get: (id: string, options?: RequestOptions) => Promise<TrainingExample>;
|
|
4557
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
|
|
4558
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
|
|
4559
|
+
};
|
|
4560
|
+
};
|
|
4561
|
+
/** Semantic search, embeddings, and AI conversations */
|
|
4562
|
+
readonly ai: {
|
|
4563
|
+
search: (query: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4564
|
+
searchAdvanced: (query: string, params?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4565
|
+
embed: (text: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4566
|
+
conversations: {
|
|
4567
|
+
list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
|
|
4568
|
+
create: (attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4569
|
+
};
|
|
4570
|
+
messages: {
|
|
4571
|
+
list: (options?: RequestOptions) => Promise<Record<string, unknown>[]>;
|
|
4572
|
+
stream: (conversationId: string, body: Record<string, unknown>, options?: RequestOptions, streamOptions?: StreamOptions) => Promise<AsyncIterableIterator<StreamMessageChunk>>;
|
|
4573
|
+
send: (_conversationId: string, body: Record<string, unknown>, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4574
|
+
};
|
|
4575
|
+
};
|
|
4576
|
+
/** Wallet, plans, transactions, and payment methods */
|
|
4577
|
+
readonly billing: {
|
|
4578
|
+
wallet: {
|
|
4579
|
+
get: (options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4580
|
+
};
|
|
4581
|
+
plans: {
|
|
4582
|
+
list: (options?: {
|
|
4583
|
+
page?: number;
|
|
3792
4584
|
pageSize?: number;
|
|
3793
4585
|
} & RequestOptions) => Promise<Plan[]>;
|
|
3794
4586
|
listAll: (options?: RequestOptions) => Promise<Plan[]>;
|
|
@@ -3797,9 +4589,7 @@ declare class GptClient extends BaseClient {
|
|
|
3797
4589
|
transactions: {
|
|
3798
4590
|
list: (options?: {
|
|
3799
4591
|
page?: number;
|
|
3800
|
-
pageSize
|
|
3801
|
-
/** Notification logs, methods, and preferences */
|
|
3802
|
-
?: number;
|
|
4592
|
+
pageSize?: number;
|
|
3803
4593
|
} & RequestOptions) => Promise<Transaction[]>;
|
|
3804
4594
|
listAll: (options?: RequestOptions) => Promise<Transaction[]>;
|
|
3805
4595
|
get: (id: string, options?: RequestOptions) => Promise<Transaction>;
|
|
@@ -3907,6 +4697,7 @@ declare class GptClient extends BaseClient {
|
|
|
3907
4697
|
page?: number;
|
|
3908
4698
|
pageSize?: number;
|
|
3909
4699
|
} & RequestOptions) => Promise<ExtractionResult[]>;
|
|
4700
|
+
query: (resultId: string, params: ExtractionRowQueryParams, options?: RequestOptions) => Promise<ExtractionRowQueryResult>;
|
|
3910
4701
|
};
|
|
3911
4702
|
batches: {
|
|
3912
4703
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<ExtractionBatch>;
|
|
@@ -3953,6 +4744,12 @@ declare class GptClient extends BaseClient {
|
|
|
3953
4744
|
get: (id: string, options?: RequestOptions) => Promise<User>;
|
|
3954
4745
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<User>;
|
|
3955
4746
|
resendConfirmation: (options?: RequestOptions) => Promise<User>;
|
|
4747
|
+
confirmEmail: (email: string, confirmationToken: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4748
|
+
requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4749
|
+
requestPasswordReset: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4750
|
+
signInWithMagicLink: (token: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4751
|
+
resetPasswordWithToken: (token: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4752
|
+
changePassword: (currentPassword: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
3956
4753
|
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
3957
4754
|
tokens: {
|
|
3958
4755
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Token>;
|
|
@@ -4043,6 +4840,75 @@ declare class GptClient extends BaseClient {
|
|
|
4043
4840
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
|
|
4044
4841
|
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
|
|
4045
4842
|
};
|
|
4843
|
+
workspaceMembers: {
|
|
4844
|
+
list: (workspaceId: string, options?: {
|
|
4845
|
+
page?: number;
|
|
4846
|
+
pageSize?: number;
|
|
4847
|
+
} & RequestOptions) => Promise<WorkspaceMembership[]>;
|
|
4848
|
+
get: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
4849
|
+
create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
4850
|
+
update: (workspaceId: string, memberId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
4851
|
+
updateProfile: (workspaceId: string, memberId: string, profileAttrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
4852
|
+
remove: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<true>;
|
|
4853
|
+
};
|
|
4854
|
+
};
|
|
4855
|
+
/** Event types, scheduled events, bookings, participants, and calendar sync */
|
|
4856
|
+
readonly scheduling: {
|
|
4857
|
+
eventTypes: {
|
|
4858
|
+
list: (options?: {
|
|
4859
|
+
page?: number;
|
|
4860
|
+
pageSize?: number;
|
|
4861
|
+
} & RequestOptions) => Promise<SchedulingEventType[]>;
|
|
4862
|
+
listAll: (options?: RequestOptions) => Promise<SchedulingEventType[]>;
|
|
4863
|
+
get: (id: string, options?: RequestOptions) => Promise<SchedulingEventType>;
|
|
4864
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEventType>;
|
|
4865
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEventType>;
|
|
4866
|
+
};
|
|
4867
|
+
events: {
|
|
4868
|
+
list: (options?: {
|
|
4869
|
+
page?: number;
|
|
4870
|
+
pageSize?: number;
|
|
4871
|
+
} & RequestOptions) => Promise<SchedulingEvent[]>;
|
|
4872
|
+
listAll: (options?: RequestOptions) => Promise<SchedulingEvent[]>;
|
|
4873
|
+
get: (id: string, options?: RequestOptions) => Promise<SchedulingEvent>;
|
|
4874
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEvent>;
|
|
4875
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingEvent>;
|
|
4876
|
+
};
|
|
4877
|
+
participants: {
|
|
4878
|
+
list: (options?: {
|
|
4879
|
+
page?: number;
|
|
4880
|
+
pageSize?: number;
|
|
4881
|
+
} & RequestOptions) => Promise<SchedulingParticipant[]>;
|
|
4882
|
+
listAll: (options?: RequestOptions) => Promise<SchedulingParticipant[]>;
|
|
4883
|
+
get: (id: string, options?: RequestOptions) => Promise<SchedulingParticipant>;
|
|
4884
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingParticipant>;
|
|
4885
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingParticipant>;
|
|
4886
|
+
};
|
|
4887
|
+
bookings: {
|
|
4888
|
+
list: (options?: {
|
|
4889
|
+
page?: number;
|
|
4890
|
+
pageSize?: number;
|
|
4891
|
+
} & RequestOptions) => Promise<SchedulingBooking[]>;
|
|
4892
|
+
listAll: (options?: RequestOptions) => Promise<SchedulingBooking[]>;
|
|
4893
|
+
get: (id: string, options?: RequestOptions) => Promise<SchedulingBooking>;
|
|
4894
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
|
|
4895
|
+
confirm: (id: string, options?: RequestOptions) => Promise<SchedulingBooking>;
|
|
4896
|
+
cancel: (id: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
|
|
4897
|
+
reschedule: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingBooking>;
|
|
4898
|
+
};
|
|
4899
|
+
calendarSyncs: {
|
|
4900
|
+
list: (options?: {
|
|
4901
|
+
page?: number;
|
|
4902
|
+
pageSize?: number;
|
|
4903
|
+
} & RequestOptions) => Promise<SchedulingCalendarSync[]>;
|
|
4904
|
+
listAll: (options?: RequestOptions) => Promise<SchedulingCalendarSync[]>;
|
|
4905
|
+
get: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
4906
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
4907
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
4908
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4909
|
+
pause: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
4910
|
+
resume: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
4911
|
+
};
|
|
4046
4912
|
};
|
|
4047
4913
|
/** Full-text, semantic, and saved search operations */
|
|
4048
4914
|
readonly search: {
|
|
@@ -4059,10 +4925,6 @@ declare class GptClient extends BaseClient {
|
|
|
4059
4925
|
/** Bucket and object management, presigned URLs */
|
|
4060
4926
|
readonly storage: {
|
|
4061
4927
|
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
4928
|
buckets: {
|
|
4067
4929
|
list: (options?: {
|
|
4068
4930
|
page?: number;
|
|
@@ -4097,92 +4959,129 @@ declare class GptClient extends BaseClient {
|
|
|
4097
4959
|
stream: (threadId: string, body: Record<string, unknown>, options?: RequestOptions, streamOptions?: StreamOptions) => Promise<AsyncIterableIterator<StreamMessageChunk>>;
|
|
4098
4960
|
};
|
|
4099
4961
|
};
|
|
4100
|
-
/**
|
|
4101
|
-
readonly
|
|
4102
|
-
|
|
4962
|
+
/** Training examples and sessions */
|
|
4963
|
+
readonly training: {
|
|
4964
|
+
examples: {
|
|
4103
4965
|
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4104
4966
|
list: (options?: {
|
|
4105
4967
|
page?: number;
|
|
4106
4968
|
pageSize?: number;
|
|
4107
|
-
} & RequestOptions) => Promise<
|
|
4108
|
-
listAll: (options?: RequestOptions) => Promise<
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
get: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
4116
|
-
rotateSecret: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
4969
|
+
} & RequestOptions) => Promise<TrainingExample[]>;
|
|
4970
|
+
listAll: (options?: RequestOptions) => Promise<TrainingExample[]>;
|
|
4971
|
+
get: (id: string, options?: RequestOptions) => Promise<TrainingExample>;
|
|
4972
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
|
|
4973
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingExample>;
|
|
4974
|
+
bulkCreate: (options?: RequestOptions) => Promise<TrainingExample>;
|
|
4975
|
+
bulkDestroy: (options?: RequestOptions) => Promise<TrainingExample>;
|
|
4976
|
+
searchByVector: (options?: RequestOptions) => Promise<TrainingExample>;
|
|
4117
4977
|
};
|
|
4118
|
-
|
|
4119
|
-
|
|
4978
|
+
sessions: {
|
|
4979
|
+
listAgentsSessions: (options?: {
|
|
4120
4980
|
page?: number;
|
|
4121
4981
|
pageSize?: number;
|
|
4122
|
-
} & RequestOptions) => Promise<
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4982
|
+
} & RequestOptions) => Promise<TrainingSession[]>;
|
|
4983
|
+
listAllAgentsSessions: (options?: RequestOptions) => Promise<TrainingSession[]>;
|
|
4984
|
+
get: (id: string, options?: RequestOptions) => Promise<TrainingSession>;
|
|
4985
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingSession>;
|
|
4986
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4987
|
+
update: (agentId: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<TrainingSession>;
|
|
4128
4988
|
};
|
|
4129
4989
|
};
|
|
4130
|
-
/**
|
|
4131
|
-
readonly
|
|
4132
|
-
|
|
4990
|
+
/** Voice transcription, TTS, and real-time voice session management */
|
|
4991
|
+
readonly voice: {
|
|
4992
|
+
transcribe: (audio: File | Blob, params?: {
|
|
4993
|
+
language?: string;
|
|
4994
|
+
modelSize?: "tiny" | "base" | "small" | "medium" | "large";
|
|
4995
|
+
phiMode?: "none" | "tokenize" | "tokenize_encrypt";
|
|
4996
|
+
phiKey?: string;
|
|
4997
|
+
}, options?: RequestOptions) => Promise<VoiceTranscribeResult>;
|
|
4998
|
+
sessions: {
|
|
4133
4999
|
list: (options?: {
|
|
4134
5000
|
page?: number;
|
|
4135
5001
|
pageSize?: number;
|
|
4136
|
-
} & RequestOptions) => Promise<
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
5002
|
+
} & RequestOptions) => Promise<VoiceSession[]>;
|
|
5003
|
+
get: (id: string, options?: RequestOptions) => Promise<VoiceSession>;
|
|
5004
|
+
listMine: (options?: {
|
|
5005
|
+
page?: number;
|
|
5006
|
+
pageSize?: number;
|
|
5007
|
+
} & RequestOptions) => Promise<VoiceSession[]>;
|
|
5008
|
+
listByWorkspace: (workspaceId: string, options?: {
|
|
5009
|
+
page?: number;
|
|
5010
|
+
pageSize?: number;
|
|
5011
|
+
} & RequestOptions) => Promise<VoiceSession[]>;
|
|
5012
|
+
start: (params?: {
|
|
5013
|
+
threadId?: string;
|
|
5014
|
+
blueprintId?: string;
|
|
5015
|
+
blueprintMode?: "chat" | "extraction" | "both";
|
|
5016
|
+
phiMode?: "none" | "tokenize" | "tokenize_encrypt";
|
|
5017
|
+
phiKey?: string;
|
|
5018
|
+
patientId?: string;
|
|
5019
|
+
}, options?: RequestOptions) => Promise<VoiceSession>;
|
|
5020
|
+
stop: (id: string, options?: RequestOptions) => Promise<VoiceSession>;
|
|
5021
|
+
finalize: (id: string, params?: {
|
|
5022
|
+
blueprintId?: string;
|
|
5023
|
+
phiMode?: "none" | "tokenize" | "tokenize_encrypt";
|
|
5024
|
+
phiKey?: string;
|
|
5025
|
+
patientId?: string;
|
|
5026
|
+
}, options?: RequestOptions) => Promise<VoiceSession>;
|
|
4141
5027
|
};
|
|
4142
|
-
|
|
5028
|
+
};
|
|
5029
|
+
/** File watcher claims and event management */
|
|
5030
|
+
readonly watcher: {
|
|
5031
|
+
claims: {
|
|
4143
5032
|
list: (options?: {
|
|
4144
5033
|
page?: number;
|
|
4145
5034
|
pageSize?: number;
|
|
4146
|
-
} & RequestOptions) => Promise<
|
|
4147
|
-
listAll: (options?: RequestOptions) => Promise<
|
|
4148
|
-
|
|
4149
|
-
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<
|
|
4150
|
-
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<
|
|
5035
|
+
} & RequestOptions) => Promise<WatcherClaim[]>;
|
|
5036
|
+
listAll: (options?: RequestOptions) => Promise<WatcherClaim[]>;
|
|
5037
|
+
claim: (options?: RequestOptions) => Promise<WatcherClaim>;
|
|
5038
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WatcherClaim>;
|
|
5039
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WatcherClaim>;
|
|
5040
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
5041
|
+
registerCompleted: (options?: RequestOptions) => Promise<WatcherClaim>;
|
|
5042
|
+
readStatus: (options?: RequestOptions) => Promise<WatcherClaim>;
|
|
5043
|
+
get: (id: string, options?: RequestOptions) => Promise<WatcherClaim>;
|
|
4151
5044
|
};
|
|
4152
|
-
|
|
5045
|
+
events: {
|
|
5046
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WatcherEvent>;
|
|
4153
5047
|
list: (options?: {
|
|
4154
5048
|
page?: number;
|
|
4155
5049
|
pageSize?: number;
|
|
4156
|
-
} & RequestOptions) => Promise<
|
|
4157
|
-
listAll: (options?: RequestOptions) => Promise<
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
5050
|
+
} & RequestOptions) => Promise<WatcherEvent[]>;
|
|
5051
|
+
listAll: (options?: RequestOptions) => Promise<WatcherEvent[]>;
|
|
5052
|
+
delete: (options?: RequestOptions) => Promise<true>;
|
|
5053
|
+
batchCreate: (options?: RequestOptions) => Promise<WatcherEvent>;
|
|
5054
|
+
get: (id: string, options?: RequestOptions) => Promise<WatcherEvent>;
|
|
4161
5055
|
};
|
|
4162
|
-
|
|
5056
|
+
};
|
|
5057
|
+
/** Webhook configuration, testing, and delivery management */
|
|
5058
|
+
readonly webhooks: {
|
|
5059
|
+
configs: {
|
|
5060
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4163
5061
|
list: (options?: {
|
|
4164
5062
|
page?: number;
|
|
4165
5063
|
pageSize?: number;
|
|
4166
|
-
} & RequestOptions) => Promise<
|
|
4167
|
-
listAll: (options?: RequestOptions) => Promise<
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
5064
|
+
} & RequestOptions) => Promise<WebhookConfig[]>;
|
|
5065
|
+
listAll: (options?: RequestOptions) => Promise<WebhookConfig[]>;
|
|
5066
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5067
|
+
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5068
|
+
test: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5069
|
+
bulkEnable: (options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5070
|
+
bulkDisable: (options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5071
|
+
replay: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5072
|
+
get: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
5073
|
+
rotateSecret: (id: string, options?: RequestOptions) => Promise<WebhookConfig>;
|
|
4173
5074
|
};
|
|
4174
|
-
|
|
5075
|
+
deliveries: {
|
|
4175
5076
|
list: (options?: {
|
|
4176
5077
|
page?: number;
|
|
4177
5078
|
pageSize?: number;
|
|
4178
|
-
} & RequestOptions) => Promise<
|
|
4179
|
-
listAll: (options?: RequestOptions) => Promise<
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
pause: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
4185
|
-
resume: (id: string, options?: RequestOptions) => Promise<SchedulingCalendarSync>;
|
|
5079
|
+
} & RequestOptions) => Promise<WebhookDelivery[]>;
|
|
5080
|
+
listAll: (options?: RequestOptions) => Promise<WebhookDelivery[]>;
|
|
5081
|
+
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<WebhookDelivery>;
|
|
5082
|
+
retry: (options?: RequestOptions) => Promise<WebhookDelivery>;
|
|
5083
|
+
bulkRetry: (options?: RequestOptions) => Promise<WebhookDelivery>;
|
|
5084
|
+
get: (id: string, options?: RequestOptions) => Promise<WebhookDelivery>;
|
|
4186
5085
|
};
|
|
4187
5086
|
};
|
|
4188
5087
|
constructor(config?: BaseClientConfig);
|
|
@@ -4211,123 +5110,6 @@ declare class GptClient extends BaseClient {
|
|
|
4211
5110
|
on<K extends keyof SdkEvents>(event: K, handler: (event: SdkEvents[K]) => void): () => void;
|
|
4212
5111
|
}
|
|
4213
5112
|
|
|
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
5113
|
/**
|
|
4332
5114
|
* Webhook signature verification for GPT Core webhooks.
|
|
4333
5115
|
*
|
|
@@ -4481,6 +5263,21 @@ declare function createIdentityNamespace(rb: RequestBuilder): {
|
|
|
4481
5263
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<User>;
|
|
4482
5264
|
/** Resend confirmation email to an unconfirmed user */
|
|
4483
5265
|
resendConfirmation: (options?: RequestOptions) => Promise<User>;
|
|
5266
|
+
/** Confirm an email address using the token from the confirmation email */
|
|
5267
|
+
confirmEmail: (email: string, confirmationToken: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
5268
|
+
/** Request a magic link sign-in email */
|
|
5269
|
+
requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
5270
|
+
/**
|
|
5271
|
+
* Request a password reset email — always returns success to prevent email enumeration.
|
|
5272
|
+
* The user will receive an email with a reset token if the account exists.
|
|
5273
|
+
*/
|
|
5274
|
+
requestPasswordReset: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
5275
|
+
/** Sign in using a token from a magic link email */
|
|
5276
|
+
signInWithMagicLink: (token: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
5277
|
+
/** Reset a password using the token from a password reset email */
|
|
5278
|
+
resetPasswordWithToken: (token: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
5279
|
+
/** Change password for the currently authenticated user */
|
|
5280
|
+
changePassword: (currentPassword: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
4484
5281
|
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
4485
5282
|
tokens: {
|
|
4486
5283
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Token>;
|
|
@@ -4515,85 +5312,6 @@ declare function createIdentityNamespace(rb: RequestBuilder): {
|
|
|
4515
5312
|
};
|
|
4516
5313
|
};
|
|
4517
5314
|
|
|
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
5315
|
declare function createBillingNamespace(rb: RequestBuilder): {
|
|
4598
5316
|
wallet: {
|
|
4599
5317
|
/** Get the current workspace wallet balance and details */
|
|
@@ -4733,12 +5451,6 @@ declare function createAgentsNamespace(rb: RequestBuilder): {
|
|
|
4733
5451
|
declare function createStorageNamespace(rb: RequestBuilder): {
|
|
4734
5452
|
/** Generate a presigned upload URL for direct-to-storage uploads */
|
|
4735
5453
|
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
5454
|
buckets: {
|
|
4743
5455
|
list: (options?: {
|
|
4744
5456
|
page?: number;
|
|
@@ -4843,6 +5555,23 @@ declare function createPlatformNamespace(rb: RequestBuilder): {
|
|
|
4843
5555
|
create: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
|
|
4844
5556
|
update: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Invitation>;
|
|
4845
5557
|
};
|
|
5558
|
+
workspaceMembers: {
|
|
5559
|
+
/** List members of a workspace */
|
|
5560
|
+
list: (workspaceId: string, options?: {
|
|
5561
|
+
page?: number;
|
|
5562
|
+
pageSize?: number;
|
|
5563
|
+
} & RequestOptions) => Promise<WorkspaceMembership[]>;
|
|
5564
|
+
/** Get a specific workspace member by workspace and user ID */
|
|
5565
|
+
get: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
5566
|
+
/** Add a user to a workspace */
|
|
5567
|
+
create: (workspaceId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
5568
|
+
/** Update workspace member permissions or role */
|
|
5569
|
+
update: (workspaceId: string, memberId: string, attrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
5570
|
+
/** Update workspace member profile attributes (G9) */
|
|
5571
|
+
updateProfile: (workspaceId: string, memberId: string, profileAttrs: Record<string, unknown>, options?: RequestOptions) => Promise<WorkspaceMembership>;
|
|
5572
|
+
/** Remove a user from a workspace */
|
|
5573
|
+
remove: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<true>;
|
|
5574
|
+
};
|
|
4846
5575
|
};
|
|
4847
5576
|
|
|
4848
5577
|
declare function createWebhooksNamespace(rb: RequestBuilder): {
|
|
@@ -5032,5 +5761,6 @@ type AiAPI = ReturnType<typeof createAiNamespace>;
|
|
|
5032
5761
|
type PlatformAPI = ReturnType<typeof createPlatformNamespace>;
|
|
5033
5762
|
type WebhooksAPI = ReturnType<typeof createWebhooksNamespace>;
|
|
5034
5763
|
type SchedulingAPI = ReturnType<typeof createSchedulingNamespace>;
|
|
5764
|
+
type VoiceAPI = ReturnType<typeof createVoiceNamespace>;
|
|
5035
5765
|
|
|
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 };
|
|
5766
|
+
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 };
|