lua-cli 3.1.0-alpha.3 → 3.1.0-alpha.5
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 +0 -4
- package/dist/api/cdn.api.service.d.ts +18 -0
- package/dist/api/cdn.api.service.js +43 -0
- package/dist/api/custom.data.api.service.d.ts +4 -3
- package/dist/api/custom.data.api.service.js +4 -3
- package/dist/api/developer.api.service.d.ts +54 -1
- package/dist/api/developer.api.service.js +89 -0
- package/dist/api/job.api.service.d.ts +33 -100
- package/dist/api/job.api.service.js +27 -11
- package/dist/api/lazy-instances.d.ts +16 -0
- package/dist/api/lazy-instances.js +32 -0
- package/dist/api/postprocessor.api.service.d.ts +3 -13
- package/dist/api/postprocessor.api.service.js +2 -4
- package/dist/api/preprocessor.api.service.d.ts +1 -8
- package/dist/api/preprocessor.api.service.js +1 -2
- package/dist/api/webhook.api.service.d.ts +1 -3
- package/dist/api/webhook.api.service.js +1 -1
- package/dist/api/whatsapp-templates.api.service.d.ts +40 -0
- package/dist/api/whatsapp-templates.api.service.js +78 -0
- package/dist/api-exports.d.ts +153 -6
- package/dist/api-exports.js +177 -21
- package/dist/cli/command-definitions.js +34 -7
- package/dist/commands/admin.js +1 -1
- package/dist/commands/channels.js +1 -1
- package/dist/commands/chat.js +2 -4
- package/dist/commands/compile.js +23 -4
- package/dist/commands/evals.d.ts +8 -0
- package/dist/commands/evals.js +41 -0
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/init.d.ts +10 -1
- package/dist/commands/init.js +23 -46
- package/dist/commands/jobs.js +5 -5
- package/dist/commands/mcp.d.ts +18 -0
- package/dist/commands/mcp.js +393 -0
- package/dist/commands/push.js +174 -23
- package/dist/common/data.entry.instance.d.ts +1 -1
- package/dist/common/data.entry.instance.js +4 -4
- package/dist/common/job.instance.d.ts +59 -7
- package/dist/common/job.instance.js +84 -19
- package/dist/config/constants.d.ts +1 -0
- package/dist/config/constants.js +1 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/agent.d.ts +0 -3
- package/dist/interfaces/cdn.d.ts +24 -0
- package/dist/interfaces/cdn.js +5 -0
- package/dist/interfaces/compile.d.ts +1 -0
- package/dist/interfaces/custom.data.d.ts +3 -3
- package/dist/interfaces/index.d.ts +2 -1
- package/dist/interfaces/init.d.ts +0 -1
- package/dist/interfaces/jobs.d.ts +88 -132
- package/dist/interfaces/jobs.js +1 -1
- package/dist/interfaces/mcp.d.ts +64 -0
- package/dist/interfaces/mcp.js +5 -0
- package/dist/interfaces/postprocessors.d.ts +0 -3
- package/dist/interfaces/preprocessors.d.ts +0 -3
- package/dist/interfaces/webhooks.d.ts +0 -5
- package/dist/interfaces/whatsapp-templates.d.ts +104 -0
- package/dist/interfaces/whatsapp-templates.js +5 -0
- package/dist/types/api-contracts.d.ts +68 -14
- package/dist/types/compile.types.d.ts +5 -6
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +3 -1
- package/dist/types/skill.d.ts +181 -103
- package/dist/types/skill.js +123 -91
- package/dist/utils/agent-management.d.ts +3 -5
- package/dist/utils/agent-management.js +6 -8
- package/dist/utils/bundling.d.ts +4 -11
- package/dist/utils/bundling.js +24 -33
- package/dist/utils/compile.d.ts +17 -9
- package/dist/utils/compile.js +72 -88
- package/dist/utils/deployment.js +13 -7
- package/dist/utils/dev-api.js +1 -4
- package/dist/utils/dev-server.js +1 -1
- package/dist/utils/files.d.ts +11 -4
- package/dist/utils/files.js +17 -14
- package/dist/utils/init-agent.d.ts +1 -2
- package/dist/utils/init-agent.js +4 -6
- package/dist/utils/init-helpers.d.ts +4 -4
- package/dist/utils/init-helpers.js +10 -11
- package/dist/utils/job-management.js +0 -2
- package/dist/utils/mcp-server-management.d.ts +23 -0
- package/dist/utils/mcp-server-management.js +212 -0
- package/dist/utils/postprocessor-management.js +2 -4
- package/dist/utils/preprocessor-management.js +2 -4
- package/dist/utils/sandbox.d.ts +4 -2
- package/dist/utils/sandbox.js +38 -9
- package/dist/utils/webhook-management.js +1 -3
- package/dist/web/app.css +1505 -14
- package/dist/web/app.js +79 -64
- package/package.json +2 -6
- package/template/QUICKSTART.md +57 -774
- package/template/README.md +80 -907
- package/template/examples/README.md +106 -0
- package/template/{src → examples}/jobs/AbandonedBasketProcessorJob.ts +67 -14
- package/template/{src → examples}/jobs/DailyCleanupJob.ts +0 -3
- package/template/{src → examples}/jobs/DataMigrationJob.ts +0 -3
- package/template/{src → examples}/jobs/HealthCheckJob.ts +0 -3
- package/template/{src → examples}/postprocessors/modifyResponse.ts +3 -4
- package/template/examples/preprocessors/messageMatching.ts +35 -0
- package/template/{src → examples}/skills/basket.skill.ts +0 -1
- package/template/{src → examples}/skills/product.skill.ts +0 -1
- package/template/{src → examples}/skills/tools/GameScoreTrackerTool.ts +11 -15
- package/template/{src → examples}/skills/tools/OrderTool.ts +25 -0
- package/template/examples/skills/tools/PremiumFeatureTool.ts +98 -0
- package/template/{src → examples}/skills/tools/UserDataTool.ts +34 -0
- package/template/{src → examples}/skills/user.skill.ts +0 -1
- package/template/examples/webhooks/FileUploadWebhook.ts +86 -0
- package/template/{src → examples}/webhooks/PaymentWebhook.ts +12 -9
- package/template/examples/webhooks/UserEventWebhook.ts +105 -0
- package/template/package-lock.json +7895 -0
- package/template/package.json +1 -1
- package/template/src/index.ts +40 -22
- package/template/src/preprocessors/messageMatching.ts +0 -22
- package/template/src/webhooks/UserEventWebhook.ts +0 -77
- /package/template/{src → examples}/services/ApiService.ts +0 -0
- /package/template/{src → examples}/services/GetWeather.ts +0 -0
- /package/template/{src → examples}/skills/tools/BasketTool.ts +0 -0
- /package/template/{src → examples}/skills/tools/CreateInlineJob.ts +0 -0
- /package/template/{src → examples}/skills/tools/CreatePostTool.ts +0 -0
- /package/template/{src → examples}/skills/tools/CustomDataTool.ts +0 -0
- /package/template/{src → examples}/skills/tools/GetWeatherTool.ts +0 -0
- /package/template/{src → examples}/skills/tools/PaymentTool.ts +0 -0
- /package/template/{src → examples}/skills/tools/ProductsTool.ts +0 -0
- /package/template/{src → examples}/skills/tools/SmartBasketTool.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDN Interfaces
|
|
3
|
+
* Types for CDN asset upload and retrieval operations
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Internal response from the CDN upload endpoint
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface CdnUploadResponse {
|
|
10
|
+
fileId: string;
|
|
11
|
+
mediaType: string;
|
|
12
|
+
extension: string;
|
|
13
|
+
originalFilename?: string;
|
|
14
|
+
compression?: CompressionStats;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Compression statistics for an uploaded asset
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface CompressionStats {
|
|
21
|
+
original: number;
|
|
22
|
+
compressed: number;
|
|
23
|
+
ratio: number;
|
|
24
|
+
}
|
|
@@ -14,7 +14,7 @@ import { Pagination, TimestampedEntity, IdentifiedEntity } from './common.js';
|
|
|
14
14
|
*/
|
|
15
15
|
export interface CustomDataEntry extends IdentifiedEntity, TimestampedEntity {
|
|
16
16
|
id: string;
|
|
17
|
-
data: any
|
|
17
|
+
data: Record<string, any>;
|
|
18
18
|
createdAt: number;
|
|
19
19
|
updatedAt: number;
|
|
20
20
|
searchText?: string;
|
|
@@ -31,7 +31,7 @@ export interface CustomDataEntry extends IdentifiedEntity, TimestampedEntity {
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export interface CreateCustomDataRequest {
|
|
34
|
-
data: any
|
|
34
|
+
data: Record<string, any>;
|
|
35
35
|
searchText?: string;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
@@ -53,7 +53,7 @@ export interface GetCustomDataResponse {
|
|
|
53
53
|
* Request to update a custom data entry.
|
|
54
54
|
*/
|
|
55
55
|
export interface UpdateCustomDataRequest {
|
|
56
|
-
data: any
|
|
56
|
+
data: Record<string, any>;
|
|
57
57
|
searchText?: string;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* It re-exports interfaces and DTOs from various modules for convenient importing.
|
|
6
6
|
*/
|
|
7
7
|
export { CreateWebhookDTO, PushWebhookVersionDTO, UpdateWebhookVersionDTO, WebhookVersion, Webhook, GetWebhooksResponse, DeleteWebhookResponse, CreateWebhookResponse, PushWebhookVersionResponse, } from "./webhooks.js";
|
|
8
|
-
export { CreateJobDTO, PushJobVersionDTO, UpdateJobVersionDTO, JobSchedule, JobScheduleType, JobRetryConfig, JobVersion, JobExecutionStatus, JobExecution, JobStatus, Job,
|
|
8
|
+
export { CreateJobDTO, PushJobVersionDTO, UpdateJobVersionDTO, JobSchedule, JobScheduleType, JobRetryConfig, JobVersion, JobExecutionStatus, JobExecution, JobStatus, Job, GetJobsResponseData, GetJobExecutionsResponseData, DeleteJobResponseData, UpdateJobMetadataResponseData, } from "./jobs.js";
|
|
9
9
|
export { ApiResponse, Pagination } from "./common.js";
|
|
10
10
|
export { SkillTool, SkillVersion, Skill, GetSkillsResponse, DeleteSkillResponse, } from "./skills.js";
|
|
11
11
|
export { ImmutableUserProfile, UserAgentData } from "./user.js";
|
|
12
|
+
export { MCPServerResponse, MCPServerStdioResponse, MCPServerSSEResponse, CreateMCPServerRequest, UpdateMCPServerRequest, } from "./mcp.js";
|
|
@@ -1,72 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Jobs Interfaces
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* DTO for creating a new job
|
|
7
|
-
*/
|
|
8
|
-
export interface CreateJobDTO {
|
|
9
|
-
name: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
context?: string;
|
|
12
|
-
schedule: JobSchedule;
|
|
13
|
-
timeout?: number;
|
|
14
|
-
retry?: JobRetryConfig;
|
|
15
|
-
metadata?: Record<string, any>;
|
|
16
|
-
dynamic?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Optional initial version data.
|
|
19
|
-
* If provided, creates the first version automatically.
|
|
20
|
-
*/
|
|
21
|
-
version?: {
|
|
22
|
-
version: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
context?: string;
|
|
25
|
-
code: string;
|
|
26
|
-
executeFunction: string;
|
|
27
|
-
timeout?: number;
|
|
28
|
-
retry?: JobRetryConfig;
|
|
29
|
-
metadata?: Record<string, any>;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Auto-publish and activate the job after creation.
|
|
33
|
-
* If true, the job will be immediately active and running.
|
|
34
|
-
* Default: false
|
|
35
|
-
*/
|
|
36
|
-
activate?: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* DTO for pushing a job version
|
|
40
|
-
*/
|
|
41
|
-
export interface PushJobVersionDTO {
|
|
42
|
-
name: string;
|
|
43
|
-
version: string;
|
|
44
|
-
description?: string;
|
|
45
|
-
context?: string;
|
|
46
|
-
jobId: string;
|
|
47
|
-
schedule: JobSchedule;
|
|
48
|
-
timeout?: number;
|
|
49
|
-
retry?: JobRetryConfig;
|
|
50
|
-
code?: string;
|
|
51
|
-
executeFunction?: string;
|
|
52
|
-
metadata?: Record<string, any>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* DTO for updating a job version
|
|
56
|
-
*/
|
|
57
|
-
export interface UpdateJobVersionDTO {
|
|
58
|
-
version?: string;
|
|
59
|
-
description?: string;
|
|
60
|
-
context?: string;
|
|
61
|
-
schedule?: JobSchedule;
|
|
62
|
-
timeout?: number;
|
|
63
|
-
retry?: JobRetryConfig;
|
|
64
|
-
code?: string;
|
|
65
|
-
executeFunction?: string;
|
|
66
|
-
metadata?: Record<string, any>;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Job schedule configuration
|
|
3
|
+
* Matches lua-api/src/dto/job.dto.ts exactly
|
|
70
4
|
*/
|
|
71
5
|
export type JobScheduleType = 'cron' | 'once' | 'interval';
|
|
72
6
|
export interface JobSchedule {
|
|
@@ -76,34 +10,15 @@ export interface JobSchedule {
|
|
|
76
10
|
seconds?: number;
|
|
77
11
|
timezone?: string;
|
|
78
12
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Job retry configuration
|
|
81
|
-
*/
|
|
82
13
|
export interface JobRetryConfig {
|
|
83
14
|
maxAttempts: number;
|
|
84
15
|
backoffSeconds?: number;
|
|
85
16
|
}
|
|
86
|
-
|
|
87
|
-
* Job version information
|
|
88
|
-
*/
|
|
89
|
-
export interface JobVersion {
|
|
90
|
-
id: string;
|
|
91
|
-
version: string;
|
|
92
|
-
description: string;
|
|
93
|
-
active: boolean;
|
|
94
|
-
context: string;
|
|
95
|
-
schedule: JobSchedule;
|
|
96
|
-
timeout?: number;
|
|
97
|
-
retry?: JobRetryConfig;
|
|
98
|
-
createdAt: string;
|
|
99
|
-
updatedAt: string;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Job execution status
|
|
103
|
-
*/
|
|
17
|
+
export type JobStatus = 'active' | 'paused' | 'failed' | 'inactive';
|
|
104
18
|
export type JobExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'timeout';
|
|
105
19
|
/**
|
|
106
20
|
* Job execution record
|
|
21
|
+
* Matches JobExecutionDto
|
|
107
22
|
*/
|
|
108
23
|
export interface JobExecution {
|
|
109
24
|
id: string;
|
|
@@ -118,76 +33,117 @@ export interface JobExecution {
|
|
|
118
33
|
retryCount?: number;
|
|
119
34
|
}
|
|
120
35
|
/**
|
|
121
|
-
* Job
|
|
36
|
+
* Job version (full details)
|
|
37
|
+
* Matches JobVersionDto
|
|
122
38
|
*/
|
|
123
|
-
export
|
|
39
|
+
export interface JobVersion {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
version: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
jobId: string;
|
|
45
|
+
active: boolean;
|
|
46
|
+
schedule: JobSchedule;
|
|
47
|
+
timeout?: number;
|
|
48
|
+
retry?: JobRetryConfig;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
metadata?: Record<string, any>;
|
|
52
|
+
}
|
|
124
53
|
/**
|
|
125
|
-
* Job
|
|
54
|
+
* Job with versions array
|
|
55
|
+
* Matches JobDto and job.schema.ts
|
|
126
56
|
*/
|
|
127
57
|
export interface Job {
|
|
128
58
|
id: string;
|
|
129
59
|
name: string;
|
|
130
|
-
description
|
|
60
|
+
description?: string;
|
|
61
|
+
agentId: string;
|
|
131
62
|
public: boolean;
|
|
132
63
|
active: boolean;
|
|
133
64
|
status: JobStatus;
|
|
134
|
-
createdAt: string;
|
|
135
|
-
updatedAt: string;
|
|
136
|
-
versions: JobVersion[];
|
|
137
65
|
activeVersionId?: string;
|
|
66
|
+
/** The active version (if one exists) */
|
|
67
|
+
activeVersion?: JobVersion;
|
|
138
68
|
lastRunAt?: string;
|
|
139
69
|
nextRunAt?: string;
|
|
70
|
+
createdAt: string;
|
|
71
|
+
updatedAt: string;
|
|
72
|
+
dynamic?: boolean;
|
|
73
|
+
userId?: string;
|
|
74
|
+
metadata?: Record<string, any>;
|
|
75
|
+
versions: JobVersion[];
|
|
140
76
|
lastExecution?: JobExecution;
|
|
141
77
|
}
|
|
142
|
-
|
|
143
|
-
* Response from get all jobs API endpoint
|
|
144
|
-
*/
|
|
145
|
-
export interface GetJobsResponse {
|
|
146
|
-
jobs: Job[];
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Response from delete job API endpoint
|
|
150
|
-
* If deleted is false and deactivated is true, the job has versions
|
|
151
|
-
* and cannot be deleted, so it was deactivated instead
|
|
152
|
-
*/
|
|
153
|
-
export interface DeleteJobResponse {
|
|
154
|
-
message: string;
|
|
155
|
-
deleted: boolean;
|
|
156
|
-
deactivated: boolean;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Response from create job API endpoint
|
|
160
|
-
*/
|
|
161
|
-
export interface CreateJobResponse {
|
|
162
|
-
id: string;
|
|
78
|
+
export interface CreateJobDTO {
|
|
163
79
|
name: string;
|
|
164
80
|
description?: string;
|
|
165
|
-
agentId: string;
|
|
166
|
-
context?: string;
|
|
167
81
|
schedule: JobSchedule;
|
|
82
|
+
timeout?: number;
|
|
83
|
+
retry?: JobRetryConfig;
|
|
84
|
+
metadata?: Record<string, any>;
|
|
85
|
+
dynamic?: boolean;
|
|
86
|
+
version?: {
|
|
87
|
+
version: string;
|
|
88
|
+
description?: string;
|
|
89
|
+
code: string;
|
|
90
|
+
executeFunction: string;
|
|
91
|
+
timeout?: number;
|
|
92
|
+
retry?: JobRetryConfig;
|
|
93
|
+
metadata?: Record<string, any>;
|
|
94
|
+
};
|
|
95
|
+
activate?: boolean;
|
|
168
96
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
*/
|
|
172
|
-
export interface PushJobVersionResponse {
|
|
173
|
-
versionId: string;
|
|
174
|
-
jobId: string;
|
|
97
|
+
export interface PushJobVersionDTO {
|
|
98
|
+
name: string;
|
|
175
99
|
version: string;
|
|
176
|
-
|
|
100
|
+
description?: string;
|
|
101
|
+
jobId: string;
|
|
177
102
|
schedule: JobSchedule;
|
|
103
|
+
timeout?: number;
|
|
104
|
+
retry?: JobRetryConfig;
|
|
105
|
+
code?: string;
|
|
106
|
+
executeFunction?: string;
|
|
107
|
+
metadata?: Record<string, any>;
|
|
108
|
+
}
|
|
109
|
+
export interface UpdateJobVersionDTO {
|
|
110
|
+
version?: string;
|
|
111
|
+
description?: string;
|
|
112
|
+
schedule?: JobSchedule;
|
|
113
|
+
timeout?: number;
|
|
114
|
+
retry?: JobRetryConfig;
|
|
115
|
+
code?: string;
|
|
116
|
+
executeFunction?: string;
|
|
117
|
+
metadata?: Record<string, any>;
|
|
178
118
|
}
|
|
179
119
|
/**
|
|
180
|
-
*
|
|
120
|
+
* GetJobs response data
|
|
181
121
|
*/
|
|
182
|
-
export interface
|
|
183
|
-
|
|
122
|
+
export interface GetJobsResponseData {
|
|
123
|
+
jobs: Job[];
|
|
184
124
|
}
|
|
185
125
|
/**
|
|
186
|
-
*
|
|
126
|
+
* GetJobExecutions response data
|
|
187
127
|
*/
|
|
188
|
-
export interface
|
|
128
|
+
export interface GetJobExecutionsResponseData {
|
|
189
129
|
executions: JobExecution[];
|
|
190
130
|
total: number;
|
|
191
|
-
|
|
192
|
-
|
|
131
|
+
limit: number;
|
|
132
|
+
offset: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* DeleteJob response data
|
|
136
|
+
*/
|
|
137
|
+
export interface DeleteJobResponseData {
|
|
138
|
+
deleted: boolean;
|
|
139
|
+
deactivated: boolean;
|
|
140
|
+
message: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* UpdateJobMetadata response data
|
|
144
|
+
*/
|
|
145
|
+
export interface UpdateJobMetadataResponseData {
|
|
146
|
+
message: string;
|
|
147
|
+
jobId: string;
|
|
148
|
+
metadata: Record<string, any>;
|
|
193
149
|
}
|
package/dist/interfaces/jobs.js
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Interfaces
|
|
3
|
+
* API request/response types for MCP server management
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base MCP Server response fields
|
|
7
|
+
*/
|
|
8
|
+
interface MCPServerResponseBase {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
agentId: string;
|
|
12
|
+
active: boolean;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* MCP Server response for stdio transport
|
|
19
|
+
*/
|
|
20
|
+
export interface MCPServerStdioResponse extends MCPServerResponseBase {
|
|
21
|
+
transport: 'stdio';
|
|
22
|
+
command: string;
|
|
23
|
+
args?: string[];
|
|
24
|
+
env?: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* MCP Server response for SSE transport
|
|
28
|
+
*/
|
|
29
|
+
export interface MCPServerSSEResponse extends MCPServerResponseBase {
|
|
30
|
+
transport: 'sse';
|
|
31
|
+
url: string;
|
|
32
|
+
headers?: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Union type for MCP Server API responses
|
|
36
|
+
*/
|
|
37
|
+
export type MCPServerResponse = MCPServerStdioResponse | MCPServerSSEResponse;
|
|
38
|
+
/**
|
|
39
|
+
* Request payload for creating an MCP server
|
|
40
|
+
*/
|
|
41
|
+
export interface CreateMCPServerRequest {
|
|
42
|
+
name: string;
|
|
43
|
+
transport: 'stdio' | 'sse';
|
|
44
|
+
command?: string;
|
|
45
|
+
args?: string[];
|
|
46
|
+
env?: Record<string, string>;
|
|
47
|
+
url?: string;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
timeout?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Request payload for updating an MCP server
|
|
53
|
+
*/
|
|
54
|
+
export interface UpdateMCPServerRequest {
|
|
55
|
+
name?: string;
|
|
56
|
+
transport?: 'stdio' | 'sse';
|
|
57
|
+
command?: string;
|
|
58
|
+
args?: string[];
|
|
59
|
+
env?: Record<string, string>;
|
|
60
|
+
url?: string;
|
|
61
|
+
headers?: Record<string, string>;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
export interface CreatePostProcessorDTO {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string;
|
|
10
|
-
context?: string;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
12
|
* DTO for pushing a postprocessor version
|
|
@@ -16,7 +15,6 @@ export interface PushPostProcessorVersionDTO {
|
|
|
16
15
|
name: string;
|
|
17
16
|
version: string;
|
|
18
17
|
description?: string;
|
|
19
|
-
context?: string;
|
|
20
18
|
postprocessorId: string;
|
|
21
19
|
code?: string;
|
|
22
20
|
executeFunction?: string;
|
|
@@ -29,7 +27,6 @@ export interface PostProcessorVersion {
|
|
|
29
27
|
version: string;
|
|
30
28
|
description: string;
|
|
31
29
|
active: boolean;
|
|
32
|
-
context: string;
|
|
33
30
|
createdAt: string;
|
|
34
31
|
updatedAt: string;
|
|
35
32
|
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
export interface CreatePreProcessorDTO {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string;
|
|
10
|
-
context?: string;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
12
|
* DTO for pushing a preprocessor version
|
|
@@ -16,7 +15,6 @@ export interface PushPreProcessorVersionDTO {
|
|
|
16
15
|
name: string;
|
|
17
16
|
version: string;
|
|
18
17
|
description?: string;
|
|
19
|
-
context?: string;
|
|
20
18
|
preprocessorId: string;
|
|
21
19
|
code?: string;
|
|
22
20
|
executeFunction?: string;
|
|
@@ -29,7 +27,6 @@ export interface PreProcessorVersion {
|
|
|
29
27
|
version: string;
|
|
30
28
|
description: string;
|
|
31
29
|
active: boolean;
|
|
32
|
-
context: string;
|
|
33
30
|
createdAt: string;
|
|
34
31
|
updatedAt: string;
|
|
35
32
|
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
export interface CreateWebhookDTO {
|
|
9
9
|
name: string;
|
|
10
10
|
description?: string;
|
|
11
|
-
context?: string;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
13
|
* DTO for pushing a webhook version
|
|
@@ -17,7 +16,6 @@ export interface PushWebhookVersionDTO {
|
|
|
17
16
|
name: string;
|
|
18
17
|
version: string;
|
|
19
18
|
description?: string;
|
|
20
|
-
context?: string;
|
|
21
19
|
webhookId: string;
|
|
22
20
|
querySchema?: any;
|
|
23
21
|
headerSchema?: any;
|
|
@@ -31,7 +29,6 @@ export interface PushWebhookVersionDTO {
|
|
|
31
29
|
export interface UpdateWebhookVersionDTO {
|
|
32
30
|
version?: string;
|
|
33
31
|
description?: string;
|
|
34
|
-
context?: string;
|
|
35
32
|
querySchema?: any;
|
|
36
33
|
headerSchema?: any;
|
|
37
34
|
bodySchema?: any;
|
|
@@ -46,7 +43,6 @@ export interface WebhookVersion {
|
|
|
46
43
|
version: string;
|
|
47
44
|
description: string;
|
|
48
45
|
active: boolean;
|
|
49
|
-
context: string;
|
|
50
46
|
querySchema?: any;
|
|
51
47
|
headerSchema?: any;
|
|
52
48
|
bodySchema?: any;
|
|
@@ -91,7 +87,6 @@ export interface CreateWebhookResponse {
|
|
|
91
87
|
name: string;
|
|
92
88
|
description?: string;
|
|
93
89
|
agentId: string;
|
|
94
|
-
context?: string;
|
|
95
90
|
}
|
|
96
91
|
/**
|
|
97
92
|
* Response from push webhook version API endpoint
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Templates Interfaces
|
|
3
|
+
* TypeScript interfaces for the Templates API
|
|
4
|
+
*/
|
|
5
|
+
export type WhatsAppTemplateCategory = 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
|
|
6
|
+
export type WhatsAppTemplateStatus = 'APPROVED' | 'REJECTED' | 'PENDING';
|
|
7
|
+
export type WhatsAppTemplateButtonType = 'COPY_CODE' | 'PHONE_NUMBER' | 'QUICK_REPLY' | 'URL';
|
|
8
|
+
export type WhatsAppTemplateComponentType = 'HEADER' | 'BODY' | 'FOOTER' | 'BUTTONS';
|
|
9
|
+
export interface WhatsAppTemplateHeaderComponent {
|
|
10
|
+
type: 'HEADER';
|
|
11
|
+
format: 'TEXT';
|
|
12
|
+
text: string;
|
|
13
|
+
example?: {
|
|
14
|
+
header_text_named_params: Array<{
|
|
15
|
+
param_name: string;
|
|
16
|
+
example: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface WhatsAppTemplateBodyComponent {
|
|
21
|
+
type: 'BODY';
|
|
22
|
+
text: string;
|
|
23
|
+
example?: {
|
|
24
|
+
body_text_named_params: Array<{
|
|
25
|
+
param_name: string;
|
|
26
|
+
example: string;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface WhatsAppTemplateFooterComponent {
|
|
31
|
+
type: 'FOOTER';
|
|
32
|
+
text: string;
|
|
33
|
+
}
|
|
34
|
+
export interface WhatsAppTemplateCopyCodeButton {
|
|
35
|
+
type: 'COPY_CODE';
|
|
36
|
+
example: string | string[];
|
|
37
|
+
}
|
|
38
|
+
export interface WhatsAppTemplatePhoneNumberButton {
|
|
39
|
+
type: 'PHONE_NUMBER';
|
|
40
|
+
text: string;
|
|
41
|
+
phone_number: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WhatsAppTemplateUrlButton {
|
|
44
|
+
type: 'URL';
|
|
45
|
+
text: string;
|
|
46
|
+
url: string;
|
|
47
|
+
example?: string | string[];
|
|
48
|
+
}
|
|
49
|
+
export interface WhatsAppTemplateQuickReplyButton {
|
|
50
|
+
type: 'QUICK_REPLY';
|
|
51
|
+
text: string;
|
|
52
|
+
}
|
|
53
|
+
export type WhatsAppTemplateButton = WhatsAppTemplateCopyCodeButton | WhatsAppTemplatePhoneNumberButton | WhatsAppTemplateUrlButton | WhatsAppTemplateQuickReplyButton;
|
|
54
|
+
export interface WhatsAppTemplateButtonsComponent {
|
|
55
|
+
type: 'BUTTONS';
|
|
56
|
+
buttons: WhatsAppTemplateButton[];
|
|
57
|
+
}
|
|
58
|
+
export type WhatsAppTemplateComponent = WhatsAppTemplateHeaderComponent | WhatsAppTemplateBodyComponent | WhatsAppTemplateFooterComponent | WhatsAppTemplateButtonsComponent;
|
|
59
|
+
export interface WhatsAppTemplate {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
category: WhatsAppTemplateCategory;
|
|
63
|
+
language: string;
|
|
64
|
+
status: WhatsAppTemplateStatus;
|
|
65
|
+
components: WhatsAppTemplateComponent[];
|
|
66
|
+
correct_category?: WhatsAppTemplateCategory;
|
|
67
|
+
message_send_ttl_seconds?: number;
|
|
68
|
+
parameter_format?: 'NAMED' | 'POSITIONAL';
|
|
69
|
+
previous_category?: WhatsAppTemplateCategory;
|
|
70
|
+
rejected_reason?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface PaginatedTemplatesResponse {
|
|
73
|
+
templates: WhatsAppTemplate[];
|
|
74
|
+
total: number;
|
|
75
|
+
page: number;
|
|
76
|
+
limit: number;
|
|
77
|
+
totalPages: number;
|
|
78
|
+
}
|
|
79
|
+
export interface ListTemplatesOptions {
|
|
80
|
+
page?: number;
|
|
81
|
+
limit?: number;
|
|
82
|
+
search?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SendTemplateButtonValue {
|
|
85
|
+
sub_type: WhatsAppTemplateButtonType;
|
|
86
|
+
index: string;
|
|
87
|
+
text?: string;
|
|
88
|
+
coupon_code?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface SendTemplateValues {
|
|
91
|
+
header?: Record<string, string>;
|
|
92
|
+
body?: Record<string, string>;
|
|
93
|
+
buttons?: SendTemplateButtonValue[];
|
|
94
|
+
}
|
|
95
|
+
export interface SendTemplateData {
|
|
96
|
+
phoneNumbers: string[];
|
|
97
|
+
values?: SendTemplateValues;
|
|
98
|
+
}
|
|
99
|
+
export interface SendTemplateResponse {
|
|
100
|
+
results: any[];
|
|
101
|
+
errors: any[];
|
|
102
|
+
totalProcessed: number;
|
|
103
|
+
totalErrors: number;
|
|
104
|
+
}
|