@gpt-platform/client 0.10.3 → 0.10.4

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.ts CHANGED
@@ -606,7 +606,7 @@ declare class BrowserApiKeyError extends Error {
606
606
  }
607
607
 
608
608
  /** SDK version — updated automatically by mix update.sdks */
609
- declare const SDK_VERSION = "0.10.3";
609
+ declare const SDK_VERSION = "0.10.4";
610
610
  /** Default API version sent in every request — updated automatically by mix update.sdks */
611
611
  declare const DEFAULT_API_VERSION = "2026-03-23";
612
612
 
@@ -1033,6 +1033,12 @@ declare class RequestBuilder {
1033
1033
  * Used for endpoints implemented as custom Phoenix controllers.
1034
1034
  */
1035
1035
  rawPost<TResponse>(url: string, body?: unknown, options?: RequestOptions): Promise<TResponse>;
1036
+ /**
1037
+ * Execute a raw POST to a custom endpoint that returns flat JSON (no data wrapper).
1038
+ * Unlike rawPost (which unwraps data.data), this returns the response body directly.
1039
+ * Used for hand-written Phoenix controllers like DocumentsController.
1040
+ */
1041
+ rawPostDirect<TResponse>(url: string, body?: unknown, options?: RequestOptions): Promise<TResponse>;
1036
1042
  /**
1037
1043
  * Execute a raw PUT request to a custom (non-generated) endpoint.
1038
1044
  */
@@ -1681,7 +1687,7 @@ type WorkspaceAgentConfig = {
1681
1687
  /**
1682
1688
  * A "Resource object" representing a clinical-goal-template
1683
1689
  */
1684
- type ClinicalGoalTemplate = {
1690
+ type ClinicalGoalTemplate$1 = {
1685
1691
  /**
1686
1692
  * An attributes object for a clinical-goal-template
1687
1693
  */
@@ -2026,7 +2032,7 @@ type VoiceTranscriptionResult = {
2026
2032
  /**
2027
2033
  * A "Resource object" representing a clinical-goal-template-category
2028
2034
  */
2029
- type ClinicalGoalTemplateCategory = {
2035
+ type ClinicalGoalTemplateCategory$1 = {
2030
2036
  /**
2031
2037
  * An attributes object for a clinical-goal-template-category
2032
2038
  */
@@ -2920,7 +2926,7 @@ type CrmCompany = {
2920
2926
  /**
2921
2927
  * A "Resource object" representing a clinical-practice-tool
2922
2928
  */
2923
- type ClinicalPracticeTool = {
2929
+ type ClinicalPracticeTool$1 = {
2924
2930
  /**
2925
2931
  * An attributes object for a clinical-practice-tool
2926
2932
  */
@@ -3251,7 +3257,7 @@ type SupportTag = {
3251
3257
  /**
3252
3258
  * A "Resource object" representing a clinical-note-version
3253
3259
  */
3254
- type ClinicalNoteVersion = {
3260
+ type ClinicalNoteVersion$1 = {
3255
3261
  /**
3256
3262
  * An attributes object for a clinical-note-version
3257
3263
  */
@@ -4164,7 +4170,7 @@ type VoiceRecording = {
4164
4170
  /**
4165
4171
  * A "Resource object" representing a clinical-client-resource-assignment
4166
4172
  */
4167
- type ClinicalClientResourceAssignment = {
4173
+ type ClinicalClientResourceAssignment$1 = {
4168
4174
  /**
4169
4175
  * An attributes object for a clinical-client-resource-assignment
4170
4176
  */
@@ -5360,7 +5366,7 @@ type Application = {
5360
5366
  /**
5361
5367
  * A "Resource object" representing a clinical-client-supplement
5362
5368
  */
5363
- type ClinicalClientSupplement = {
5369
+ type ClinicalClientSupplement$1 = {
5364
5370
  /**
5365
5371
  * An attributes object for a clinical-client-supplement
5366
5372
  */
@@ -6035,6 +6041,40 @@ type Transaction = {
6035
6041
  };
6036
6042
  type: string;
6037
6043
  };
6044
+ /**
6045
+ * A "Resource object" representing a extraction-agent
6046
+ */
6047
+ type ExtractionAgent = {
6048
+ /**
6049
+ * An attributes object for a extraction-agent
6050
+ */
6051
+ attributes?: {
6052
+ /**
6053
+ * Description of what this agent is good at, used for AI matching. Field included by default.
6054
+ */
6055
+ capabilities: string;
6056
+ /**
6057
+ * Field included by default.
6058
+ */
6059
+ description: string;
6060
+ /**
6061
+ * Field included by default.
6062
+ */
6063
+ name: string;
6064
+ /**
6065
+ * Field included by default.
6066
+ */
6067
+ slug: string;
6068
+ };
6069
+ id: string;
6070
+ /**
6071
+ * A relationships object for a extraction-agent
6072
+ */
6073
+ relationships?: {
6074
+ [key: string]: never;
6075
+ };
6076
+ type: string;
6077
+ };
6038
6078
  /**
6039
6079
  * A "Resource object" representing a agent-deployment
6040
6080
  */
@@ -6243,6 +6283,84 @@ type AgentDeployment = {
6243
6283
  };
6244
6284
  type: string;
6245
6285
  };
6286
+ /**
6287
+ * A "Resource object" representing a training-analytics
6288
+ */
6289
+ type TrainingAnalytics = {
6290
+ /**
6291
+ * An attributes object for a training-analytics
6292
+ */
6293
+ attributes?: {
6294
+ /**
6295
+ * Field included by default.
6296
+ */
6297
+ accuracy_improvement?: number | null | unknown;
6298
+ /**
6299
+ * Field included by default.
6300
+ */
6301
+ accuracy_trend?: Array<{
6302
+ [key: string]: unknown;
6303
+ }> | null | unknown;
6304
+ /**
6305
+ * Field included by default.
6306
+ */
6307
+ avg_confidence?: number | null | unknown;
6308
+ /**
6309
+ * Field included by default.
6310
+ */
6311
+ confidence_threshold?: number | null | unknown;
6312
+ /**
6313
+ * Field included by default.
6314
+ */
6315
+ docs_needing_review_count?: number | null | unknown;
6316
+ /**
6317
+ * Field included by default.
6318
+ */
6319
+ low_confidence_documents?: Array<{
6320
+ [key: string]: unknown;
6321
+ }> | null | unknown;
6322
+ /**
6323
+ * Field included by default.
6324
+ */
6325
+ top_corrected_field?: string | null | unknown;
6326
+ /**
6327
+ * Field included by default.
6328
+ */
6329
+ top_field_correction_count?: number | null | unknown;
6330
+ /**
6331
+ * Field included by default.
6332
+ */
6333
+ total_examples?: number | null | unknown;
6334
+ /**
6335
+ * Field included by default.
6336
+ */
6337
+ total_fields_confirmed?: number | null | unknown;
6338
+ /**
6339
+ * Field included by default.
6340
+ */
6341
+ total_fields_corrected?: number | null | unknown;
6342
+ /**
6343
+ * Field included by default.
6344
+ */
6345
+ total_fields_reviewed?: number | null | unknown;
6346
+ /**
6347
+ * Field included by default.
6348
+ */
6349
+ trained?: number | null | unknown;
6350
+ /**
6351
+ * Field included by default.
6352
+ */
6353
+ workspace_id?: string | null | unknown;
6354
+ };
6355
+ id: string;
6356
+ /**
6357
+ * A relationships object for a training-analytics
6358
+ */
6359
+ relationships?: {
6360
+ [key: string]: never;
6361
+ };
6362
+ type: string;
6363
+ };
6246
6364
  /**
6247
6365
  * A "Resource object" representing a data-subject-request
6248
6366
  */
@@ -6658,7 +6776,7 @@ type AgentVersionComparison = {
6658
6776
  /**
6659
6777
  * A "Resource object" representing a clinical-session
6660
6778
  */
6661
- type ClinicalSession = {
6779
+ type ClinicalSession$1 = {
6662
6780
  /**
6663
6781
  * An attributes object for a clinical-session
6664
6782
  */
@@ -6886,7 +7004,7 @@ type SavedSearch = {
6886
7004
  /**
6887
7005
  * A "Resource object" representing a clinical-meal-plan
6888
7006
  */
6889
- type ClinicalMealPlan = {
7007
+ type ClinicalMealPlan$1 = {
6890
7008
  /**
6891
7009
  * An attributes object for a clinical-meal-plan
6892
7010
  */
@@ -7334,7 +7452,7 @@ type EmailTrackingEvent = {
7334
7452
  /**
7335
7453
  * A "Resource object" representing a clinical-patient
7336
7454
  */
7337
- type ClinicalPatient = {
7455
+ type ClinicalPatient$1 = {
7338
7456
  /**
7339
7457
  * An attributes object for a clinical-patient
7340
7458
  */
@@ -7703,7 +7821,7 @@ type ApiKey = {
7703
7821
  /**
7704
7822
  * A "Resource object" representing a clinical-practice-resource
7705
7823
  */
7706
- type ClinicalPracticeResource = {
7824
+ type ClinicalPracticeResource$1 = {
7707
7825
  /**
7708
7826
  * An attributes object for a clinical-practice-resource
7709
7827
  */
@@ -8193,7 +8311,7 @@ type AccessLog = {
8193
8311
  /**
8194
8312
  * A "Resource object" representing a clinical-delivery
8195
8313
  */
8196
- type ClinicalDelivery = {
8314
+ type ClinicalDelivery$1 = {
8197
8315
  /**
8198
8316
  * An attributes object for a clinical-delivery
8199
8317
  */
@@ -8560,7 +8678,7 @@ type DisclosureLog = {
8560
8678
  /**
8561
8679
  * A "Resource object" representing a clinical-supplement-rec-cache
8562
8680
  */
8563
- type ClinicalSupplementRecCache = {
8681
+ type ClinicalSupplementRecCache$1 = {
8564
8682
  /**
8565
8683
  * An attributes object for a clinical-supplement-rec-cache
8566
8684
  */
@@ -9666,7 +9784,7 @@ type DataTransferRecord = {
9666
9784
  /**
9667
9785
  * A "Resource object" representing a clinical-health-metric
9668
9786
  */
9669
- type ClinicalHealthMetric = {
9787
+ type ClinicalHealthMetric$1 = {
9670
9788
  /**
9671
9789
  * An attributes object for a clinical-health-metric
9672
9790
  */
@@ -10719,7 +10837,7 @@ type Bucket = {
10719
10837
  /**
10720
10838
  * A "Resource object" representing a clinical-note
10721
10839
  */
10722
- type ClinicalNote = {
10840
+ type ClinicalNote$1 = {
10723
10841
  /**
10724
10842
  * An attributes object for a clinical-note
10725
10843
  */
@@ -11712,7 +11830,7 @@ type CrmCustomEntity = {
11712
11830
  /**
11713
11831
  * A "Resource object" representing a clinical-client-goal
11714
11832
  */
11715
- type ClinicalClientGoal = {
11833
+ type ClinicalClientGoal$1 = {
11716
11834
  /**
11717
11835
  * An attributes object for a clinical-client-goal
11718
11836
  */
@@ -13013,6 +13131,18 @@ declare function createSocialNamespace(rb: RequestBuilder): {
13013
13131
  generateMasterCopy: (id: string, workspaceId: string, options?: RequestOptions) => Promise<unknown>;
13014
13132
  /** Adapt master copy for target platforms and create SocialPost drafts. */
13015
13133
  adaptForPlatforms: (id: string, workspaceId: string, socialAccountId: string, options?: RequestOptions) => Promise<unknown>;
13134
+ /**
13135
+ * Preview adapted copy per platform without creating SocialPost records.
13136
+ *
13137
+ * Returns the AI-adapted text for each target platform so the user can
13138
+ * review before committing via `adaptForPlatforms`.
13139
+ *
13140
+ * @param id - Campaign UUID.
13141
+ * @param workspaceId - Workspace UUID.
13142
+ * @param options - Optional request options.
13143
+ * @returns `{ adaptations: [{ platform: string, content: string }] }`
13144
+ */
13145
+ previewAdaptations: (id: string, workspaceId: string, options?: RequestOptions) => Promise<unknown>;
13016
13146
  };
13017
13147
  /** Trending content discovery — snapshots, items, and watch alerts. */
13018
13148
  trending: {
@@ -14540,6 +14670,18 @@ declare function createThreadsNamespace(rb: RequestBuilder): {
14540
14670
  search: (query: string, options?: RequestOptions) => Promise<ChatThread[]>;
14541
14671
  };
14542
14672
 
14673
+ /** Parameters for requesting a presigned download URL. */
14674
+ interface RequestDownloadUrlParams {
14675
+ /** Time in seconds until the URL expires (default: 3600). */
14676
+ expires_in?: number;
14677
+ }
14678
+ /** Response from a presigned download URL request. */
14679
+ interface DownloadUrlResponse {
14680
+ /** The presigned download URL. */
14681
+ url: string;
14682
+ /** When the URL expires (ISO 8601). */
14683
+ expires_at: string;
14684
+ }
14543
14685
  /** Response from a presigned upload request. */
14544
14686
  interface PresignedUploadResponse {
14545
14687
  url?: string;
@@ -14879,6 +15021,28 @@ declare function createStorageNamespace(rb: RequestBuilder): {
14879
15021
  * @returns A promise resolving to an array of child `StorageFile` objects.
14880
15022
  */
14881
15023
  listChildren: (parentId: string, options?: RequestOptions) => Promise<StorageFile[]>;
15024
+ /**
15025
+ * Generate a short-lived presigned download URL for a file.
15026
+ *
15027
+ * Returns a URL that can be used to download the file directly from
15028
+ * object storage (GCS in production, MinIO in dev) without routing
15029
+ * through the application server.
15030
+ *
15031
+ * @param id - The UUID of the file to download.
15032
+ * @param params - Optional parameters (e.g., custom `expires_in` seconds).
15033
+ * @param options - Optional request options (abort signal, custom headers).
15034
+ * @returns A promise resolving to the presigned URL and its expiry.
15035
+ *
15036
+ * @example
15037
+ * ```typescript
15038
+ * const { url, expires_at } = await client.storage.files.requestDownloadUrl(
15039
+ * 'file-uuid',
15040
+ * { expires_in: 300 }, // 5 minutes
15041
+ * );
15042
+ * // Redirect browser to `url` for direct download
15043
+ * ```
15044
+ */
15045
+ requestDownloadUrl: (id: string, params?: RequestDownloadUrlParams, options?: RequestOptions) => Promise<DownloadUrlResponse>;
14882
15046
  };
14883
15047
  };
14884
15048
 
@@ -16143,34 +16307,54 @@ type CreateInvitationAttributes = {
16143
16307
  };
16144
16308
  /** Attributes accepted when creating a brand identity. */
16145
16309
  type CreateBrandIdentityAttributes = {
16310
+ /** Required. Display name for this brand identity. */
16146
16311
  name: string;
16312
+ /** Tenant UUID — required for tenant-scoped identities. */
16313
+ tenant_id: string;
16314
+ /** Optional workspace UUID — set for workspace-level overrides, omit for tenant-level. */
16147
16315
  workspace_id?: string;
16148
- tenant_id?: string;
16316
+ /** Brand voice description (e.g. "Professional but approachable"). */
16317
+ voice?: string;
16318
+ /** Brand values as an array of strings (e.g. ["innovation", "integrity"]). */
16319
+ values?: string[];
16320
+ /** Target audience description. */
16321
+ target_audience?: string;
16322
+ /** Industry vertical. */
16323
+ industry?: string;
16324
+ /** Brand website URL. */
16325
+ website_url?: string;
16326
+ /** Logo image URL. */
16149
16327
  logo_url?: string;
16150
- icon_url?: string;
16151
- primary_color?: string;
16152
- secondary_color?: string;
16153
- accent_color?: string;
16154
- font_family?: string;
16155
- tagline?: string;
16328
+ /** Color palette map (e.g. { primary: "#0066CC", secondary: "#FF0000" }). */
16329
+ color_palette?: Record<string, string>;
16330
+ /** General description of this brand identity. */
16156
16331
  description?: string;
16157
- [key: string]: unknown;
16332
+ /** Whether this is the default identity at its scope level. */
16333
+ is_default?: boolean;
16158
16334
  };
16159
16335
  /** Attributes accepted when updating a brand identity (PATCH semantics). */
16160
16336
  type UpdateBrandIdentityAttributes = Partial<Omit<CreateBrandIdentityAttributes, "workspace_id" | "tenant_id">>;
16161
16337
  /** Attributes accepted when creating a platform tone. */
16162
16338
  type CreatePlatformToneAttributes = {
16163
- name: string;
16339
+ /** Required. Social platform this tone applies to. */
16340
+ platform: "facebook" | "instagram" | "threads" | "twitter" | "linkedin" | "reddit" | "bluesky";
16341
+ /** Required. Brand identity UUID this tone belongs to. */
16164
16342
  brand_identity_id: string;
16165
- tone_style?: string;
16166
- formality_level?: string;
16167
- vocabulary_preferences?: string;
16168
- communication_guidelines?: string;
16169
- example_phrases?: string[];
16170
- [key: string]: unknown;
16343
+ /** Tone preset. Default: "casual". */
16344
+ tone?: "casual" | "professional" | "humorous" | "inspirational" | "educational" | "promotional";
16345
+ /** Emoji usage policy. Default: "minimal". */
16346
+ emoji_policy?: "none" | "minimal" | "moderate" | "heavy";
16347
+ /** Number of hashtags to include. Default: 5. */
16348
+ hashtag_count?: number;
16349
+ /** Maximum character length for posts on this platform. */
16350
+ max_length?: number;
16351
+ /** Call-to-action text to include in generated copy. */
16352
+ call_to_action?: string;
16353
+ /** Free-form instructions for AI content generation on this platform. */
16354
+ custom_instructions?: string;
16171
16355
  };
16172
16356
  /** Attributes accepted when updating a platform tone (PATCH semantics). */
16173
- type UpdatePlatformToneAttributes = Partial<Omit<CreatePlatformToneAttributes, "brand_identity_id">>;
16357
+ type UpdatePlatformToneAttributes = Partial<Omit<CreatePlatformToneAttributes, "brand_identity_id" | "platform">>;
16174
16358
 
16175
16359
  /**
16176
16360
  * Creates the platform namespace providing access to workspace management,
@@ -19105,8 +19289,128 @@ declare function createExtractionNamespace(rb: RequestBuilder): {
19105
19289
  */
19106
19290
  create: (workspaceId: string, documentId: string, attrs: CreateFieldMappingAttributes, options?: RequestOptions) => Promise<FieldMappingRecord>;
19107
19291
  };
19292
+ /** Extraction agents — list and predict best extraction agents for documents. */
19293
+ extractionAgents: {
19294
+ /**
19295
+ * Lists all available extraction agents (system agents tagged with
19296
+ * "extraction" category).
19297
+ *
19298
+ * @param options - Optional request options (abort signal, custom headers).
19299
+ * @returns An array of extraction agent objects.
19300
+ *
19301
+ * @example
19302
+ * ```typescript
19303
+ * const agents = await client.extraction.extractionAgents.list();
19304
+ * ```
19305
+ */
19306
+ list: (options?: RequestOptions) => Promise<ExtractionAgent[]>;
19307
+ /**
19308
+ * Retrieves a single extraction agent by its unique identifier.
19309
+ *
19310
+ * @param id - The UUID of the extraction agent.
19311
+ * @param options - Optional request options (abort signal, custom headers).
19312
+ * @returns The matching extraction agent object.
19313
+ *
19314
+ * @example
19315
+ * ```typescript
19316
+ * const agent = await client.extraction.extractionAgents.get('agent-uuid');
19317
+ * ```
19318
+ */
19319
+ get: (id: string, options?: RequestOptions) => Promise<ExtractionAgent>;
19320
+ /**
19321
+ * Predicts the best extraction agent for a given document based on its
19322
+ * name, description, or file content.
19323
+ *
19324
+ * @param attributes - Prediction input (name, description, file_content, document_id).
19325
+ * @param options - Optional request options (abort signal, custom headers).
19326
+ * @returns A prediction result with recommended agents.
19327
+ *
19328
+ * @example
19329
+ * ```typescript
19330
+ * const prediction = await client.extraction.extractionAgents.predict({
19331
+ * name: 'invoice.pdf',
19332
+ * file_content: 'Invoice #12345...',
19333
+ * });
19334
+ * ```
19335
+ */
19336
+ predict: (attributes: {
19337
+ name?: string;
19338
+ description?: string;
19339
+ file_content?: string;
19340
+ document_id?: string;
19341
+ [key: string]: unknown;
19342
+ }, options?: RequestOptions) => Promise<unknown>;
19343
+ };
19344
+ /** Training analytics — workspace-level extraction training metrics. */
19345
+ trainingAnalytics: {
19346
+ /**
19347
+ * Retrieves training analytics for a specific workspace, including
19348
+ * accuracy trends, correction counts, and low-confidence documents.
19349
+ *
19350
+ * @param workspaceId - The UUID of the workspace.
19351
+ * @param options - Optional request options (abort signal, custom headers).
19352
+ * @returns The training analytics object for the workspace.
19353
+ *
19354
+ * @example
19355
+ * ```typescript
19356
+ * const analytics = await client.extraction.trainingAnalytics.forWorkspace('ws-uuid');
19357
+ * console.log(analytics.avg_confidence, analytics.total_examples);
19358
+ * ```
19359
+ */
19360
+ forWorkspace: (workspaceId: string, options?: RequestOptions) => Promise<TrainingAnalytics>;
19361
+ };
19108
19362
  };
19109
19363
 
19364
+ /** Parameters for generating a PDF from HTML. */
19365
+ interface GeneratePdfParams {
19366
+ /** HTML content to convert to PDF (max 2MB). */
19367
+ html: string;
19368
+ /** Output filename (default: "document.pdf"). */
19369
+ filename?: string;
19370
+ /**
19371
+ * When true, stores the PDF in platform Storage and returns a storage_key.
19372
+ * When false, returns the PDF as base64-encoded string.
19373
+ * Default: false.
19374
+ */
19375
+ store?: boolean;
19376
+ /** Workspace ID — required when store is true. */
19377
+ workspace_id?: string;
19378
+ }
19379
+ /** Response when store is true. */
19380
+ interface GeneratePdfStoredResponse {
19381
+ storage_key: string;
19382
+ /** UUID of the StorageFile record. Use with `storage.files.requestDownloadUrl(file_id)` to get a presigned download URL. */
19383
+ file_id: string;
19384
+ }
19385
+ /** Union response from generatePdf (when store is true or omitted with workspace_id). */
19386
+ type GeneratePdfResponse = GeneratePdfStoredResponse;
19387
+ /** Parameters for generating a PDF and emailing it. */
19388
+ interface EmailReportParams {
19389
+ /** HTML content to convert to PDF (max 2MB). */
19390
+ html: string;
19391
+ /** Recipient email address. */
19392
+ to: string;
19393
+ /** Email subject line. */
19394
+ subject: string;
19395
+ /** HTML body for the email (default: generic attachment note). */
19396
+ body_html?: string;
19397
+ /** PDF attachment filename (default: "report.pdf"). */
19398
+ filename?: string;
19399
+ /** Also store the PDF in platform Storage. */
19400
+ store?: boolean;
19401
+ /** Workspace ID — required when store is true. */
19402
+ workspace_id?: string;
19403
+ }
19404
+ /** Response from emailReport. */
19405
+ interface EmailReportResponse {
19406
+ /** Whether the email was sent successfully. */
19407
+ sent: boolean;
19408
+ /** Storage key if store was true, null otherwise. */
19409
+ storage_key: string | null;
19410
+ /** Error message if storage failed (email still sent). */
19411
+ storage_error?: string;
19412
+ }
19413
+
19110
19414
  /** Attributes accepted when creating a new support ticket. */
19111
19415
  type CreateSupportTicketAttributes = {
19112
19416
  workspace_id: string;
@@ -25387,6 +25691,32 @@ type ActivityFeedParams = {
25387
25691
  offset?: number;
25388
25692
  };
25389
25693
 
25694
+ /**
25695
+ * Utility type for JSON:API resource flattening.
25696
+ *
25697
+ * The SDK runtime unwraps JSON:API envelopes via `flattenResource()`:
25698
+ * { id, type, attributes: { a, b }, relationships: { r } } → { id, type, a, b, r }
25699
+ *
25700
+ * Generated types in `_internal/types.gen.ts` keep the nested envelope shape.
25701
+ * `FlatResource<T>` mirrors the runtime flattening at the type level so namespace
25702
+ * method return types match what callers actually receive.
25703
+ *
25704
+ * @example
25705
+ * ```ts
25706
+ * import type { ClinicalMealPlan } from "./_internal/types.gen";
25707
+ * import type { FlatResource } from "./json-api";
25708
+ *
25709
+ * type MealPlan = FlatResource<ClinicalMealPlan>;
25710
+ * // MealPlan.status works directly — no .attributes?.status
25711
+ * ```
25712
+ */
25713
+ type FlatResource<T> = T extends {
25714
+ id: string;
25715
+ type: string;
25716
+ attributes?: infer A;
25717
+ relationships?: infer R;
25718
+ } ? Omit<T, "attributes" | "relationships"> & (NonNullable<A> extends Record<string, unknown> ? NonNullable<A> : {}) & (NonNullable<R> extends Record<string, unknown> ? NonNullable<R> : {}) : T;
25719
+
25390
25720
  /**
25391
25721
  * Clinical namespace for the GPT Platform Client SDK.
25392
25722
  * Covers patients, sessions, notes, health metrics, meal plans,
@@ -25394,6 +25724,21 @@ type ActivityFeedParams = {
25394
25724
  * practice tools, client resource assignments, and supplement caches.
25395
25725
  */
25396
25726
 
25727
+ type ClinicalClientGoal = FlatResource<ClinicalClientGoal$1>;
25728
+ type ClinicalClientResourceAssignment = FlatResource<ClinicalClientResourceAssignment$1>;
25729
+ type ClinicalClientSupplement = FlatResource<ClinicalClientSupplement$1>;
25730
+ type ClinicalDelivery = FlatResource<ClinicalDelivery$1>;
25731
+ type ClinicalGoalTemplate = FlatResource<ClinicalGoalTemplate$1>;
25732
+ type ClinicalGoalTemplateCategory = FlatResource<ClinicalGoalTemplateCategory$1>;
25733
+ type ClinicalHealthMetric = FlatResource<ClinicalHealthMetric$1>;
25734
+ type ClinicalMealPlan = FlatResource<ClinicalMealPlan$1>;
25735
+ type ClinicalNote = FlatResource<ClinicalNote$1>;
25736
+ type ClinicalNoteVersion = FlatResource<ClinicalNoteVersion$1>;
25737
+ type ClinicalPatient = FlatResource<ClinicalPatient$1>;
25738
+ type ClinicalPracticeResource = FlatResource<ClinicalPracticeResource$1>;
25739
+ type ClinicalPracticeTool = FlatResource<ClinicalPracticeTool$1>;
25740
+ type ClinicalSession = FlatResource<ClinicalSession$1>;
25741
+ type ClinicalSupplementRecCache = FlatResource<ClinicalSupplementRecCache$1>;
25397
25742
  interface CreateClinicalPatientAttributes {
25398
25743
  workspace_id: string;
25399
25744
  contact_id?: string;
@@ -28746,6 +29091,11 @@ declare class GptClient extends BaseClient {
28746
29091
  delete: (id: string, options?: RequestOptions) => Promise<true>;
28747
29092
  };
28748
29093
  };
29094
+ /** HTML→PDF generation and report delivery */
29095
+ readonly documents: {
29096
+ generatePdf: (params: GeneratePdfParams, options?: RequestOptions) => Promise<GeneratePdfResponse>;
29097
+ emailReport: (params: EmailReportParams, options?: RequestOptions) => Promise<EmailReportResponse>;
29098
+ };
28749
29099
  /** Document upload, processing, results, and exports */
28750
29100
  readonly extraction: {
28751
29101
  documents: {
@@ -28825,6 +29175,20 @@ declare class GptClient extends BaseClient {
28825
29175
  get: (workspaceId: string, documentId: string, options?: RequestOptions) => Promise<FieldMappingRecord>;
28826
29176
  create: (workspaceId: string, documentId: string, attrs: CreateFieldMappingAttributes, options?: RequestOptions) => Promise<FieldMappingRecord>;
28827
29177
  };
29178
+ extractionAgents: {
29179
+ list: (options?: RequestOptions) => Promise<ExtractionAgent[]>;
29180
+ get: (id: string, options?: RequestOptions) => Promise<ExtractionAgent>;
29181
+ predict: (attributes: {
29182
+ name?: string;
29183
+ description?: string;
29184
+ file_content?: string;
29185
+ document_id?: string;
29186
+ [key: string]: unknown;
29187
+ }, options?: RequestOptions) => Promise<unknown>;
29188
+ };
29189
+ trainingAnalytics: {
29190
+ forWorkspace: (workspaceId: string, options?: RequestOptions) => Promise<TrainingAnalytics>;
29191
+ };
28828
29192
  };
28829
29193
  /** User authentication, profiles, and API key management */
28830
29194
  readonly identity: {
@@ -29212,7 +29576,9 @@ declare class GptClient extends BaseClient {
29212
29576
  buckets: {
29213
29577
  list: (options?: {
29214
29578
  page?: number;
29215
- pageSize?: number;
29579
+ pageSize
29580
+ /** Scoped channel tokens for WebSocket authentication */
29581
+ ? /** Scoped channel tokens for WebSocket authentication */: number;
29216
29582
  } & RequestOptions) => Promise<Bucket[]>;
29217
29583
  listAll: (options?: RequestOptions) => Promise<Bucket[]>;
29218
29584
  delete: (id: string, options?: RequestOptions) => Promise<true>;
@@ -29234,6 +29600,7 @@ declare class GptClient extends BaseClient {
29234
29600
  updateMetadata: (id: string, newMetadata: Record<string, unknown>, options?: RequestOptions) => Promise<StorageFile>;
29235
29601
  byChecksum: (checksum: string, options?: RequestOptions) => Promise<StorageFile[]>;
29236
29602
  listChildren: (parentId: string, options?: RequestOptions) => Promise<StorageFile[]>;
29603
+ requestDownloadUrl: (id: string, params?: RequestDownloadUrlParams, options?: RequestOptions) => Promise<DownloadUrlResponse>;
29237
29604
  };
29238
29605
  };
29239
29606
  /** Conversation threads, messaging, and thread management */
@@ -29468,6 +29835,7 @@ declare class GptClient extends BaseClient {
29468
29835
  cancel: (id: string, options?: RequestOptions) => Promise<unknown>;
29469
29836
  generateMasterCopy: (id: string, workspaceId: string, options?: RequestOptions) => Promise<unknown>;
29470
29837
  adaptForPlatforms: (id: string, workspaceId: string, socialAccountId: string, options?: RequestOptions) => Promise<unknown>;
29838
+ previewAdaptations: (id: string, workspaceId: string, options?: RequestOptions) => Promise<unknown>;
29471
29839
  };
29472
29840
  trending: {
29473
29841
  get: (id: string, options?: RequestOptions) => Promise<unknown>;
@@ -29610,9 +29978,7 @@ declare class GptClient extends BaseClient {
29610
29978
  };
29611
29979
  documentSections: {
29612
29980
  list: (params?: {
29613
- page
29614
- /** Contacts, companies, deals, activities, pipelines, relationships, and custom entities */
29615
- ? /** Contacts, companies, deals, activities, pipelines, relationships, and custom entities */: number;
29981
+ page?: number;
29616
29982
  pageSize?: number;
29617
29983
  }, options?: RequestOptions) => Promise<DocumentSection[]>;
29618
29984
  get: (id: string, options?: RequestOptions) => Promise<DocumentSection>;
@@ -29640,7 +30006,7 @@ declare class GptClient extends BaseClient {
29640
30006
  upload: (file: File | Blob, params: {
29641
30007
  adapter: string;
29642
30008
  workspace_id: string;
29643
- column_mapping?: Record<string, string>;
30009
+ column_mapping? /** Product catalog, inventory, pricing, and taxonomy */: Record<string, string>;
29644
30010
  metadata?: Record<string, unknown>;
29645
30011
  }, options?: RequestOptions) => Promise<{
29646
30012
  data: {
@@ -29652,7 +30018,7 @@ declare class GptClient extends BaseClient {
29652
30018
  workspace_id: string;
29653
30019
  adapter?: string;
29654
30020
  status?: string;
29655
- offset?: number;
30021
+ offset? /** Document upload, processing, results, and exports */: number;
29656
30022
  limit?: number;
29657
30023
  }, options?: RequestOptions) => Promise<{
29658
30024
  data: Import[];
@@ -29930,6 +30296,7 @@ type CampaignsAPI = ReturnType<typeof createCampaignsNamespace>;
29930
30296
  type EmailAPI = ReturnType<typeof createEmailNamespace>;
29931
30297
  type AgentsAPI = ReturnType<typeof createAgentsNamespace>;
29932
30298
  type StorageAPI = ReturnType<typeof createStorageNamespace>;
30299
+
29933
30300
  type AiAPI = ReturnType<typeof createAiNamespace>;
29934
30301
  type PlatformAPI = ReturnType<typeof createPlatformNamespace>;
29935
30302
  type SchedulingAPI = ReturnType<typeof createSchedulingNamespace>;
@@ -29938,4 +30305,4 @@ type SocialAPI = ReturnType<typeof createSocialNamespace>;
29938
30305
  type ModelsAPI = ReturnType<typeof createModelsNamespace>;
29939
30306
  type MemoryAPI = ReturnType<typeof createMemoryNamespace>;
29940
30307
 
29941
- export { API_KEY_PREFIXES, type AccessGrant, type ActivityFeedParams, type AddMemberInput, type Agent, type AgentDeployment, type AgentVersion, type AgentsAPI, type AiAPI, type ApiKey, type AppInfo, type ApprovalRequiredEvent, type AssigneeSuggestion, type AttributeFilter$1 as AttributeFilter, type AuditLog, AuthenticationError, AuthorizationError, type BaseClientConfig, type BillingAPI, type BillingAccount, BrowserApiKeyError, type BuyAddonAttributes, type CampaignsAPI, type CapacityCalculatorResponse, CardDeclinedError, type CatalogAPI, type CatalogOptionType, type CatalogOptionValue, type CatalogPriceList, type CatalogPriceListEntry, type CatalogProduct, type CatalogProductVariant, type CatalogTaxonomy, type CatalogTaxonomyNode, type CatalogView, type ChannelTokenRequest, type ChannelTokenResponse, type ChatMessage, type ChatMessageFeedback, type ChatThread, type ClinicalSearchResult, type CommunicationAPI, type CompletionEstimate, type ComplianceFrameworkReadiness, type CompliancePosture, type ComposeWithAiAttributes, ConflictError, type CreateAgentAttributes, type CreateAgentTrainingExampleAttributes, type CreateAgentVersionAttributes, type CreateCatalogOptionTypeAttributes, type CreateCatalogOptionValueAttributes, type CreateCatalogPriceListAttributes, type CreateCatalogPriceListEntryAttributes, type CreateCatalogProductAttributes, type CreateCatalogProductVariantAttributes, type CreateCatalogTaxonomyAttributes, type CreateCatalogTaxonomyNodeAttributes, type CreateCatalogViewAttributes, type CreateFieldTemplateAttributes, type CreateLabelInput, type CreateMilestoneInput, type CreateProjectInput, type CreateTaskInput, type CreateTestResultAttributes, type CreateThreadAttributes, type CreateTimeEntryInput, type CreditPackage, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DecomposedPlan, type DocumentSection, type DoneEvent, type EmailAPI, type ErrorEvent, type Execution, type ExecutionEvent, type ExtractionAPI, type ExtractionRowQueryParams, type ExtractionRowQueryResult, type FeatureDefinition, type FeatureSummary, type FeatureUsage, type FullscriptOrder, type FullscriptProduct, type FullscriptTreatmentPlan, GptClient, GptCoreError, type IdentityAPI, type Import, type ImportAdapter, type ImportRow, InsecureConnectionError, type InsertMessageAttributes, type Invitation, type Invoice, type IterationCompleteEvent, LOG_LEVELS, type ListModelsOptions, type ListPracticeToolsParams, type ListProjectsParams, type LogLevel, type Logger, type MemoryAPI, type MessageFeedback, type Milestone, type MjmlCompileResult, type ModelInfo, type ModelTier, type ModelsAPI, NetworkError, NotFoundError, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PaymentMethod, type PaymentMethodCreateAttributes, type PaymentMethodTokenizeAttributes, type PaymentMethodUpdateAttributes, PaymentRequiredError, type Plan, type PlanFeatureAllocation, type PlatformAPI, type PracticeToolCategory, type Project, type ProjectActivity, type ProjectMember, type ProjectRisk, type ProjectTemplate, type ProjectUpdate, type ProjectsNamespace, RateLimitError, type RateMessageAttributes, RequestBuilder, type RequestOptions, type RetryConfig, RetryTimeoutError, SDK_VERSION, type SchedulingAPI, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SeatInfo, type SectionDocument, type SecurityConfig, type SendMessageAttributes, ServerError, type SessionNoteType, type SessionNoteValue, type SocialAPI, type SocketManager, type SocketManagerOptions, type StorageAPI, type StreamApprovalRequiredEvent, type StreamDoneEvent, type StreamDoneMetadata, type StreamErrorEvent, type StreamIterationCompleteEvent, type StreamMessageChunk, type StreamOptions, type StreamTokenEvent, type StreamToolCallEvent, type StreamToolResultEvent, SubscriptionConflictError, type SyncActionParams, type Task, type TaskLabel, type TeachParams, type TemplateVariableSchema, type TemplateVersion, type Tenant, type ThreadsAPI, type TimeEntry, TimeoutError, type TokenDeltaEvent, type ToolCallEvent, type ToolResultEvent, type Transaction, type TranscriptionChunkResult, type TranscriptionJob, type TranscriptionJobCreateOptions, type TranscriptionJobFinalizeOptions, type TranscriptionJobFinalizeResult, type TrendingSnapshot, type TrendingSnapshotItem, type TrendingWatch, type TriggerPipelineAttributes, type UpdateAgentAttributes, type UpdateAgentTrainingExampleAttributes, type UpdateAgentVersionAttributes, type UpdateCatalogOptionTypeAttributes, type UpdateCatalogOptionValueAttributes, type UpdateCatalogPriceListAttributes, type UpdateCatalogPriceListEntryAttributes, type UpdateCatalogProductAttributes, type UpdateCatalogProductVariantAttributes, type UpdateCatalogTaxonomyAttributes, type UpdateCatalogTaxonomyNodeAttributes, type UpdateCatalogViewAttributes, type UpdateFeatureDefinitionAttributes, type UpdateMemberInput, type UpdateMessageAttributes, type UpdateProjectInput, type UpdateThreadAttributes, type UsageHistoryEntry, type User, type UserProfile, ValidationError, type VoiceAPI, type VoiceFinalizeOptions, type VoiceRecording, type VoiceSession, type VoiceSessionStart, type VoiceStartOptions, type VoiceTranscribeOptions, type VoiceTranscribeResult, type VoiceTranscriptionResult, type Wallet, type WalletPaymentMethod, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type Workspace, type WorkspaceAgentConfig, buildHeaders, buildUserAgent, collectStreamedMessage, createChannelsNamespace, createImportsNamespace, createProjectsNamespace, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
30308
+ export { API_KEY_PREFIXES, type AccessGrant, type ActivityFeedParams, type AddMemberInput, type Agent, type AgentDeployment, type AgentVersion, type AgentsAPI, type AiAPI, type ApiKey, type AppInfo, type ApprovalRequiredEvent, type AssigneeSuggestion, type AttributeFilter$1 as AttributeFilter, type AuditLog, AuthenticationError, AuthorizationError, type BaseClientConfig, type BeginUploadAttributes, type BillingAPI, type BillingAccount, BrowserApiKeyError, type BulkOperationResult, type BulkReprocessResult, type BuyAddonAttributes, type CampaignsAPI, type CapacityCalculatorResponse, CardDeclinedError, type CatalogAPI, type CatalogOptionType, type CatalogOptionValue, type CatalogPriceList, type CatalogPriceListEntry, type CatalogProduct, type CatalogProductVariant, type CatalogTaxonomy, type CatalogTaxonomyNode, type CatalogView, type ChannelTokenRequest, type ChannelTokenResponse, type ChatMessage, type ChatMessageFeedback, type ChatThread, type ClinicalSearchResult, type CommunicationAPI, type CompletionEstimate, type ComplianceFrameworkReadiness, type CompliancePosture, type ComposeWithAiAttributes, ConflictError, type CreateAgentAttributes, type CreateAgentTrainingExampleAttributes, type CreateAgentVersionAttributes, type CreateCatalogOptionTypeAttributes, type CreateCatalogOptionValueAttributes, type CreateCatalogPriceListAttributes, type CreateCatalogPriceListEntryAttributes, type CreateCatalogProductAttributes, type CreateCatalogProductVariantAttributes, type CreateCatalogTaxonomyAttributes, type CreateCatalogTaxonomyNodeAttributes, type CreateCatalogViewAttributes, type CreateExtractionBatchAttributes, type CreateExtractionExportAttributes, type CreateFieldMappingAttributes, type CreateFieldTemplateAttributes, type CreateLabelInput, type CreateMilestoneInput, type CreateProjectInput, type CreateSchemaDiscoveryAttributes, type CreateTaskInput, type CreateTestResultAttributes, type CreateThreadAttributes, type CreateTimeEntryInput, type CreditPackage, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DecomposedPlan, type DismissAllTrainedResult, type DocumentSection, type DocumentStatsResponse, type DocumentStatusResponse, type DoneEvent, type DownloadUrlResponse, type EmailAPI, type ErrorEvent, type Execution, type ExecutionEvent, type ExtractionAPI, type ExtractionExportRecord, type ExtractionPresignedUploadAttributes, type ExtractionPresignedUploadResponse, type ExtractionRowQueryParams, type ExtractionRowQueryResult, type FeatureDefinition, type FeatureSummary, type FeatureUsage, type FieldMappingRecord, type FieldTemplateRecord, type FindOrBeginUploadAttributes, type FlatResource, type FullscriptOrder, type FullscriptProduct, type FullscriptTreatmentPlan, GptClient, GptCoreError, type IdentityAPI, type Import, type ImportAdapter, type ImportRow, InsecureConnectionError, type InsertMessageAttributes, type Invitation, type Invoice, type IterationCompleteEvent, LOG_LEVELS, type ListModelsOptions, type ListPracticeToolsParams, type ListProjectsParams, type LogLevel, type Logger, type MemoryAPI, type MessageFeedback, type Milestone, type MjmlCompileResult, type ModelInfo, type ModelTier, type ModelsAPI, NetworkError, NotFoundError, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PaymentMethod, type PaymentMethodCreateAttributes, type PaymentMethodTokenizeAttributes, type PaymentMethodUpdateAttributes, PaymentRequiredError, type Plan, type PlanFeatureAllocation, type PlatformAPI, type PracticeToolCategory, type Project, type ProjectActivity, type ProjectMember, type ProjectRisk, type ProjectTemplate, type ProjectUpdate, type ProjectsNamespace, RateLimitError, type RateMessageAttributes, type RegenerateResultAttributes, RequestBuilder, type RequestDownloadUrlParams, type RequestOptions, type RetryConfig, RetryTimeoutError, SDK_VERSION, type SaveCorrectionsAttributes, type SchedulingAPI, type SchemaDiscoveryRecord, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SeatInfo, type SectionDocument, type SecurityConfig, type SendMessageAttributes, ServerError, type SessionNoteType, type SessionNoteValue, type SocialAPI, type SocketManager, type SocketManagerOptions, type StorageAPI, type StreamApprovalRequiredEvent, type StreamDoneEvent, type StreamDoneMetadata, type StreamErrorEvent, type StreamIterationCompleteEvent, type StreamMessageChunk, type StreamOptions, type StreamTokenEvent, type StreamToolCallEvent, type StreamToolResultEvent, SubscriptionConflictError, type SyncActionParams, type Task, type TaskLabel, type TeachParams, type TemplateVariableSchema, type TemplateVersion, type Tenant, type ThreadsAPI, type TimeEntry, TimeoutError, type TokenDeltaEvent, type ToolCallEvent, type ToolResultEvent, type Transaction, type TranscriptionChunkResult, type TranscriptionJob, type TranscriptionJobCreateOptions, type TranscriptionJobFinalizeOptions, type TranscriptionJobFinalizeResult, type TrendingSnapshot, type TrendingSnapshotItem, type TrendingWatch, type TriggerPipelineAttributes, type UpdateAgentAttributes, type UpdateAgentTrainingExampleAttributes, type UpdateAgentVersionAttributes, type UpdateCatalogOptionTypeAttributes, type UpdateCatalogOptionValueAttributes, type UpdateCatalogPriceListAttributes, type UpdateCatalogPriceListEntryAttributes, type UpdateCatalogProductAttributes, type UpdateCatalogProductVariantAttributes, type UpdateCatalogTaxonomyAttributes, type UpdateCatalogTaxonomyNodeAttributes, type UpdateCatalogViewAttributes, type UpdateExtractionResultAttributes, type UpdateFeatureDefinitionAttributes, type UpdateMemberInput, type UpdateMessageAttributes, type UpdateProjectInput, type UpdateThreadAttributes, type UpdateVerificationAttributes, type UsageHistoryEntry, type User, type UserProfile, ValidationError, type VoiceAPI, type VoiceFinalizeOptions, type VoiceRecording, type VoiceSession, type VoiceSessionStart, type VoiceStartOptions, type VoiceTranscribeOptions, type VoiceTranscribeResult, type VoiceTranscriptionResult, type Wallet, type WalletPaymentMethod, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type Workspace, type WorkspaceAgentConfig, buildHeaders, buildUserAgent, collectStreamedMessage, createChannelsNamespace, createImportsNamespace, createProjectsNamespace, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };