@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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Workflow resource — client.workflows.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /workflows
|
|
7
|
+
* POST /workflows
|
|
8
|
+
* GET /workflows/templates
|
|
9
|
+
* GET /workflows/:workflow_id
|
|
10
|
+
* PATCH /workflows/:workflow_id
|
|
11
|
+
* DELETE /workflows/:workflow_id
|
|
12
|
+
* POST /workflows/:workflow_id/duplicate
|
|
13
|
+
* POST /workflows/:workflow_id/publish
|
|
14
|
+
* POST /workflows/:workflow_id/unpublish
|
|
15
|
+
* POST /workflows/:workflow_id/cancel-runs
|
|
16
|
+
* GET /workflows/:workflow_id/versions
|
|
17
|
+
* GET /workflows/:workflow_id/runs
|
|
18
|
+
* POST /workflows/:workflow_id/runs
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.WorkflowsResource = void 0;
|
|
22
|
+
const pagination_1 = require("../core/pagination");
|
|
23
|
+
class WorkflowsResource {
|
|
24
|
+
http;
|
|
25
|
+
constructor(http) {
|
|
26
|
+
this.http = http;
|
|
27
|
+
}
|
|
28
|
+
/** List workflows (paginated). */
|
|
29
|
+
async list(query) {
|
|
30
|
+
return this.http.request({
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: "/workflows",
|
|
33
|
+
query: query,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Iterate over all workflows across pages. */
|
|
37
|
+
listAll(query) {
|
|
38
|
+
return (0, pagination_1.paginate)(this.http, "/workflows", query);
|
|
39
|
+
}
|
|
40
|
+
/** Create a new workflow. */
|
|
41
|
+
async create(body) {
|
|
42
|
+
return this.http.request({
|
|
43
|
+
method: "POST",
|
|
44
|
+
path: "/workflows",
|
|
45
|
+
body,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Get a workflow by ID or slug. */
|
|
49
|
+
async get(workflowId) {
|
|
50
|
+
return this.http.request({
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: `/workflows/${encodeURIComponent(workflowId)}`,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/** Update a workflow. */
|
|
56
|
+
async update(workflowId, body) {
|
|
57
|
+
return this.http.request({
|
|
58
|
+
method: "PATCH",
|
|
59
|
+
path: `/workflows/${encodeURIComponent(workflowId)}`,
|
|
60
|
+
body,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Delete a workflow. */
|
|
64
|
+
async delete(workflowId) {
|
|
65
|
+
return this.http.request({
|
|
66
|
+
method: "DELETE",
|
|
67
|
+
path: `/workflows/${encodeURIComponent(workflowId)}`,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** Duplicate a workflow. */
|
|
71
|
+
async duplicate(workflowId, body) {
|
|
72
|
+
return this.http.request({
|
|
73
|
+
method: "POST",
|
|
74
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/duplicate`,
|
|
75
|
+
body: body ?? {},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** Publish the latest version of a workflow. */
|
|
79
|
+
async publish(workflowId, body) {
|
|
80
|
+
return this.http.request({
|
|
81
|
+
method: "POST",
|
|
82
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/publish`,
|
|
83
|
+
body: body ?? {},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/** Unpublish a workflow. */
|
|
87
|
+
async unpublish(workflowId) {
|
|
88
|
+
return this.http.request({
|
|
89
|
+
method: "POST",
|
|
90
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/unpublish`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/** Cancel all active runs for a workflow. */
|
|
94
|
+
async cancelRuns(workflowId) {
|
|
95
|
+
return this.http.request({
|
|
96
|
+
method: "POST",
|
|
97
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/cancel-runs`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/** List templates for workflow creation. */
|
|
101
|
+
async listTemplates(query) {
|
|
102
|
+
return this.http.request({
|
|
103
|
+
method: "GET",
|
|
104
|
+
path: "/workflows/templates",
|
|
105
|
+
query: query,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/** List versions for a workflow. */
|
|
109
|
+
async listVersions(workflowId, query) {
|
|
110
|
+
return this.http.request({
|
|
111
|
+
method: "GET",
|
|
112
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/versions`,
|
|
113
|
+
query: query,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/** List runs for a workflow. */
|
|
117
|
+
async listRuns(workflowId, query) {
|
|
118
|
+
return this.http.request({
|
|
119
|
+
method: "GET",
|
|
120
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/runs`,
|
|
121
|
+
query: query,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/** Trigger a run for a workflow. */
|
|
125
|
+
async triggerRun(workflowId, body) {
|
|
126
|
+
return this.http.request({
|
|
127
|
+
method: "POST",
|
|
128
|
+
path: `/workflows/${encodeURIComponent(workflowId)}/runs`,
|
|
129
|
+
body: body ?? {},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.WorkflowsResource = WorkflowsResource;
|
|
134
|
+
//# sourceMappingURL=workflows.js.map
|