@happyrobot-ai/sdk 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/client.d.ts +85 -0
- package/client.js +115 -0
- package/client.mjs +3 -0
- package/core/errors.d.ts +48 -0
- package/core/errors.js +82 -0
- package/core/errors.mjs +3 -0
- package/core/http.d.ts +26 -0
- package/core/http.js +189 -0
- package/core/http.mjs +3 -0
- package/core/pagination.d.ts +22 -0
- package/core/pagination.js +43 -0
- package/core/pagination.mjs +3 -0
- package/core/sse.d.ts +20 -0
- package/core/sse.js +104 -0
- package/core/sse.mjs +3 -0
- package/core/types.d.ts +50 -0
- package/core/types.js +6 -0
- package/core/types.mjs +3 -0
- package/helpers/index.d.ts +14 -0
- package/helpers/index.js +18 -0
- package/helpers/index.mjs +3 -0
- package/helpers/template-workflows.d.ts +49 -0
- package/helpers/template-workflows.js +46 -0
- package/helpers/template-workflows.mjs +3 -0
- package/helpers/trigger-and-wait.d.ts +37 -0
- package/helpers/trigger-and-wait.js +62 -0
- package/helpers/trigger-and-wait.mjs +3 -0
- package/helpers/voice-agent.d.ts +47 -0
- package/helpers/voice-agent.js +47 -0
- package/helpers/voice-agent.mjs +3 -0
- package/index.d.ts +75 -0
- package/index.js +90 -0
- package/index.mjs +3 -0
- package/package.json +42 -0
- package/resources/adversarial-suites.d.ts +42 -0
- package/resources/adversarial-suites.js +96 -0
- package/resources/adversarial-suites.mjs +3 -0
- package/resources/adversarial-tests.d.ts +36 -0
- package/resources/adversarial-tests.js +78 -0
- package/resources/adversarial-tests.mjs +3 -0
- package/resources/api-key.d.ts +23 -0
- package/resources/api-key.js +24 -0
- package/resources/api-key.mjs +3 -0
- package/resources/audit-remarks.d.ts +22 -0
- package/resources/audit-remarks.js +44 -0
- package/resources/audit-remarks.mjs +3 -0
- package/resources/billing.d.ts +25 -0
- package/resources/billing.js +34 -0
- package/resources/billing.mjs +3 -0
- package/resources/contacts.d.ts +40 -0
- package/resources/contacts.js +61 -0
- package/resources/contacts.mjs +3 -0
- package/resources/custom-evals.d.ts +28 -0
- package/resources/custom-evals.js +62 -0
- package/resources/custom-evals.mjs +3 -0
- package/resources/integrations.d.ts +95 -0
- package/resources/integrations.js +220 -0
- package/resources/integrations.mjs +3 -0
- package/resources/issues.d.ts +14 -0
- package/resources/issues.js +25 -0
- package/resources/issues.mjs +3 -0
- package/resources/knowledge-bases.d.ts +35 -0
- package/resources/knowledge-bases.js +68 -0
- package/resources/knowledge-bases.mjs +3 -0
- package/resources/mcp.d.ts +20 -0
- package/resources/mcp.js +42 -0
- package/resources/mcp.mjs +3 -0
- package/resources/messages.d.ts +17 -0
- package/resources/messages.js +37 -0
- package/resources/messages.mjs +3 -0
- package/resources/nodes.d.ts +50 -0
- package/resources/nodes.js +86 -0
- package/resources/nodes.mjs +3 -0
- package/resources/northstars.d.ts +29 -0
- package/resources/northstars.js +69 -0
- package/resources/northstars.mjs +3 -0
- package/resources/phone-numbers.d.ts +47 -0
- package/resources/phone-numbers.js +121 -0
- package/resources/phone-numbers.mjs +3 -0
- package/resources/runs.d.ts +31 -0
- package/resources/runs.js +71 -0
- package/resources/runs.mjs +3 -0
- package/resources/sessions.d.ts +36 -0
- package/resources/sessions.js +62 -0
- package/resources/sessions.mjs +3 -0
- package/resources/sip-trunks.d.ts +32 -0
- package/resources/sip-trunks.js +78 -0
- package/resources/sip-trunks.mjs +3 -0
- package/resources/usage.d.ts +27 -0
- package/resources/usage.js +70 -0
- package/resources/usage.mjs +3 -0
- package/resources/variables.d.ts +23 -0
- package/resources/variables.js +54 -0
- package/resources/variables.mjs +3 -0
- package/resources/versions.d.ts +38 -0
- package/resources/versions.js +90 -0
- package/resources/versions.mjs +3 -0
- package/resources/workflow-folders.d.ts +26 -0
- package/resources/workflow-folders.js +62 -0
- package/resources/workflow-folders.mjs +3 -0
- package/resources/workflows.d.ts +55 -0
- package/resources/workflows.js +134 -0
- package/resources/workflows.mjs +3 -0
package/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @happyrobot/sdk — TypeScript SDK for the HappyRobot Public API.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { HappyRobotClient } from "@happyrobot/sdk";
|
|
8
|
+
*
|
|
9
|
+
* const client = new HappyRobotClient({ apiKey: "sk_live_..." });
|
|
10
|
+
*
|
|
11
|
+
* // List all workflows
|
|
12
|
+
* const { data } = await client.workflows.list();
|
|
13
|
+
*
|
|
14
|
+
* // Iterate all workflows across pages
|
|
15
|
+
* for await (const wf of client.workflows.listAll()) {
|
|
16
|
+
* console.log(wf.name);
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* // Trigger a run
|
|
20
|
+
* const { run_id } = await client.workflows.triggerRun("my-workflow", {
|
|
21
|
+
* payload: { phone: "+1234567890" },
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AuditRemarksResource = exports.IssuesResource = exports.CustomEvalsResource = exports.NorthstarsResource = exports.AdversarialTestsResource = exports.AdversarialSuitesResource = exports.ApiKeyResource = exports.BillingResource = exports.UsageResource = exports.MCPResource = exports.WorkflowFoldersResource = exports.KnowledgeBasesResource = exports.ContactsResource = exports.IntegrationsResource = exports.SipTrunksResource = exports.PhoneNumbersResource = exports.VariablesResource = exports.MessagesResource = exports.SessionsResource = exports.RunsResource = exports.NodesResource = exports.VersionsResource = exports.WorkflowsResource = exports.iterateSSE = exports.paginate = exports.NetworkError = exports.TimeoutError = exports.RateLimitError = exports.ValidationError = exports.NotFoundError = exports.AuthenticationError = exports.ApiError = exports.HappyRobotError = exports.HappyRobotClient = void 0;
|
|
27
|
+
// ── Client ──
|
|
28
|
+
var client_1 = require("./client");
|
|
29
|
+
Object.defineProperty(exports, "HappyRobotClient", { enumerable: true, get: function () { return client_1.HappyRobotClient; } });
|
|
30
|
+
var errors_1 = require("./core/errors");
|
|
31
|
+
Object.defineProperty(exports, "HappyRobotError", { enumerable: true, get: function () { return errors_1.HappyRobotError; } });
|
|
32
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return errors_1.ApiError; } });
|
|
33
|
+
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return errors_1.AuthenticationError; } });
|
|
34
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return errors_1.NotFoundError; } });
|
|
35
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
36
|
+
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return errors_1.RateLimitError; } });
|
|
37
|
+
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_1.TimeoutError; } });
|
|
38
|
+
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return errors_1.NetworkError; } });
|
|
39
|
+
var pagination_1 = require("./core/pagination");
|
|
40
|
+
Object.defineProperty(exports, "paginate", { enumerable: true, get: function () { return pagination_1.paginate; } });
|
|
41
|
+
var sse_1 = require("./core/sse");
|
|
42
|
+
Object.defineProperty(exports, "iterateSSE", { enumerable: true, get: function () { return sse_1.iterateSSE; } });
|
|
43
|
+
// ── Resource classes (for advanced use / extension) ──
|
|
44
|
+
var workflows_1 = require("./resources/workflows");
|
|
45
|
+
Object.defineProperty(exports, "WorkflowsResource", { enumerable: true, get: function () { return workflows_1.WorkflowsResource; } });
|
|
46
|
+
var versions_1 = require("./resources/versions");
|
|
47
|
+
Object.defineProperty(exports, "VersionsResource", { enumerable: true, get: function () { return versions_1.VersionsResource; } });
|
|
48
|
+
var nodes_1 = require("./resources/nodes");
|
|
49
|
+
Object.defineProperty(exports, "NodesResource", { enumerable: true, get: function () { return nodes_1.NodesResource; } });
|
|
50
|
+
var runs_1 = require("./resources/runs");
|
|
51
|
+
Object.defineProperty(exports, "RunsResource", { enumerable: true, get: function () { return runs_1.RunsResource; } });
|
|
52
|
+
var sessions_1 = require("./resources/sessions");
|
|
53
|
+
Object.defineProperty(exports, "SessionsResource", { enumerable: true, get: function () { return sessions_1.SessionsResource; } });
|
|
54
|
+
var messages_1 = require("./resources/messages");
|
|
55
|
+
Object.defineProperty(exports, "MessagesResource", { enumerable: true, get: function () { return messages_1.MessagesResource; } });
|
|
56
|
+
var variables_1 = require("./resources/variables");
|
|
57
|
+
Object.defineProperty(exports, "VariablesResource", { enumerable: true, get: function () { return variables_1.VariablesResource; } });
|
|
58
|
+
var phone_numbers_1 = require("./resources/phone-numbers");
|
|
59
|
+
Object.defineProperty(exports, "PhoneNumbersResource", { enumerable: true, get: function () { return phone_numbers_1.PhoneNumbersResource; } });
|
|
60
|
+
var sip_trunks_1 = require("./resources/sip-trunks");
|
|
61
|
+
Object.defineProperty(exports, "SipTrunksResource", { enumerable: true, get: function () { return sip_trunks_1.SipTrunksResource; } });
|
|
62
|
+
var integrations_1 = require("./resources/integrations");
|
|
63
|
+
Object.defineProperty(exports, "IntegrationsResource", { enumerable: true, get: function () { return integrations_1.IntegrationsResource; } });
|
|
64
|
+
var contacts_1 = require("./resources/contacts");
|
|
65
|
+
Object.defineProperty(exports, "ContactsResource", { enumerable: true, get: function () { return contacts_1.ContactsResource; } });
|
|
66
|
+
var knowledge_bases_1 = require("./resources/knowledge-bases");
|
|
67
|
+
Object.defineProperty(exports, "KnowledgeBasesResource", { enumerable: true, get: function () { return knowledge_bases_1.KnowledgeBasesResource; } });
|
|
68
|
+
var workflow_folders_1 = require("./resources/workflow-folders");
|
|
69
|
+
Object.defineProperty(exports, "WorkflowFoldersResource", { enumerable: true, get: function () { return workflow_folders_1.WorkflowFoldersResource; } });
|
|
70
|
+
var mcp_1 = require("./resources/mcp");
|
|
71
|
+
Object.defineProperty(exports, "MCPResource", { enumerable: true, get: function () { return mcp_1.MCPResource; } });
|
|
72
|
+
var usage_1 = require("./resources/usage");
|
|
73
|
+
Object.defineProperty(exports, "UsageResource", { enumerable: true, get: function () { return usage_1.UsageResource; } });
|
|
74
|
+
var billing_1 = require("./resources/billing");
|
|
75
|
+
Object.defineProperty(exports, "BillingResource", { enumerable: true, get: function () { return billing_1.BillingResource; } });
|
|
76
|
+
var api_key_1 = require("./resources/api-key");
|
|
77
|
+
Object.defineProperty(exports, "ApiKeyResource", { enumerable: true, get: function () { return api_key_1.ApiKeyResource; } });
|
|
78
|
+
var adversarial_suites_1 = require("./resources/adversarial-suites");
|
|
79
|
+
Object.defineProperty(exports, "AdversarialSuitesResource", { enumerable: true, get: function () { return adversarial_suites_1.AdversarialSuitesResource; } });
|
|
80
|
+
var adversarial_tests_1 = require("./resources/adversarial-tests");
|
|
81
|
+
Object.defineProperty(exports, "AdversarialTestsResource", { enumerable: true, get: function () { return adversarial_tests_1.AdversarialTestsResource; } });
|
|
82
|
+
var northstars_1 = require("./resources/northstars");
|
|
83
|
+
Object.defineProperty(exports, "NorthstarsResource", { enumerable: true, get: function () { return northstars_1.NorthstarsResource; } });
|
|
84
|
+
var custom_evals_1 = require("./resources/custom-evals");
|
|
85
|
+
Object.defineProperty(exports, "CustomEvalsResource", { enumerable: true, get: function () { return custom_evals_1.CustomEvalsResource; } });
|
|
86
|
+
var issues_1 = require("./resources/issues");
|
|
87
|
+
Object.defineProperty(exports, "IssuesResource", { enumerable: true, get: function () { return issues_1.IssuesResource; } });
|
|
88
|
+
var audit_remarks_1 = require("./resources/audit-remarks");
|
|
89
|
+
Object.defineProperty(exports, "AuditRemarksResource", { enumerable: true, get: function () { return audit_remarks_1.AuditRemarksResource; } });
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
package/index.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@happyrobot-ai/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK for the HappyRobot Public API",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"module": "./index.mjs",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./index.js",
|
|
11
|
+
"import": "./index.mjs",
|
|
12
|
+
"types": "./index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./helpers": {
|
|
15
|
+
"require": "./helpers/index.js",
|
|
16
|
+
"import": "./helpers/index.mjs",
|
|
17
|
+
"types": "./helpers/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"**/*.js",
|
|
22
|
+
"**/*.mjs",
|
|
23
|
+
"**/*.d.ts",
|
|
24
|
+
"**/*.d.ts.map"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"happyrobot",
|
|
31
|
+
"sdk",
|
|
32
|
+
"api",
|
|
33
|
+
"voice-ai",
|
|
34
|
+
"workflows"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/happyrobot-ai/app-v2"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adversarial suite resource — client.adversarialSuites.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /adversarial-suites/:suite_id
|
|
6
|
+
* PATCH /adversarial-suites/:suite_id
|
|
7
|
+
* DELETE /adversarial-suites/:suite_id
|
|
8
|
+
* POST /adversarial-suites/:suite_id/generate
|
|
9
|
+
* POST /adversarial-suites/:suite_id/generate-graph
|
|
10
|
+
* POST /adversarial-suites/:suite_id/run
|
|
11
|
+
* GET /adversarial-suites/:suite_id/runs
|
|
12
|
+
* GET /adversarial-suites/runs/:suite_run_id
|
|
13
|
+
* GET /adversarial-suites/runs/:suite_run_id/test-runs
|
|
14
|
+
*/
|
|
15
|
+
import type { HttpClient } from "../core/http";
|
|
16
|
+
import type { GetAdversarialSuiteResponse, PatchAdversarialSuiteBody, PatchAdversarialSuiteResponse, RunAdversarialSuiteBody, RunAdversarialSuiteResponse, ListAdversarialSuiteRunsResponse, ListAdversarialSuiteRunTestRunsResponse, GenerateAdversarialSuiteTestsBody, GenerateAdversarialSuiteTestsResponse, GenerateAdversarialSuiteGraphBody, GenerateAdversarialSuiteGraphResponse } from "../types/adversarial-suites.types";
|
|
17
|
+
export declare class AdversarialSuitesResource {
|
|
18
|
+
private readonly http;
|
|
19
|
+
constructor(http: HttpClient);
|
|
20
|
+
/** Get an adversarial suite by ID. */
|
|
21
|
+
get(suiteId: string): Promise<GetAdversarialSuiteResponse>;
|
|
22
|
+
/** Update an adversarial suite. */
|
|
23
|
+
update(suiteId: string, body: PatchAdversarialSuiteBody): Promise<PatchAdversarialSuiteResponse>;
|
|
24
|
+
/** Delete an adversarial suite. */
|
|
25
|
+
delete(suiteId: string): Promise<void>;
|
|
26
|
+
/** Auto-generate individual adversarial tests from the suite's generation_prompt. */
|
|
27
|
+
generate(suiteId: string, body?: GenerateAdversarialSuiteTestsBody): Promise<GenerateAdversarialSuiteTestsResponse>;
|
|
28
|
+
/** Generate a mermaid workflow graph for the suite. */
|
|
29
|
+
generateGraph(suiteId: string, body: GenerateAdversarialSuiteGraphBody): Promise<GenerateAdversarialSuiteGraphResponse>;
|
|
30
|
+
/** Run all tests in an adversarial suite asynchronously. */
|
|
31
|
+
run(suiteId: string, body: RunAdversarialSuiteBody): Promise<RunAdversarialSuiteResponse>;
|
|
32
|
+
/** List runs for an adversarial suite. */
|
|
33
|
+
listRuns(suiteId: string, query?: {
|
|
34
|
+
limit?: number;
|
|
35
|
+
}): Promise<ListAdversarialSuiteRunsResponse>;
|
|
36
|
+
/** Get an adversarial suite run by ID. */
|
|
37
|
+
getRun(suiteRunId: string): Promise<{
|
|
38
|
+
run: ListAdversarialSuiteRunsResponse["runs"][number];
|
|
39
|
+
}>;
|
|
40
|
+
/** List all individual test runs within a suite run. */
|
|
41
|
+
getRunTestRuns(suiteRunId: string): Promise<ListAdversarialSuiteRunTestRunsResponse>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Adversarial suite resource — client.adversarialSuites.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /adversarial-suites/:suite_id
|
|
7
|
+
* PATCH /adversarial-suites/:suite_id
|
|
8
|
+
* DELETE /adversarial-suites/:suite_id
|
|
9
|
+
* POST /adversarial-suites/:suite_id/generate
|
|
10
|
+
* POST /adversarial-suites/:suite_id/generate-graph
|
|
11
|
+
* POST /adversarial-suites/:suite_id/run
|
|
12
|
+
* GET /adversarial-suites/:suite_id/runs
|
|
13
|
+
* GET /adversarial-suites/runs/:suite_run_id
|
|
14
|
+
* GET /adversarial-suites/runs/:suite_run_id/test-runs
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AdversarialSuitesResource = void 0;
|
|
18
|
+
class AdversarialSuitesResource {
|
|
19
|
+
http;
|
|
20
|
+
constructor(http) {
|
|
21
|
+
this.http = http;
|
|
22
|
+
}
|
|
23
|
+
/** Get an adversarial suite by ID. */
|
|
24
|
+
async get(suiteId) {
|
|
25
|
+
return this.http.request({
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: `/adversarial-suites/${enc(suiteId)}`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Update an adversarial suite. */
|
|
31
|
+
async update(suiteId, body) {
|
|
32
|
+
return this.http.request({
|
|
33
|
+
method: "PATCH",
|
|
34
|
+
path: `/adversarial-suites/${enc(suiteId)}`,
|
|
35
|
+
body,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Delete an adversarial suite. */
|
|
39
|
+
async delete(suiteId) {
|
|
40
|
+
return this.http.request({
|
|
41
|
+
method: "DELETE",
|
|
42
|
+
path: `/adversarial-suites/${enc(suiteId)}`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** Auto-generate individual adversarial tests from the suite's generation_prompt. */
|
|
46
|
+
async generate(suiteId, body) {
|
|
47
|
+
return this.http.request({
|
|
48
|
+
method: "POST",
|
|
49
|
+
path: `/adversarial-suites/${enc(suiteId)}/generate`,
|
|
50
|
+
body: body ?? {},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Generate a mermaid workflow graph for the suite. */
|
|
54
|
+
async generateGraph(suiteId, body) {
|
|
55
|
+
return this.http.request({
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: `/adversarial-suites/${enc(suiteId)}/generate-graph`,
|
|
58
|
+
body,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Run all tests in an adversarial suite asynchronously. */
|
|
62
|
+
async run(suiteId, body) {
|
|
63
|
+
return this.http.request({
|
|
64
|
+
method: "POST",
|
|
65
|
+
path: `/adversarial-suites/${enc(suiteId)}/run`,
|
|
66
|
+
body,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** List runs for an adversarial suite. */
|
|
70
|
+
async listRuns(suiteId, query) {
|
|
71
|
+
return this.http.request({
|
|
72
|
+
method: "GET",
|
|
73
|
+
path: `/adversarial-suites/${enc(suiteId)}/runs`,
|
|
74
|
+
query: query,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/** Get an adversarial suite run by ID. */
|
|
78
|
+
async getRun(suiteRunId) {
|
|
79
|
+
return this.http.request({
|
|
80
|
+
method: "GET",
|
|
81
|
+
path: `/adversarial-suites/runs/${enc(suiteRunId)}`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** List all individual test runs within a suite run. */
|
|
85
|
+
async getRunTestRuns(suiteRunId) {
|
|
86
|
+
return this.http.request({
|
|
87
|
+
method: "GET",
|
|
88
|
+
path: `/adversarial-suites/runs/${enc(suiteRunId)}/test-runs`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.AdversarialSuitesResource = AdversarialSuitesResource;
|
|
93
|
+
function enc(s) {
|
|
94
|
+
return encodeURIComponent(s);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=adversarial-suites.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adversarial test resource — client.adversarialTests.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /adversarial-tests/:test_id
|
|
6
|
+
* PATCH /adversarial-tests/:test_id
|
|
7
|
+
* DELETE /adversarial-tests/:test_id
|
|
8
|
+
* POST /adversarial-tests/:test_id/run
|
|
9
|
+
* GET /adversarial-tests/:test_id/runs
|
|
10
|
+
* GET /adversarial-tests/runs/:run_id
|
|
11
|
+
* GET /adversarial-tests/runs/:run_id/messages
|
|
12
|
+
*/
|
|
13
|
+
import type { HttpClient } from "../core/http";
|
|
14
|
+
import type { GetAdversarialTestResponse, PatchAdversarialTestBody, PatchAdversarialTestResponse, RunAdversarialTestBody, RunAdversarialTestResponse, ListAdversarialTestRunsResponse, ListAdversarialTestRunMessagesResponse } from "../types/adversarial-tests.types";
|
|
15
|
+
export declare class AdversarialTestsResource {
|
|
16
|
+
private readonly http;
|
|
17
|
+
constructor(http: HttpClient);
|
|
18
|
+
/** Get an adversarial test by ID. */
|
|
19
|
+
get(testId: string): Promise<GetAdversarialTestResponse>;
|
|
20
|
+
/** Update an adversarial test. */
|
|
21
|
+
update(testId: string, body: PatchAdversarialTestBody): Promise<PatchAdversarialTestResponse>;
|
|
22
|
+
/** Delete an adversarial test. */
|
|
23
|
+
delete(testId: string): Promise<void>;
|
|
24
|
+
/** Run an adversarial test asynchronously. */
|
|
25
|
+
run(testId: string, body: RunAdversarialTestBody): Promise<RunAdversarialTestResponse>;
|
|
26
|
+
/** List runs for an adversarial test. */
|
|
27
|
+
listRuns(testId: string, query?: {
|
|
28
|
+
limit?: number;
|
|
29
|
+
}): Promise<ListAdversarialTestRunsResponse>;
|
|
30
|
+
/** Get an adversarial test run by ID. */
|
|
31
|
+
getRun(runId: string): Promise<{
|
|
32
|
+
run: ListAdversarialTestRunsResponse["runs"][number];
|
|
33
|
+
}>;
|
|
34
|
+
/** Get the conversation messages from a test run. */
|
|
35
|
+
getRunMessages(runId: string): Promise<ListAdversarialTestRunMessagesResponse>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Adversarial test resource — client.adversarialTests.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /adversarial-tests/:test_id
|
|
7
|
+
* PATCH /adversarial-tests/:test_id
|
|
8
|
+
* DELETE /adversarial-tests/:test_id
|
|
9
|
+
* POST /adversarial-tests/:test_id/run
|
|
10
|
+
* GET /adversarial-tests/:test_id/runs
|
|
11
|
+
* GET /adversarial-tests/runs/:run_id
|
|
12
|
+
* GET /adversarial-tests/runs/:run_id/messages
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AdversarialTestsResource = void 0;
|
|
16
|
+
class AdversarialTestsResource {
|
|
17
|
+
http;
|
|
18
|
+
constructor(http) {
|
|
19
|
+
this.http = http;
|
|
20
|
+
}
|
|
21
|
+
/** Get an adversarial test by ID. */
|
|
22
|
+
async get(testId) {
|
|
23
|
+
return this.http.request({
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: `/adversarial-tests/${enc(testId)}`,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** Update an adversarial test. */
|
|
29
|
+
async update(testId, body) {
|
|
30
|
+
return this.http.request({
|
|
31
|
+
method: "PATCH",
|
|
32
|
+
path: `/adversarial-tests/${enc(testId)}`,
|
|
33
|
+
body,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Delete an adversarial test. */
|
|
37
|
+
async delete(testId) {
|
|
38
|
+
return this.http.request({
|
|
39
|
+
method: "DELETE",
|
|
40
|
+
path: `/adversarial-tests/${enc(testId)}`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Run an adversarial test asynchronously. */
|
|
44
|
+
async run(testId, body) {
|
|
45
|
+
return this.http.request({
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: `/adversarial-tests/${enc(testId)}/run`,
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** List runs for an adversarial test. */
|
|
52
|
+
async listRuns(testId, query) {
|
|
53
|
+
return this.http.request({
|
|
54
|
+
method: "GET",
|
|
55
|
+
path: `/adversarial-tests/${enc(testId)}/runs`,
|
|
56
|
+
query: query,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Get an adversarial test run by ID. */
|
|
60
|
+
async getRun(runId) {
|
|
61
|
+
return this.http.request({
|
|
62
|
+
method: "GET",
|
|
63
|
+
path: `/adversarial-tests/runs/${enc(runId)}`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Get the conversation messages from a test run. */
|
|
67
|
+
async getRunMessages(runId) {
|
|
68
|
+
return this.http.request({
|
|
69
|
+
method: "GET",
|
|
70
|
+
path: `/adversarial-tests/runs/${enc(runId)}/messages`,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.AdversarialTestsResource = AdversarialTestsResource;
|
|
75
|
+
function enc(s) {
|
|
76
|
+
return encodeURIComponent(s);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=adversarial-tests.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key resource — client.apiKey.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /api-key/describe
|
|
6
|
+
*/
|
|
7
|
+
import type { HttpClient } from "../core/http";
|
|
8
|
+
export interface ApiKeyInfo {
|
|
9
|
+
id: string;
|
|
10
|
+
orgId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
prefix: string;
|
|
13
|
+
lastFour: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
lastUsedAt: string | null;
|
|
16
|
+
revokedAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare class ApiKeyResource {
|
|
19
|
+
private readonly http;
|
|
20
|
+
constructor(http: HttpClient);
|
|
21
|
+
/** Describe the current API key (introspection). */
|
|
22
|
+
describe(): Promise<ApiKeyInfo>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* API key resource — client.apiKey.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /api-key/describe
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ApiKeyResource = void 0;
|
|
10
|
+
class ApiKeyResource {
|
|
11
|
+
http;
|
|
12
|
+
constructor(http) {
|
|
13
|
+
this.http = http;
|
|
14
|
+
}
|
|
15
|
+
/** Describe the current API key (introspection). */
|
|
16
|
+
async describe() {
|
|
17
|
+
return this.http.request({
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: "/api-key/describe",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ApiKeyResource = ApiKeyResource;
|
|
24
|
+
//# sourceMappingURL=api-key.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit remark resource — client.auditRemarks.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /audit-remarks/:audit_remark_id/feedback
|
|
6
|
+
* POST /audit-remarks/:audit_remark_id/feedback
|
|
7
|
+
* DELETE /audit-remarks/:audit_remark_id/feedback
|
|
8
|
+
*/
|
|
9
|
+
import type { HttpClient } from "../core/http";
|
|
10
|
+
import type { AuditRemarkFeedback, SubmitAuditRemarkFeedbackBody } from "../types/audit-remarks.types";
|
|
11
|
+
export declare class AuditRemarksResource {
|
|
12
|
+
private readonly http;
|
|
13
|
+
constructor(http: HttpClient);
|
|
14
|
+
/** Get the current user's feedback for an audit remark, or null if none exists. */
|
|
15
|
+
getFeedback(auditRemarkId: string): Promise<AuditRemarkFeedback | null>;
|
|
16
|
+
/** Submit a thumbs up/down for an audit remark. */
|
|
17
|
+
submitFeedback(auditRemarkId: string, body: SubmitAuditRemarkFeedbackBody): Promise<AuditRemarkFeedback>;
|
|
18
|
+
/** Delete the current user's feedback for an audit remark. */
|
|
19
|
+
deleteFeedback(auditRemarkId: string): Promise<{
|
|
20
|
+
success: true;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Audit remark resource — client.auditRemarks.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /audit-remarks/:audit_remark_id/feedback
|
|
7
|
+
* POST /audit-remarks/:audit_remark_id/feedback
|
|
8
|
+
* DELETE /audit-remarks/:audit_remark_id/feedback
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.AuditRemarksResource = void 0;
|
|
12
|
+
class AuditRemarksResource {
|
|
13
|
+
http;
|
|
14
|
+
constructor(http) {
|
|
15
|
+
this.http = http;
|
|
16
|
+
}
|
|
17
|
+
/** Get the current user's feedback for an audit remark, or null if none exists. */
|
|
18
|
+
async getFeedback(auditRemarkId) {
|
|
19
|
+
return this.http.request({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `/audit-remarks/${enc(auditRemarkId)}/feedback`,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Submit a thumbs up/down for an audit remark. */
|
|
25
|
+
async submitFeedback(auditRemarkId, body) {
|
|
26
|
+
return this.http.request({
|
|
27
|
+
method: "POST",
|
|
28
|
+
path: `/audit-remarks/${enc(auditRemarkId)}/feedback`,
|
|
29
|
+
body,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Delete the current user's feedback for an audit remark. */
|
|
33
|
+
async deleteFeedback(auditRemarkId) {
|
|
34
|
+
return this.http.request({
|
|
35
|
+
method: "DELETE",
|
|
36
|
+
path: `/audit-remarks/${enc(auditRemarkId)}/feedback`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.AuditRemarksResource = AuditRemarksResource;
|
|
41
|
+
function enc(s) {
|
|
42
|
+
return encodeURIComponent(s);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=audit-remarks.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Billing resource — client.billing.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /billing/usage/details
|
|
6
|
+
* GET /billing/usage/totals
|
|
7
|
+
*/
|
|
8
|
+
import type { HttpClient } from "../core/http";
|
|
9
|
+
export interface BillingDetailsQuery {
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
use_case_id?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BillingTotalsQuery {
|
|
15
|
+
start: string;
|
|
16
|
+
end: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class BillingResource {
|
|
19
|
+
private readonly http;
|
|
20
|
+
constructor(http: HttpClient);
|
|
21
|
+
/** Get detailed billing usage. */
|
|
22
|
+
getDetails(query: BillingDetailsQuery): Promise<unknown>;
|
|
23
|
+
/** Get billing usage totals. */
|
|
24
|
+
getTotals(query: BillingTotalsQuery): Promise<unknown>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Billing resource — client.billing.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /billing/usage/details
|
|
7
|
+
* GET /billing/usage/totals
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.BillingResource = void 0;
|
|
11
|
+
class BillingResource {
|
|
12
|
+
http;
|
|
13
|
+
constructor(http) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
}
|
|
16
|
+
/** Get detailed billing usage. */
|
|
17
|
+
async getDetails(query) {
|
|
18
|
+
return this.http.request({
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/billing/usage/details",
|
|
21
|
+
query: query,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Get billing usage totals. */
|
|
25
|
+
async getTotals(query) {
|
|
26
|
+
return this.http.request({
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: "/billing/usage/totals",
|
|
29
|
+
query: query,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.BillingResource = BillingResource;
|
|
34
|
+
//# sourceMappingURL=billing.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contacts resource — client.contacts.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /contacts
|
|
6
|
+
* GET /contacts/resolve
|
|
7
|
+
* GET /contacts/:contact_id
|
|
8
|
+
* GET /contacts/:contact_id/interactions
|
|
9
|
+
* GET /contacts/:contact_id/memories
|
|
10
|
+
*/
|
|
11
|
+
import type { HttpClient } from "../core/http";
|
|
12
|
+
import type { Contact } from "../types/contacts.types";
|
|
13
|
+
export interface ListContactsQuery {
|
|
14
|
+
limit?: number;
|
|
15
|
+
cursor?: string;
|
|
16
|
+
search?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CursorPaginatedContacts {
|
|
19
|
+
data: Contact[];
|
|
20
|
+
next_cursor: string | null;
|
|
21
|
+
has_more: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ResolveContactQuery {
|
|
24
|
+
phone_number?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class ContactsResource {
|
|
28
|
+
private readonly http;
|
|
29
|
+
constructor(http: HttpClient);
|
|
30
|
+
/** List contacts (cursor-paginated). */
|
|
31
|
+
list(query?: ListContactsQuery): Promise<CursorPaginatedContacts>;
|
|
32
|
+
/** Resolve a contact by phone number or email. */
|
|
33
|
+
resolve(query: ResolveContactQuery): Promise<Contact>;
|
|
34
|
+
/** Get a contact by ID. */
|
|
35
|
+
get(contactId: string): Promise<Contact>;
|
|
36
|
+
/** Get interactions for a contact. */
|
|
37
|
+
getInteractions(contactId: string): Promise<unknown>;
|
|
38
|
+
/** Get memories for a contact. */
|
|
39
|
+
getMemories(contactId: string): Promise<unknown>;
|
|
40
|
+
}
|