@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,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Session resource — client.sessions.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /sessions/:session_id
|
|
7
|
+
* GET /sessions/:session_id/messages
|
|
8
|
+
* GET /sessions/:session_id/stream
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.SessionsResource = void 0;
|
|
12
|
+
const sse_1 = require("../core/sse");
|
|
13
|
+
class SessionsResource {
|
|
14
|
+
http;
|
|
15
|
+
constructor(http) {
|
|
16
|
+
this.http = http;
|
|
17
|
+
}
|
|
18
|
+
/** Get a session by ID. */
|
|
19
|
+
async get(sessionId) {
|
|
20
|
+
return this.http.request({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/sessions/${enc(sessionId)}`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** Get messages for a session. */
|
|
26
|
+
async getMessages(sessionId, query) {
|
|
27
|
+
return this.http.request({
|
|
28
|
+
method: "GET",
|
|
29
|
+
path: `/sessions/${enc(sessionId)}/messages`,
|
|
30
|
+
query: query,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Open an SSE stream for a session's messages.
|
|
35
|
+
*
|
|
36
|
+
* Returns an async iterable of typed SSE events (`connected`, `message`,
|
|
37
|
+
* `backfill_complete`, `session_ended`, `error`).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* for await (const event of client.sessions.stream(sessionId, { backfillLimit: 50 })) {
|
|
42
|
+
* if (event.event === "message") {
|
|
43
|
+
* console.log(event.data.role, event.data.content);
|
|
44
|
+
* }
|
|
45
|
+
* if (event.event === "session_ended") break;
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
async stream(sessionId, query) {
|
|
50
|
+
const response = await this.http.requestRaw({
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: `/sessions/${enc(sessionId)}/stream`,
|
|
53
|
+
query: query,
|
|
54
|
+
});
|
|
55
|
+
return (0, sse_1.iterateSSE)(response);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.SessionsResource = SessionsResource;
|
|
59
|
+
function enc(s) {
|
|
60
|
+
return encodeURIComponent(s);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=sessions.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIP trunks resource — client.sipTrunks.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /sip-trunks
|
|
6
|
+
* GET /sip-trunks/options
|
|
7
|
+
* POST /sip-trunks
|
|
8
|
+
* POST /sip-trunks/bulk
|
|
9
|
+
* GET /sip-trunks/:id
|
|
10
|
+
* PUT /sip-trunks/:id
|
|
11
|
+
* DELETE /sip-trunks/:id
|
|
12
|
+
*/
|
|
13
|
+
import type { HttpClient } from "../core/http";
|
|
14
|
+
import type { SipTrunkResponse, ListSipTrunksResponse, CreateSipTrunkBody, CreateSipTrunkBulkBody, UpdateSipTrunkBody, SipTrunkOptionsResponse } from "../types/sip-trunks.types";
|
|
15
|
+
export declare class SipTrunksResource {
|
|
16
|
+
private readonly http;
|
|
17
|
+
constructor(http: HttpClient);
|
|
18
|
+
/** List all SIP trunks. */
|
|
19
|
+
list(): Promise<ListSipTrunksResponse>;
|
|
20
|
+
/** Get SIP trunk options (lightweight list). */
|
|
21
|
+
listOptions(): Promise<SipTrunkOptionsResponse>;
|
|
22
|
+
/** Create a SIP trunk. */
|
|
23
|
+
create(body: CreateSipTrunkBody): Promise<SipTrunkResponse>;
|
|
24
|
+
/** Create multiple SIP trunks in bulk. */
|
|
25
|
+
createBulk(body: CreateSipTrunkBulkBody): Promise<SipTrunkResponse[]>;
|
|
26
|
+
/** Get a SIP trunk by ID. */
|
|
27
|
+
get(trunkId: string): Promise<SipTrunkResponse>;
|
|
28
|
+
/** Update a SIP trunk. */
|
|
29
|
+
update(trunkId: string, body: UpdateSipTrunkBody): Promise<SipTrunkResponse>;
|
|
30
|
+
/** Delete a SIP trunk. */
|
|
31
|
+
delete(trunkId: string): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SIP trunks resource — client.sipTrunks.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /sip-trunks
|
|
7
|
+
* GET /sip-trunks/options
|
|
8
|
+
* POST /sip-trunks
|
|
9
|
+
* POST /sip-trunks/bulk
|
|
10
|
+
* GET /sip-trunks/:id
|
|
11
|
+
* PUT /sip-trunks/:id
|
|
12
|
+
* DELETE /sip-trunks/:id
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SipTrunksResource = void 0;
|
|
16
|
+
class SipTrunksResource {
|
|
17
|
+
http;
|
|
18
|
+
constructor(http) {
|
|
19
|
+
this.http = http;
|
|
20
|
+
}
|
|
21
|
+
/** List all SIP trunks. */
|
|
22
|
+
async list() {
|
|
23
|
+
return this.http.request({
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: "/sip-trunks",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** Get SIP trunk options (lightweight list). */
|
|
29
|
+
async listOptions() {
|
|
30
|
+
return this.http.request({
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: "/sip-trunks/options",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Create a SIP trunk. */
|
|
36
|
+
async create(body) {
|
|
37
|
+
return this.http.request({
|
|
38
|
+
method: "POST",
|
|
39
|
+
path: "/sip-trunks",
|
|
40
|
+
body,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Create multiple SIP trunks in bulk. */
|
|
44
|
+
async createBulk(body) {
|
|
45
|
+
return this.http.request({
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/sip-trunks/bulk",
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Get a SIP trunk by ID. */
|
|
52
|
+
async get(trunkId) {
|
|
53
|
+
return this.http.request({
|
|
54
|
+
method: "GET",
|
|
55
|
+
path: `/sip-trunks/${enc(trunkId)}`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** Update a SIP trunk. */
|
|
59
|
+
async update(trunkId, body) {
|
|
60
|
+
return this.http.request({
|
|
61
|
+
method: "PUT",
|
|
62
|
+
path: `/sip-trunks/${enc(trunkId)}`,
|
|
63
|
+
body,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Delete a SIP trunk. */
|
|
67
|
+
async delete(trunkId) {
|
|
68
|
+
return this.http.request({
|
|
69
|
+
method: "DELETE",
|
|
70
|
+
path: `/sip-trunks/${enc(trunkId)}`,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.SipTrunksResource = SipTrunksResource;
|
|
75
|
+
function enc(s) {
|
|
76
|
+
return encodeURIComponent(s);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=sip-trunks.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Usage resource — client.usage.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /usage/call-minutes
|
|
6
|
+
* GET /usage/llm-tokens
|
|
7
|
+
* GET /usage/text-count
|
|
8
|
+
* GET /usage/ocr-count
|
|
9
|
+
* GET /usage/rpa-minutes
|
|
10
|
+
*/
|
|
11
|
+
import type { HttpClient } from "../core/http";
|
|
12
|
+
import type { UsageQuery, DetailedUsageResponse } from "../types/usage.types";
|
|
13
|
+
export declare class UsageResource {
|
|
14
|
+
private readonly http;
|
|
15
|
+
constructor(http: HttpClient);
|
|
16
|
+
/** Get call minutes usage. */
|
|
17
|
+
callMinutes(query: UsageQuery): Promise<DetailedUsageResponse>;
|
|
18
|
+
/** Get LLM token usage. */
|
|
19
|
+
llmTokens(query: UsageQuery): Promise<DetailedUsageResponse>;
|
|
20
|
+
/** Get text message count usage. */
|
|
21
|
+
textCount(query: UsageQuery): Promise<DetailedUsageResponse>;
|
|
22
|
+
/** Get OCR count usage. */
|
|
23
|
+
ocrCount(query: UsageQuery): Promise<DetailedUsageResponse>;
|
|
24
|
+
/** Get RPA minutes usage. */
|
|
25
|
+
rpaMinutes(query: UsageQuery): Promise<DetailedUsageResponse>;
|
|
26
|
+
private toQuery;
|
|
27
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Usage resource — client.usage.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /usage/call-minutes
|
|
7
|
+
* GET /usage/llm-tokens
|
|
8
|
+
* GET /usage/text-count
|
|
9
|
+
* GET /usage/ocr-count
|
|
10
|
+
* GET /usage/rpa-minutes
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.UsageResource = void 0;
|
|
14
|
+
class UsageResource {
|
|
15
|
+
http;
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
/** Get call minutes usage. */
|
|
20
|
+
async callMinutes(query) {
|
|
21
|
+
return this.http.request({
|
|
22
|
+
method: "GET",
|
|
23
|
+
path: "/usage/call-minutes",
|
|
24
|
+
query: this.toQuery(query),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Get LLM token usage. */
|
|
28
|
+
async llmTokens(query) {
|
|
29
|
+
return this.http.request({
|
|
30
|
+
method: "GET",
|
|
31
|
+
path: "/usage/llm-tokens",
|
|
32
|
+
query: this.toQuery(query),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Get text message count usage. */
|
|
36
|
+
async textCount(query) {
|
|
37
|
+
return this.http.request({
|
|
38
|
+
method: "GET",
|
|
39
|
+
path: "/usage/text-count",
|
|
40
|
+
query: this.toQuery(query),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Get OCR count usage. */
|
|
44
|
+
async ocrCount(query) {
|
|
45
|
+
return this.http.request({
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "/usage/ocr-count",
|
|
48
|
+
query: this.toQuery(query),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Get RPA minutes usage. */
|
|
52
|
+
async rpaMinutes(query) {
|
|
53
|
+
return this.http.request({
|
|
54
|
+
method: "GET",
|
|
55
|
+
path: "/usage/rpa-minutes",
|
|
56
|
+
query: this.toQuery(query),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
toQuery(query) {
|
|
60
|
+
const { workflow_id, start_date, end_date } = query;
|
|
61
|
+
const ids = Array.isArray(workflow_id) ? workflow_id : [workflow_id];
|
|
62
|
+
return {
|
|
63
|
+
workflow_id: ids.join(","),
|
|
64
|
+
start_date,
|
|
65
|
+
end_date,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.UsageResource = UsageResource;
|
|
70
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variables resource — client.variables.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /workflows/:workflow_id/variables
|
|
6
|
+
* POST /workflows/:workflow_id/variables
|
|
7
|
+
* PATCH /workflows/:workflow_id/variables/:variable_id
|
|
8
|
+
* DELETE /workflows/:workflow_id/variables/:variable_id
|
|
9
|
+
*/
|
|
10
|
+
import type { HttpClient } from "../core/http";
|
|
11
|
+
import type { ListVariablesQuery, PaginatedVariablesResponse, CreateVariableBody, UpdateVariableBody, VariableResponse } from "../types/variables.types";
|
|
12
|
+
export declare class VariablesResource {
|
|
13
|
+
private readonly http;
|
|
14
|
+
constructor(http: HttpClient);
|
|
15
|
+
/** List variables for a workflow. */
|
|
16
|
+
list(workflowId: string, query?: ListVariablesQuery): Promise<PaginatedVariablesResponse>;
|
|
17
|
+
/** Create a variable for a workflow. */
|
|
18
|
+
create(workflowId: string, body: CreateVariableBody): Promise<VariableResponse>;
|
|
19
|
+
/** Update a variable. */
|
|
20
|
+
update(workflowId: string, variableId: string, body: UpdateVariableBody): Promise<VariableResponse>;
|
|
21
|
+
/** Delete a variable. */
|
|
22
|
+
delete(workflowId: string, variableId: string): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Variables resource — client.variables.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /workflows/:workflow_id/variables
|
|
7
|
+
* POST /workflows/:workflow_id/variables
|
|
8
|
+
* PATCH /workflows/:workflow_id/variables/:variable_id
|
|
9
|
+
* DELETE /workflows/:workflow_id/variables/:variable_id
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.VariablesResource = void 0;
|
|
13
|
+
class VariablesResource {
|
|
14
|
+
http;
|
|
15
|
+
constructor(http) {
|
|
16
|
+
this.http = http;
|
|
17
|
+
}
|
|
18
|
+
/** List variables for a workflow. */
|
|
19
|
+
async list(workflowId, query) {
|
|
20
|
+
return this.http.request({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/workflows/${enc(workflowId)}/variables`,
|
|
23
|
+
query: query,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Create a variable for a workflow. */
|
|
27
|
+
async create(workflowId, body) {
|
|
28
|
+
return this.http.request({
|
|
29
|
+
method: "POST",
|
|
30
|
+
path: `/workflows/${enc(workflowId)}/variables`,
|
|
31
|
+
body,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Update a variable. */
|
|
35
|
+
async update(workflowId, variableId, body) {
|
|
36
|
+
return this.http.request({
|
|
37
|
+
method: "PATCH",
|
|
38
|
+
path: `/workflows/${enc(workflowId)}/variables/${enc(variableId)}`,
|
|
39
|
+
body,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Delete a variable. */
|
|
43
|
+
async delete(workflowId, variableId) {
|
|
44
|
+
return this.http.request({
|
|
45
|
+
method: "DELETE",
|
|
46
|
+
path: `/workflows/${enc(workflowId)}/variables/${enc(variableId)}`,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.VariablesResource = VariablesResource;
|
|
51
|
+
function enc(s) {
|
|
52
|
+
return encodeURIComponent(s);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version resource — client.versions.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /versions/:version_id
|
|
6
|
+
* PATCH /versions/:version_id
|
|
7
|
+
* POST /versions/:version_id/fork
|
|
8
|
+
* POST /versions/:version_id/publish
|
|
9
|
+
* POST /versions/:version_id/unpublish
|
|
10
|
+
* POST /versions/:version_id/lock
|
|
11
|
+
* POST /versions/:version_id/unlock
|
|
12
|
+
* POST /versions/:version_id/test-all
|
|
13
|
+
* GET /versions/:version_id/prompt-issues
|
|
14
|
+
*/
|
|
15
|
+
import type { HttpClient } from "../core/http";
|
|
16
|
+
import type { VersionWithNodesSummary, UpdateVersionBody, UpdateVersionResponse, ForkVersionResponse, PublishBody, PublishResponse, VersionStatusResponse, PromptIssuesResponse } from "../types/versions.types";
|
|
17
|
+
export declare class VersionsResource {
|
|
18
|
+
private readonly http;
|
|
19
|
+
constructor(http: HttpClient);
|
|
20
|
+
/** Get a version by ID or slug (includes node summary and changelog). */
|
|
21
|
+
get(versionId: string): Promise<VersionWithNodesSummary>;
|
|
22
|
+
/** Update a version's name or description. */
|
|
23
|
+
update(versionId: string, body: UpdateVersionBody): Promise<UpdateVersionResponse>;
|
|
24
|
+
/** Fork (clone) a version. */
|
|
25
|
+
fork(versionId: string): Promise<ForkVersionResponse>;
|
|
26
|
+
/** Publish a version. */
|
|
27
|
+
publish(versionId: string, body?: PublishBody): Promise<PublishResponse>;
|
|
28
|
+
/** Unpublish a version. */
|
|
29
|
+
unpublish(versionId: string): Promise<VersionStatusResponse>;
|
|
30
|
+
/** Lock a version (prevent edits). */
|
|
31
|
+
lock(versionId: string): Promise<VersionStatusResponse>;
|
|
32
|
+
/** Unlock a version. */
|
|
33
|
+
unlock(versionId: string): Promise<VersionStatusResponse>;
|
|
34
|
+
/** Run test-all validation on a version. */
|
|
35
|
+
testAll(versionId: string): Promise<unknown>;
|
|
36
|
+
/** Get prompt quality issues for all prompt nodes in a version. */
|
|
37
|
+
getPromptIssues(versionId: string): Promise<PromptIssuesResponse>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Version resource — client.versions.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /versions/:version_id
|
|
7
|
+
* PATCH /versions/:version_id
|
|
8
|
+
* POST /versions/:version_id/fork
|
|
9
|
+
* POST /versions/:version_id/publish
|
|
10
|
+
* POST /versions/:version_id/unpublish
|
|
11
|
+
* POST /versions/:version_id/lock
|
|
12
|
+
* POST /versions/:version_id/unlock
|
|
13
|
+
* POST /versions/:version_id/test-all
|
|
14
|
+
* GET /versions/:version_id/prompt-issues
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.VersionsResource = void 0;
|
|
18
|
+
class VersionsResource {
|
|
19
|
+
http;
|
|
20
|
+
constructor(http) {
|
|
21
|
+
this.http = http;
|
|
22
|
+
}
|
|
23
|
+
/** Get a version by ID or slug (includes node summary and changelog). */
|
|
24
|
+
async get(versionId) {
|
|
25
|
+
return this.http.request({
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: `/versions/${encodeURIComponent(versionId)}`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Update a version's name or description. */
|
|
31
|
+
async update(versionId, body) {
|
|
32
|
+
return this.http.request({
|
|
33
|
+
method: "PATCH",
|
|
34
|
+
path: `/versions/${encodeURIComponent(versionId)}`,
|
|
35
|
+
body,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Fork (clone) a version. */
|
|
39
|
+
async fork(versionId) {
|
|
40
|
+
return this.http.request({
|
|
41
|
+
method: "POST",
|
|
42
|
+
path: `/versions/${encodeURIComponent(versionId)}/fork`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** Publish a version. */
|
|
46
|
+
async publish(versionId, body) {
|
|
47
|
+
return this.http.request({
|
|
48
|
+
method: "POST",
|
|
49
|
+
path: `/versions/${encodeURIComponent(versionId)}/publish`,
|
|
50
|
+
body: body ?? {},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Unpublish a version. */
|
|
54
|
+
async unpublish(versionId) {
|
|
55
|
+
return this.http.request({
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: `/versions/${encodeURIComponent(versionId)}/unpublish`,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Lock a version (prevent edits). */
|
|
61
|
+
async lock(versionId) {
|
|
62
|
+
return this.http.request({
|
|
63
|
+
method: "POST",
|
|
64
|
+
path: `/versions/${encodeURIComponent(versionId)}/lock`,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Unlock a version. */
|
|
68
|
+
async unlock(versionId) {
|
|
69
|
+
return this.http.request({
|
|
70
|
+
method: "POST",
|
|
71
|
+
path: `/versions/${encodeURIComponent(versionId)}/unlock`,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/** Run test-all validation on a version. */
|
|
75
|
+
async testAll(versionId) {
|
|
76
|
+
return this.http.request({
|
|
77
|
+
method: "POST",
|
|
78
|
+
path: `/versions/${encodeURIComponent(versionId)}/test-all`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Get prompt quality issues for all prompt nodes in a version. */
|
|
82
|
+
async getPromptIssues(versionId) {
|
|
83
|
+
return this.http.request({
|
|
84
|
+
method: "GET",
|
|
85
|
+
path: `/versions/${encodeURIComponent(versionId)}/prompt-issues`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.VersionsResource = VersionsResource;
|
|
90
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow folders resource — client.workflowFolders.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /workflow-folders
|
|
6
|
+
* POST /workflow-folders
|
|
7
|
+
* GET /workflow-folders/:folder_id
|
|
8
|
+
* PUT /workflow-folders/:folder_id
|
|
9
|
+
* DELETE /workflow-folders/:folder_id
|
|
10
|
+
*/
|
|
11
|
+
import type { HttpClient } from "../core/http";
|
|
12
|
+
import type { ListFoldersQuery, PaginatedFoldersResponse, CreateFolderBody, WorkflowFolder } from "../types/workflow-folders.types";
|
|
13
|
+
export declare class WorkflowFoldersResource {
|
|
14
|
+
private readonly http;
|
|
15
|
+
constructor(http: HttpClient);
|
|
16
|
+
/** List workflow folders (paginated). */
|
|
17
|
+
list(query?: ListFoldersQuery): Promise<PaginatedFoldersResponse>;
|
|
18
|
+
/** Create a workflow folder. */
|
|
19
|
+
create(body: CreateFolderBody): Promise<WorkflowFolder>;
|
|
20
|
+
/** Get a folder by ID. */
|
|
21
|
+
get(folderId: string): Promise<WorkflowFolder>;
|
|
22
|
+
/** Update a folder. */
|
|
23
|
+
update(folderId: string, body: Partial<CreateFolderBody>): Promise<WorkflowFolder>;
|
|
24
|
+
/** Delete a folder. */
|
|
25
|
+
delete(folderId: string): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Workflow folders resource — client.workflowFolders.*
|
|
4
|
+
*
|
|
5
|
+
* Maps to:
|
|
6
|
+
* GET /workflow-folders
|
|
7
|
+
* POST /workflow-folders
|
|
8
|
+
* GET /workflow-folders/:folder_id
|
|
9
|
+
* PUT /workflow-folders/:folder_id
|
|
10
|
+
* DELETE /workflow-folders/:folder_id
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.WorkflowFoldersResource = void 0;
|
|
14
|
+
class WorkflowFoldersResource {
|
|
15
|
+
http;
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
/** List workflow folders (paginated). */
|
|
20
|
+
async list(query) {
|
|
21
|
+
return this.http.request({
|
|
22
|
+
method: "GET",
|
|
23
|
+
path: "/workflow-folders",
|
|
24
|
+
query: query,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Create a workflow folder. */
|
|
28
|
+
async create(body) {
|
|
29
|
+
return this.http.request({
|
|
30
|
+
method: "POST",
|
|
31
|
+
path: "/workflow-folders",
|
|
32
|
+
body,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Get a folder by ID. */
|
|
36
|
+
async get(folderId) {
|
|
37
|
+
return this.http.request({
|
|
38
|
+
method: "GET",
|
|
39
|
+
path: `/workflow-folders/${enc(folderId)}`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Update a folder. */
|
|
43
|
+
async update(folderId, body) {
|
|
44
|
+
return this.http.request({
|
|
45
|
+
method: "PUT",
|
|
46
|
+
path: `/workflow-folders/${enc(folderId)}`,
|
|
47
|
+
body,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** Delete a folder. */
|
|
51
|
+
async delete(folderId) {
|
|
52
|
+
return this.http.request({
|
|
53
|
+
method: "DELETE",
|
|
54
|
+
path: `/workflow-folders/${enc(folderId)}`,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.WorkflowFoldersResource = WorkflowFoldersResource;
|
|
59
|
+
function enc(s) {
|
|
60
|
+
return encodeURIComponent(s);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=workflow-folders.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow resource — client.workflows.*
|
|
3
|
+
*
|
|
4
|
+
* Maps to:
|
|
5
|
+
* GET /workflows
|
|
6
|
+
* POST /workflows
|
|
7
|
+
* GET /workflows/templates
|
|
8
|
+
* GET /workflows/:workflow_id
|
|
9
|
+
* PATCH /workflows/:workflow_id
|
|
10
|
+
* DELETE /workflows/:workflow_id
|
|
11
|
+
* POST /workflows/:workflow_id/duplicate
|
|
12
|
+
* POST /workflows/:workflow_id/publish
|
|
13
|
+
* POST /workflows/:workflow_id/unpublish
|
|
14
|
+
* POST /workflows/:workflow_id/cancel-runs
|
|
15
|
+
* GET /workflows/:workflow_id/versions
|
|
16
|
+
* GET /workflows/:workflow_id/runs
|
|
17
|
+
* POST /workflows/:workflow_id/runs
|
|
18
|
+
*/
|
|
19
|
+
import type { HttpClient } from "../core/http";
|
|
20
|
+
import type { ListWorkflowsQuery, WorkflowListItem, PaginatedWorkflowsResponse, CreateWorkflowBody, CreateWorkflowResponse, WorkflowDetailResponse, UpdateWorkflowBody, UpdateWorkflowResponse, DuplicateWorkflowBody, DuplicateWorkflowResponse, ListTemplatesQuery, PaginatedTemplatesResponse, WorkflowPublishResponse, WorkflowUnpublishResponse, CancelRunsResponse, ListWorkflowVersionsQuery, PaginatedWorkflowVersionsResponse } from "../types/workflows.types";
|
|
21
|
+
import type { WorkflowRunsQuery, PaginatedWorkflowRunsResponse, TriggerRunBody, TriggerRunResponse } from "../types/runs.types";
|
|
22
|
+
export declare class WorkflowsResource {
|
|
23
|
+
private readonly http;
|
|
24
|
+
constructor(http: HttpClient);
|
|
25
|
+
/** List workflows (paginated). */
|
|
26
|
+
list(query?: ListWorkflowsQuery): Promise<PaginatedWorkflowsResponse>;
|
|
27
|
+
/** Iterate over all workflows across pages. */
|
|
28
|
+
listAll(query?: Omit<ListWorkflowsQuery, "page">): AsyncGenerator<WorkflowListItem>;
|
|
29
|
+
/** Create a new workflow. */
|
|
30
|
+
create(body: CreateWorkflowBody): Promise<CreateWorkflowResponse>;
|
|
31
|
+
/** Get a workflow by ID or slug. */
|
|
32
|
+
get(workflowId: string): Promise<WorkflowDetailResponse>;
|
|
33
|
+
/** Update a workflow. */
|
|
34
|
+
update(workflowId: string, body: UpdateWorkflowBody): Promise<UpdateWorkflowResponse>;
|
|
35
|
+
/** Delete a workflow. */
|
|
36
|
+
delete(workflowId: string): Promise<void>;
|
|
37
|
+
/** Duplicate a workflow. */
|
|
38
|
+
duplicate(workflowId: string, body?: DuplicateWorkflowBody): Promise<DuplicateWorkflowResponse>;
|
|
39
|
+
/** Publish the latest version of a workflow. */
|
|
40
|
+
publish(workflowId: string, body?: {
|
|
41
|
+
environment?: "production" | "staging" | "development";
|
|
42
|
+
}): Promise<WorkflowPublishResponse>;
|
|
43
|
+
/** Unpublish a workflow. */
|
|
44
|
+
unpublish(workflowId: string): Promise<WorkflowUnpublishResponse>;
|
|
45
|
+
/** Cancel all active runs for a workflow. */
|
|
46
|
+
cancelRuns(workflowId: string): Promise<CancelRunsResponse>;
|
|
47
|
+
/** List templates for workflow creation. */
|
|
48
|
+
listTemplates(query?: ListTemplatesQuery): Promise<PaginatedTemplatesResponse>;
|
|
49
|
+
/** List versions for a workflow. */
|
|
50
|
+
listVersions(workflowId: string, query?: ListWorkflowVersionsQuery): Promise<PaginatedWorkflowVersionsResponse>;
|
|
51
|
+
/** List runs for a workflow. */
|
|
52
|
+
listRuns(workflowId: string, query?: WorkflowRunsQuery): Promise<PaginatedWorkflowRunsResponse>;
|
|
53
|
+
/** Trigger a run for a workflow. */
|
|
54
|
+
triggerRun(workflowId: string, body?: TriggerRunBody): Promise<TriggerRunResponse>;
|
|
55
|
+
}
|