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.
Files changed (125) hide show
  1. package/README.md +0 -4
  2. package/dist/api/cdn.api.service.d.ts +18 -0
  3. package/dist/api/cdn.api.service.js +43 -0
  4. package/dist/api/custom.data.api.service.d.ts +4 -3
  5. package/dist/api/custom.data.api.service.js +4 -3
  6. package/dist/api/developer.api.service.d.ts +54 -1
  7. package/dist/api/developer.api.service.js +89 -0
  8. package/dist/api/job.api.service.d.ts +33 -100
  9. package/dist/api/job.api.service.js +27 -11
  10. package/dist/api/lazy-instances.d.ts +16 -0
  11. package/dist/api/lazy-instances.js +32 -0
  12. package/dist/api/postprocessor.api.service.d.ts +3 -13
  13. package/dist/api/postprocessor.api.service.js +2 -4
  14. package/dist/api/preprocessor.api.service.d.ts +1 -8
  15. package/dist/api/preprocessor.api.service.js +1 -2
  16. package/dist/api/webhook.api.service.d.ts +1 -3
  17. package/dist/api/webhook.api.service.js +1 -1
  18. package/dist/api/whatsapp-templates.api.service.d.ts +40 -0
  19. package/dist/api/whatsapp-templates.api.service.js +78 -0
  20. package/dist/api-exports.d.ts +153 -6
  21. package/dist/api-exports.js +177 -21
  22. package/dist/cli/command-definitions.js +34 -7
  23. package/dist/commands/admin.js +1 -1
  24. package/dist/commands/channels.js +1 -1
  25. package/dist/commands/chat.js +2 -4
  26. package/dist/commands/compile.js +23 -4
  27. package/dist/commands/evals.d.ts +8 -0
  28. package/dist/commands/evals.js +41 -0
  29. package/dist/commands/index.d.ts +2 -0
  30. package/dist/commands/index.js +2 -0
  31. package/dist/commands/init.d.ts +10 -1
  32. package/dist/commands/init.js +23 -46
  33. package/dist/commands/jobs.js +5 -5
  34. package/dist/commands/mcp.d.ts +18 -0
  35. package/dist/commands/mcp.js +393 -0
  36. package/dist/commands/push.js +174 -23
  37. package/dist/common/data.entry.instance.d.ts +1 -1
  38. package/dist/common/data.entry.instance.js +4 -4
  39. package/dist/common/job.instance.d.ts +59 -7
  40. package/dist/common/job.instance.js +84 -19
  41. package/dist/config/constants.d.ts +1 -0
  42. package/dist/config/constants.js +1 -0
  43. package/dist/index.js +1 -0
  44. package/dist/interfaces/agent.d.ts +0 -3
  45. package/dist/interfaces/cdn.d.ts +24 -0
  46. package/dist/interfaces/cdn.js +5 -0
  47. package/dist/interfaces/compile.d.ts +1 -0
  48. package/dist/interfaces/custom.data.d.ts +3 -3
  49. package/dist/interfaces/index.d.ts +2 -1
  50. package/dist/interfaces/init.d.ts +0 -1
  51. package/dist/interfaces/jobs.d.ts +88 -132
  52. package/dist/interfaces/jobs.js +1 -1
  53. package/dist/interfaces/mcp.d.ts +64 -0
  54. package/dist/interfaces/mcp.js +5 -0
  55. package/dist/interfaces/postprocessors.d.ts +0 -3
  56. package/dist/interfaces/preprocessors.d.ts +0 -3
  57. package/dist/interfaces/webhooks.d.ts +0 -5
  58. package/dist/interfaces/whatsapp-templates.d.ts +104 -0
  59. package/dist/interfaces/whatsapp-templates.js +5 -0
  60. package/dist/types/api-contracts.d.ts +68 -14
  61. package/dist/types/compile.types.d.ts +5 -6
  62. package/dist/types/index.d.ts +2 -2
  63. package/dist/types/index.js +3 -1
  64. package/dist/types/skill.d.ts +181 -103
  65. package/dist/types/skill.js +123 -91
  66. package/dist/utils/agent-management.d.ts +3 -5
  67. package/dist/utils/agent-management.js +6 -8
  68. package/dist/utils/bundling.d.ts +4 -11
  69. package/dist/utils/bundling.js +24 -33
  70. package/dist/utils/compile.d.ts +17 -9
  71. package/dist/utils/compile.js +72 -88
  72. package/dist/utils/deployment.js +13 -7
  73. package/dist/utils/dev-api.js +1 -4
  74. package/dist/utils/dev-server.js +1 -1
  75. package/dist/utils/files.d.ts +11 -4
  76. package/dist/utils/files.js +17 -14
  77. package/dist/utils/init-agent.d.ts +1 -2
  78. package/dist/utils/init-agent.js +4 -6
  79. package/dist/utils/init-helpers.d.ts +4 -4
  80. package/dist/utils/init-helpers.js +10 -11
  81. package/dist/utils/job-management.js +0 -2
  82. package/dist/utils/mcp-server-management.d.ts +23 -0
  83. package/dist/utils/mcp-server-management.js +212 -0
  84. package/dist/utils/postprocessor-management.js +2 -4
  85. package/dist/utils/preprocessor-management.js +2 -4
  86. package/dist/utils/sandbox.d.ts +4 -2
  87. package/dist/utils/sandbox.js +38 -9
  88. package/dist/utils/webhook-management.js +1 -3
  89. package/dist/web/app.css +1505 -14
  90. package/dist/web/app.js +79 -64
  91. package/package.json +2 -6
  92. package/template/QUICKSTART.md +57 -774
  93. package/template/README.md +80 -907
  94. package/template/examples/README.md +106 -0
  95. package/template/{src → examples}/jobs/AbandonedBasketProcessorJob.ts +67 -14
  96. package/template/{src → examples}/jobs/DailyCleanupJob.ts +0 -3
  97. package/template/{src → examples}/jobs/DataMigrationJob.ts +0 -3
  98. package/template/{src → examples}/jobs/HealthCheckJob.ts +0 -3
  99. package/template/{src → examples}/postprocessors/modifyResponse.ts +3 -4
  100. package/template/examples/preprocessors/messageMatching.ts +35 -0
  101. package/template/{src → examples}/skills/basket.skill.ts +0 -1
  102. package/template/{src → examples}/skills/product.skill.ts +0 -1
  103. package/template/{src → examples}/skills/tools/GameScoreTrackerTool.ts +11 -15
  104. package/template/{src → examples}/skills/tools/OrderTool.ts +25 -0
  105. package/template/examples/skills/tools/PremiumFeatureTool.ts +98 -0
  106. package/template/{src → examples}/skills/tools/UserDataTool.ts +34 -0
  107. package/template/{src → examples}/skills/user.skill.ts +0 -1
  108. package/template/examples/webhooks/FileUploadWebhook.ts +86 -0
  109. package/template/{src → examples}/webhooks/PaymentWebhook.ts +12 -9
  110. package/template/examples/webhooks/UserEventWebhook.ts +105 -0
  111. package/template/package-lock.json +7895 -0
  112. package/template/package.json +1 -1
  113. package/template/src/index.ts +40 -22
  114. package/template/src/preprocessors/messageMatching.ts +0 -22
  115. package/template/src/webhooks/UserEventWebhook.ts +0 -77
  116. /package/template/{src → examples}/services/ApiService.ts +0 -0
  117. /package/template/{src → examples}/services/GetWeather.ts +0 -0
  118. /package/template/{src → examples}/skills/tools/BasketTool.ts +0 -0
  119. /package/template/{src → examples}/skills/tools/CreateInlineJob.ts +0 -0
  120. /package/template/{src → examples}/skills/tools/CreatePostTool.ts +0 -0
  121. /package/template/{src → examples}/skills/tools/CustomDataTool.ts +0 -0
  122. /package/template/{src → examples}/skills/tools/GetWeatherTool.ts +0 -0
  123. /package/template/{src → examples}/skills/tools/PaymentTool.ts +0 -0
  124. /package/template/{src → examples}/skills/tools/ProductsTool.ts +0 -0
  125. /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
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * CDN Interfaces
3
+ * Types for CDN asset upload and retrieval operations
4
+ */
5
+ export {};
@@ -8,4 +8,5 @@ export interface ToolInfo {
8
8
  description?: string;
9
9
  inputSchema?: any;
10
10
  executeCode?: string;
11
+ conditionCode?: string;
11
12
  }
@@ -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, GetJobsResponse, DeleteJobResponse, CreateJobResponse, PushJobVersionResponse, JobExecutionResponse, GetJobExecutionsResponse, } from "./jobs.js";
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";
@@ -56,5 +56,4 @@ export interface AgentCreationResult {
56
56
  agent: SelectedAgent;
57
57
  org: SelectedOrg;
58
58
  persona?: string;
59
- welcomeMessage?: string;
60
59
  }
@@ -1,72 +1,6 @@
1
1
  /**
2
2
  * Jobs Interfaces
3
- * Structures for job management
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 status
36
+ * Job version (full details)
37
+ * Matches JobVersionDto
122
38
  */
123
- export type JobStatus = 'active' | 'paused' | 'failed' | 'inactive';
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 information
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: string;
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
- * Response from push job version API endpoint
171
- */
172
- export interface PushJobVersionResponse {
173
- versionId: string;
174
- jobId: string;
97
+ export interface PushJobVersionDTO {
98
+ name: string;
175
99
  version: string;
176
- createdAt: string;
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
- * Response from job execution APIs
120
+ * GetJobs response data
181
121
  */
182
- export interface JobExecutionResponse {
183
- execution: JobExecution;
122
+ export interface GetJobsResponseData {
123
+ jobs: Job[];
184
124
  }
185
125
  /**
186
- * Response from get job executions API
126
+ * GetJobExecutions response data
187
127
  */
188
- export interface GetJobExecutionsResponse {
128
+ export interface GetJobExecutionsResponseData {
189
129
  executions: JobExecution[];
190
130
  total: number;
191
- page?: number;
192
- limit?: number;
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
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Jobs Interfaces
3
- * Structures for job management
3
+ * Matches lua-api/src/dto/job.dto.ts exactly
4
4
  */
5
5
  export {};
@@ -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 {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MCP Server Interfaces
3
+ * API request/response types for MCP server management
4
+ */
5
+ 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
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * WhatsApp Templates Interfaces
3
+ * TypeScript interfaces for the Templates API
4
+ */
5
+ export {};