@amigo-ai/platform-sdk 0.4.1 → 0.4.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 +111 -0
- package/api.md +347 -0
- package/dist/core/errors.js +26 -4
- package/dist/core/errors.js.map +1 -1
- package/dist/core/openapi-client.js +164 -28
- package/dist/core/openapi-client.js.map +1 -1
- package/dist/core/request-options.js +80 -0
- package/dist/core/request-options.js.map +1 -0
- package/dist/core/retry.js +5 -2
- package/dist/core/retry.js.map +1 -1
- package/dist/core/utils.js +48 -2
- package/dist/core/utils.js.map +1 -1
- package/dist/core/webhooks.js +9 -0
- package/dist/core/webhooks.js.map +1 -1
- package/dist/index.cjs +538 -84
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +113 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +538 -84
- package/dist/index.mjs.map +4 -4
- package/dist/resources/base.js +33 -0
- package/dist/resources/base.js.map +1 -1
- package/dist/types/core/errors.d.ts +6 -0
- package/dist/types/core/errors.d.ts.map +1 -1
- package/dist/types/core/openapi-client.d.ts +26 -1
- package/dist/types/core/openapi-client.d.ts.map +1 -1
- package/dist/types/core/request-options.d.ts +66 -0
- package/dist/types/core/request-options.d.ts.map +1 -0
- package/dist/types/core/retry.d.ts +1 -1
- package/dist/types/core/retry.d.ts.map +1 -1
- package/dist/types/core/utils.d.ts +27 -1
- package/dist/types/core/utils.d.ts.map +1 -1
- package/dist/types/core/webhooks.d.ts.map +1 -1
- package/dist/types/index.d.ts +31 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/actions.d.ts +5 -5
- package/dist/types/resources/agents.d.ts +7 -7
- package/dist/types/resources/analytics.d.ts +11 -11
- package/dist/types/resources/api-keys.d.ts +4 -4
- package/dist/types/resources/audit.d.ts +6 -6
- package/dist/types/resources/base.d.ts +8 -3
- package/dist/types/resources/base.d.ts.map +1 -1
- package/dist/types/resources/billing.d.ts +6 -6
- package/dist/types/resources/calls.d.ts +6 -6
- package/dist/types/resources/compliance.d.ts +3 -3
- package/dist/types/resources/context-graphs.d.ts +7 -7
- package/dist/types/resources/data-sources.d.ts +6 -6
- package/dist/types/resources/functions.d.ts +6 -6
- package/dist/types/resources/integrations.d.ts +6 -6
- package/dist/types/resources/memory.d.ts +3 -3
- package/dist/types/resources/operators.d.ts +18 -18
- package/dist/types/resources/personas.d.ts +4 -4
- package/dist/types/resources/phone-numbers.d.ts +5 -5
- package/dist/types/resources/recordings.d.ts +2 -2
- package/dist/types/resources/review-queue.d.ts +17 -17
- package/dist/types/resources/safety.d.ts +5 -5
- package/dist/types/resources/services.d.ts +4 -4
- package/dist/types/resources/settings.d.ts +14 -14
- package/dist/types/resources/simulations.d.ts +6 -6
- package/dist/types/resources/skills.d.ts +5 -5
- package/dist/types/resources/triggers.d.ts +8 -8
- package/dist/types/resources/webhook-destinations.d.ts +6 -6
- package/dist/types/resources/workspaces.d.ts +5 -5
- package/dist/types/resources/world.d.ts +18 -18
- package/package.json +6 -2
package/dist/resources/base.js
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
* injected from AmigoClient. Resources call typed HTTP methods that
|
|
6
6
|
* flow through the middleware chain automatically.
|
|
7
7
|
*/
|
|
8
|
+
import { applyPlatformRequestOptions } from '../core/openapi-client.js';
|
|
9
|
+
import { mergeRequestOptions, mergeScopedRequestOptions, } from '../core/request-options.js';
|
|
8
10
|
import { extractData } from '../core/utils.js';
|
|
11
|
+
const scopedClientState = new WeakMap();
|
|
9
12
|
export class WorkspaceScopedResource {
|
|
10
13
|
client;
|
|
11
14
|
workspaceId;
|
|
@@ -13,6 +16,36 @@ export class WorkspaceScopedResource {
|
|
|
13
16
|
this.client = client;
|
|
14
17
|
this.workspaceId = workspaceId;
|
|
15
18
|
}
|
|
19
|
+
withOptions(options) {
|
|
20
|
+
const ResourceCtor = this.constructor;
|
|
21
|
+
return new ResourceCtor(scopePlatformClient(this.client, options), this.workspaceId);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function scopePlatformClient(client, options) {
|
|
25
|
+
const { baseClient, options: existingOptions } = resolveScopedPlatformClient(client);
|
|
26
|
+
const mergedOptions = mergeScopedRequestOptions(existingOptions, options);
|
|
27
|
+
const scopedClient = {
|
|
28
|
+
request: (method, path, init) => baseClient.request(method, path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
29
|
+
GET: (path, init) => baseClient.GET(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
30
|
+
PUT: (path, init) => baseClient.PUT(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
31
|
+
POST: (path, init) => baseClient.POST(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
32
|
+
DELETE: (path, init) => baseClient.DELETE(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
33
|
+
OPTIONS: (path, init) => baseClient.OPTIONS(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
34
|
+
HEAD: (path, init) => baseClient.HEAD(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
35
|
+
PATCH: (path, init) => baseClient.PATCH(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
36
|
+
TRACE: (path, init) => baseClient.TRACE(path, applyPlatformRequestOptions(baseClient, mergeRequestOptions(mergedOptions, init))),
|
|
37
|
+
use: (...middleware) => baseClient.use(...middleware),
|
|
38
|
+
eject: (...middleware) => baseClient.eject(...middleware),
|
|
39
|
+
};
|
|
40
|
+
scopedClientState.set(scopedClient, { baseClient, options: mergedOptions });
|
|
41
|
+
return scopedClient;
|
|
42
|
+
}
|
|
43
|
+
export function resolveScopedPlatformClient(client) {
|
|
44
|
+
const existing = scopedClientState.get(client);
|
|
45
|
+
return {
|
|
46
|
+
baseClient: existing?.baseClient ?? client,
|
|
47
|
+
options: existing?.options,
|
|
48
|
+
};
|
|
16
49
|
}
|
|
17
50
|
export { extractData };
|
|
18
51
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/resources/base.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/resources/base.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,2BAA2B,EAAsB,MAAM,2BAA2B,CAAA;AAC3F,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAE1B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAGlC,CAAA;AAEH,MAAM,OAAgB,uBAAuB;IAEtB;IACA;IAFrB,YACqB,MAAqB,EACrB,WAAmB;QADnB,WAAM,GAAN,MAAM,CAAe;QACrB,gBAAW,GAAX,WAAW,CAAQ;IACrC,CAAC;IAEJ,WAAW,CAAC,OAA6B;QACvC,MAAM,YAAY,GAAG,IAAI,CAAC,WAGjB,CAAA;QACT,OAAO,IAAI,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACtF,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB,CACjC,MAAqB,EACrB,OAA6B;IAE7B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAA;IACpF,MAAM,aAAa,GAAG,yBAAyB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IAEzE,MAAM,YAAY,GAAG;QACnB,OAAO,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,IAAa,EAAE,EAAE,CACvD,UAAU,CAAC,OAAO,CACh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CAAC,aAAa,EAAE,IAAa,CAAC,CACzC,CACX;QACH,KAAK,EAAE,CAAC,IAAY,EAAE,IAAa,EAAE,EAAE,CACrC,UAAU,CAAC,KAAK,CACd,IAAa,EACb,2BAA2B,CACzB,UAAU,EACV,mBAAmB,CAAC,aAAa,EAAE,IAAa,CAAC,CACzC,CACX;QACH,GAAG,EAAE,CAAC,GAAG,UAAwB,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;QACnE,KAAK,EAAE,CAAC,GAAG,UAAwB,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;KACvD,CAAA;IAElB,iBAAiB,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAA;IAC3E,OAAO,YAAY,CAAA;AACrB,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,MAAqB;IAI/D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9C,OAAO;QACL,UAAU,EAAE,QAAQ,EAAE,UAAU,IAAI,MAAM;QAC1C,OAAO,EAAE,QAAQ,EAAE,OAAO;KAC3B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -62,6 +62,11 @@ export declare class ServiceUnavailableError extends ServerError {
|
|
|
62
62
|
export declare class NetworkError extends AmigoError {
|
|
63
63
|
constructor(message: string, cause?: unknown);
|
|
64
64
|
}
|
|
65
|
+
/** Request timed out before receiving a response */
|
|
66
|
+
export declare class RequestTimeoutError extends NetworkError {
|
|
67
|
+
readonly timeoutMs?: number;
|
|
68
|
+
constructor(message: string, timeoutMs?: number, cause?: unknown);
|
|
69
|
+
}
|
|
65
70
|
/** Failed to parse response body */
|
|
66
71
|
export declare class ParseError extends AmigoError {
|
|
67
72
|
readonly body?: string;
|
|
@@ -76,4 +81,5 @@ export declare function isAmigoError(err: unknown): err is AmigoError;
|
|
|
76
81
|
export declare function isNotFoundError(err: unknown): err is NotFoundError;
|
|
77
82
|
export declare function isRateLimitError(err: unknown): err is RateLimitError;
|
|
78
83
|
export declare function isAuthenticationError(err: unknown): err is AuthenticationError;
|
|
84
|
+
export declare function isRequestTimeoutError(err: unknown): err is RequestTimeoutError;
|
|
79
85
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAkCD,mDAAmD;AACnD,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,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SAAQ,UAAU;gBAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAM7C;AAED,oDAAoD;AACpD,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;gBAEf,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAIjE;AAED,oCAAoC;AACpC,qBAAa,UAAW,SAAQ,UAAU;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;gBAEV,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAI3C;AAED,2BAA2B;AAC3B,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,OAAO,EAAE,MAAM;CAG5B;AAWD,wBAAsB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAwC5E;AAgBD,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAE5D;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,aAAa,CAElE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,cAAc,CAEpE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,mBAAmB,CAE9E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,mBAAmB,CAE9E"}
|
|
@@ -5,18 +5,43 @@
|
|
|
5
5
|
* Supports custom `fetch` for BFF proxy patterns (e.g., developer-console
|
|
6
6
|
* routing through Next.js API routes).
|
|
7
7
|
*/
|
|
8
|
-
import createClientImport from 'openapi-fetch';
|
|
8
|
+
import createClientImport, { type HeadersOptions } from 'openapi-fetch';
|
|
9
9
|
import type { paths } from '../generated/api.js';
|
|
10
|
+
import { parseRateLimitHeaders } from './rate-limit.js';
|
|
11
|
+
import { type AmigoRequestOptions } from './request-options.js';
|
|
10
12
|
import { type RetryOptions } from './retry.js';
|
|
11
13
|
declare const createClient: typeof createClientImport;
|
|
12
14
|
export type PlatformFetch = ReturnType<typeof createClient<paths>>;
|
|
15
|
+
export interface RequestHookContext {
|
|
16
|
+
id: string;
|
|
17
|
+
request: Request;
|
|
18
|
+
schemaPath: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ResponseHookContext extends RequestHookContext {
|
|
21
|
+
response: Response;
|
|
22
|
+
requestId: string | null;
|
|
23
|
+
rateLimit: ReturnType<typeof parseRateLimitHeaders>;
|
|
24
|
+
}
|
|
25
|
+
export interface ErrorHookContext extends RequestHookContext {
|
|
26
|
+
error: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface ClientHooks {
|
|
29
|
+
onRequest?: (context: RequestHookContext) => void | Promise<void>;
|
|
30
|
+
onResponse?: (context: ResponseHookContext) => void | Promise<void>;
|
|
31
|
+
onError?: (context: ErrorHookContext) => void | Promise<void>;
|
|
32
|
+
}
|
|
13
33
|
export interface ClientConfig {
|
|
14
34
|
apiKey: string;
|
|
15
35
|
baseUrl: string;
|
|
16
36
|
retry?: RetryOptions;
|
|
37
|
+
maxRetries?: number;
|
|
38
|
+
timeout?: number;
|
|
39
|
+
headers?: HeadersOptions;
|
|
40
|
+
hooks?: ClientHooks;
|
|
17
41
|
/** Custom fetch implementation — use for BFF proxy routing or test mocking. */
|
|
18
42
|
fetch?: typeof globalThis.fetch;
|
|
19
43
|
}
|
|
20
44
|
export declare function createPlatformClient(config: ClientConfig): PlatformFetch;
|
|
45
|
+
export declare function applyPlatformRequestOptions<Operation>(client: PlatformFetch, init: AmigoRequestOptions<Operation> | undefined): AmigoRequestOptions<Operation> | undefined;
|
|
21
46
|
export {};
|
|
22
47
|
//# sourceMappingURL=openapi-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi-client.d.ts","sourceRoot":"","sources":["../../../src/core/openapi-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"openapi-client.d.ts","sourceRoot":"","sources":["../../../src/core/openapi-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,kBAAkB,EAAE,EAAE,KAAK,cAAc,EAAmB,MAAM,eAAe,CAAA;AACxF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAGhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAkD,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAI9F,QAAA,MAAM,YAAY,EAAE,OAAO,kBAG4D,CAAA;AAEvF,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AAElE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;CACpD;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAWD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CA2DxE;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EACnD,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,GAAG,SAAS,GAC/C,mBAAmB,CAAC,SAAS,CAAC,GAAG,SAAS,CAoC5C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { FetchOptions, HeadersOptions } from 'openapi-fetch';
|
|
2
|
+
import type { paths } from '../generated/api.js';
|
|
3
|
+
import type { RetryOptions } from './retry.js';
|
|
4
|
+
export type OperationFor<Path extends keyof paths & string, Method extends keyof paths[Path] & string> = paths[Path][Method];
|
|
5
|
+
type OptionalizeWorkspacePath<PathParams> = PathParams extends {
|
|
6
|
+
workspace_id: infer WorkspaceId;
|
|
7
|
+
} ? Omit<PathParams, 'workspace_id'> & {
|
|
8
|
+
workspace_id?: WorkspaceId;
|
|
9
|
+
} : PathParams;
|
|
10
|
+
type EmptyShape = Record<never, never>;
|
|
11
|
+
type RewriteParams<Options> = Options extends {
|
|
12
|
+
params: infer Params;
|
|
13
|
+
} ? RewriteParamShape<Params> extends infer RewrittenParams ? RewrittenParams extends object ? RequiredKeysOf<RewrittenParams> extends never ? Omit<Options, 'params'> & {
|
|
14
|
+
params?: RewrittenParams;
|
|
15
|
+
} : Omit<Options, 'params'> & {
|
|
16
|
+
params: RewrittenParams;
|
|
17
|
+
} : Omit<Options, 'params'> & {
|
|
18
|
+
params: RewrittenParams;
|
|
19
|
+
} : Options : Options extends {
|
|
20
|
+
params?: infer Params;
|
|
21
|
+
} ? Omit<Options, 'params'> & {
|
|
22
|
+
params?: RewriteParamShape<Params>;
|
|
23
|
+
} : Options;
|
|
24
|
+
type RewriteParamShape<Params> = Params extends object ? Omit<Params, 'path'> & RewritePathParam<Params> : Params;
|
|
25
|
+
type RewritePathParam<Params> = Params extends {
|
|
26
|
+
path: infer PathParams;
|
|
27
|
+
} ? OptionalizeWorkspacePath<PathParams> extends infer RewrittenPath ? RewrittenPath extends object ? RequiredKeysOf<RewrittenPath> extends never ? {
|
|
28
|
+
path?: RewrittenPath;
|
|
29
|
+
} : {
|
|
30
|
+
path: RewrittenPath;
|
|
31
|
+
} : {
|
|
32
|
+
path: RewrittenPath;
|
|
33
|
+
} : EmptyShape : EmptyShape;
|
|
34
|
+
type RequiredKeysOf<T extends object> = Exclude<{
|
|
35
|
+
[K in keyof T]-?: EmptyShape extends Pick<T, K> ? never : K;
|
|
36
|
+
}[keyof T], undefined>;
|
|
37
|
+
export type InitParam<Init extends object> = RequiredKeysOf<Init> extends never ? [init?: Init] : [init: Init];
|
|
38
|
+
export type AmigoRequestOptions<Operation = unknown> = Omit<RewriteParams<FetchOptions<Operation>>, 'timeout' | 'maxRetries' | 'retry'> & {
|
|
39
|
+
timeout?: number;
|
|
40
|
+
maxRetries?: number;
|
|
41
|
+
retry?: RetryOptions;
|
|
42
|
+
};
|
|
43
|
+
export type ScopedRequestOptions = Omit<RequestInit, 'body' | 'headers' | 'method'> & {
|
|
44
|
+
headers?: HeadersOptions;
|
|
45
|
+
timeout?: number;
|
|
46
|
+
maxRetries?: number;
|
|
47
|
+
retry?: RetryOptions;
|
|
48
|
+
};
|
|
49
|
+
export interface RequestControlOptions {
|
|
50
|
+
timeout?: number;
|
|
51
|
+
maxRetries?: number;
|
|
52
|
+
retry?: RetryOptions;
|
|
53
|
+
}
|
|
54
|
+
type MergeableRequestOptions = object & {
|
|
55
|
+
headers?: HeadersOptions;
|
|
56
|
+
signal?: AbortSignal | null;
|
|
57
|
+
timeout?: number;
|
|
58
|
+
maxRetries?: number;
|
|
59
|
+
retry?: RetryOptions;
|
|
60
|
+
};
|
|
61
|
+
export declare function stripRequestControls<Options extends RequestControlOptions>(options: Options | undefined): Omit<Options, keyof RequestControlOptions> | undefined;
|
|
62
|
+
export declare function mergeRequestOptions<Options extends object>(base: ScopedRequestOptions | undefined, override: Options | undefined): (Options & MergeableRequestOptions) | undefined;
|
|
63
|
+
export declare function mergeScopedRequestOptions(base: ScopedRequestOptions | undefined, override: ScopedRequestOptions): ScopedRequestOptions;
|
|
64
|
+
export declare function mergeHeaders(base: HeadersOptions | undefined, override: HeadersOptions | undefined): Headers | undefined;
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=request-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../../../src/core/request-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,YAAY,CACtB,IAAI,SAAS,MAAM,KAAK,GAAG,MAAM,EACjC,MAAM,SAAS,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,IACvC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvB,KAAK,wBAAwB,CAAC,UAAU,IAAI,UAAU,SAAS;IAAE,YAAY,EAAE,MAAM,WAAW,CAAA;CAAE,GAC9F,IAAI,CAAC,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G,MAAM,GAAG;IACtC,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB,CAAA;AAED,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,qBAAqB,EACxE,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,qBAAqB,CAAC,GAAG,SAAS,CAUxD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,MAAM,EACxD,IAAI,EAAE,oBAAoB,GAAG,SAAS,EACtC,QAAQ,EAAE,OAAO,GAAG,SAAS,GAC5B,CAAC,OAAO,GAAG,uBAAuB,CAAC,GAAG,SAAS,CAoBjD;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,oBAAoB,GAAG,SAAS,EACtC,QAAQ,EAAE,oBAAoB,GAC7B,oBAAoB,CAEtB;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,GAAG,SAAS,EAChC,QAAQ,EAAE,cAAc,GAAG,SAAS,GACnC,OAAO,GAAG,SAAS,CAgBrB"}
|
|
@@ -17,5 +17,5 @@ export interface RetryContext {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function shouldRetry(ctx: RetryContext): boolean;
|
|
19
19
|
export declare function computeDelay(attempt: number, response: Response, options: Required<RetryOptions>): number;
|
|
20
|
-
export declare function resolveRetryOptions(opts?: RetryOptions): Required<RetryOptions>;
|
|
20
|
+
export declare function resolveRetryOptions(opts?: RetryOptions, maxRetries?: number): Required<RetryOptions>;
|
|
21
21
|
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/core/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,M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
|
/**
|
|
2
2
|
* Shared utilities: response extraction and pagination helpers.
|
|
3
3
|
*/
|
|
4
|
+
import { type RateLimitInfo } from './rate-limit.js';
|
|
5
|
+
export interface LastResponseInfo {
|
|
6
|
+
requestId: string | null;
|
|
7
|
+
statusCode: number;
|
|
8
|
+
headers: Headers;
|
|
9
|
+
rateLimit: RateLimitInfo;
|
|
10
|
+
}
|
|
11
|
+
export interface ResponseMetadata {
|
|
12
|
+
_request_id: string | null;
|
|
13
|
+
lastResponse: LastResponseInfo;
|
|
14
|
+
}
|
|
15
|
+
export interface AmigoResponse<T> {
|
|
16
|
+
data: WithResponseMetadata<T>;
|
|
17
|
+
response: Response;
|
|
18
|
+
requestId: string | null;
|
|
19
|
+
rateLimit: RateLimitInfo;
|
|
20
|
+
}
|
|
21
|
+
export type WithResponseMetadata<T> = T extends object ? T & ResponseMetadata : T;
|
|
22
|
+
export declare function extractRequestId(response: Response): string | null;
|
|
23
|
+
export declare function buildLastResponse(response: Response): LastResponseInfo;
|
|
4
24
|
/**
|
|
5
25
|
* Extracts the data payload from an openapi-fetch response,
|
|
6
26
|
* throwing ParseError if the response is empty or unexpected.
|
|
@@ -8,7 +28,13 @@
|
|
|
8
28
|
export declare function extractData<T>(result: {
|
|
9
29
|
data?: T;
|
|
10
30
|
error?: unknown;
|
|
11
|
-
|
|
31
|
+
response?: Response;
|
|
32
|
+
}): WithResponseMetadata<T>;
|
|
33
|
+
export declare function withResponse<T>(result: {
|
|
34
|
+
data?: T;
|
|
35
|
+
error?: unknown;
|
|
36
|
+
response: Response;
|
|
37
|
+
}): AmigoResponse<T>;
|
|
12
38
|
/**
|
|
13
39
|
* Standard paginated list response shape.
|
|
14
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils.ts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AED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,QAAQ,EAAE,OAAO,CAAA;IACjB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAuB,QAAQ,CAAC,CAAC,EAC/B,OAAO,EAAE,CAAC,iBAAiB,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GACjE,cAAc,CAAC,CAAC,CAAC,CAUnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/core/webhooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/core/webhooks.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,CAAC,CAAA;CACR;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAA;IAC1C,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,0BAA0B;IACvF,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAA;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAC5C;AAED,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,EAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAAA;AACnB,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAiCnG,wBAAsB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EACjD,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AAC3B,wBAAsB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EACjD,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,GACnC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
* console.log(agents.items)
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
+
import type { ClientPathsWithMethod, HeadersOptions, MethodResponse } from 'openapi-fetch';
|
|
20
|
+
import { type ClientHooks } from './core/openapi-client.js';
|
|
21
|
+
import { type AmigoRequestOptions, type InitParam, type OperationFor, type ScopedRequestOptions } from './core/request-options.js';
|
|
19
22
|
import type { RetryOptions } from './core/retry.js';
|
|
20
23
|
import { WorkspacesResource } from './resources/workspaces.js';
|
|
21
24
|
import { ApiKeysResource } from './resources/api-keys.js';
|
|
@@ -44,6 +47,7 @@ import { WebhookDestinationsResource } from './resources/webhook-destinations.js
|
|
|
44
47
|
import { SafetyResource } from './resources/safety.js';
|
|
45
48
|
import { ComplianceResource } from './resources/compliance.js';
|
|
46
49
|
import { FunctionsResource } from './resources/functions.js';
|
|
50
|
+
import { type AmigoResponse } from './core/utils.js';
|
|
47
51
|
export declare const DEFAULT_BASE_URL = "https://api.platform.amigo.ai";
|
|
48
52
|
export interface AmigoClientConfig {
|
|
49
53
|
/** API key created via POST /v1/{workspace_id}/api-keys */
|
|
@@ -61,6 +65,14 @@ export interface AmigoClientConfig {
|
|
|
61
65
|
baseUrl?: string;
|
|
62
66
|
/** Retry configuration for failed requests */
|
|
63
67
|
retry?: RetryOptions;
|
|
68
|
+
/** Convenience alias for retry count (same semantics as "number of retries") */
|
|
69
|
+
maxRetries?: number;
|
|
70
|
+
/** Default request timeout in milliseconds */
|
|
71
|
+
timeout?: number;
|
|
72
|
+
/** Additional headers sent with every request */
|
|
73
|
+
headers?: HeadersOptions;
|
|
74
|
+
/** Request lifecycle hooks for logging, tracing, or metrics */
|
|
75
|
+
hooks?: ClientHooks;
|
|
64
76
|
/**
|
|
65
77
|
* Custom fetch implementation.
|
|
66
78
|
*
|
|
@@ -71,6 +83,8 @@ export interface AmigoClientConfig {
|
|
|
71
83
|
fetch?: typeof globalThis.fetch;
|
|
72
84
|
}
|
|
73
85
|
export declare class AmigoClient {
|
|
86
|
+
readonly workspaceId: string;
|
|
87
|
+
readonly baseUrl: string;
|
|
74
88
|
readonly workspaces: WorkspacesResource;
|
|
75
89
|
readonly apiKeys: ApiKeysResource;
|
|
76
90
|
readonly agents: AgentsResource;
|
|
@@ -99,18 +113,33 @@ export declare class AmigoClient {
|
|
|
99
113
|
readonly safety: SafetyResource;
|
|
100
114
|
readonly compliance: ComplianceResource;
|
|
101
115
|
readonly functions: FunctionsResource;
|
|
116
|
+
private readonly api;
|
|
102
117
|
constructor(config: AmigoClientConfig);
|
|
118
|
+
withOptions(options: ScopedRequestOptions): AmigoClient;
|
|
119
|
+
GET<Path extends ClientPathsWithMethod<typeof this.api, 'get'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'get'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'get', Path>>>;
|
|
120
|
+
POST<Path extends ClientPathsWithMethod<typeof this.api, 'post'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'post'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'post', Path>>>;
|
|
121
|
+
PUT<Path extends ClientPathsWithMethod<typeof this.api, 'put'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'put'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'put', Path>>>;
|
|
122
|
+
PATCH<Path extends ClientPathsWithMethod<typeof this.api, 'patch'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'patch'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'patch', Path>>>;
|
|
123
|
+
DELETE<Path extends ClientPathsWithMethod<typeof this.api, 'delete'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'delete'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'delete', Path>>>;
|
|
124
|
+
HEAD<Path extends ClientPathsWithMethod<typeof this.api, 'head'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'head'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'head', Path>>>;
|
|
125
|
+
OPTIONS<Path extends ClientPathsWithMethod<typeof this.api, 'options'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'options'>>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'options', Path>>>;
|
|
126
|
+
private static fromPlatformClient;
|
|
127
|
+
private static hydrate;
|
|
128
|
+
private resolveApiRequest;
|
|
103
129
|
}
|
|
104
130
|
export type { AmigoClientConfig as AmigoConfig };
|
|
105
|
-
export { AmigoError, BadRequestError, AuthenticationError, PermissionError, NotFoundError, ConflictError, ValidationError, RateLimitError, ServerError, ServiceUnavailableError, NetworkError, ParseError, ConfigurationError, isAmigoError, isNotFoundError, isRateLimitError, isAuthenticationError, } from './core/errors.js';
|
|
131
|
+
export { AmigoError, BadRequestError, AuthenticationError, PermissionError, NotFoundError, ConflictError, ValidationError, RateLimitError, ServerError, ServiceUnavailableError, NetworkError, RequestTimeoutError, ParseError, ConfigurationError, isAmigoError, isNotFoundError, isRateLimitError, isAuthenticationError, isRequestTimeoutError, } from './core/errors.js';
|
|
106
132
|
export type { WorkspaceId, ApiKeyId, AgentId, PersonaId, SkillId, ActionId, ServiceId, ContextGraphId, CallId, PhoneNumberId, IntegrationId, EntityId, EventId, SimulationRunId, SimulationSessionId, FunctionId, DataSourceId, } from './core/branded-types.js';
|
|
107
133
|
export { workspaceId, apiKeyId, agentId, personaId, skillId, actionId, serviceId, contextGraphId, callId, phoneNumberId, integrationId, entityId, eventId, simulationRunId, simulationSessionId, functionId, dataSourceId, } from './core/branded-types.js';
|
|
108
134
|
export { paginate } from './core/utils.js';
|
|
109
|
-
export
|
|
135
|
+
export { buildLastResponse, extractRequestId } from './core/utils.js';
|
|
136
|
+
export type { PaginatedList, ListParams, LastResponseInfo, ResponseMetadata, WithResponseMetadata, AmigoResponse, } from './core/utils.js';
|
|
137
|
+
export type { AmigoRequestOptions, ScopedRequestOptions } from './core/request-options.js';
|
|
110
138
|
export type { RetryOptions } from './core/retry.js';
|
|
111
139
|
export { parseRateLimitHeaders } from './core/rate-limit.js';
|
|
112
140
|
export type { RateLimitInfo } from './core/rate-limit.js';
|
|
113
141
|
export { verifyWebhookSignature, parseWebhookEvent, WebhookVerificationError, } from './core/webhooks.js';
|
|
114
142
|
export type { WebhookEvent, WebhookVerificationOptions, ParseWebhookEventOptions, } from './core/webhooks.js';
|
|
143
|
+
export type { ClientHooks, RequestHookContext, ResponseHookContext, ErrorHookContext, } from './core/openapi-client.js';
|
|
115
144
|
export type { paths, components, operations } from './generated/api.js';
|
|
116
145
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE1F,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;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BAAgB,EAAE,MAAM,iBAAiB,CAAA;AACrE,YAAY,EACV,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAC1F,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,YAAY,EACZ,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,0BAA0B,CAAA;AAGjC,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -52,14 +52,14 @@ export declare class ActionsResource extends WorkspaceScopedResource {
|
|
|
52
52
|
use_structured_output: boolean;
|
|
53
53
|
version: number;
|
|
54
54
|
workspace_id: string;
|
|
55
|
-
}>;
|
|
55
|
+
} & import("../index.js").ResponseMetadata>;
|
|
56
56
|
/** List actions in the workspace */
|
|
57
57
|
list(params?: ListActionsParams): Promise<{
|
|
58
58
|
continuation_token?: number | null;
|
|
59
59
|
has_more: boolean;
|
|
60
60
|
items: components["schemas"]["SkillResponse"][];
|
|
61
61
|
total?: number | null;
|
|
62
|
-
}>;
|
|
62
|
+
} & import("../index.js").ResponseMetadata>;
|
|
63
63
|
/** Get a single action */
|
|
64
64
|
get(actionId: ActionId | string): Promise<{
|
|
65
65
|
approval_required: boolean;
|
|
@@ -98,7 +98,7 @@ export declare class ActionsResource extends WorkspaceScopedResource {
|
|
|
98
98
|
use_structured_output: boolean;
|
|
99
99
|
version: number;
|
|
100
100
|
workspace_id: string;
|
|
101
|
-
}>;
|
|
101
|
+
} & import("../index.js").ResponseMetadata>;
|
|
102
102
|
/** Update an action */
|
|
103
103
|
update(actionId: ActionId | string, body: components['schemas']['UpdateSkillRequest']): Promise<{
|
|
104
104
|
approval_required: boolean;
|
|
@@ -137,7 +137,7 @@ export declare class ActionsResource extends WorkspaceScopedResource {
|
|
|
137
137
|
use_structured_output: boolean;
|
|
138
138
|
version: number;
|
|
139
139
|
workspace_id: string;
|
|
140
|
-
}>;
|
|
140
|
+
} & import("../index.js").ResponseMetadata>;
|
|
141
141
|
/** Delete an action */
|
|
142
142
|
delete(actionId: ActionId | string): Promise<void>;
|
|
143
143
|
/**
|
|
@@ -153,6 +153,6 @@ export declare class ActionsResource extends WorkspaceScopedResource {
|
|
|
153
153
|
result: string;
|
|
154
154
|
rounds: number;
|
|
155
155
|
sub_tool_logs: components["schemas"]["SubToolLog"][];
|
|
156
|
-
}>;
|
|
156
|
+
} & import("../index.js").ResponseMetadata>;
|
|
157
157
|
}
|
|
158
158
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -14,13 +14,13 @@ export declare class AgentsResource extends WorkspaceScopedResource {
|
|
|
14
14
|
name: string;
|
|
15
15
|
updated_at: string;
|
|
16
16
|
workspace_id: string;
|
|
17
|
-
}>;
|
|
17
|
+
} & import("../index.js").ResponseMetadata>;
|
|
18
18
|
list(params?: ListAgentsParams): Promise<{
|
|
19
19
|
continuation_token?: number | null;
|
|
20
20
|
has_more: boolean;
|
|
21
21
|
items: components["schemas"]["AgentResponse"][];
|
|
22
22
|
total?: number | null;
|
|
23
|
-
}>;
|
|
23
|
+
} & import("../index.js").ResponseMetadata>;
|
|
24
24
|
get(agentId: AgentId | string): Promise<{
|
|
25
25
|
created_at: string;
|
|
26
26
|
description: string;
|
|
@@ -29,7 +29,7 @@ export declare class AgentsResource extends WorkspaceScopedResource {
|
|
|
29
29
|
name: string;
|
|
30
30
|
updated_at: string;
|
|
31
31
|
workspace_id: string;
|
|
32
|
-
}>;
|
|
32
|
+
} & import("../index.js").ResponseMetadata>;
|
|
33
33
|
update(agentId: AgentId | string, body: components['schemas']['UpdateAgentRequest']): Promise<{
|
|
34
34
|
created_at: string;
|
|
35
35
|
description: string;
|
|
@@ -38,14 +38,14 @@ export declare class AgentsResource extends WorkspaceScopedResource {
|
|
|
38
38
|
name: string;
|
|
39
39
|
updated_at: string;
|
|
40
40
|
workspace_id: string;
|
|
41
|
-
}>;
|
|
41
|
+
} & import("../index.js").ResponseMetadata>;
|
|
42
42
|
delete(agentId: AgentId | string): Promise<void>;
|
|
43
43
|
listVersions(agentId: AgentId | string, params?: ListParams): Promise<{
|
|
44
44
|
continuation_token?: number | null;
|
|
45
45
|
has_more: boolean;
|
|
46
46
|
items: components["schemas"]["AgentVersionResponse"][];
|
|
47
47
|
total?: number | null;
|
|
48
|
-
}>;
|
|
48
|
+
} & import("../index.js").ResponseMetadata>;
|
|
49
49
|
getVersion(agentId: AgentId | string, version: number | 'latest'): Promise<{
|
|
50
50
|
agent_id: string;
|
|
51
51
|
background: string;
|
|
@@ -60,7 +60,7 @@ export declare class AgentsResource extends WorkspaceScopedResource {
|
|
|
60
60
|
version: number;
|
|
61
61
|
voice_config: components["schemas"]["VoiceConfig"] | null;
|
|
62
62
|
workspace_id: string;
|
|
63
|
-
}>;
|
|
63
|
+
} & import("../index.js").ResponseMetadata>;
|
|
64
64
|
createVersion(agentId: AgentId | string, body: components['schemas']['CreateAgentVersionRequest']): Promise<{
|
|
65
65
|
agent_id: string;
|
|
66
66
|
background: string;
|
|
@@ -75,6 +75,6 @@ export declare class AgentsResource extends WorkspaceScopedResource {
|
|
|
75
75
|
version: number;
|
|
76
76
|
voice_config: components["schemas"]["VoiceConfig"] | null;
|
|
77
77
|
workspace_id: string;
|
|
78
|
-
}>;
|
|
78
|
+
} & import("../index.js").ResponseMetadata>;
|
|
79
79
|
}
|
|
80
80
|
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -8,7 +8,7 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
8
8
|
days?: number;
|
|
9
9
|
}): Promise<{
|
|
10
10
|
[key: string]: unknown;
|
|
11
|
-
}>;
|
|
11
|
+
} & import("../index.js").ResponseMetadata>;
|
|
12
12
|
/** Call volume and duration metrics */
|
|
13
13
|
getCalls(params?: {
|
|
14
14
|
days?: number;
|
|
@@ -26,14 +26,14 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
26
26
|
total_calls: number;
|
|
27
27
|
total_duration_seconds: number;
|
|
28
28
|
workspace_id: string;
|
|
29
|
-
}>;
|
|
29
|
+
} & import("../index.js").ResponseMetadata>;
|
|
30
30
|
/** Per-agent performance breakdown */
|
|
31
31
|
getAgents(params?: {
|
|
32
32
|
period?: string;
|
|
33
33
|
}): Promise<{
|
|
34
34
|
agents: import("../index.js").components["schemas"]["AgentAnalyticsEntry"][];
|
|
35
35
|
period?: string | null;
|
|
36
|
-
}>;
|
|
36
|
+
} & import("../index.js").ResponseMetadata>;
|
|
37
37
|
/** Call quality — sentiment, transcription confidence, flagged calls */
|
|
38
38
|
getCallQuality(params?: {
|
|
39
39
|
days?: number;
|
|
@@ -43,7 +43,7 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
43
43
|
service_id?: string | null;
|
|
44
44
|
}): Promise<{
|
|
45
45
|
[key: string]: unknown;
|
|
46
|
-
}>;
|
|
46
|
+
} & import("../index.js").ResponseMetadata>;
|
|
47
47
|
/** Emotion trend data over time */
|
|
48
48
|
getEmotionTrends(params?: {
|
|
49
49
|
days?: number;
|
|
@@ -53,7 +53,7 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
53
53
|
service_id?: string | null;
|
|
54
54
|
}): Promise<{
|
|
55
55
|
[key: string]: unknown;
|
|
56
|
-
}>;
|
|
56
|
+
} & import("../index.js").ResponseMetadata>;
|
|
57
57
|
/** Voice pipeline latency metrics (TTFB, response time) */
|
|
58
58
|
getLatency(params?: {
|
|
59
59
|
days?: number;
|
|
@@ -63,13 +63,13 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
63
63
|
service_id?: string | null;
|
|
64
64
|
}): Promise<{
|
|
65
65
|
[key: string]: unknown;
|
|
66
|
-
}>;
|
|
66
|
+
} & import("../index.js").ResponseMetadata>;
|
|
67
67
|
/** Tool call performance — success rates and latency per tool */
|
|
68
68
|
getToolPerformance(params?: {
|
|
69
69
|
days?: number;
|
|
70
70
|
}): Promise<{
|
|
71
71
|
[key: string]: unknown;
|
|
72
|
-
}>;
|
|
72
|
+
} & import("../index.js").ResponseMetadata>;
|
|
73
73
|
/** Data quality metrics for the workspace world model */
|
|
74
74
|
getDataQuality(params?: {
|
|
75
75
|
days?: number;
|
|
@@ -88,7 +88,7 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
88
88
|
}[];
|
|
89
89
|
total_events: number;
|
|
90
90
|
workspace_id: string;
|
|
91
|
-
}>;
|
|
91
|
+
} & import("../index.js").ResponseMetadata>;
|
|
92
92
|
/** Usage summary — API requests, call minutes, storage */
|
|
93
93
|
getUsage(params?: {
|
|
94
94
|
days?: number;
|
|
@@ -103,7 +103,7 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
103
103
|
period_start: string;
|
|
104
104
|
total_events: number;
|
|
105
105
|
workspace_id: string;
|
|
106
|
-
}>;
|
|
106
|
+
} & import("../index.js").ResponseMetadata>;
|
|
107
107
|
/** Advanced call statistics (abandonment, transfers, silence, hour-of-day) */
|
|
108
108
|
getAdvancedCallStats(params?: {
|
|
109
109
|
days?: number;
|
|
@@ -113,7 +113,7 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
113
113
|
service_id?: string | null;
|
|
114
114
|
}): Promise<{
|
|
115
115
|
[key: string]: unknown;
|
|
116
|
-
}>;
|
|
116
|
+
} & import("../index.js").ResponseMetadata>;
|
|
117
117
|
/** Compare two time periods side by side */
|
|
118
118
|
compareCallPeriods(params: {
|
|
119
119
|
current_from: string;
|
|
@@ -123,6 +123,6 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
|
|
|
123
123
|
service_id?: string;
|
|
124
124
|
}): Promise<{
|
|
125
125
|
[key: string]: unknown;
|
|
126
|
-
}>;
|
|
126
|
+
} & import("../index.js").ResponseMetadata>;
|
|
127
127
|
}
|
|
128
128
|
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -19,7 +19,7 @@ export declare class ApiKeysResource extends WorkspaceScopedResource {
|
|
|
19
19
|
key_id: string;
|
|
20
20
|
name: string | null;
|
|
21
21
|
workspace_id: string;
|
|
22
|
-
}>;
|
|
22
|
+
} & import("../index.js").ResponseMetadata>;
|
|
23
23
|
/** Create a new API key */
|
|
24
24
|
create(body: components['schemas']['CreateApiKeyRequest']): Promise<{
|
|
25
25
|
api_key: string;
|
|
@@ -30,7 +30,7 @@ export declare class ApiKeysResource extends WorkspaceScopedResource {
|
|
|
30
30
|
name: string | null;
|
|
31
31
|
permissions: string[];
|
|
32
32
|
role: string;
|
|
33
|
-
}>;
|
|
33
|
+
} & import("../index.js").ResponseMetadata>;
|
|
34
34
|
/** List API keys in the workspace */
|
|
35
35
|
list(params?: ListParams & {
|
|
36
36
|
mine_only?: boolean;
|
|
@@ -39,7 +39,7 @@ export declare class ApiKeysResource extends WorkspaceScopedResource {
|
|
|
39
39
|
has_more: boolean;
|
|
40
40
|
items: components["schemas"]["ApiKeyResponse"][];
|
|
41
41
|
total?: number | null;
|
|
42
|
-
}>;
|
|
42
|
+
} & import("../index.js").ResponseMetadata>;
|
|
43
43
|
/** Revoke an API key */
|
|
44
44
|
revoke(keyId: ApiKeyId | string): Promise<void>;
|
|
45
45
|
/** Rotate an API key — invalidates the old key and issues a new one */
|
|
@@ -52,6 +52,6 @@ export declare class ApiKeysResource extends WorkspaceScopedResource {
|
|
|
52
52
|
name: string | null;
|
|
53
53
|
permissions: string[];
|
|
54
54
|
role: string;
|
|
55
|
-
}>;
|
|
55
|
+
} & import("../index.js").ResponseMetadata>;
|
|
56
56
|
}
|
|
57
57
|
//# sourceMappingURL=api-keys.d.ts.map
|