@upon-ai/sdk 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UponAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,60 @@
1
- # Temporary Holding Version
1
+ # @upon-ai/sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Typed Node.js client for the UponAI customer API. MIT © 2026 UponAI.
4
+ Requires Node >=22.14. ESM package; CommonJS consumers can use dynamic `import()`.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ npm install @upon-ai/sdk@0.1.0
10
+ ```
11
+
12
+ ```ts
13
+ import { UponAI, UponAIError } from '@upon-ai/sdk';
14
+
15
+ const client = new UponAI({ apiKey: process.env.UPONAI_API_KEY! });
16
+ const workspaces = await client.listWorkspaces();
17
+ const agents = await client.listAgents({ query: { workspaceId: 123, limit: 20 } });
18
+ const agent = await client.getAgent({
19
+ path: { agentId: 'agent_example' },
20
+ query: { workspaceId: 123 },
21
+ });
22
+ ```
23
+
24
+ Keep the API key on your server. Do not embed customer credentials in browser
25
+ bundles. Each client keeps its own credential; an async `apiKey` callback can
26
+ supply a rotated token. There are no global credentials or privileged header overrides.
27
+
28
+ All 75 reviewed public operations have named methods. Inputs use `path`, `query`
29
+ and `body` groups matching the public OpenAPI contract. Types include
30
+ `OperationInput`, `OperationOutput`, `operations` and `components`.
31
+ Multipart bodies use native `FormData`; binary endpoints return `Blob`.
32
+ JSON responses retain the API's native shape, without invented pagination fields.
33
+
34
+ ```ts
35
+ const controller = new AbortController();
36
+ try {
37
+ await client.getAgent(
38
+ { path: { agentId: 'agent_example' }, query: { workspaceId: 123 } },
39
+ { signal: controller.signal, timeoutMs: 15_000 },
40
+ );
41
+ } catch (error) {
42
+ if (error instanceof UponAIError) {
43
+ console.error(error.status, error.requestId);
44
+ }
45
+ }
46
+ ```
47
+
48
+ Default timeout is 30 seconds. Only GET requests retry HTTP 429/502/503/504,
49
+ up to twice with bounded backoff. Writes and network failures are not automatically
50
+ retried. Redirects are rejected. Responses are capped at 5 MiB; JSON requests
51
+ are capped at 5 MiB. The server applies its own multipart upload limits.
52
+
53
+ For pagination, `client.paginate({ operation, input, items, next, maxPages })`
54
+ accepts callbacks for the particular endpoint's documented page shape. `next`
55
+ returns the next operation input or `undefined`; repeated inputs and excessive
56
+ pages fail instead of looping indefinitely. No universal cursor format is assumed.
57
+
58
+ Use `baseUrl` only for a trusted HTTPS API origin, such as your staging deployment.
59
+ The optional injected `fetch` is trusted application code, primarily for tests.
60
+ Types describe the reviewed contract; responses are not runtime schema-validated.
@@ -0,0 +1,11 @@
1
+ import type { ClientOptions, OperationId, OperationInput, OperationOutput, RequestOptions, PaginationOptions } from './types.js';
2
+ export declare class ClientCore {
3
+ private readonly config;
4
+ private readonly base;
5
+ private readonly fetcher;
6
+ private readonly timeout;
7
+ private readonly retries;
8
+ constructor(config: ClientOptions);
9
+ protected execute<K extends OperationId>(operation: K, args: OperationInput<K>, options?: RequestOptions): Promise<OperationOutput<K>>;
10
+ paginate<K extends OperationId, T>(options: PaginationOptions<K, T>): AsyncGenerator<T>;
11
+ }
package/dist/client.js ADDED
@@ -0,0 +1,194 @@
1
+ import { metadata } from './metadata.js';
2
+ import { UponAIError, UponAIValidationError } from './errors.js';
3
+ const MAX_BYTES = 5 * 1024 * 1024;
4
+ const fail = (message) => { throw new UponAIValidationError(message); };
5
+ function bounded(n, min, max, label) { if (!Number.isInteger(n) || n < min || n > max)
6
+ fail(`Invalid ${label}`); return n; }
7
+ function validateValue(value, schema, name) {
8
+ if (schema.type === 'integer' && (!Number.isInteger(value)))
9
+ fail(`Expected integer: ${name}`);
10
+ if (schema.type === 'number' && (typeof value !== 'number' || !Number.isFinite(value)))
11
+ fail(`Expected number: ${name}`);
12
+ if (schema.type === 'string' && typeof value !== 'string')
13
+ fail(`Expected string: ${name}`);
14
+ if (schema.type === 'boolean' && typeof value !== 'boolean')
15
+ fail(`Expected boolean: ${name}`);
16
+ if (typeof value === 'number' && ((schema.minimum !== undefined && value < schema.minimum) || (schema.maximum !== undefined && value > schema.maximum)))
17
+ fail(`Out of range: ${name}`);
18
+ if (schema.enum && !schema.enum.includes(value))
19
+ fail(`Invalid value: ${name}`);
20
+ }
21
+ export class ClientCore {
22
+ config;
23
+ base;
24
+ fetcher;
25
+ timeout;
26
+ retries;
27
+ constructor(config) {
28
+ this.config = config;
29
+ if (!config || !(typeof config.apiKey === 'string' || typeof config.apiKey === 'function'))
30
+ fail('apiKey is required');
31
+ const url = new URL(config.baseUrl || 'https://api.upon-ai.com');
32
+ if (url.protocol !== 'https:' || url.username || url.password || url.pathname !== '/' || url.search || url.hash)
33
+ fail('baseUrl must be an HTTPS origin');
34
+ this.base = url.origin;
35
+ this.fetcher = config.fetch || globalThis.fetch;
36
+ this.timeout = bounded(config.timeoutMs ?? 30000, 1, 120000, 'timeout');
37
+ this.retries = bounded(config.maxRetries ?? 2, 0, 3, 'retry limit');
38
+ }
39
+ async execute(operation, args, options = {}) {
40
+ if (!Object.hasOwn(metadata, operation))
41
+ fail('Operation is not in the public contract');
42
+ const meta = metadata[operation], input = (args || {});
43
+ if (Object.keys(input).some(k => !['path', 'query', 'body'].includes(k)))
44
+ fail('Only path, query and body inputs are supported');
45
+ let route = meta.path;
46
+ const query = new URLSearchParams();
47
+ for (const location of ['path', 'query']) {
48
+ const supplied = input[location] || {};
49
+ if (typeof supplied !== 'object' || Array.isArray(supplied))
50
+ fail(`Invalid ${location}`);
51
+ const parameters = meta.parameters.filter((p) => p.in === location);
52
+ if (Object.keys(supplied).some(k => !parameters.some((p) => p.name === k)))
53
+ fail(`Unknown ${location} parameter`);
54
+ for (const p of parameters) {
55
+ const value = supplied[p.name];
56
+ if (value === undefined) {
57
+ if (p.required)
58
+ fail(`Missing ${location} parameter: ${p.name}`);
59
+ continue;
60
+ }
61
+ validateValue(value, p.schema, p.name);
62
+ if (location === 'path') {
63
+ if (!/^[A-Za-z0-9_-]+$/.test(String(value)))
64
+ fail(`Invalid path identifier: ${p.name}`);
65
+ route = route.replace(`{${p.name}}`, encodeURIComponent(String(value)));
66
+ }
67
+ else if (Array.isArray(value)) {
68
+ for (const v of value)
69
+ query.append(p.name, String(v));
70
+ }
71
+ else if (typeof value === 'object')
72
+ fail(`Unsupported query value: ${p.name}`);
73
+ else
74
+ query.set(p.name, String(value));
75
+ }
76
+ }
77
+ if (route.includes('{'))
78
+ fail('Missing path parameter');
79
+ if (meta.bodyRequired && input.body === undefined)
80
+ fail('Request body is required');
81
+ if (!meta.bodyType && input.body !== undefined)
82
+ fail('This operation does not accept a body');
83
+ const headers = { Accept: 'application/json' };
84
+ let body;
85
+ if (input.body !== undefined) {
86
+ if (meta.bodyType === 'multipart/form-data') {
87
+ if (!(input.body instanceof FormData))
88
+ fail('Multipart operations require FormData');
89
+ body = input.body;
90
+ }
91
+ else {
92
+ body = JSON.stringify(input.body);
93
+ headers['Content-Type'] = 'application/json';
94
+ if (Buffer.byteLength(body) > MAX_BYTES)
95
+ fail('Request exceeds 5 MiB');
96
+ }
97
+ }
98
+ const token = typeof this.config.apiKey === 'function' ? await this.config.apiKey() : this.config.apiKey;
99
+ if (!token || /[\s\x00-\x1f\x7f]/.test(token))
100
+ fail('Invalid API credential');
101
+ headers.Authorization = `Bearer ${token}`;
102
+ const url = this.base + route + (query.size ? '?' + query.toString() : '');
103
+ const timeout = AbortSignal.timeout(bounded(options.timeoutMs ?? this.timeout, 1, 120000, 'timeout'));
104
+ const signal = options.signal ? AbortSignal.any([options.signal, timeout]) : timeout;
105
+ const retryable = meta.method === 'get';
106
+ for (let attempt = 0;; attempt++) {
107
+ let response;
108
+ try {
109
+ response = await this.fetcher(url, { method: meta.method.toUpperCase(), headers, body, redirect: 'error', credentials: 'omit', signal });
110
+ }
111
+ catch {
112
+ if (signal.aborted)
113
+ throw new UponAIError('Request cancelled or timed out');
114
+ throw new UponAIError('Unable to reach the UponAI API');
115
+ }
116
+ if (retryable && attempt < this.retries && [429, 502, 503, 504].includes(response.status)) {
117
+ const retryAfter = response.headers.get('retry-after');
118
+ const seconds = retryAfter === null ? NaN : Number(retryAfter);
119
+ const delay = Number.isFinite(seconds) ? Math.min(Math.max(seconds * 1000, 0), 5000) : Math.min(200 * 2 ** attempt, 2000);
120
+ await response.body?.cancel();
121
+ await new Promise((resolve, reject) => { if (signal.aborted)
122
+ return reject(new UponAIError('Request cancelled or timed out')); const cancel = () => { clearTimeout(timer); reject(new UponAIError('Request cancelled or timed out')); }; const timer = setTimeout(() => { signal.removeEventListener('abort', cancel); resolve(); }, delay); signal.addEventListener('abort', cancel, { once: true }); });
123
+ continue;
124
+ }
125
+ if (!response.ok) {
126
+ await response.body?.cancel();
127
+ const id = response.headers.get('x-request-id');
128
+ throw new UponAIError(`UponAI API returned HTTP ${response.status}`, response.status, id && /^[\w-]{1,128}$/.test(id) ? id : undefined);
129
+ }
130
+ if (response.status === 204)
131
+ return undefined;
132
+ const contentLength = Number(response.headers.get('content-length'));
133
+ if (contentLength > MAX_BYTES) {
134
+ await response.body?.cancel();
135
+ throw new UponAIError('Response exceeds 5 MiB');
136
+ }
137
+ const chunks = [];
138
+ let size = 0;
139
+ const reader = response.body?.getReader();
140
+ if (reader) {
141
+ try {
142
+ for (;;) {
143
+ const { done, value } = await reader.read();
144
+ if (done)
145
+ break;
146
+ size += value.byteLength;
147
+ if (size > MAX_BYTES) {
148
+ await reader.cancel();
149
+ throw new UponAIError('Response exceeds 5 MiB');
150
+ }
151
+ chunks.push(value);
152
+ }
153
+ }
154
+ catch (e) {
155
+ if (e instanceof UponAIError)
156
+ throw e;
157
+ throw new UponAIError('Response interrupted');
158
+ }
159
+ }
160
+ const bytes = Buffer.concat(chunks);
161
+ const contentType = response.headers.get('content-type') || '';
162
+ if (contentType.includes('json')) {
163
+ try {
164
+ return JSON.parse(bytes.toString('utf8'));
165
+ }
166
+ catch {
167
+ throw new UponAIError('Invalid JSON response');
168
+ }
169
+ }
170
+ return new Blob([bytes], { type: contentType });
171
+ }
172
+ }
173
+ async *paginate(options) {
174
+ if (!Object.hasOwn(metadata, options.operation) || metadata[options.operation].method !== 'get')
175
+ fail('Pagination supports GET operations only');
176
+ const max = bounded(options.maxPages ?? 100, 1, 1000, 'page limit');
177
+ let input = options.input;
178
+ const seen = new Set();
179
+ for (let i = 0; i < max; i++) {
180
+ const key = JSON.stringify(input);
181
+ if (seen.has(key))
182
+ throw new UponAIError('Pagination cursor repeated');
183
+ seen.add(key);
184
+ const page = await this.execute(options.operation, input, { signal: options.signal });
185
+ for (const item of options.items(page))
186
+ yield item;
187
+ const next = options.next(page, input);
188
+ if (!next)
189
+ return;
190
+ input = next;
191
+ }
192
+ throw new UponAIError('Pagination page limit reached');
193
+ }
194
+ }
@@ -0,0 +1,8 @@
1
+ export declare class UponAIError extends Error {
2
+ readonly status?: number | undefined;
3
+ readonly requestId?: string | undefined;
4
+ constructor(message: string, status?: number | undefined, requestId?: string | undefined);
5
+ }
6
+ export declare class UponAIValidationError extends UponAIError {
7
+ constructor(message: string);
8
+ }
package/dist/errors.js ADDED
@@ -0,0 +1,13 @@
1
+ export class UponAIError extends Error {
2
+ status;
3
+ requestId;
4
+ constructor(message, status, requestId) {
5
+ super(message);
6
+ this.status = status;
7
+ this.requestId = requestId;
8
+ this.name = 'UponAIError';
9
+ }
10
+ }
11
+ export class UponAIValidationError extends UponAIError {
12
+ constructor(message) { super(message); this.name = 'UponAIValidationError'; }
13
+ }
@@ -0,0 +1,83 @@
1
+ import { ClientCore } from './client.js';
2
+ import type { OperationInput, OperationOutput, RequestOptions } from './types.js';
3
+ export * from './types.js';
4
+ export * from './errors.js';
5
+ export type { paths, components, operations } from './schema.js';
6
+ export { publicContractSha256 } from './version.js';
7
+ export declare class UponAI extends ClientCore {
8
+ listLlms(args: OperationInput<'listLlms'>, options?: RequestOptions): Promise<OperationOutput<'listLlms'>>;
9
+ createLlm(args: OperationInput<'createLlm'>, options?: RequestOptions): Promise<OperationOutput<'createLlm'>>;
10
+ getLlm(args: OperationInput<'getLlm'>, options?: RequestOptions): Promise<OperationOutput<'getLlm'>>;
11
+ updateLlm(args: OperationInput<'updateLlm'>, options?: RequestOptions): Promise<OperationOutput<'updateLlm'>>;
12
+ deleteLlm(args: OperationInput<'deleteLlm'>, options?: RequestOptions): Promise<OperationOutput<'deleteLlm'>>;
13
+ listAgents(args: OperationInput<'listAgents'>, options?: RequestOptions): Promise<OperationOutput<'listAgents'>>;
14
+ createAgent(args: OperationInput<'createAgent'>, options?: RequestOptions): Promise<OperationOutput<'createAgent'>>;
15
+ getAgent(args: OperationInput<'getAgent'>, options?: RequestOptions): Promise<OperationOutput<'getAgent'>>;
16
+ updateAgent(args: OperationInput<'updateAgent'>, options?: RequestOptions): Promise<OperationOutput<'updateAgent'>>;
17
+ deleteAgent(args: OperationInput<'deleteAgent'>, options?: RequestOptions): Promise<OperationOutput<'deleteAgent'>>;
18
+ listAgentVersions(args: OperationInput<'listAgentVersions'>, options?: RequestOptions): Promise<OperationOutput<'listAgentVersions'>>;
19
+ createAgentDraftVersion(args: OperationInput<'createAgentDraftVersion'>, options?: RequestOptions): Promise<OperationOutput<'createAgentDraftVersion'>>;
20
+ publishAgentVersion(args: OperationInput<'publishAgentVersion'>, options?: RequestOptions): Promise<OperationOutput<'publishAgentVersion'>>;
21
+ deleteAgentVersion(args: OperationInput<'deleteAgentVersion'>, options?: RequestOptions): Promise<OperationOutput<'deleteAgentVersion'>>;
22
+ listChatAgents(args: OperationInput<'listChatAgents'>, options?: RequestOptions): Promise<OperationOutput<'listChatAgents'>>;
23
+ createChatAgent(args: OperationInput<'createChatAgent'>, options?: RequestOptions): Promise<OperationOutput<'createChatAgent'>>;
24
+ getChatAgent(args: OperationInput<'getChatAgent'>, options?: RequestOptions): Promise<OperationOutput<'getChatAgent'>>;
25
+ updateChatAgent(args: OperationInput<'updateChatAgent'>, options?: RequestOptions): Promise<OperationOutput<'updateChatAgent'>>;
26
+ deleteChatAgent(args: OperationInput<'deleteChatAgent'>, options?: RequestOptions): Promise<OperationOutput<'deleteChatAgent'>>;
27
+ listChatAgentVersions(args: OperationInput<'listChatAgentVersions'>, options?: RequestOptions): Promise<OperationOutput<'listChatAgentVersions'>>;
28
+ createChatAgentDraftVersion(args: OperationInput<'createChatAgentDraftVersion'>, options?: RequestOptions): Promise<OperationOutput<'createChatAgentDraftVersion'>>;
29
+ publishChatAgentVersion(args: OperationInput<'publishChatAgentVersion'>, options?: RequestOptions): Promise<OperationOutput<'publishChatAgentVersion'>>;
30
+ deleteChatAgentVersion(args: OperationInput<'deleteChatAgentVersion'>, options?: RequestOptions): Promise<OperationOutput<'deleteChatAgentVersion'>>;
31
+ publishChatAgentVersionFiltered(args: OperationInput<'publishChatAgentVersionFiltered'>, options?: RequestOptions): Promise<OperationOutput<'publishChatAgentVersionFiltered'>>;
32
+ listChats(args: OperationInput<'listChats'>, options?: RequestOptions): Promise<OperationOutput<'listChats'>>;
33
+ createChat(args: OperationInput<'createChat'>, options?: RequestOptions): Promise<OperationOutput<'createChat'>>;
34
+ createOutboundSmsChat(args: OperationInput<'createOutboundSmsChat'>, options?: RequestOptions): Promise<OperationOutput<'createOutboundSmsChat'>>;
35
+ getChat(args: OperationInput<'getChat'>, options?: RequestOptions): Promise<OperationOutput<'getChat'>>;
36
+ updateChat(args: OperationInput<'updateChat'>, options?: RequestOptions): Promise<OperationOutput<'updateChat'>>;
37
+ createChatCompletion(args: OperationInput<'createChatCompletion'>, options?: RequestOptions): Promise<OperationOutput<'createChatCompletion'>>;
38
+ endChat(args: OperationInput<'endChat'>, options?: RequestOptions): Promise<OperationOutput<'endChat'>>;
39
+ listChatWidgets(args: OperationInput<'listChatWidgets'>, options?: RequestOptions): Promise<OperationOutput<'listChatWidgets'>>;
40
+ createChatWidget(args: OperationInput<'createChatWidget'>, options?: RequestOptions): Promise<OperationOutput<'createChatWidget'>>;
41
+ getChatWidget(args: OperationInput<'getChatWidget'>, options?: RequestOptions): Promise<OperationOutput<'getChatWidget'>>;
42
+ updateChatWidget(args: OperationInput<'updateChatWidget'>, options?: RequestOptions): Promise<OperationOutput<'updateChatWidget'>>;
43
+ regenerateWidgetKey(args: OperationInput<'regenerateWidgetKey'>, options?: RequestOptions): Promise<OperationOutput<'regenerateWidgetKey'>>;
44
+ listConversationFlows(args: OperationInput<'listConversationFlows'>, options?: RequestOptions): Promise<OperationOutput<'listConversationFlows'>>;
45
+ createConversationFlow(args: OperationInput<'createConversationFlow'>, options?: RequestOptions): Promise<OperationOutput<'createConversationFlow'>>;
46
+ getConversationFlow(args: OperationInput<'getConversationFlow'>, options?: RequestOptions): Promise<OperationOutput<'getConversationFlow'>>;
47
+ updateConversationFlow(args: OperationInput<'updateConversationFlow'>, options?: RequestOptions): Promise<OperationOutput<'updateConversationFlow'>>;
48
+ deleteConversationFlow(args: OperationInput<'deleteConversationFlow'>, options?: RequestOptions): Promise<OperationOutput<'deleteConversationFlow'>>;
49
+ listKnowledgeBases(args: OperationInput<'listKnowledgeBases'>, options?: RequestOptions): Promise<OperationOutput<'listKnowledgeBases'>>;
50
+ createKnowledgeBase(args: OperationInput<'createKnowledgeBase'>, options?: RequestOptions): Promise<OperationOutput<'createKnowledgeBase'>>;
51
+ getKnowledgeBase(args: OperationInput<'getKnowledgeBase'>, options?: RequestOptions): Promise<OperationOutput<'getKnowledgeBase'>>;
52
+ deleteKnowledgeBase(args: OperationInput<'deleteKnowledgeBase'>, options?: RequestOptions): Promise<OperationOutput<'deleteKnowledgeBase'>>;
53
+ addKnowledgeBaseSources(args: OperationInput<'addKnowledgeBaseSources'>, options?: RequestOptions): Promise<OperationOutput<'addKnowledgeBaseSources'>>;
54
+ deleteKnowledgeBaseSource(args: OperationInput<'deleteKnowledgeBaseSource'>, options?: RequestOptions): Promise<OperationOutput<'deleteKnowledgeBaseSource'>>;
55
+ listVoices(args: OperationInput<'listVoices'>, options?: RequestOptions): Promise<OperationOutput<'listVoices'>>;
56
+ searchCommunityVoices(args: OperationInput<'searchCommunityVoices'>, options?: RequestOptions): Promise<OperationOutput<'searchCommunityVoices'>>;
57
+ addCommunityVoice(args: OperationInput<'addCommunityVoice'>, options?: RequestOptions): Promise<OperationOutput<'addCommunityVoice'>>;
58
+ cloneVoice(args: OperationInput<'cloneVoice'>, options?: RequestOptions): Promise<OperationOutput<'cloneVoice'>>;
59
+ getVoice(args: OperationInput<'getVoice'>, options?: RequestOptions): Promise<OperationOutput<'getVoice'>>;
60
+ streamVoiceSample(args: OperationInput<'streamVoiceSample'>, options?: RequestOptions): Promise<OperationOutput<'streamVoiceSample'>>;
61
+ listTestCaseDefinitions(args: OperationInput<'listTestCaseDefinitions'>, options?: RequestOptions): Promise<OperationOutput<'listTestCaseDefinitions'>>;
62
+ createTestCaseDefinition(args: OperationInput<'createTestCaseDefinition'>, options?: RequestOptions): Promise<OperationOutput<'createTestCaseDefinition'>>;
63
+ listBatchTests(args: OperationInput<'listBatchTests'>, options?: RequestOptions): Promise<OperationOutput<'listBatchTests'>>;
64
+ createBatchTest(args: OperationInput<'createBatchTest'>, options?: RequestOptions): Promise<OperationOutput<'createBatchTest'>>;
65
+ getBatchTest(args: OperationInput<'getBatchTest'>, options?: RequestOptions): Promise<OperationOutput<'getBatchTest'>>;
66
+ getTestCaseDefinition(args: OperationInput<'getTestCaseDefinition'>, options?: RequestOptions): Promise<OperationOutput<'getTestCaseDefinition'>>;
67
+ updateTestCaseDefinition(args: OperationInput<'updateTestCaseDefinition'>, options?: RequestOptions): Promise<OperationOutput<'updateTestCaseDefinition'>>;
68
+ deleteTestCaseDefinition(args: OperationInput<'deleteTestCaseDefinition'>, options?: RequestOptions): Promise<OperationOutput<'deleteTestCaseDefinition'>>;
69
+ getTestRun(args: OperationInput<'getTestRun'>, options?: RequestOptions): Promise<OperationOutput<'getTestRun'>>;
70
+ listTestRunsByBatch(args: OperationInput<'listTestRunsByBatch'>, options?: RequestOptions): Promise<OperationOutput<'listTestRunsByBatch'>>;
71
+ getConcurrency(args: OperationInput<'getConcurrency'>, options?: RequestOptions): Promise<OperationOutput<'getConcurrency'>>;
72
+ listWorkspaces(args?: OperationInput<'listWorkspaces'>, options?: RequestOptions): Promise<OperationOutput<'listWorkspaces'>>;
73
+ createPhoneCall(args: OperationInput<'createPhoneCall'>, options?: RequestOptions): Promise<OperationOutput<'createPhoneCall'>>;
74
+ createWebCall(args: OperationInput<'createWebCall'>, options?: RequestOptions): Promise<OperationOutput<'createWebCall'>>;
75
+ listCalls(args?: OperationInput<'listCalls'>, options?: RequestOptions): Promise<OperationOutput<'listCalls'>>;
76
+ listCallsFiltered(args?: OperationInput<'listCallsFiltered'>, options?: RequestOptions): Promise<OperationOutput<'listCallsFiltered'>>;
77
+ fetchCallHistory(args: OperationInput<'fetchCallHistory'>, options?: RequestOptions): Promise<OperationOutput<'fetchCallHistory'>>;
78
+ getCall(args: OperationInput<'getCall'>, options?: RequestOptions): Promise<OperationOutput<'getCall'>>;
79
+ updateCall(args: OperationInput<'updateCall'>, options?: RequestOptions): Promise<OperationOutput<'updateCall'>>;
80
+ endLiveCall(args: OperationInput<'endLiveCall'>, options?: RequestOptions): Promise<OperationOutput<'endLiveCall'>>;
81
+ updateLiveCall(args: OperationInput<'updateLiveCall'>, options?: RequestOptions): Promise<OperationOutput<'updateLiveCall'>>;
82
+ rerunCallAnalysis(args: OperationInput<'rerunCallAnalysis'>, options?: RequestOptions): Promise<OperationOutput<'rerunCallAnalysis'>>;
83
+ }
package/dist/index.js ADDED
@@ -0,0 +1,82 @@
1
+ // Generated; edit the generator, not this file.
2
+ import { ClientCore } from './client.js';
3
+ export * from './types.js';
4
+ export * from './errors.js';
5
+ export { publicContractSha256 } from './version.js';
6
+ export class UponAI extends ClientCore {
7
+ listLlms(args, options) { return this.execute('listLlms', args, options); }
8
+ createLlm(args, options) { return this.execute('createLlm', args, options); }
9
+ getLlm(args, options) { return this.execute('getLlm', args, options); }
10
+ updateLlm(args, options) { return this.execute('updateLlm', args, options); }
11
+ deleteLlm(args, options) { return this.execute('deleteLlm', args, options); }
12
+ listAgents(args, options) { return this.execute('listAgents', args, options); }
13
+ createAgent(args, options) { return this.execute('createAgent', args, options); }
14
+ getAgent(args, options) { return this.execute('getAgent', args, options); }
15
+ updateAgent(args, options) { return this.execute('updateAgent', args, options); }
16
+ deleteAgent(args, options) { return this.execute('deleteAgent', args, options); }
17
+ listAgentVersions(args, options) { return this.execute('listAgentVersions', args, options); }
18
+ createAgentDraftVersion(args, options) { return this.execute('createAgentDraftVersion', args, options); }
19
+ publishAgentVersion(args, options) { return this.execute('publishAgentVersion', args, options); }
20
+ deleteAgentVersion(args, options) { return this.execute('deleteAgentVersion', args, options); }
21
+ listChatAgents(args, options) { return this.execute('listChatAgents', args, options); }
22
+ createChatAgent(args, options) { return this.execute('createChatAgent', args, options); }
23
+ getChatAgent(args, options) { return this.execute('getChatAgent', args, options); }
24
+ updateChatAgent(args, options) { return this.execute('updateChatAgent', args, options); }
25
+ deleteChatAgent(args, options) { return this.execute('deleteChatAgent', args, options); }
26
+ listChatAgentVersions(args, options) { return this.execute('listChatAgentVersions', args, options); }
27
+ createChatAgentDraftVersion(args, options) { return this.execute('createChatAgentDraftVersion', args, options); }
28
+ publishChatAgentVersion(args, options) { return this.execute('publishChatAgentVersion', args, options); }
29
+ deleteChatAgentVersion(args, options) { return this.execute('deleteChatAgentVersion', args, options); }
30
+ publishChatAgentVersionFiltered(args, options) { return this.execute('publishChatAgentVersionFiltered', args, options); }
31
+ listChats(args, options) { return this.execute('listChats', args, options); }
32
+ createChat(args, options) { return this.execute('createChat', args, options); }
33
+ createOutboundSmsChat(args, options) { return this.execute('createOutboundSmsChat', args, options); }
34
+ getChat(args, options) { return this.execute('getChat', args, options); }
35
+ updateChat(args, options) { return this.execute('updateChat', args, options); }
36
+ createChatCompletion(args, options) { return this.execute('createChatCompletion', args, options); }
37
+ endChat(args, options) { return this.execute('endChat', args, options); }
38
+ listChatWidgets(args, options) { return this.execute('listChatWidgets', args, options); }
39
+ createChatWidget(args, options) { return this.execute('createChatWidget', args, options); }
40
+ getChatWidget(args, options) { return this.execute('getChatWidget', args, options); }
41
+ updateChatWidget(args, options) { return this.execute('updateChatWidget', args, options); }
42
+ regenerateWidgetKey(args, options) { return this.execute('regenerateWidgetKey', args, options); }
43
+ listConversationFlows(args, options) { return this.execute('listConversationFlows', args, options); }
44
+ createConversationFlow(args, options) { return this.execute('createConversationFlow', args, options); }
45
+ getConversationFlow(args, options) { return this.execute('getConversationFlow', args, options); }
46
+ updateConversationFlow(args, options) { return this.execute('updateConversationFlow', args, options); }
47
+ deleteConversationFlow(args, options) { return this.execute('deleteConversationFlow', args, options); }
48
+ listKnowledgeBases(args, options) { return this.execute('listKnowledgeBases', args, options); }
49
+ createKnowledgeBase(args, options) { return this.execute('createKnowledgeBase', args, options); }
50
+ getKnowledgeBase(args, options) { return this.execute('getKnowledgeBase', args, options); }
51
+ deleteKnowledgeBase(args, options) { return this.execute('deleteKnowledgeBase', args, options); }
52
+ addKnowledgeBaseSources(args, options) { return this.execute('addKnowledgeBaseSources', args, options); }
53
+ deleteKnowledgeBaseSource(args, options) { return this.execute('deleteKnowledgeBaseSource', args, options); }
54
+ listVoices(args, options) { return this.execute('listVoices', args, options); }
55
+ searchCommunityVoices(args, options) { return this.execute('searchCommunityVoices', args, options); }
56
+ addCommunityVoice(args, options) { return this.execute('addCommunityVoice', args, options); }
57
+ cloneVoice(args, options) { return this.execute('cloneVoice', args, options); }
58
+ getVoice(args, options) { return this.execute('getVoice', args, options); }
59
+ streamVoiceSample(args, options) { return this.execute('streamVoiceSample', args, options); }
60
+ listTestCaseDefinitions(args, options) { return this.execute('listTestCaseDefinitions', args, options); }
61
+ createTestCaseDefinition(args, options) { return this.execute('createTestCaseDefinition', args, options); }
62
+ listBatchTests(args, options) { return this.execute('listBatchTests', args, options); }
63
+ createBatchTest(args, options) { return this.execute('createBatchTest', args, options); }
64
+ getBatchTest(args, options) { return this.execute('getBatchTest', args, options); }
65
+ getTestCaseDefinition(args, options) { return this.execute('getTestCaseDefinition', args, options); }
66
+ updateTestCaseDefinition(args, options) { return this.execute('updateTestCaseDefinition', args, options); }
67
+ deleteTestCaseDefinition(args, options) { return this.execute('deleteTestCaseDefinition', args, options); }
68
+ getTestRun(args, options) { return this.execute('getTestRun', args, options); }
69
+ listTestRunsByBatch(args, options) { return this.execute('listTestRunsByBatch', args, options); }
70
+ getConcurrency(args, options) { return this.execute('getConcurrency', args, options); }
71
+ listWorkspaces(args = {}, options) { return this.execute('listWorkspaces', args, options); }
72
+ createPhoneCall(args, options) { return this.execute('createPhoneCall', args, options); }
73
+ createWebCall(args, options) { return this.execute('createWebCall', args, options); }
74
+ listCalls(args = {}, options) { return this.execute('listCalls', args, options); }
75
+ listCallsFiltered(args = {}, options) { return this.execute('listCallsFiltered', args, options); }
76
+ fetchCallHistory(args, options) { return this.execute('fetchCallHistory', args, options); }
77
+ getCall(args, options) { return this.execute('getCall', args, options); }
78
+ updateCall(args, options) { return this.execute('updateCall', args, options); }
79
+ endLiveCall(args, options) { return this.execute('endLiveCall', args, options); }
80
+ updateLiveCall(args, options) { return this.execute('updateLiveCall', args, options); }
81
+ rerunCallAnalysis(args, options) { return this.execute('rerunCallAnalysis', args, options); }
82
+ }