@upon-ai/sdk 0.1.2 → 0.1.3
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/README.md +22 -2
- package/dist/metadata.d.ts +4 -0
- package/dist/metadata.js +4 -0
- package/dist/schema.d.ts +124 -12
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Requires Node >=22.14. ESM package; CommonJS consumers can use dynamic `import()
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npm install @upon-ai/sdk@0.1.
|
|
9
|
+
npm install @upon-ai/sdk@0.1.3
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
```ts
|
|
@@ -25,7 +25,7 @@ Keep the API key on your server. Do not embed customer credentials in browser
|
|
|
25
25
|
bundles. Each client keeps its own credential; an async `apiKey` callback can
|
|
26
26
|
supply a rotated token. There are no global credentials or privileged header overrides.
|
|
27
27
|
|
|
28
|
-
All
|
|
28
|
+
All 110 reviewed public operations have named methods. Inputs use `path`, `query`
|
|
29
29
|
and `body` groups matching the public OpenAPI contract. Types include
|
|
30
30
|
`OperationInput`, `OperationOutput`, `operations` and `components`.
|
|
31
31
|
Multipart bodies use native `FormData`; binary endpoints return `Blob`.
|
|
@@ -58,3 +58,23 @@ pages fail instead of looping indefinitely. No universal cursor format is assume
|
|
|
58
58
|
Use `baseUrl` only for a trusted HTTPS API origin, such as your staging deployment.
|
|
59
59
|
The optional injected `fetch` is trusted application code, primarily for tests.
|
|
60
60
|
Types describe the reviewed contract; responses are not runtime schema-validated.
|
|
61
|
+
|
|
62
|
+
## Agent webhook settings
|
|
63
|
+
|
|
64
|
+
The contract types all eight voice events and three chat events. Use
|
|
65
|
+
`updateAgent` or `updateChatAgent` with `body.workspaceId`, `body.webhook_url`, and
|
|
66
|
+
`body.webhook_events`; set `query.version` to the editable version when changing
|
|
67
|
+
subscriptions. The platform saves the customer destination and routes delivery
|
|
68
|
+
through its proxy. Omitted fields are preserved. `webhook_url: null` clears the
|
|
69
|
+
destination; `webhook_events: []` disables customer event delivery. Read back with
|
|
70
|
+
`getAgent` or `getChatAgent` to verify the current saved customer settings.
|
|
71
|
+
Subscription changes on published versions return 409; publish the edited draft
|
|
72
|
+
separately to activate.
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
await client.updateAgent({
|
|
76
|
+
path: { agentId: 'agent_example' },
|
|
77
|
+
query: { version: 3 },
|
|
78
|
+
body: { workspaceId: 123, webhook_events: ['transcript_updated', 'transfer_ended'] },
|
|
79
|
+
});
|
|
80
|
+
```
|
package/dist/metadata.d.ts
CHANGED
|
@@ -2290,6 +2290,10 @@ export declare const metadata: {
|
|
|
2290
2290
|
readonly minItems: 1;
|
|
2291
2291
|
readonly maxItems: 100;
|
|
2292
2292
|
};
|
|
2293
|
+
readonly ai_model: {
|
|
2294
|
+
readonly type: "string";
|
|
2295
|
+
readonly description: "Optional allowed AI model ID from settings. Overrides scenario scoring models and selects their per-run tier price. Aliases are display labels, not IDs.";
|
|
2296
|
+
};
|
|
2293
2297
|
readonly repetitions: {
|
|
2294
2298
|
readonly type: "integer";
|
|
2295
2299
|
readonly minimum: 1;
|
package/dist/metadata.js
CHANGED
|
@@ -2544,6 +2544,10 @@ export const metadata = {
|
|
|
2544
2544
|
"minItems": 1,
|
|
2545
2545
|
"maxItems": 100
|
|
2546
2546
|
},
|
|
2547
|
+
"ai_model": {
|
|
2548
|
+
"type": "string",
|
|
2549
|
+
"description": "Optional allowed AI model ID from settings. Overrides scenario scoring models and selects their per-run tier price. Aliases are display labels, not IDs."
|
|
2550
|
+
},
|
|
2547
2551
|
"repetitions": {
|
|
2548
2552
|
"type": "integer",
|
|
2549
2553
|
"minimum": 1,
|
package/dist/schema.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export interface paths {
|
|
|
104
104
|
head?: never;
|
|
105
105
|
/**
|
|
106
106
|
* Update agent
|
|
107
|
-
* @description Apply partial updates
|
|
107
|
+
* @description Apply partial updates. Customer webhook URLs and event selections are stored by the platform; delivery uses the platform proxy. Omitted webhook fields are preserved. Subscription changes require an editable version; publish it separately to activate.
|
|
108
108
|
*/
|
|
109
109
|
patch: operations["updateAgent"];
|
|
110
110
|
trace?: never;
|
|
@@ -236,7 +236,7 @@ export interface paths {
|
|
|
236
236
|
head?: never;
|
|
237
237
|
/**
|
|
238
238
|
* Update chat agent
|
|
239
|
-
* @description Apply partial updates
|
|
239
|
+
* @description Apply partial updates. Customer webhook URLs and event selections are stored by the platform; delivery uses the platform proxy. Omitted webhook fields are preserved. Subscription changes require an editable version; publish it separately to activate.
|
|
240
240
|
*/
|
|
241
241
|
patch: operations["updateChatAgent"];
|
|
242
242
|
trace?: never;
|
|
@@ -2091,9 +2091,13 @@ export interface components {
|
|
|
2091
2091
|
/** @default en-US */
|
|
2092
2092
|
language?: string;
|
|
2093
2093
|
response_engine: components["schemas"]["ResponseEngine"];
|
|
2094
|
-
/**
|
|
2094
|
+
/**
|
|
2095
|
+
* Format: uri
|
|
2096
|
+
* @description Customer receiving URL saved by the platform. Delivery uses the platform proxy. Null disables customer forwarding; omitted PATCH fields are preserved. Responses include the current agent-level destination, even for historical versions.
|
|
2097
|
+
*/
|
|
2095
2098
|
webhook_url?: string | null;
|
|
2096
|
-
|
|
2099
|
+
/** @description Customer event selections. Omission preserves selections on update and defaults to the three lifecycle events on creation. An empty array disables customer event delivery. Optional subscriptions are enabled only when selected. Subscription changes require an editable version and publication to activate for production calls or chats. */
|
|
2100
|
+
webhook_events?: components["schemas"]["VoiceWebhookEvent"][];
|
|
2097
2101
|
webhook_timeout_ms?: number;
|
|
2098
2102
|
response_threshold?: number;
|
|
2099
2103
|
interruption_sensitivity?: number;
|
|
@@ -2135,6 +2139,8 @@ export interface components {
|
|
|
2135
2139
|
type: string;
|
|
2136
2140
|
llm_id?: string;
|
|
2137
2141
|
};
|
|
2142
|
+
/** @enum {string} */
|
|
2143
|
+
VoiceWebhookEvent: "call_started" | "call_ended" | "call_analyzed" | "transcript_updated" | "transfer_started" | "transfer_bridged" | "transfer_cancelled" | "transfer_ended";
|
|
2138
2144
|
CustomSttConfig: ({
|
|
2139
2145
|
/**
|
|
2140
2146
|
* @description Realtime transcription provider used when stt_mode is custom.
|
|
@@ -2152,9 +2158,13 @@ export interface components {
|
|
|
2152
2158
|
fallback_voice_ids?: string[] | null;
|
|
2153
2159
|
language?: string | null;
|
|
2154
2160
|
response_engine?: components["schemas"]["ResponseEngine"];
|
|
2155
|
-
/**
|
|
2161
|
+
/**
|
|
2162
|
+
* Format: uri
|
|
2163
|
+
* @description Customer receiving URL saved by the platform. Delivery uses the platform proxy. Null disables customer forwarding; omitted PATCH fields are preserved. Responses include the current agent-level destination, even for historical versions.
|
|
2164
|
+
*/
|
|
2156
2165
|
webhook_url?: string | null;
|
|
2157
|
-
|
|
2166
|
+
/** @description Customer event selections. Omission preserves selections on update and defaults to the three lifecycle events on creation. An empty array disables customer event delivery. Optional subscriptions are enabled only when selected. Subscription changes require an editable version and publication to activate for production calls or chats. */
|
|
2167
|
+
webhook_events?: components["schemas"]["VoiceWebhookEvent"][];
|
|
2158
2168
|
webhook_timeout_ms?: number | null;
|
|
2159
2169
|
response_threshold?: number | null;
|
|
2160
2170
|
interruption_sensitivity?: number | null;
|
|
@@ -2195,6 +2205,13 @@ export interface components {
|
|
|
2195
2205
|
voice_model?: components["schemas"]["VoiceModel"];
|
|
2196
2206
|
fallback_voice_ids?: string[] | null;
|
|
2197
2207
|
language?: string;
|
|
2208
|
+
/**
|
|
2209
|
+
* Format: uri
|
|
2210
|
+
* @description Customer receiving URL saved by the platform. Delivery uses the platform proxy. Null disables customer forwarding; omitted PATCH fields are preserved. Responses include the current agent-level destination, even for historical versions.
|
|
2211
|
+
*/
|
|
2212
|
+
webhook_url?: string | null;
|
|
2213
|
+
/** @description Customer event selections. Omission preserves selections on update and defaults to the three lifecycle events on creation. An empty array disables customer event delivery. Optional subscriptions are enabled only when selected. Subscription changes require an editable version and publication to activate for production calls or chats. */
|
|
2214
|
+
webhook_events?: components["schemas"]["VoiceWebhookEvent"][];
|
|
2198
2215
|
response_engine?: components["schemas"]["ResponseEngine"];
|
|
2199
2216
|
interruption_sensitivity?: number;
|
|
2200
2217
|
max_call_duration_ms?: number;
|
|
@@ -2279,9 +2296,13 @@ export interface components {
|
|
|
2279
2296
|
auto_close_message?: string | null;
|
|
2280
2297
|
end_chat_after_silence_ms?: number;
|
|
2281
2298
|
timezone?: string;
|
|
2282
|
-
/**
|
|
2299
|
+
/**
|
|
2300
|
+
* Format: uri
|
|
2301
|
+
* @description Customer receiving URL saved by the platform. Delivery uses the platform proxy. Null disables customer forwarding; omitted PATCH fields are preserved. Responses include the current agent-level destination, even for historical versions.
|
|
2302
|
+
*/
|
|
2283
2303
|
webhook_url?: string | null;
|
|
2284
|
-
|
|
2304
|
+
/** @description Customer event selections. Omission preserves selections on update and defaults to the three lifecycle events on creation. An empty array disables customer event delivery. Optional subscriptions are enabled only when selected. Subscription changes require an editable version and publication to activate for production calls or chats. */
|
|
2305
|
+
webhook_events?: components["schemas"]["ChatWebhookEvent"][];
|
|
2285
2306
|
webhook_timeout_ms?: number;
|
|
2286
2307
|
/** @enum {string} */
|
|
2287
2308
|
data_storage_setting?: "everything" | "everything_except_pii" | "basic_attributes_only";
|
|
@@ -2302,6 +2323,8 @@ export interface components {
|
|
|
2302
2323
|
[key: string]: string;
|
|
2303
2324
|
};
|
|
2304
2325
|
};
|
|
2326
|
+
/** @enum {string} */
|
|
2327
|
+
ChatWebhookEvent: "chat_started" | "chat_ended" | "chat_analyzed";
|
|
2305
2328
|
ChatAgentAnalysisField: {
|
|
2306
2329
|
/** @example chat_summary */
|
|
2307
2330
|
type: string;
|
|
@@ -2314,9 +2337,13 @@ export interface components {
|
|
|
2314
2337
|
ChatAgent: components["schemas"]["ChatAgentSummary"] & {
|
|
2315
2338
|
end_chat_after_silence_ms?: number | null;
|
|
2316
2339
|
timezone?: string | null;
|
|
2317
|
-
/**
|
|
2340
|
+
/**
|
|
2341
|
+
* Format: uri
|
|
2342
|
+
* @description Customer receiving URL saved by the platform. Delivery uses the platform proxy. Null disables customer forwarding; omitted PATCH fields are preserved. Responses include the current agent-level destination, even for historical versions.
|
|
2343
|
+
*/
|
|
2318
2344
|
webhook_url?: string | null;
|
|
2319
|
-
|
|
2345
|
+
/** @description Customer event selections. Omission preserves selections on update and defaults to the three lifecycle events on creation. An empty array disables customer event delivery. Optional subscriptions are enabled only when selected. Subscription changes require an editable version and publication to activate for production calls or chats. */
|
|
2346
|
+
webhook_events?: components["schemas"]["ChatWebhookEvent"][];
|
|
2320
2347
|
webhook_timeout_ms?: number | null;
|
|
2321
2348
|
/** @enum {string|null} */
|
|
2322
2349
|
data_storage_setting?: "everything" | "everything_except_pii" | "basic_attributes_only" | null;
|
|
@@ -2348,9 +2375,13 @@ export interface components {
|
|
|
2348
2375
|
auto_close_message?: string | null;
|
|
2349
2376
|
end_chat_after_silence_ms?: number;
|
|
2350
2377
|
timezone?: string;
|
|
2351
|
-
/**
|
|
2378
|
+
/**
|
|
2379
|
+
* Format: uri
|
|
2380
|
+
* @description Customer receiving URL saved by the platform. Delivery uses the platform proxy. Null disables customer forwarding; omitted PATCH fields are preserved. Responses include the current agent-level destination, even for historical versions.
|
|
2381
|
+
*/
|
|
2352
2382
|
webhook_url?: string | null;
|
|
2353
|
-
|
|
2383
|
+
/** @description Customer event selections. Omission preserves selections on update and defaults to the three lifecycle events on creation. An empty array disables customer event delivery. Optional subscriptions are enabled only when selected. Subscription changes require an editable version and publication to activate for production calls or chats. */
|
|
2384
|
+
webhook_events?: components["schemas"]["ChatWebhookEvent"][];
|
|
2354
2385
|
webhook_timeout_ms?: number;
|
|
2355
2386
|
/** @enum {string} */
|
|
2356
2387
|
data_storage_setting?: "everything" | "everything_except_pii" | "basic_attributes_only";
|
|
@@ -3456,6 +3487,8 @@ export interface components {
|
|
|
3456
3487
|
model_options?: {
|
|
3457
3488
|
counterpart?: string[];
|
|
3458
3489
|
ai?: string[];
|
|
3490
|
+
/** @description Retail-facing labels and effective per-connected-run prices for allowed AI model IDs. Blank configuration inherits the workspace surcharge. */
|
|
3491
|
+
ai_details?: components["schemas"]["VoiceSimulationModelOption"][];
|
|
3459
3492
|
defaults?: {
|
|
3460
3493
|
counterpart?: string | null;
|
|
3461
3494
|
ai?: string | null;
|
|
@@ -3483,6 +3516,15 @@ export interface components {
|
|
|
3483
3516
|
}[];
|
|
3484
3517
|
};
|
|
3485
3518
|
};
|
|
3519
|
+
VoiceSimulationModelOption: {
|
|
3520
|
+
/** @description Stable allowed AI model ID used in requests. */
|
|
3521
|
+
id: string;
|
|
3522
|
+
/** @description Configured alias */
|
|
3523
|
+
label: string;
|
|
3524
|
+
alias?: string | null;
|
|
3525
|
+
tier?: string | null;
|
|
3526
|
+
per_run_price: number;
|
|
3527
|
+
};
|
|
3486
3528
|
VoiceSimulationProject: {
|
|
3487
3529
|
/** Format: uuid */
|
|
3488
3530
|
id: string;
|
|
@@ -3561,7 +3603,17 @@ export interface components {
|
|
|
3561
3603
|
VoiceSimulationEstimate: {
|
|
3562
3604
|
currency: string;
|
|
3563
3605
|
run_count: number;
|
|
3606
|
+
/** @description Highest per-run surcharge in this session. For mixed models, use model_prices and maximum_surcharge for exact amounts. */
|
|
3564
3607
|
per_run_price?: number;
|
|
3608
|
+
/** @description Server-computed per-scenario pricing, frozen when the session is launched. Each connected repetition incurs this surcharge; voice usage and Agent IQ interactions remain separate. */
|
|
3609
|
+
model_prices?: {
|
|
3610
|
+
/** Format: uuid */
|
|
3611
|
+
scenario_id?: string;
|
|
3612
|
+
ai_model?: string;
|
|
3613
|
+
label?: string;
|
|
3614
|
+
tier?: string | null;
|
|
3615
|
+
per_run_price?: number;
|
|
3616
|
+
}[];
|
|
3565
3617
|
maximum_surcharge: number;
|
|
3566
3618
|
monthly_price?: number;
|
|
3567
3619
|
max_audio_seconds?: number;
|
|
@@ -3569,6 +3621,8 @@ export interface components {
|
|
|
3569
3621
|
};
|
|
3570
3622
|
VoiceSimulationLaunchInput: {
|
|
3571
3623
|
scenario_ids: string[];
|
|
3624
|
+
/** @description Use the same optional AI model ID as the estimate. Selects scoring and per-run tier pricing; changing it requires a new idempotency key. */
|
|
3625
|
+
ai_model?: string;
|
|
3572
3626
|
/** @default 1 */
|
|
3573
3627
|
repetitions?: number;
|
|
3574
3628
|
max_surcharge: number;
|
|
@@ -4261,6 +4315,34 @@ export interface operations {
|
|
|
4261
4315
|
"application/json": components["schemas"]["Agent"];
|
|
4262
4316
|
};
|
|
4263
4317
|
};
|
|
4318
|
+
/** @description Invalid webhook URL or event selection for this agent channel. */
|
|
4319
|
+
400: {
|
|
4320
|
+
headers: {
|
|
4321
|
+
[name: string]: unknown;
|
|
4322
|
+
};
|
|
4323
|
+
content?: never;
|
|
4324
|
+
};
|
|
4325
|
+
/** @description Agent or workspace not found or inaccessible. */
|
|
4326
|
+
404: {
|
|
4327
|
+
headers: {
|
|
4328
|
+
[name: string]: unknown;
|
|
4329
|
+
};
|
|
4330
|
+
content?: never;
|
|
4331
|
+
};
|
|
4332
|
+
/** @description The selected version is published. Create an editable version before changing subscriptions. */
|
|
4333
|
+
409: {
|
|
4334
|
+
headers: {
|
|
4335
|
+
[name: string]: unknown;
|
|
4336
|
+
};
|
|
4337
|
+
content?: never;
|
|
4338
|
+
};
|
|
4339
|
+
/** @description The webhook subscription could not be verified. Customer settings were not saved. */
|
|
4340
|
+
502: {
|
|
4341
|
+
headers: {
|
|
4342
|
+
[name: string]: unknown;
|
|
4343
|
+
};
|
|
4344
|
+
content?: never;
|
|
4345
|
+
};
|
|
4264
4346
|
};
|
|
4265
4347
|
};
|
|
4266
4348
|
listAgentVersions: {
|
|
@@ -4504,6 +4586,34 @@ export interface operations {
|
|
|
4504
4586
|
"application/json": components["schemas"]["ChatAgent"];
|
|
4505
4587
|
};
|
|
4506
4588
|
};
|
|
4589
|
+
/** @description Invalid webhook URL or event selection for this agent channel. */
|
|
4590
|
+
400: {
|
|
4591
|
+
headers: {
|
|
4592
|
+
[name: string]: unknown;
|
|
4593
|
+
};
|
|
4594
|
+
content?: never;
|
|
4595
|
+
};
|
|
4596
|
+
/** @description Agent or workspace not found or inaccessible. */
|
|
4597
|
+
404: {
|
|
4598
|
+
headers: {
|
|
4599
|
+
[name: string]: unknown;
|
|
4600
|
+
};
|
|
4601
|
+
content?: never;
|
|
4602
|
+
};
|
|
4603
|
+
/** @description The selected version is published. Create an editable version before changing subscriptions. */
|
|
4604
|
+
409: {
|
|
4605
|
+
headers: {
|
|
4606
|
+
[name: string]: unknown;
|
|
4607
|
+
};
|
|
4608
|
+
content?: never;
|
|
4609
|
+
};
|
|
4610
|
+
/** @description The webhook subscription could not be verified. Customer settings were not saved. */
|
|
4611
|
+
502: {
|
|
4612
|
+
headers: {
|
|
4613
|
+
[name: string]: unknown;
|
|
4614
|
+
};
|
|
4615
|
+
content?: never;
|
|
4616
|
+
};
|
|
4507
4617
|
};
|
|
4508
4618
|
};
|
|
4509
4619
|
listChatAgentVersions: {
|
|
@@ -7170,6 +7280,8 @@ export interface operations {
|
|
|
7170
7280
|
content: {
|
|
7171
7281
|
"application/json": {
|
|
7172
7282
|
scenario_ids: string[];
|
|
7283
|
+
/** @description Optional allowed AI model ID from settings. Overrides scenario scoring models and selects their per-run tier price. Aliases are display labels, not IDs. */
|
|
7284
|
+
ai_model?: string;
|
|
7173
7285
|
repetitions?: number;
|
|
7174
7286
|
};
|
|
7175
7287
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const publicContractSha256 = "
|
|
1
|
+
export declare const publicContractSha256 = "7f23a8c8fb2cda3db95301c41e2b7d95dbdb40419d2dd2e2878d5299eb3d5a9d";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const publicContractSha256 = '
|
|
1
|
+
export const publicContractSha256 = '7f23a8c8fb2cda3db95301c41e2b7d95dbdb40419d2dd2e2878d5299eb3d5a9d';
|