@upon-ai/sdk 0.1.1 → 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/client.js +5 -4
- package/dist/index.d.ts +35 -0
- package/dist/index.js +35 -0
- package/dist/metadata.d.ts +1101 -0
- package/dist/metadata.js +1243 -0
- package/dist/schema.d.ts +7199 -2680
- 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/client.js
CHANGED
|
@@ -129,10 +129,11 @@ export class ClientCore {
|
|
|
129
129
|
}
|
|
130
130
|
if (response.status === 204)
|
|
131
131
|
return undefined;
|
|
132
|
+
const responseLimit = operation === 'getVoiceSimulationRecording' ? 64 * 1024 * 1024 : MAX_BYTES;
|
|
132
133
|
const contentLength = Number(response.headers.get('content-length'));
|
|
133
|
-
if (contentLength >
|
|
134
|
+
if (contentLength > responseLimit) {
|
|
134
135
|
await response.body?.cancel();
|
|
135
|
-
throw new UponAIError('Response exceeds
|
|
136
|
+
throw new UponAIError('Response exceeds the permitted size');
|
|
136
137
|
}
|
|
137
138
|
const chunks = [];
|
|
138
139
|
let size = 0;
|
|
@@ -144,9 +145,9 @@ export class ClientCore {
|
|
|
144
145
|
if (done)
|
|
145
146
|
break;
|
|
146
147
|
size += value.byteLength;
|
|
147
|
-
if (size >
|
|
148
|
+
if (size > responseLimit) {
|
|
148
149
|
await reader.cancel();
|
|
149
|
-
throw new UponAIError('Response exceeds
|
|
150
|
+
throw new UponAIError('Response exceeds the permitted size');
|
|
150
151
|
}
|
|
151
152
|
chunks.push(value);
|
|
152
153
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -80,4 +80,39 @@ export declare class UponAI extends ClientCore {
|
|
|
80
80
|
endLiveCall(args: OperationInput<'endLiveCall'>, options?: RequestOptions): Promise<OperationOutput<'endLiveCall'>>;
|
|
81
81
|
updateLiveCall(args: OperationInput<'updateLiveCall'>, options?: RequestOptions): Promise<OperationOutput<'updateLiveCall'>>;
|
|
82
82
|
rerunCallAnalysis(args: OperationInput<'rerunCallAnalysis'>, options?: RequestOptions): Promise<OperationOutput<'rerunCallAnalysis'>>;
|
|
83
|
+
listVoiceSimulationTemplates(args: OperationInput<'listVoiceSimulationTemplates'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationTemplates'>>;
|
|
84
|
+
getVoiceSimulationSettings(args: OperationInput<'getVoiceSimulationSettings'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationSettings'>>;
|
|
85
|
+
listVoiceSimulationSourceAgents(args: OperationInput<'listVoiceSimulationSourceAgents'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationSourceAgents'>>;
|
|
86
|
+
listVoiceSimulationProjects(args: OperationInput<'listVoiceSimulationProjects'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationProjects'>>;
|
|
87
|
+
createVoiceSimulationProject(args: OperationInput<'createVoiceSimulationProject'>, options?: RequestOptions): Promise<OperationOutput<'createVoiceSimulationProject'>>;
|
|
88
|
+
getVoiceSimulationProject(args: OperationInput<'getVoiceSimulationProject'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationProject'>>;
|
|
89
|
+
updateVoiceSimulationProject(args: OperationInput<'updateVoiceSimulationProject'>, options?: RequestOptions): Promise<OperationOutput<'updateVoiceSimulationProject'>>;
|
|
90
|
+
listVoiceSimulationScenarios(args: OperationInput<'listVoiceSimulationScenarios'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationScenarios'>>;
|
|
91
|
+
createVoiceSimulationScenario(args: OperationInput<'createVoiceSimulationScenario'>, options?: RequestOptions): Promise<OperationOutput<'createVoiceSimulationScenario'>>;
|
|
92
|
+
updateVoiceSimulationScenario(args: OperationInput<'updateVoiceSimulationScenario'>, options?: RequestOptions): Promise<OperationOutput<'updateVoiceSimulationScenario'>>;
|
|
93
|
+
generateVoiceSimulationScenarios(args: OperationInput<'generateVoiceSimulationScenarios'>, options?: RequestOptions): Promise<OperationOutput<'generateVoiceSimulationScenarios'>>;
|
|
94
|
+
estimateVoiceSimulationSession(args: OperationInput<'estimateVoiceSimulationSession'>, options?: RequestOptions): Promise<OperationOutput<'estimateVoiceSimulationSession'>>;
|
|
95
|
+
listVoiceSimulationSessions(args: OperationInput<'listVoiceSimulationSessions'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationSessions'>>;
|
|
96
|
+
launchVoiceSimulationSession(args: OperationInput<'launchVoiceSimulationSession'>, options?: RequestOptions): Promise<OperationOutput<'launchVoiceSimulationSession'>>;
|
|
97
|
+
getVoiceSimulationSession(args: OperationInput<'getVoiceSimulationSession'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationSession'>>;
|
|
98
|
+
cancelVoiceSimulationSession(args: OperationInput<'cancelVoiceSimulationSession'>, options?: RequestOptions): Promise<OperationOutput<'cancelVoiceSimulationSession'>>;
|
|
99
|
+
proposeVoiceSimulationImprovement(args: OperationInput<'proposeVoiceSimulationImprovement'>, options?: RequestOptions): Promise<OperationOutput<'proposeVoiceSimulationImprovement'>>;
|
|
100
|
+
applyVoiceSimulationImprovement(args: OperationInput<'applyVoiceSimulationImprovement'>, options?: RequestOptions): Promise<OperationOutput<'applyVoiceSimulationImprovement'>>;
|
|
101
|
+
getVoiceSimulationRecording(args: OperationInput<'getVoiceSimulationRecording'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationRecording'>>;
|
|
102
|
+
archiveVoiceSimulationProject(args: OperationInput<'archiveVoiceSimulationProject'>, options?: RequestOptions): Promise<OperationOutput<'archiveVoiceSimulationProject'>>;
|
|
103
|
+
archiveVoiceSimulationScenario(args: OperationInput<'archiveVoiceSimulationScenario'>, options?: RequestOptions): Promise<OperationOutput<'archiveVoiceSimulationScenario'>>;
|
|
104
|
+
listVoiceSimulationImprovements(args: OperationInput<'listVoiceSimulationImprovements'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationImprovements'>>;
|
|
105
|
+
listVoiceSimulationSpeechVoices(args: OperationInput<'listVoiceSimulationSpeechVoices'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationSpeechVoices'>>;
|
|
106
|
+
generateVoiceSimulationIvrAudio(args: OperationInput<'generateVoiceSimulationIvrAudio'>, options?: RequestOptions): Promise<OperationOutput<'generateVoiceSimulationIvrAudio'>>;
|
|
107
|
+
getVoiceSimulationIvrAudio(args: OperationInput<'getVoiceSimulationIvrAudio'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationIvrAudio'>>;
|
|
108
|
+
listVoiceSimulationImprovementRuns(args: OperationInput<'listVoiceSimulationImprovementRuns'>, options?: RequestOptions): Promise<OperationOutput<'listVoiceSimulationImprovementRuns'>>;
|
|
109
|
+
createVoiceSimulationImprovementRun(args: OperationInput<'createVoiceSimulationImprovementRun'>, options?: RequestOptions): Promise<OperationOutput<'createVoiceSimulationImprovementRun'>>;
|
|
110
|
+
getVoiceSimulationImprovementRun(args: OperationInput<'getVoiceSimulationImprovementRun'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationImprovementRun'>>;
|
|
111
|
+
updateVoiceSimulationImprovementRun(args: OperationInput<'updateVoiceSimulationImprovementRun'>, options?: RequestOptions): Promise<OperationOutput<'updateVoiceSimulationImprovementRun'>>;
|
|
112
|
+
generateVoiceSimulationImprovementScenarios(args: OperationInput<'generateVoiceSimulationImprovementScenarios'>, options?: RequestOptions): Promise<OperationOutput<'generateVoiceSimulationImprovementScenarios'>>;
|
|
113
|
+
approveVoiceSimulationImprovementRun(args: OperationInput<'approveVoiceSimulationImprovementRun'>, options?: RequestOptions): Promise<OperationOutput<'approveVoiceSimulationImprovementRun'>>;
|
|
114
|
+
stopVoiceSimulationImprovementRun(args: OperationInput<'stopVoiceSimulationImprovementRun'>, options?: RequestOptions): Promise<OperationOutput<'stopVoiceSimulationImprovementRun'>>;
|
|
115
|
+
getVoiceSimulationSchedule(args: OperationInput<'getVoiceSimulationSchedule'>, options?: RequestOptions): Promise<OperationOutput<'getVoiceSimulationSchedule'>>;
|
|
116
|
+
saveVoiceSimulationSchedule(args: OperationInput<'saveVoiceSimulationSchedule'>, options?: RequestOptions): Promise<OperationOutput<'saveVoiceSimulationSchedule'>>;
|
|
117
|
+
pauseVoiceSimulationSchedule(args: OperationInput<'pauseVoiceSimulationSchedule'>, options?: RequestOptions): Promise<OperationOutput<'pauseVoiceSimulationSchedule'>>;
|
|
83
118
|
}
|
package/dist/index.js
CHANGED
|
@@ -79,4 +79,39 @@ export class UponAI extends ClientCore {
|
|
|
79
79
|
endLiveCall(args, options) { return this.execute('endLiveCall', args, options); }
|
|
80
80
|
updateLiveCall(args, options) { return this.execute('updateLiveCall', args, options); }
|
|
81
81
|
rerunCallAnalysis(args, options) { return this.execute('rerunCallAnalysis', args, options); }
|
|
82
|
+
listVoiceSimulationTemplates(args, options) { return this.execute('listVoiceSimulationTemplates', args, options); }
|
|
83
|
+
getVoiceSimulationSettings(args, options) { return this.execute('getVoiceSimulationSettings', args, options); }
|
|
84
|
+
listVoiceSimulationSourceAgents(args, options) { return this.execute('listVoiceSimulationSourceAgents', args, options); }
|
|
85
|
+
listVoiceSimulationProjects(args, options) { return this.execute('listVoiceSimulationProjects', args, options); }
|
|
86
|
+
createVoiceSimulationProject(args, options) { return this.execute('createVoiceSimulationProject', args, options); }
|
|
87
|
+
getVoiceSimulationProject(args, options) { return this.execute('getVoiceSimulationProject', args, options); }
|
|
88
|
+
updateVoiceSimulationProject(args, options) { return this.execute('updateVoiceSimulationProject', args, options); }
|
|
89
|
+
listVoiceSimulationScenarios(args, options) { return this.execute('listVoiceSimulationScenarios', args, options); }
|
|
90
|
+
createVoiceSimulationScenario(args, options) { return this.execute('createVoiceSimulationScenario', args, options); }
|
|
91
|
+
updateVoiceSimulationScenario(args, options) { return this.execute('updateVoiceSimulationScenario', args, options); }
|
|
92
|
+
generateVoiceSimulationScenarios(args, options) { return this.execute('generateVoiceSimulationScenarios', args, options); }
|
|
93
|
+
estimateVoiceSimulationSession(args, options) { return this.execute('estimateVoiceSimulationSession', args, options); }
|
|
94
|
+
listVoiceSimulationSessions(args, options) { return this.execute('listVoiceSimulationSessions', args, options); }
|
|
95
|
+
launchVoiceSimulationSession(args, options) { return this.execute('launchVoiceSimulationSession', args, options); }
|
|
96
|
+
getVoiceSimulationSession(args, options) { return this.execute('getVoiceSimulationSession', args, options); }
|
|
97
|
+
cancelVoiceSimulationSession(args, options) { return this.execute('cancelVoiceSimulationSession', args, options); }
|
|
98
|
+
proposeVoiceSimulationImprovement(args, options) { return this.execute('proposeVoiceSimulationImprovement', args, options); }
|
|
99
|
+
applyVoiceSimulationImprovement(args, options) { return this.execute('applyVoiceSimulationImprovement', args, options); }
|
|
100
|
+
getVoiceSimulationRecording(args, options) { return this.execute('getVoiceSimulationRecording', args, options); }
|
|
101
|
+
archiveVoiceSimulationProject(args, options) { return this.execute('archiveVoiceSimulationProject', args, options); }
|
|
102
|
+
archiveVoiceSimulationScenario(args, options) { return this.execute('archiveVoiceSimulationScenario', args, options); }
|
|
103
|
+
listVoiceSimulationImprovements(args, options) { return this.execute('listVoiceSimulationImprovements', args, options); }
|
|
104
|
+
listVoiceSimulationSpeechVoices(args, options) { return this.execute('listVoiceSimulationSpeechVoices', args, options); }
|
|
105
|
+
generateVoiceSimulationIvrAudio(args, options) { return this.execute('generateVoiceSimulationIvrAudio', args, options); }
|
|
106
|
+
getVoiceSimulationIvrAudio(args, options) { return this.execute('getVoiceSimulationIvrAudio', args, options); }
|
|
107
|
+
listVoiceSimulationImprovementRuns(args, options) { return this.execute('listVoiceSimulationImprovementRuns', args, options); }
|
|
108
|
+
createVoiceSimulationImprovementRun(args, options) { return this.execute('createVoiceSimulationImprovementRun', args, options); }
|
|
109
|
+
getVoiceSimulationImprovementRun(args, options) { return this.execute('getVoiceSimulationImprovementRun', args, options); }
|
|
110
|
+
updateVoiceSimulationImprovementRun(args, options) { return this.execute('updateVoiceSimulationImprovementRun', args, options); }
|
|
111
|
+
generateVoiceSimulationImprovementScenarios(args, options) { return this.execute('generateVoiceSimulationImprovementScenarios', args, options); }
|
|
112
|
+
approveVoiceSimulationImprovementRun(args, options) { return this.execute('approveVoiceSimulationImprovementRun', args, options); }
|
|
113
|
+
stopVoiceSimulationImprovementRun(args, options) { return this.execute('stopVoiceSimulationImprovementRun', args, options); }
|
|
114
|
+
getVoiceSimulationSchedule(args, options) { return this.execute('getVoiceSimulationSchedule', args, options); }
|
|
115
|
+
saveVoiceSimulationSchedule(args, options) { return this.execute('saveVoiceSimulationSchedule', args, options); }
|
|
116
|
+
pauseVoiceSimulationSchedule(args, options) { return this.execute('pauseVoiceSimulationSchedule', args, options); }
|
|
82
117
|
}
|