@happyrobot-ai/sdk 0.1.4 → 0.1.6
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 +117 -0
- package/chat/index.d.ts +17 -0
- package/chat/index.js +20 -0
- package/chat/index.mjs +3 -0
- package/chat-client.mjs +3 -3
- package/client.d.ts +3 -0
- package/client.js +4 -0
- package/client.mjs +3 -3
- package/core/errors.mjs +3 -3
- package/core/http.mjs +3 -3
- package/core/pagination.mjs +3 -3
- package/core/sse.mjs +3 -3
- package/core/types.mjs +0 -2
- package/helpers/index.mjs +3 -3
- package/helpers/template-workflows.mjs +3 -3
- package/helpers/trigger-and-wait.mjs +3 -3
- package/helpers/voice-agent.mjs +3 -3
- package/index.d.ts +2 -2
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/package.json +19 -1
- package/resources/adversarial-suites.mjs +3 -3
- package/resources/adversarial-tests.mjs +3 -3
- package/resources/api-key.mjs +3 -3
- package/resources/artifacts.mjs +3 -3
- package/resources/audit-remarks.mjs +3 -3
- package/resources/billing.mjs +3 -3
- package/resources/chat.mjs +3 -3
- package/resources/contacts.mjs +3 -3
- package/resources/custom-evals.mjs +3 -3
- package/resources/integrations.mjs +3 -3
- package/resources/issues.mjs +3 -3
- package/resources/knowledge-bases.mjs +3 -3
- package/resources/mcp.mjs +3 -3
- package/resources/messages.mjs +3 -3
- package/resources/nodes.mjs +3 -3
- package/resources/northstars.mjs +3 -3
- package/resources/phone-numbers.mjs +3 -3
- package/resources/runs.mjs +3 -3
- package/resources/sessions.mjs +3 -3
- package/resources/sip-trunks.mjs +3 -3
- package/resources/variables.mjs +3 -3
- package/resources/versions.mjs +3 -3
- package/resources/voice.d.ts +29 -0
- package/resources/voice.js +40 -0
- package/resources/voice.mjs +3 -0
- package/resources/workflow-folders.mjs +3 -3
- package/resources/workflows.mjs +3 -3
- package/types/adversarial-suites.types.d.ts +26 -0
- package/types/adversarial-suites.types.js +6 -0
- package/types/adversarial-suites.types.mjs +1 -0
- package/types/adversarial-tests.types.d.ts +21 -0
- package/types/adversarial-tests.types.js +6 -0
- package/types/adversarial-tests.types.mjs +1 -0
- package/types/artifacts.types.d.ts +4 -0
- package/types/artifacts.types.js +3 -0
- package/types/artifacts.types.mjs +1 -0
- package/types/audit-remarks.types.d.ts +19 -0
- package/types/audit-remarks.types.js +6 -0
- package/types/audit-remarks.types.mjs +1 -0
- package/types/chat.types.d.ts +145 -0
- package/types/chat.types.js +3 -0
- package/types/chat.types.mjs +1 -0
- package/types/common.types.d.ts +19 -0
- package/types/common.types.js +7 -0
- package/types/common.types.mjs +1 -0
- package/types/contacts.types.d.ts +6 -0
- package/types/contacts.types.js +6 -0
- package/types/contacts.types.mjs +1 -0
- package/types/custom-evals.types.d.ts +19 -0
- package/types/custom-evals.types.js +6 -0
- package/types/custom-evals.types.mjs +1 -0
- package/types/integrations.types.d.ts +45 -0
- package/types/integrations.types.js +6 -0
- package/types/integrations.types.mjs +1 -0
- package/types/issues.types.d.ts +11 -0
- package/types/issues.types.js +6 -0
- package/types/issues.types.mjs +1 -0
- package/types/knowledge-bases.types.d.ts +21 -0
- package/types/knowledge-bases.types.js +7 -0
- package/types/knowledge-bases.types.mjs +1 -0
- package/types/mcp.types.d.ts +10 -0
- package/types/mcp.types.js +6 -0
- package/types/mcp.types.mjs +1 -0
- package/types/messages.types.d.ts +9 -0
- package/types/messages.types.js +6 -0
- package/types/messages.types.mjs +1 -0
- package/types/nodes.types.d.ts +12 -0
- package/types/nodes.types.js +6 -0
- package/types/nodes.types.mjs +1 -0
- package/types/northstars.types.d.ts +18 -0
- package/types/northstars.types.js +6 -0
- package/types/northstars.types.mjs +1 -0
- package/types/phone-numbers.types.d.ts +24 -0
- package/types/phone-numbers.types.js +6 -0
- package/types/phone-numbers.types.mjs +1 -0
- package/types/runs.types.d.ts +16 -0
- package/types/runs.types.js +6 -0
- package/types/runs.types.mjs +1 -0
- package/types/sessions.types.d.ts +51 -0
- package/types/sessions.types.js +6 -0
- package/types/sessions.types.mjs +1 -0
- package/types/sip-trunks.types.d.ts +11 -0
- package/types/sip-trunks.types.js +6 -0
- package/types/sip-trunks.types.mjs +1 -0
- package/types/variables.types.d.ts +10 -0
- package/types/variables.types.js +6 -0
- package/types/variables.types.mjs +1 -0
- package/types/versions.types.d.ts +22 -0
- package/types/versions.types.js +6 -0
- package/types/versions.types.mjs +1 -0
- package/types/voice.types.d.ts +13 -0
- package/types/voice.types.js +3 -0
- package/types/voice.types.mjs +1 -0
- package/types/workflow-folders.types.d.ts +9 -0
- package/types/workflow-folders.types.js +6 -0
- package/types/workflow-folders.types.mjs +1 -0
- package/types/workflows.types.d.ts +24 -0
- package/types/workflows.types.js +7 -0
- package/types/workflows.types.mjs +1 -0
- package/voice/index.d.ts +22 -0
- package/voice/index.js +25 -0
- package/voice/index.mjs +3 -0
- package/voice-client.d.ts +87 -0
- package/voice-client.js +148 -0
- package/voice-client.mjs +3 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Voice resource — client.voice.*
|
|
4
|
+
*
|
|
5
|
+
* Server-side only. Creates LiveKit tokens that are passed to the
|
|
6
|
+
* browser-side `HappyRobotVoiceClient`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const client = new HappyRobotClient({ apiKey: "sk_live_..." });
|
|
11
|
+
* const { url, token } = await client.voice.createToken({
|
|
12
|
+
* workflow_id: "my-workflow",
|
|
13
|
+
* data: { customer_name: "John" },
|
|
14
|
+
* });
|
|
15
|
+
* // Pass `url` and `token` to the browser → new HappyRobotVoiceClient({ url, token })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.VoiceResource = void 0;
|
|
20
|
+
class VoiceResource {
|
|
21
|
+
http;
|
|
22
|
+
constructor(http) {
|
|
23
|
+
this.http = http;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a LiveKit token for browser-side voice calls.
|
|
27
|
+
*
|
|
28
|
+
* Call this from your server, then pass the returned `url` and `token`
|
|
29
|
+
* to the browser where they can be used to initialize `HappyRobotVoiceClient`.
|
|
30
|
+
*/
|
|
31
|
+
async createToken(body) {
|
|
32
|
+
return this.http.request({
|
|
33
|
+
method: "POST",
|
|
34
|
+
path: "/voice/tokens",
|
|
35
|
+
body,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.VoiceResource = VoiceResource;
|
|
40
|
+
//# sourceMappingURL=voice.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as _cjs from "./workflow-folders.js";
|
|
2
|
+
const { WorkflowFoldersResource } = _cjs;
|
|
3
|
+
export { WorkflowFoldersResource };
|
package/resources/workflows.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as _cjs from "./workflows.js";
|
|
2
|
+
const { WorkflowsResource } = _cjs;
|
|
3
|
+
export { WorkflowsResource };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adversarial suite types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { AdversarialSuiteApiSchema } from "../../routes/nodes/:node_id/adversarial-suites/get";
|
|
6
|
+
import type { GetAdversarialSuiteByIdResponseSchema } from "../../routes/adversarial-suites/get";
|
|
7
|
+
import type { PatchAdversarialSuiteBodySchema, PatchAdversarialSuiteResponseSchema } from "../../routes/adversarial-suites/patch";
|
|
8
|
+
import type { RunAdversarialSuiteBodySchema, RunAdversarialSuiteResponseSchema } from "../../routes/adversarial-suites/run/post";
|
|
9
|
+
import type { AdversarialSuiteRunApiSchema, GetAdversarialSuiteRunsResponseSchema } from "../../routes/adversarial-suites/runs/get";
|
|
10
|
+
import type { AdversarialSuiteTestRunItemSchema, GetAdversarialSuiteRunTestRunsResponseSchema } from "../../routes/adversarial-suites/runs/:suite_run_id/test-runs/get";
|
|
11
|
+
import type { GenerateAdversarialSuiteTestsBodySchema, GenerateAdversarialSuiteTestsResponseSchema } from "../../routes/adversarial-suites/generate/post";
|
|
12
|
+
import type { GenerateAdversarialSuiteGraphBodySchema, GenerateAdversarialSuiteGraphResponseSchema } from "../../routes/adversarial-suites/generate-graph/post";
|
|
13
|
+
export type AdversarialSuite = z.infer<typeof AdversarialSuiteApiSchema>;
|
|
14
|
+
export type GetAdversarialSuiteResponse = z.infer<typeof GetAdversarialSuiteByIdResponseSchema>;
|
|
15
|
+
export type PatchAdversarialSuiteBody = z.input<typeof PatchAdversarialSuiteBodySchema>;
|
|
16
|
+
export type PatchAdversarialSuiteResponse = z.infer<typeof PatchAdversarialSuiteResponseSchema>;
|
|
17
|
+
export type RunAdversarialSuiteBody = z.input<typeof RunAdversarialSuiteBodySchema>;
|
|
18
|
+
export type RunAdversarialSuiteResponse = z.infer<typeof RunAdversarialSuiteResponseSchema>;
|
|
19
|
+
export type AdversarialSuiteRun = z.infer<typeof AdversarialSuiteRunApiSchema>;
|
|
20
|
+
export type ListAdversarialSuiteRunsResponse = z.infer<typeof GetAdversarialSuiteRunsResponseSchema>;
|
|
21
|
+
export type AdversarialSuiteTestRunItem = z.infer<typeof AdversarialSuiteTestRunItemSchema>;
|
|
22
|
+
export type ListAdversarialSuiteRunTestRunsResponse = z.infer<typeof GetAdversarialSuiteRunTestRunsResponseSchema>;
|
|
23
|
+
export type GenerateAdversarialSuiteTestsBody = z.input<typeof GenerateAdversarialSuiteTestsBodySchema>;
|
|
24
|
+
export type GenerateAdversarialSuiteTestsResponse = z.infer<typeof GenerateAdversarialSuiteTestsResponseSchema>;
|
|
25
|
+
export type GenerateAdversarialSuiteGraphBody = z.input<typeof GenerateAdversarialSuiteGraphBodySchema>;
|
|
26
|
+
export type GenerateAdversarialSuiteGraphResponse = z.infer<typeof GenerateAdversarialSuiteGraphResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./adversarial-suites.types.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adversarial test types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { AdversarialTestApiSchema } from "../../routes/nodes/:node_id/adversarial-tests/get";
|
|
6
|
+
import type { GetAdversarialTestByIdResponseSchema } from "../../routes/adversarial-tests/get";
|
|
7
|
+
import type { PatchAdversarialTestBodySchema, PatchAdversarialTestResponseSchema } from "../../routes/adversarial-tests/patch";
|
|
8
|
+
import type { RunAdversarialTestBodySchema, RunAdversarialTestResponseSchema } from "../../routes/adversarial-tests/run/post";
|
|
9
|
+
import type { AuditRemarkApiSchema, AdversarialTestRunApiSchema, GetAdversarialTestRunsResponseSchema } from "../../routes/adversarial-tests/runs/get";
|
|
10
|
+
import type { AdversarialTestRunMessageSchema, GetAdversarialTestRunMessagesResponseSchema } from "../../routes/adversarial-tests/runs/:run_id/messages/get";
|
|
11
|
+
export type AdversarialTest = z.infer<typeof AdversarialTestApiSchema>;
|
|
12
|
+
export type GetAdversarialTestResponse = z.infer<typeof GetAdversarialTestByIdResponseSchema>;
|
|
13
|
+
export type PatchAdversarialTestBody = z.input<typeof PatchAdversarialTestBodySchema>;
|
|
14
|
+
export type PatchAdversarialTestResponse = z.infer<typeof PatchAdversarialTestResponseSchema>;
|
|
15
|
+
export type RunAdversarialTestBody = z.input<typeof RunAdversarialTestBodySchema>;
|
|
16
|
+
export type RunAdversarialTestResponse = z.infer<typeof RunAdversarialTestResponseSchema>;
|
|
17
|
+
export type AuditRemark = z.infer<typeof AuditRemarkApiSchema>;
|
|
18
|
+
export type AdversarialTestRun = z.infer<typeof AdversarialTestRunApiSchema>;
|
|
19
|
+
export type ListAdversarialTestRunsResponse = z.infer<typeof GetAdversarialTestRunsResponseSchema>;
|
|
20
|
+
export type AdversarialTestRunMessage = z.infer<typeof AdversarialTestRunMessageSchema>;
|
|
21
|
+
export type ListAdversarialTestRunMessagesResponse = z.infer<typeof GetAdversarialTestRunMessagesResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./adversarial-tests.types.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { ResolveArtifactsBodySchema, ResolveArtifactsResponseSchema } from "../../routes/artifacts/schemas";
|
|
3
|
+
export type ResolveArtifactsBody = z.input<typeof ResolveArtifactsBodySchema>;
|
|
4
|
+
export type ResolveArtifactsResponse = z.infer<typeof ResolveArtifactsResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./artifacts.types.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit remark types.
|
|
3
|
+
*/
|
|
4
|
+
export interface AuditRemarkFeedback {
|
|
5
|
+
id: string;
|
|
6
|
+
polarity: boolean;
|
|
7
|
+
issue_attribution: string | null;
|
|
8
|
+
comment: string | null;
|
|
9
|
+
audit_remark_id: string;
|
|
10
|
+
northstar_id: string;
|
|
11
|
+
created_by: string;
|
|
12
|
+
created_at: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SubmitAuditRemarkFeedbackBody {
|
|
15
|
+
polarity: boolean;
|
|
16
|
+
/** Attribution when polarity is false. */
|
|
17
|
+
issue_attribution?: "auditor" | "northstar";
|
|
18
|
+
comment?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./audit-remarks.types.js";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/** POST /chat/tokens request body. */
|
|
2
|
+
export interface CreateChatTokenBody {
|
|
3
|
+
workflow_id: string;
|
|
4
|
+
env?: "production" | "staging" | "development";
|
|
5
|
+
}
|
|
6
|
+
/** POST /chat/tokens response. */
|
|
7
|
+
export interface CreateChatTokenResponse {
|
|
8
|
+
token: string;
|
|
9
|
+
expires_at: string;
|
|
10
|
+
}
|
|
11
|
+
/** POST /chat/sessions response. */
|
|
12
|
+
export interface CreateChatSessionResponse {
|
|
13
|
+
session_id: string;
|
|
14
|
+
status: string;
|
|
15
|
+
}
|
|
16
|
+
/** Artifact reference for file attachments. */
|
|
17
|
+
export interface ArtifactRef {
|
|
18
|
+
type?: string;
|
|
19
|
+
media_id: string;
|
|
20
|
+
s3_key?: string;
|
|
21
|
+
mime_type: string;
|
|
22
|
+
presigned_url?: string;
|
|
23
|
+
filename?: string;
|
|
24
|
+
size_bytes?: number;
|
|
25
|
+
artifact_text?: string;
|
|
26
|
+
}
|
|
27
|
+
/** POST /chat/sessions/:id/messages request body. */
|
|
28
|
+
export interface SendChatMessageBody {
|
|
29
|
+
content: string;
|
|
30
|
+
artifacts?: ArtifactRef[];
|
|
31
|
+
}
|
|
32
|
+
/** POST /chat/sessions/:id/messages response. */
|
|
33
|
+
export interface SendChatMessageResponse {
|
|
34
|
+
message: {
|
|
35
|
+
id: string;
|
|
36
|
+
session_id: string;
|
|
37
|
+
content: string;
|
|
38
|
+
role: string;
|
|
39
|
+
created_at: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** History artifact in message. */
|
|
43
|
+
export interface HistoryArtifact {
|
|
44
|
+
media_id: string;
|
|
45
|
+
filename: string;
|
|
46
|
+
mime_type: string;
|
|
47
|
+
file_size?: number;
|
|
48
|
+
presigned_url?: string;
|
|
49
|
+
}
|
|
50
|
+
/** History message. */
|
|
51
|
+
export interface HistoryMessage {
|
|
52
|
+
id: string;
|
|
53
|
+
role: string;
|
|
54
|
+
content: string;
|
|
55
|
+
timestamp: string;
|
|
56
|
+
metadata?: Record<string, unknown>;
|
|
57
|
+
artifacts?: HistoryArtifact[];
|
|
58
|
+
}
|
|
59
|
+
/** GET /chat/sessions/:id/history response. */
|
|
60
|
+
export interface ChatHistoryResponse {
|
|
61
|
+
session_id: string;
|
|
62
|
+
status: string;
|
|
63
|
+
started_at: string;
|
|
64
|
+
last_activity: string;
|
|
65
|
+
messages: HistoryMessage[];
|
|
66
|
+
metadata?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
/** GET /chat/upload/presigned query. */
|
|
69
|
+
export interface PresignedUploadQuery {
|
|
70
|
+
filename: string;
|
|
71
|
+
mime_type: string;
|
|
72
|
+
}
|
|
73
|
+
/** GET /chat/upload/presigned response. */
|
|
74
|
+
export interface PresignedUploadResponse {
|
|
75
|
+
artifact_id: string;
|
|
76
|
+
upload_url: string;
|
|
77
|
+
s3_uri: string;
|
|
78
|
+
max_file_size: number;
|
|
79
|
+
}
|
|
80
|
+
/** POST /chat/upload/complete request body. */
|
|
81
|
+
export interface CompleteUploadBody {
|
|
82
|
+
artifact_id: string;
|
|
83
|
+
s3_uri: string;
|
|
84
|
+
filename: string;
|
|
85
|
+
mime_type: string;
|
|
86
|
+
size_bytes: number;
|
|
87
|
+
}
|
|
88
|
+
/** POST /chat/upload/complete response. */
|
|
89
|
+
export interface CompleteUploadResponse {
|
|
90
|
+
artifact_id: string;
|
|
91
|
+
status: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ChatClientConfig {
|
|
94
|
+
/** Scoped client token from `client.chat.createToken()`. */
|
|
95
|
+
token: string;
|
|
96
|
+
/** Custom fetch implementation. Defaults to `globalThis.fetch`. */
|
|
97
|
+
fetch?: typeof globalThis.fetch;
|
|
98
|
+
}
|
|
99
|
+
export interface ChatWsConnectedEvent {
|
|
100
|
+
type: "connected";
|
|
101
|
+
session_id: string;
|
|
102
|
+
}
|
|
103
|
+
export interface ChatWsResponseStartEvent {
|
|
104
|
+
type: "response-start";
|
|
105
|
+
content: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ChatWsResponseChunkEvent {
|
|
108
|
+
type: "response-chunk";
|
|
109
|
+
content: string;
|
|
110
|
+
}
|
|
111
|
+
export interface ChatWsResponseEndEvent {
|
|
112
|
+
type: "response-end";
|
|
113
|
+
content: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ChatWsSessionClosedEvent {
|
|
116
|
+
type: "session-closed";
|
|
117
|
+
session_id: string;
|
|
118
|
+
status: string;
|
|
119
|
+
reason: string;
|
|
120
|
+
duration: number;
|
|
121
|
+
timestamp: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ChatWsHeartbeatEvent {
|
|
124
|
+
type: "heartbeat";
|
|
125
|
+
}
|
|
126
|
+
export interface ChatWsTokenExpiredEvent {
|
|
127
|
+
type: "token-expired";
|
|
128
|
+
}
|
|
129
|
+
export interface ChatWsMessageAckEvent {
|
|
130
|
+
type: "message-ack";
|
|
131
|
+
id?: string;
|
|
132
|
+
message: {
|
|
133
|
+
id: string;
|
|
134
|
+
session_id: string;
|
|
135
|
+
content: string;
|
|
136
|
+
role: string;
|
|
137
|
+
created_at: string;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export interface ChatWsMessageErrorEvent {
|
|
141
|
+
type: "message-error";
|
|
142
|
+
id?: string;
|
|
143
|
+
error: string;
|
|
144
|
+
}
|
|
145
|
+
export type ChatWsEvent = ChatWsConnectedEvent | ChatWsResponseStartEvent | ChatWsResponseChunkEvent | ChatWsResponseEndEvent | ChatWsSessionClosedEvent | ChatWsHeartbeatEvent | ChatWsTokenExpiredEvent | ChatWsMessageAckEvent | ChatWsMessageErrorEvent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./chat.types.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common types shared across the SDK.
|
|
3
|
+
* Extracted from Zod schemas using import type only — zero runtime cost.
|
|
4
|
+
*/
|
|
5
|
+
import type { z } from "zod";
|
|
6
|
+
import type { PaginationMetadataSchema } from "../../routes/shared/pagination";
|
|
7
|
+
export type PaginationMetadata = z.infer<typeof PaginationMetadataSchema>;
|
|
8
|
+
/** Standard paginated response shape. */
|
|
9
|
+
export interface PaginatedResponse<T> {
|
|
10
|
+
data: T[];
|
|
11
|
+
pagination: PaginationMetadata;
|
|
12
|
+
}
|
|
13
|
+
/** Standard error response shape. */
|
|
14
|
+
export interface ErrorResponse {
|
|
15
|
+
error: string;
|
|
16
|
+
message: string;
|
|
17
|
+
statusCode: number;
|
|
18
|
+
details?: unknown;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./common.types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./contacts.types.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom eval types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { CustomTestApiSchema, TestMessageSchema, ExpectedToolCallSchema } from "../../routes/nodes/:node_id/custom-evals/get";
|
|
6
|
+
import type { GetCustomEvalByIdResponseSchema } from "../../routes/custom-evals/get";
|
|
7
|
+
import type { PatchCustomEvalBodySchema, PatchCustomEvalResponseSchema } from "../../routes/custom-evals/patch";
|
|
8
|
+
import type { RunCustomEvalBodySchema, RunCustomEvalResponseSchema } from "../../routes/custom-evals/run/post";
|
|
9
|
+
import type { CustomEvalRunItemSchema, GetCustomEvalRunsResponseSchema } from "../../routes/custom-evals/runs/get";
|
|
10
|
+
export type CustomEval = z.infer<typeof CustomTestApiSchema>;
|
|
11
|
+
export type TestMessage = z.infer<typeof TestMessageSchema>;
|
|
12
|
+
export type ExpectedToolCall = z.infer<typeof ExpectedToolCallSchema>;
|
|
13
|
+
export type GetCustomEvalResponse = z.infer<typeof GetCustomEvalByIdResponseSchema>;
|
|
14
|
+
export type PatchCustomEvalBody = z.input<typeof PatchCustomEvalBodySchema>;
|
|
15
|
+
export type PatchCustomEvalResponse = z.infer<typeof PatchCustomEvalResponseSchema>;
|
|
16
|
+
export type RunCustomEvalBody = z.input<typeof RunCustomEvalBodySchema>;
|
|
17
|
+
export type RunCustomEvalResponse = z.infer<typeof RunCustomEvalResponseSchema>;
|
|
18
|
+
export type CustomEvalRunItem = z.infer<typeof CustomEvalRunItemSchema>;
|
|
19
|
+
export type ListCustomEvalRunsResponse = z.infer<typeof GetCustomEvalRunsResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./custom-evals.types.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { IntegrationSchema, EventSchema, CredentialSchema, ListIntegrationsQuerySchema, ListIntegrationsResponseSchema, CreateCredentialBodySchema, CreateCredentialResponseSchema } from "../../routes/integrations/schemas";
|
|
6
|
+
import type { ResourceListResponseSchema, ResourceListWithDescriptionResponseSchema, WhatsAppTemplateListResponseSchema } from "../../routes/integrations/resources-schemas";
|
|
7
|
+
export type Integration = z.infer<typeof IntegrationSchema>;
|
|
8
|
+
export type IntegrationEvent = z.infer<typeof EventSchema>;
|
|
9
|
+
export type Credential = z.infer<typeof CredentialSchema>;
|
|
10
|
+
export type ListIntegrationsQuery = z.input<typeof ListIntegrationsQuerySchema>;
|
|
11
|
+
export type ListIntegrationsResponse = z.infer<typeof ListIntegrationsResponseSchema>;
|
|
12
|
+
export type CreateCredentialBody = z.infer<typeof CreateCredentialBodySchema>;
|
|
13
|
+
export type CreateCredentialResponse = z.infer<typeof CreateCredentialResponseSchema>;
|
|
14
|
+
export type ResourceListResponse = z.infer<typeof ResourceListResponseSchema>;
|
|
15
|
+
export type ResourceListWithDescriptionResponse = z.infer<typeof ResourceListWithDescriptionResponseSchema>;
|
|
16
|
+
export type WhatsAppTemplateListResponse = z.infer<typeof WhatsAppTemplateListResponseSchema>;
|
|
17
|
+
export interface CredentialIdQuery {
|
|
18
|
+
credential_id?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GoogleSheetsWorksheetsQuery extends CredentialIdQuery {
|
|
21
|
+
spreadsheet_id: string;
|
|
22
|
+
}
|
|
23
|
+
export interface GoogleSheetsColumnsQuery extends CredentialIdQuery {
|
|
24
|
+
spreadsheet_id: string;
|
|
25
|
+
worksheet_name: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GoogleSheetsRowsQuery extends CredentialIdQuery {
|
|
28
|
+
spreadsheet_id: string;
|
|
29
|
+
worksheet_name: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TeamsChannelsQuery extends CredentialIdQuery {
|
|
32
|
+
team_id?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface WhatsAppCredentialQuery {
|
|
35
|
+
credential_id: string;
|
|
36
|
+
}
|
|
37
|
+
export interface WhatsAppBusinessAccountsQuery extends WhatsAppCredentialQuery {
|
|
38
|
+
business_id: string;
|
|
39
|
+
}
|
|
40
|
+
export interface WhatsAppPhoneNumbersQuery extends WhatsAppCredentialQuery {
|
|
41
|
+
business_account_id: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WhatsAppMessageTemplatesQuery extends WhatsAppCredentialQuery {
|
|
44
|
+
business_account_id?: string;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./integrations.types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./issues.types.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge base types.
|
|
3
|
+
* The KB routes use minimal schemas; define types manually.
|
|
4
|
+
*/
|
|
5
|
+
export interface KnowledgeBase {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
org_id: string;
|
|
9
|
+
description: string | null;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
13
|
+
export interface KnowledgeBaseDocument {
|
|
14
|
+
id: string;
|
|
15
|
+
knowledge_base_id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
status: string;
|
|
19
|
+
created_at: string;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./knowledge-bases.types.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { MCPServerResponseSchema, MCPToolResponseSchema, ListMCPServersQuerySchema, PaginatedMCPServersResponseSchema, CreateMCPServerBodySchema } from "../../routes/mcp/schemas";
|
|
6
|
+
export type MCPServerResponse = z.infer<typeof MCPServerResponseSchema>;
|
|
7
|
+
export type MCPToolResponse = z.infer<typeof MCPToolResponseSchema>;
|
|
8
|
+
export type ListMCPServersQuery = z.input<typeof ListMCPServersQuerySchema>;
|
|
9
|
+
export type PaginatedMCPServersResponse = z.infer<typeof PaginatedMCPServersResponseSchema>;
|
|
10
|
+
export type CreateMCPServerBody = z.input<typeof CreateMCPServerBodySchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./mcp.types.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { ListMessageFlagsQuerySchema, MessageFlagItemSchema, PaginatedMessageFlagsResponseSchema, CreateMessageFlagBodySchema } from "../../routes/messages/schemas";
|
|
6
|
+
export type ListMessageFlagsQuery = z.input<typeof ListMessageFlagsQuerySchema>;
|
|
7
|
+
export type MessageFlagItem = z.infer<typeof MessageFlagItemSchema>;
|
|
8
|
+
export type PaginatedMessageFlagsResponse = z.infer<typeof PaginatedMessageFlagsResponseSchema>;
|
|
9
|
+
export type CreateMessageFlagBody = z.input<typeof CreateMessageFlagBodySchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./messages.types.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { NodeResponseSchema, AddNodeResponseSchema, NodeInputSchema as VersionNodeInputSchema } from "../../routes/versions/:version_id/schemas";
|
|
6
|
+
import type { AvailableVarsResponseSchema } from "../../routes/versions/:version_id/nodes/:node_id/available-vars/schemas";
|
|
7
|
+
import type { ConfigSchemaResponseSchema } from "../../routes/versions/:version_id/nodes/:node_id/config-schema/schemas";
|
|
8
|
+
export type NodeResponse = z.infer<typeof NodeResponseSchema>;
|
|
9
|
+
export type AddNodeResponse = z.infer<typeof AddNodeResponseSchema>;
|
|
10
|
+
export type NodeInput = z.input<typeof VersionNodeInputSchema>;
|
|
11
|
+
export type AvailableVarsResponse = z.infer<typeof AvailableVarsResponseSchema>;
|
|
12
|
+
export type ConfigSchemaResponse = z.infer<typeof ConfigSchemaResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./nodes.types.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Northstar types extracted from Zod schemas.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { NorthstarApiSchema, NorthstarFeedbackApiSchema } from "../../routes/nodes/:node_id/northstars/get";
|
|
6
|
+
import type { GetNorthstarByIdResponseSchema } from "../../routes/northstars/get";
|
|
7
|
+
import type { PatchNorthstarBodySchema, PatchNorthstarResponseSchema } from "../../routes/northstars/patch";
|
|
8
|
+
import type { GetNorthstarHistoryResponseSchema } from "../../routes/northstars/history/get";
|
|
9
|
+
import type { SubmitNorthstarFeedbackBodySchema, NorthstarFeedbackItemSchema, SubmitNorthstarFeedbackResponseSchema } from "../../routes/northstars/feedback/post";
|
|
10
|
+
export type Northstar = z.infer<typeof NorthstarApiSchema>;
|
|
11
|
+
export type NorthstarFeedback = z.infer<typeof NorthstarFeedbackApiSchema>;
|
|
12
|
+
export type GetNorthstarResponse = z.infer<typeof GetNorthstarByIdResponseSchema>;
|
|
13
|
+
export type PatchNorthstarBody = z.input<typeof PatchNorthstarBodySchema>;
|
|
14
|
+
export type PatchNorthstarResponse = z.infer<typeof PatchNorthstarResponseSchema>;
|
|
15
|
+
export type GetNorthstarHistoryResponse = z.infer<typeof GetNorthstarHistoryResponseSchema>;
|
|
16
|
+
export type SubmitNorthstarFeedbackBody = z.input<typeof SubmitNorthstarFeedbackBodySchema>;
|
|
17
|
+
export type NorthstarFeedbackItem = z.infer<typeof NorthstarFeedbackItemSchema>;
|
|
18
|
+
export type SubmitNorthstarFeedbackResponse = z.infer<typeof SubmitNorthstarFeedbackResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./northstars.types.js";
|