@amigo-ai/platform-sdk 0.4.1 → 0.4.2
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 +87 -0
- package/api.md +354 -0
- package/dist/core/errors.js +26 -4
- package/dist/core/errors.js.map +1 -1
- package/dist/core/openapi-client.js +108 -6
- package/dist/core/openapi-client.js.map +1 -1
- 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/index.cjs +258 -38
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +50 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +258 -38
- package/dist/index.mjs.map +4 -4
- 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 +24 -1
- package/dist/types/core/openapi-client.d.ts.map +1 -1
- 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/index.d.ts +40 -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/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 +2 -1
|
@@ -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,EA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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,15 +5,38 @@
|
|
|
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';
|
|
10
11
|
import { type RetryOptions } from './retry.js';
|
|
11
12
|
declare const createClient: typeof createClientImport;
|
|
12
13
|
export type PlatformFetch = ReturnType<typeof createClient<paths>>;
|
|
14
|
+
export interface RequestHookContext {
|
|
15
|
+
id: string;
|
|
16
|
+
request: Request;
|
|
17
|
+
schemaPath: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ResponseHookContext extends RequestHookContext {
|
|
20
|
+
response: Response;
|
|
21
|
+
requestId: string | null;
|
|
22
|
+
rateLimit: ReturnType<typeof parseRateLimitHeaders>;
|
|
23
|
+
}
|
|
24
|
+
export interface ErrorHookContext extends RequestHookContext {
|
|
25
|
+
error: unknown;
|
|
26
|
+
}
|
|
27
|
+
export interface ClientHooks {
|
|
28
|
+
onRequest?: (context: RequestHookContext) => void | Promise<void>;
|
|
29
|
+
onResponse?: (context: ResponseHookContext) => void | Promise<void>;
|
|
30
|
+
onError?: (context: ErrorHookContext) => void | Promise<void>;
|
|
31
|
+
}
|
|
13
32
|
export interface ClientConfig {
|
|
14
33
|
apiKey: string;
|
|
15
34
|
baseUrl: string;
|
|
16
35
|
retry?: RetryOptions;
|
|
36
|
+
maxRetries?: number;
|
|
37
|
+
timeout?: number;
|
|
38
|
+
headers?: HeadersOptions;
|
|
39
|
+
hooks?: ClientHooks;
|
|
17
40
|
/** Custom fetch implementation — use for BFF proxy routing or test mocking. */
|
|
18
41
|
fetch?: typeof globalThis.fetch;
|
|
19
42
|
}
|
|
@@ -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,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;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAmHxE"}
|
|
@@ -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,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAMD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAA;CAChC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAYtD;AAED,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/core/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAMD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAA;CAChC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAYtD;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,GAC9B,MAAM,CAUR;AAYD,wBAAgB,mBAAmB,CACjC,IAAI,CAAC,EAAE,YAAY,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,QAAQ,CAAC,YAAY,CAAC,CAWxB"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
/**
|
|
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"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,aAAa,CAAA;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,YAAY,EAAE,gBAAgB,CAAA;CAC/B;AAED,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;IAC7B,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,aAAa,CAAA;CACzB;AAED,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,GAAG,gBAAgB,GAAG,CAAC,CAAA;AAEjF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAElE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAOtE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE;IACrC,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAQ1B;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE;IACtC,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,QAAQ,CAAA;CACnB,GAAG,aAAa,CAAC,CAAC,CAAC,CAUnB;AAED;;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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* console.log(agents.items)
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
+
import type { ClientPathsWithMethod, FetchOptions, HeadersOptions, MethodResponse } from 'openapi-fetch';
|
|
20
|
+
import { type ClientHooks } from './core/openapi-client.js';
|
|
19
21
|
import type { RetryOptions } from './core/retry.js';
|
|
20
22
|
import { WorkspacesResource } from './resources/workspaces.js';
|
|
21
23
|
import { ApiKeysResource } from './resources/api-keys.js';
|
|
@@ -44,7 +46,23 @@ import { WebhookDestinationsResource } from './resources/webhook-destinations.js
|
|
|
44
46
|
import { SafetyResource } from './resources/safety.js';
|
|
45
47
|
import { ComplianceResource } from './resources/compliance.js';
|
|
46
48
|
import { FunctionsResource } from './resources/functions.js';
|
|
49
|
+
import type { paths } from './generated/api.js';
|
|
50
|
+
import { type AmigoResponse } from './core/utils.js';
|
|
47
51
|
export declare const DEFAULT_BASE_URL = "https://api.platform.amigo.ai";
|
|
52
|
+
type OperationFor<Path extends keyof paths & string, Method extends keyof paths[Path] & string> = paths[Path][Method];
|
|
53
|
+
type LowLevelParams<Operation> = FetchOptions<Operation> extends {
|
|
54
|
+
params: infer Params;
|
|
55
|
+
} ? Params extends object ? Omit<Params, 'path'> & {
|
|
56
|
+
path?: Params extends {
|
|
57
|
+
path: infer PathParams;
|
|
58
|
+
} ? Partial<PathParams & Record<string, unknown>> : never;
|
|
59
|
+
} : never : never;
|
|
60
|
+
export type AmigoRequestOptions<Operation = unknown> = Omit<FetchOptions<Operation>, 'params'> & {
|
|
61
|
+
params?: LowLevelParams<Operation>;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
maxRetries?: number;
|
|
64
|
+
retry?: RetryOptions;
|
|
65
|
+
};
|
|
48
66
|
export interface AmigoClientConfig {
|
|
49
67
|
/** API key created via POST /v1/{workspace_id}/api-keys */
|
|
50
68
|
apiKey: string;
|
|
@@ -61,6 +79,14 @@ export interface AmigoClientConfig {
|
|
|
61
79
|
baseUrl?: string;
|
|
62
80
|
/** Retry configuration for failed requests */
|
|
63
81
|
retry?: RetryOptions;
|
|
82
|
+
/** Convenience alias for retry count (same semantics as "number of retries") */
|
|
83
|
+
maxRetries?: number;
|
|
84
|
+
/** Default request timeout in milliseconds */
|
|
85
|
+
timeout?: number;
|
|
86
|
+
/** Additional headers sent with every request */
|
|
87
|
+
headers?: HeadersOptions;
|
|
88
|
+
/** Request lifecycle hooks for logging, tracing, or metrics */
|
|
89
|
+
hooks?: ClientHooks;
|
|
64
90
|
/**
|
|
65
91
|
* Custom fetch implementation.
|
|
66
92
|
*
|
|
@@ -71,6 +97,8 @@ export interface AmigoClientConfig {
|
|
|
71
97
|
fetch?: typeof globalThis.fetch;
|
|
72
98
|
}
|
|
73
99
|
export declare class AmigoClient {
|
|
100
|
+
readonly workspaceId: string;
|
|
101
|
+
readonly baseUrl: string;
|
|
74
102
|
readonly workspaces: WorkspacesResource;
|
|
75
103
|
readonly apiKeys: ApiKeysResource;
|
|
76
104
|
readonly agents: AgentsResource;
|
|
@@ -99,18 +127,28 @@ export declare class AmigoClient {
|
|
|
99
127
|
readonly safety: SafetyResource;
|
|
100
128
|
readonly compliance: ComplianceResource;
|
|
101
129
|
readonly functions: FunctionsResource;
|
|
130
|
+
private readonly api;
|
|
102
131
|
constructor(config: AmigoClientConfig);
|
|
132
|
+
GET<Path extends ClientPathsWithMethod<typeof this.api, 'get'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'get'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'get', Path>>>;
|
|
133
|
+
POST<Path extends ClientPathsWithMethod<typeof this.api, 'post'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'post'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'post', Path>>>;
|
|
134
|
+
PUT<Path extends ClientPathsWithMethod<typeof this.api, 'put'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'put'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'put', Path>>>;
|
|
135
|
+
PATCH<Path extends ClientPathsWithMethod<typeof this.api, 'patch'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'patch'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'patch', Path>>>;
|
|
136
|
+
DELETE<Path extends ClientPathsWithMethod<typeof this.api, 'delete'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'delete'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'delete', Path>>>;
|
|
137
|
+
HEAD<Path extends ClientPathsWithMethod<typeof this.api, 'head'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'head'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'head', Path>>>;
|
|
138
|
+
OPTIONS<Path extends ClientPathsWithMethod<typeof this.api, 'options'>>(path: Path, init?: AmigoRequestOptions<OperationFor<Path, 'options'>>): Promise<AmigoResponse<MethodResponse<typeof this.api, 'options', Path>>>;
|
|
103
139
|
}
|
|
104
140
|
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';
|
|
141
|
+
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
142
|
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
143
|
export { workspaceId, apiKeyId, agentId, personaId, skillId, actionId, serviceId, contextGraphId, callId, phoneNumberId, integrationId, entityId, eventId, simulationRunId, simulationSessionId, functionId, dataSourceId, } from './core/branded-types.js';
|
|
108
144
|
export { paginate } from './core/utils.js';
|
|
109
|
-
export
|
|
145
|
+
export { buildLastResponse, extractRequestId } from './core/utils.js';
|
|
146
|
+
export type { PaginatedList, ListParams, LastResponseInfo, ResponseMetadata, WithResponseMetadata, AmigoResponse, } from './core/utils.js';
|
|
110
147
|
export type { RetryOptions } from './core/retry.js';
|
|
111
148
|
export { parseRateLimitHeaders } from './core/rate-limit.js';
|
|
112
149
|
export type { RateLimitInfo } from './core/rate-limit.js';
|
|
113
150
|
export { verifyWebhookSignature, parseWebhookEvent, WebhookVerificationError, } from './core/webhooks.js';
|
|
114
151
|
export type { WebhookEvent, WebhookVerificationOptions, ParseWebhookEventOptions, } from './core/webhooks.js';
|
|
152
|
+
export type { ClientHooks, RequestHookContext, ResponseHookContext, ErrorHookContext, } from './core/openapi-client.js';
|
|
115
153
|
export type { paths, components, operations } from './generated/api.js';
|
|
116
154
|
//# 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,EACV,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,cAAc,EACf,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACjF,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;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,oBA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ACP,QAAQ,EACR,SAAS,EACT,cAAc,EACd,MAAM,EACN,aAAa,EACb,aAAa,EACb,QAAQ,EACR,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,YAAY,GACb,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,cAAc,EACd,MAAM,EACN,aAAa,EACb,aAAa,EACb,QAAQ,EACR,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,YAAY,GACb,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,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,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
|
|
@@ -32,7 +32,7 @@ export declare class AuditResource extends WorkspaceScopedResource {
|
|
|
32
32
|
limit: number;
|
|
33
33
|
offset: number;
|
|
34
34
|
total: number;
|
|
35
|
-
}>;
|
|
35
|
+
} & import("../index.js").ResponseMetadata>;
|
|
36
36
|
getSummary(params?: {
|
|
37
37
|
date_from?: string | null;
|
|
38
38
|
date_to?: string | null;
|
|
@@ -41,30 +41,30 @@ export declare class AuditResource extends WorkspaceScopedResource {
|
|
|
41
41
|
services_with_events: number;
|
|
42
42
|
total_events: number;
|
|
43
43
|
unique_actors: number;
|
|
44
|
-
}>;
|
|
44
|
+
} & import("../index.js").ResponseMetadata>;
|
|
45
45
|
getPhiAccess(params?: PhiAccessParams): Promise<{
|
|
46
46
|
events: components["schemas"]["src__routes__audit__AuditEventResponse"][];
|
|
47
47
|
has_more: boolean;
|
|
48
48
|
limit: number;
|
|
49
49
|
offset: number;
|
|
50
50
|
total: number;
|
|
51
|
-
}>;
|
|
51
|
+
} & import("../index.js").ResponseMetadata>;
|
|
52
52
|
createExport(body: components['schemas']['AuditExportRequest']): Promise<{
|
|
53
53
|
created_at: string;
|
|
54
54
|
download_url: string;
|
|
55
55
|
export_id: string;
|
|
56
56
|
row_count: number;
|
|
57
57
|
s3_key: string;
|
|
58
|
-
}>;
|
|
58
|
+
} & import("../index.js").ResponseMetadata>;
|
|
59
59
|
listExports(): Promise<{
|
|
60
60
|
exports: components["schemas"]["AuditExportListItem"][];
|
|
61
|
-
}>;
|
|
61
|
+
} & import("../index.js").ResponseMetadata>;
|
|
62
62
|
getEntityAccessLog(entityId: string, params?: EntityAccessLogParams): Promise<{
|
|
63
63
|
events: components["schemas"]["src__routes__audit__AuditEventResponse"][];
|
|
64
64
|
has_more: boolean;
|
|
65
65
|
limit: number;
|
|
66
66
|
offset: number;
|
|
67
67
|
total: number;
|
|
68
|
-
}>;
|
|
68
|
+
} & import("../index.js").ResponseMetadata>;
|
|
69
69
|
}
|
|
70
70
|
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -27,11 +27,11 @@ export declare class BillingResource extends WorkspaceScopedResource {
|
|
|
27
27
|
previous_period_total: number | null;
|
|
28
28
|
top_meters: import("../index.js").components["schemas"]["MeterSummary"][];
|
|
29
29
|
workspace_id: string;
|
|
30
|
-
}>;
|
|
30
|
+
} & import("../index.js").ResponseMetadata>;
|
|
31
31
|
/** Get usage summary for the workspace */
|
|
32
32
|
getUsage(): Promise<{
|
|
33
33
|
[key: string]: unknown;
|
|
34
|
-
}>;
|
|
34
|
+
} & import("../index.js").ResponseMetadata>;
|
|
35
35
|
/** Get usage time-series per meter for trend charts */
|
|
36
36
|
getUsageTrends(params?: UsageTrendsParams): Promise<{
|
|
37
37
|
meter_key: string;
|
|
@@ -39,21 +39,21 @@ export declare class BillingResource extends WorkspaceScopedResource {
|
|
|
39
39
|
period_start: string;
|
|
40
40
|
unit: string;
|
|
41
41
|
value: number;
|
|
42
|
-
}[]>;
|
|
42
|
+
}[] & import("../index.js").ResponseMetadata>;
|
|
43
43
|
/** List invoices for the workspace */
|
|
44
44
|
listInvoices(params?: ListInvoicesParams): Promise<{
|
|
45
45
|
continuation_token?: number | null;
|
|
46
46
|
has_more: boolean;
|
|
47
47
|
items: import("../index.js").components["schemas"]["InvoiceItem"][];
|
|
48
48
|
total?: number | null;
|
|
49
|
-
}>;
|
|
49
|
+
} & import("../index.js").ResponseMetadata>;
|
|
50
50
|
/** Get invoice detail */
|
|
51
51
|
getInvoice(invoiceId: string): Promise<{
|
|
52
52
|
[key: string]: unknown;
|
|
53
|
-
}>;
|
|
53
|
+
} & import("../index.js").ResponseMetadata>;
|
|
54
54
|
/** Get presigned S3 URL for invoice PDF download */
|
|
55
55
|
getInvoicePdf(invoiceId: string): Promise<{
|
|
56
56
|
[key: string]: unknown;
|
|
57
|
-
}>;
|
|
57
|
+
} & import("../index.js").ResponseMetadata>;
|
|
58
58
|
}
|
|
59
59
|
//# sourceMappingURL=billing.d.ts.map
|
|
@@ -22,11 +22,11 @@ export declare class CallsResource extends WorkspaceScopedResource {
|
|
|
22
22
|
has_more: boolean;
|
|
23
23
|
items: import("../index.js").components["schemas"]["CallSummary"][];
|
|
24
24
|
total: number;
|
|
25
|
-
}>;
|
|
25
|
+
} & import("../index.js").ResponseMetadata>;
|
|
26
26
|
/** Get full call detail including turns, escalation, safety, and recording info */
|
|
27
27
|
get(callId: string): Promise<{
|
|
28
28
|
[key: string]: unknown;
|
|
29
|
-
}>;
|
|
29
|
+
} & import("../index.js").ResponseMetadata>;
|
|
30
30
|
/** Get AI intelligence for a call */
|
|
31
31
|
getIntelligence(callId: string): Promise<{
|
|
32
32
|
call_id: string;
|
|
@@ -46,11 +46,11 @@ export declare class CallsResource extends WorkspaceScopedResource {
|
|
|
46
46
|
risk_summary?: import("../index.js").components["schemas"]["RiskSummary"] | null;
|
|
47
47
|
safety_summary?: import("../index.js").components["schemas"]["SafetySummary"] | null;
|
|
48
48
|
tool_summary?: import("../index.js").components["schemas"]["ToolSummary"] | null;
|
|
49
|
-
}>;
|
|
49
|
+
} & import("../index.js").ResponseMetadata>;
|
|
50
50
|
/** Get active intelligence across all in-progress calls */
|
|
51
51
|
getActiveIntelligence(): Promise<{
|
|
52
52
|
[key: string]: unknown;
|
|
53
|
-
}[]>;
|
|
53
|
+
}[] & import("../index.js").ResponseMetadata>;
|
|
54
54
|
/** Get performance benchmarks for a time period */
|
|
55
55
|
getBenchmarks(params?: {
|
|
56
56
|
days?: number;
|
|
@@ -65,7 +65,7 @@ export declare class CallsResource extends WorkspaceScopedResource {
|
|
|
65
65
|
[key: string]: number;
|
|
66
66
|
};
|
|
67
67
|
total_calls?: number;
|
|
68
|
-
}>;
|
|
68
|
+
} & import("../index.js").ResponseMetadata>;
|
|
69
69
|
/** Get deep call trace analysis */
|
|
70
70
|
getTraceAnalysis(callId: string): Promise<{
|
|
71
71
|
call_entity_id?: string | null;
|
|
@@ -85,6 +85,6 @@ export declare class CallsResource extends WorkspaceScopedResource {
|
|
|
85
85
|
signal_response_alignment?: import("../index.js").components["schemas"]["SignalResponseAlignment"][];
|
|
86
86
|
status?: "ready" | "pending" | "unavailable";
|
|
87
87
|
summary?: string | null;
|
|
88
|
-
}>;
|
|
88
|
+
} & import("../index.js").ResponseMetadata>;
|
|
89
89
|
}
|
|
90
90
|
//# sourceMappingURL=calls.d.ts.map
|