mcp-aiven 0.1.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/LICENSE +201 -0
- package/README.md +173 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +84 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +35 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +42 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/aiven-api.d.ts +49982 -0
- package/dist/generated/aiven-api.d.ts.map +1 -0
- package/dist/generated/aiven-api.js +6 -0
- package/dist/generated/aiven-api.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/manifests/core.yaml +206 -0
- package/dist/manifests/integrations.yaml +72 -0
- package/dist/manifests/kafka.yaml +143 -0
- package/dist/manifests/pg.yaml +43 -0
- package/dist/prompts.d.ts +5 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +10 -0
- package/dist/prompts.js.map +1 -0
- package/dist/security.d.ts +5 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +52 -0
- package/dist/security.js.map +1 -0
- package/dist/shared/service-info.d.ts +5 -0
- package/dist/shared/service-info.d.ts.map +1 -0
- package/dist/shared/service-info.js +24 -0
- package/dist/shared/service-info.js.map +1 -0
- package/dist/tool-result-limit.d.ts +7 -0
- package/dist/tool-result-limit.d.ts.map +1 -0
- package/dist/tool-result-limit.js +44 -0
- package/dist/tool-result-limit.js.map +1 -0
- package/dist/tools/api-tool.d.ts +4 -0
- package/dist/tools/api-tool.d.ts.map +1 -0
- package/dist/tools/api-tool.js +80 -0
- package/dist/tools/api-tool.js.map +1 -0
- package/dist/tools/applications/handlers.d.ts +4 -0
- package/dist/tools/applications/handlers.d.ts.map +1 -0
- package/dist/tools/applications/handlers.js +345 -0
- package/dist/tools/applications/handlers.js.map +1 -0
- package/dist/tools/applications/index.d.ts +2 -0
- package/dist/tools/applications/index.d.ts.map +1 -0
- package/dist/tools/applications/index.js +2 -0
- package/dist/tools/applications/index.js.map +1 -0
- package/dist/tools/applications/schemas.d.ts +276 -0
- package/dist/tools/applications/schemas.d.ts.map +1 -0
- package/dist/tools/applications/schemas.js +204 -0
- package/dist/tools/applications/schemas.js.map +1 -0
- package/dist/tools/json-schema-to-zod.d.ts +4 -0
- package/dist/tools/json-schema-to-zod.d.ts.map +1 -0
- package/dist/tools/json-schema-to-zod.js +118 -0
- package/dist/tools/json-schema-to-zod.js.map +1 -0
- package/dist/tools/kafka/descriptions.d.ts +3 -0
- package/dist/tools/kafka/descriptions.d.ts.map +1 -0
- package/dist/tools/kafka/descriptions.js +43 -0
- package/dist/tools/kafka/descriptions.js.map +1 -0
- package/dist/tools/kafka/handlers.d.ts +4 -0
- package/dist/tools/kafka/handlers.d.ts.map +1 -0
- package/dist/tools/kafka/handlers.js +65 -0
- package/dist/tools/kafka/handlers.js.map +1 -0
- package/dist/tools/kafka/helpers.d.ts +4 -0
- package/dist/tools/kafka/helpers.d.ts.map +1 -0
- package/dist/tools/kafka/helpers.js +79 -0
- package/dist/tools/kafka/helpers.js.map +1 -0
- package/dist/tools/kafka/index.d.ts +2 -0
- package/dist/tools/kafka/index.d.ts.map +1 -0
- package/dist/tools/kafka/index.js +2 -0
- package/dist/tools/kafka/index.js.map +1 -0
- package/dist/tools/kafka/schemas.d.ts +43 -0
- package/dist/tools/kafka/schemas.d.ts.map +1 -0
- package/dist/tools/kafka/schemas.js +23 -0
- package/dist/tools/kafka/schemas.js.map +1 -0
- package/dist/tools/pg/connection.d.ts +5 -0
- package/dist/tools/pg/connection.d.ts.map +1 -0
- package/dist/tools/pg/connection.js +28 -0
- package/dist/tools/pg/connection.js.map +1 -0
- package/dist/tools/pg/descriptions.d.ts +4 -0
- package/dist/tools/pg/descriptions.d.ts.map +1 -0
- package/dist/tools/pg/descriptions.js +66 -0
- package/dist/tools/pg/descriptions.js.map +1 -0
- package/dist/tools/pg/handlers.d.ts +4 -0
- package/dist/tools/pg/handlers.d.ts.map +1 -0
- package/dist/tools/pg/handlers.js +91 -0
- package/dist/tools/pg/handlers.js.map +1 -0
- package/dist/tools/pg/index.d.ts +2 -0
- package/dist/tools/pg/index.d.ts.map +1 -0
- package/dist/tools/pg/index.js +2 -0
- package/dist/tools/pg/index.js.map +1 -0
- package/dist/tools/pg/query.d.ts +6 -0
- package/dist/tools/pg/query.d.ts.map +1 -0
- package/dist/tools/pg/query.js +120 -0
- package/dist/tools/pg/query.js.map +1 -0
- package/dist/tools/pg/schemas.d.ts +59 -0
- package/dist/tools/pg/schemas.d.ts.map +1 -0
- package/dist/tools/pg/schemas.js +69 -0
- package/dist/tools/pg/schemas.js.map +1 -0
- package/dist/tools/pg/validation.d.ts +10 -0
- package/dist/tools/pg/validation.d.ts.map +1 -0
- package/dist/tools/pg/validation.js +77 -0
- package/dist/tools/pg/validation.js.map +1 -0
- package/dist/tools/registry.d.ts +4 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +120 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/response-filter.d.ts +3 -0
- package/dist/tools/response-filter.d.ts.map +1 -0
- package/dist/tools/response-filter.js +19 -0
- package/dist/tools/response-filter.js.map +1 -0
- package/dist/transport.d.ts +14 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +111 -0
- package/dist/transport.js.map +1 -0
- package/dist/types.d.ts +127 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +81 -0
- package/dist/types.js.map +1 -0
- package/generator/schemas/api-schemas.json +2106 -0
- package/package.json +78 -0
- package/src/manifests/core.yaml +206 -0
- package/src/manifests/integrations.yaml +72 -0
- package/src/manifests/kafka.yaml +143 -0
- package/src/manifests/pg.yaml +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One entry in service_integrations. The platform uses these to automatically inject
|
|
4
|
+
* credentials into the running container as environment variables — no manual copy-paste
|
|
5
|
+
* of connection strings needed, and no app code changes required.
|
|
6
|
+
*
|
|
7
|
+
* Set env var names to match what your application already reads.
|
|
8
|
+
*
|
|
9
|
+
* Supported service_type values (must be an existing service in the same project):
|
|
10
|
+
* - "pg" → injects a postgres:// connection URI
|
|
11
|
+
* - "valkey" → injects a redis:// connection URI
|
|
12
|
+
* - "opensearch" → injects an https:// connection URI
|
|
13
|
+
* - "kafka" → injects bootstrap servers + SSL certificates (raw PEM strings)
|
|
14
|
+
*/
|
|
15
|
+
export declare const serviceIntegrationItem: z.ZodDiscriminatedUnion<"service_type", [z.ZodObject<{
|
|
16
|
+
service_type: z.ZodLiteral<"pg">;
|
|
17
|
+
service_name: z.ZodString;
|
|
18
|
+
env_key: z.ZodDefault<z.ZodString>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
service_type: "pg";
|
|
21
|
+
service_name: string;
|
|
22
|
+
env_key: string;
|
|
23
|
+
}, {
|
|
24
|
+
service_type: "pg";
|
|
25
|
+
service_name: string;
|
|
26
|
+
env_key?: string | undefined;
|
|
27
|
+
}>, z.ZodObject<{
|
|
28
|
+
service_type: z.ZodLiteral<"valkey">;
|
|
29
|
+
service_name: z.ZodString;
|
|
30
|
+
env_key: z.ZodDefault<z.ZodString>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
service_type: "valkey";
|
|
33
|
+
service_name: string;
|
|
34
|
+
env_key: string;
|
|
35
|
+
}, {
|
|
36
|
+
service_type: "valkey";
|
|
37
|
+
service_name: string;
|
|
38
|
+
env_key?: string | undefined;
|
|
39
|
+
}>, z.ZodObject<{
|
|
40
|
+
service_type: z.ZodLiteral<"opensearch">;
|
|
41
|
+
service_name: z.ZodString;
|
|
42
|
+
env_key: z.ZodDefault<z.ZodString>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
service_type: "opensearch";
|
|
45
|
+
service_name: string;
|
|
46
|
+
env_key: string;
|
|
47
|
+
}, {
|
|
48
|
+
service_type: "opensearch";
|
|
49
|
+
service_name: string;
|
|
50
|
+
env_key?: string | undefined;
|
|
51
|
+
}>, z.ZodObject<{
|
|
52
|
+
service_type: z.ZodLiteral<"kafka">;
|
|
53
|
+
service_name: z.ZodString;
|
|
54
|
+
bootstrap_servers_env: z.ZodDefault<z.ZodString>;
|
|
55
|
+
security_protocol_env: z.ZodDefault<z.ZodString>;
|
|
56
|
+
access_key_env: z.ZodDefault<z.ZodString>;
|
|
57
|
+
access_cert_env: z.ZodDefault<z.ZodString>;
|
|
58
|
+
ca_cert_env: z.ZodDefault<z.ZodString>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
service_type: "kafka";
|
|
61
|
+
service_name: string;
|
|
62
|
+
bootstrap_servers_env: string;
|
|
63
|
+
security_protocol_env: string;
|
|
64
|
+
access_key_env: string;
|
|
65
|
+
access_cert_env: string;
|
|
66
|
+
ca_cert_env: string;
|
|
67
|
+
}, {
|
|
68
|
+
service_type: "kafka";
|
|
69
|
+
service_name: string;
|
|
70
|
+
bootstrap_servers_env?: string | undefined;
|
|
71
|
+
security_protocol_env?: string | undefined;
|
|
72
|
+
access_key_env?: string | undefined;
|
|
73
|
+
access_cert_env?: string | undefined;
|
|
74
|
+
ca_cert_env?: string | undefined;
|
|
75
|
+
}>]>;
|
|
76
|
+
export type ServiceIntegrationInput = z.infer<typeof serviceIntegrationItem>;
|
|
77
|
+
export declare const deployApplicationInput: z.ZodObject<{
|
|
78
|
+
project: z.ZodString;
|
|
79
|
+
service_name: z.ZodString;
|
|
80
|
+
repository_url: z.ZodString;
|
|
81
|
+
vcs_integration_id: z.ZodOptional<z.ZodString>;
|
|
82
|
+
remote_repository_id: z.ZodOptional<z.ZodString>;
|
|
83
|
+
branch: z.ZodString;
|
|
84
|
+
build_path: z.ZodDefault<z.ZodString>;
|
|
85
|
+
port: z.ZodNumber;
|
|
86
|
+
port_name: z.ZodDefault<z.ZodString>;
|
|
87
|
+
plan: z.ZodDefault<z.ZodString>;
|
|
88
|
+
cloud: z.ZodDefault<z.ZodString>;
|
|
89
|
+
environment_variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
+
key: z.ZodString;
|
|
91
|
+
value: z.ZodString;
|
|
92
|
+
kind: z.ZodDefault<z.ZodEnum<["variable", "secret"]>>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
value: string;
|
|
95
|
+
key: string;
|
|
96
|
+
kind: "variable" | "secret";
|
|
97
|
+
}, {
|
|
98
|
+
value: string;
|
|
99
|
+
key: string;
|
|
100
|
+
kind?: "variable" | "secret" | undefined;
|
|
101
|
+
}>, "many">>;
|
|
102
|
+
service_integrations: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"service_type", [z.ZodObject<{
|
|
103
|
+
service_type: z.ZodLiteral<"pg">;
|
|
104
|
+
service_name: z.ZodString;
|
|
105
|
+
env_key: z.ZodDefault<z.ZodString>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
service_type: "pg";
|
|
108
|
+
service_name: string;
|
|
109
|
+
env_key: string;
|
|
110
|
+
}, {
|
|
111
|
+
service_type: "pg";
|
|
112
|
+
service_name: string;
|
|
113
|
+
env_key?: string | undefined;
|
|
114
|
+
}>, z.ZodObject<{
|
|
115
|
+
service_type: z.ZodLiteral<"valkey">;
|
|
116
|
+
service_name: z.ZodString;
|
|
117
|
+
env_key: z.ZodDefault<z.ZodString>;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
service_type: "valkey";
|
|
120
|
+
service_name: string;
|
|
121
|
+
env_key: string;
|
|
122
|
+
}, {
|
|
123
|
+
service_type: "valkey";
|
|
124
|
+
service_name: string;
|
|
125
|
+
env_key?: string | undefined;
|
|
126
|
+
}>, z.ZodObject<{
|
|
127
|
+
service_type: z.ZodLiteral<"opensearch">;
|
|
128
|
+
service_name: z.ZodString;
|
|
129
|
+
env_key: z.ZodDefault<z.ZodString>;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
service_type: "opensearch";
|
|
132
|
+
service_name: string;
|
|
133
|
+
env_key: string;
|
|
134
|
+
}, {
|
|
135
|
+
service_type: "opensearch";
|
|
136
|
+
service_name: string;
|
|
137
|
+
env_key?: string | undefined;
|
|
138
|
+
}>, z.ZodObject<{
|
|
139
|
+
service_type: z.ZodLiteral<"kafka">;
|
|
140
|
+
service_name: z.ZodString;
|
|
141
|
+
bootstrap_servers_env: z.ZodDefault<z.ZodString>;
|
|
142
|
+
security_protocol_env: z.ZodDefault<z.ZodString>;
|
|
143
|
+
access_key_env: z.ZodDefault<z.ZodString>;
|
|
144
|
+
access_cert_env: z.ZodDefault<z.ZodString>;
|
|
145
|
+
ca_cert_env: z.ZodDefault<z.ZodString>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
service_type: "kafka";
|
|
148
|
+
service_name: string;
|
|
149
|
+
bootstrap_servers_env: string;
|
|
150
|
+
security_protocol_env: string;
|
|
151
|
+
access_key_env: string;
|
|
152
|
+
access_cert_env: string;
|
|
153
|
+
ca_cert_env: string;
|
|
154
|
+
}, {
|
|
155
|
+
service_type: "kafka";
|
|
156
|
+
service_name: string;
|
|
157
|
+
bootstrap_servers_env?: string | undefined;
|
|
158
|
+
security_protocol_env?: string | undefined;
|
|
159
|
+
access_key_env?: string | undefined;
|
|
160
|
+
access_cert_env?: string | undefined;
|
|
161
|
+
ca_cert_env?: string | undefined;
|
|
162
|
+
}>]>, "many">>;
|
|
163
|
+
app_service_name: z.ZodOptional<z.ZodString>;
|
|
164
|
+
app_env_key: z.ZodDefault<z.ZodString>;
|
|
165
|
+
project_vpc_id: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, "strict", z.ZodTypeAny, {
|
|
167
|
+
project: string;
|
|
168
|
+
cloud: string;
|
|
169
|
+
service_name: string;
|
|
170
|
+
plan: string;
|
|
171
|
+
port: number;
|
|
172
|
+
repository_url: string;
|
|
173
|
+
branch: string;
|
|
174
|
+
build_path: string;
|
|
175
|
+
port_name: string;
|
|
176
|
+
app_env_key: string;
|
|
177
|
+
project_vpc_id?: string | undefined;
|
|
178
|
+
vcs_integration_id?: string | undefined;
|
|
179
|
+
remote_repository_id?: string | undefined;
|
|
180
|
+
environment_variables?: {
|
|
181
|
+
value: string;
|
|
182
|
+
key: string;
|
|
183
|
+
kind: "variable" | "secret";
|
|
184
|
+
}[] | undefined;
|
|
185
|
+
service_integrations?: ({
|
|
186
|
+
service_type: "pg";
|
|
187
|
+
service_name: string;
|
|
188
|
+
env_key: string;
|
|
189
|
+
} | {
|
|
190
|
+
service_type: "valkey";
|
|
191
|
+
service_name: string;
|
|
192
|
+
env_key: string;
|
|
193
|
+
} | {
|
|
194
|
+
service_type: "opensearch";
|
|
195
|
+
service_name: string;
|
|
196
|
+
env_key: string;
|
|
197
|
+
} | {
|
|
198
|
+
service_type: "kafka";
|
|
199
|
+
service_name: string;
|
|
200
|
+
bootstrap_servers_env: string;
|
|
201
|
+
security_protocol_env: string;
|
|
202
|
+
access_key_env: string;
|
|
203
|
+
access_cert_env: string;
|
|
204
|
+
ca_cert_env: string;
|
|
205
|
+
})[] | undefined;
|
|
206
|
+
app_service_name?: string | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
project: string;
|
|
209
|
+
service_name: string;
|
|
210
|
+
port: number;
|
|
211
|
+
repository_url: string;
|
|
212
|
+
branch: string;
|
|
213
|
+
cloud?: string | undefined;
|
|
214
|
+
project_vpc_id?: string | undefined;
|
|
215
|
+
plan?: string | undefined;
|
|
216
|
+
vcs_integration_id?: string | undefined;
|
|
217
|
+
remote_repository_id?: string | undefined;
|
|
218
|
+
build_path?: string | undefined;
|
|
219
|
+
port_name?: string | undefined;
|
|
220
|
+
environment_variables?: {
|
|
221
|
+
value: string;
|
|
222
|
+
key: string;
|
|
223
|
+
kind?: "variable" | "secret" | undefined;
|
|
224
|
+
}[] | undefined;
|
|
225
|
+
service_integrations?: ({
|
|
226
|
+
service_type: "pg";
|
|
227
|
+
service_name: string;
|
|
228
|
+
env_key?: string | undefined;
|
|
229
|
+
} | {
|
|
230
|
+
service_type: "valkey";
|
|
231
|
+
service_name: string;
|
|
232
|
+
env_key?: string | undefined;
|
|
233
|
+
} | {
|
|
234
|
+
service_type: "opensearch";
|
|
235
|
+
service_name: string;
|
|
236
|
+
env_key?: string | undefined;
|
|
237
|
+
} | {
|
|
238
|
+
service_type: "kafka";
|
|
239
|
+
service_name: string;
|
|
240
|
+
bootstrap_servers_env?: string | undefined;
|
|
241
|
+
security_protocol_env?: string | undefined;
|
|
242
|
+
access_key_env?: string | undefined;
|
|
243
|
+
access_cert_env?: string | undefined;
|
|
244
|
+
ca_cert_env?: string | undefined;
|
|
245
|
+
})[] | undefined;
|
|
246
|
+
app_service_name?: string | undefined;
|
|
247
|
+
app_env_key?: string | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
export declare const redeployApplicationInput: z.ZodObject<{
|
|
250
|
+
project: z.ZodString;
|
|
251
|
+
service_name: z.ZodString;
|
|
252
|
+
}, "strict", z.ZodTypeAny, {
|
|
253
|
+
project: string;
|
|
254
|
+
service_name: string;
|
|
255
|
+
}, {
|
|
256
|
+
project: string;
|
|
257
|
+
service_name: string;
|
|
258
|
+
}>;
|
|
259
|
+
export declare const vcsIntegrationListInput: z.ZodObject<{
|
|
260
|
+
project: z.ZodString;
|
|
261
|
+
}, "strict", z.ZodTypeAny, {
|
|
262
|
+
project: string;
|
|
263
|
+
}, {
|
|
264
|
+
project: string;
|
|
265
|
+
}>;
|
|
266
|
+
export declare const vcsIntegrationRepositoryListInput: z.ZodObject<{
|
|
267
|
+
organization_id: z.ZodString;
|
|
268
|
+
vcs_integration_id: z.ZodString;
|
|
269
|
+
}, "strict", z.ZodTypeAny, {
|
|
270
|
+
organization_id: string;
|
|
271
|
+
vcs_integration_id: string;
|
|
272
|
+
}, {
|
|
273
|
+
organization_id: string;
|
|
274
|
+
vcs_integration_id: string;
|
|
275
|
+
}>;
|
|
276
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tools/applications/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoFjC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE7E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsIxB,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;;;;;EAK1B,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;;EAQzB,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;EAanC,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const environmentVariableItem = z.object({
|
|
3
|
+
key: z.string().describe('Environment variable name (e.g. NODE_ENV, API_KEY)'),
|
|
4
|
+
value: z.string().describe('Environment variable value'),
|
|
5
|
+
kind: z
|
|
6
|
+
.enum(['variable', 'secret'])
|
|
7
|
+
.default('variable')
|
|
8
|
+
.describe('variable = visible in UI, secret = masked in UI. Use secret for tokens, passwords, URIs.'),
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* One entry in service_integrations. The platform uses these to automatically inject
|
|
12
|
+
* credentials into the running container as environment variables — no manual copy-paste
|
|
13
|
+
* of connection strings needed, and no app code changes required.
|
|
14
|
+
*
|
|
15
|
+
* Set env var names to match what your application already reads.
|
|
16
|
+
*
|
|
17
|
+
* Supported service_type values (must be an existing service in the same project):
|
|
18
|
+
* - "pg" → injects a postgres:// connection URI
|
|
19
|
+
* - "valkey" → injects a redis:// connection URI
|
|
20
|
+
* - "opensearch" → injects an https:// connection URI
|
|
21
|
+
* - "kafka" → injects bootstrap servers + SSL certificates (raw PEM strings)
|
|
22
|
+
*/
|
|
23
|
+
export const serviceIntegrationItem = z.discriminatedUnion('service_type', [
|
|
24
|
+
z.object({
|
|
25
|
+
service_type: z.literal('pg'),
|
|
26
|
+
service_name: z
|
|
27
|
+
.string()
|
|
28
|
+
.describe('Name of the existing Aiven PostgreSQL service in the same project (must be RUNNING).'),
|
|
29
|
+
env_key: z
|
|
30
|
+
.string()
|
|
31
|
+
.default('DATABASE_URL')
|
|
32
|
+
.describe('Env var your app reads for the PostgreSQL connection URI (full postgres:// URI with SSL params). ' +
|
|
33
|
+
'Set to match your app — do not change your app code to fit the default. Default: "DATABASE_URL".'),
|
|
34
|
+
}),
|
|
35
|
+
z.object({
|
|
36
|
+
service_type: z.literal('valkey'),
|
|
37
|
+
service_name: z
|
|
38
|
+
.string()
|
|
39
|
+
.describe('Name of the existing Aiven Valkey service in the same project (must be RUNNING).'),
|
|
40
|
+
env_key: z
|
|
41
|
+
.string()
|
|
42
|
+
.default('REDIS_URL')
|
|
43
|
+
.describe('Env var your app reads for the Valkey connection URI (redis:// URI). ' +
|
|
44
|
+
'Set to match your app — do not change your app code to fit the default. Default: "REDIS_URL".'),
|
|
45
|
+
}),
|
|
46
|
+
z.object({
|
|
47
|
+
service_type: z.literal('opensearch'),
|
|
48
|
+
service_name: z
|
|
49
|
+
.string()
|
|
50
|
+
.describe('Name of the existing Aiven OpenSearch service in the same project (must be RUNNING).'),
|
|
51
|
+
env_key: z
|
|
52
|
+
.string()
|
|
53
|
+
.default('OPENSEARCH_URL')
|
|
54
|
+
.describe('Env var your app reads for the OpenSearch connection URI (https:// URI). ' +
|
|
55
|
+
'Set to match your app — do not change your app code to fit the default. Default: "OPENSEARCH_URL".'),
|
|
56
|
+
}),
|
|
57
|
+
z.object({
|
|
58
|
+
service_type: z.literal('kafka'),
|
|
59
|
+
service_name: z
|
|
60
|
+
.string()
|
|
61
|
+
.describe('Name of the existing Aiven Kafka service in the same project (must be RUNNING).'),
|
|
62
|
+
bootstrap_servers_env: z
|
|
63
|
+
.string()
|
|
64
|
+
.default('KAFKA_BOOTSTRAP_SERVER')
|
|
65
|
+
.describe('Env var your app reads for Kafka bootstrap servers (comma-separated host:port). ' +
|
|
66
|
+
'Set to match your app. Default: "KAFKA_BOOTSTRAP_SERVER".'),
|
|
67
|
+
security_protocol_env: z
|
|
68
|
+
.string()
|
|
69
|
+
.default('KAFKA_SECURITY_PROTOCOL')
|
|
70
|
+
.describe('Env var your app reads for the security protocol (value will be "SSL"). ' +
|
|
71
|
+
'Set to match your app. Default: "KAFKA_SECURITY_PROTOCOL".'),
|
|
72
|
+
access_key_env: z
|
|
73
|
+
.string()
|
|
74
|
+
.default('KAFKA_ACCESS_KEY')
|
|
75
|
+
.describe('Env var your app reads for the SSL client private key (raw PEM string, NOT base64). ' +
|
|
76
|
+
'Set to match your app. Default: "KAFKA_ACCESS_KEY".'),
|
|
77
|
+
access_cert_env: z
|
|
78
|
+
.string()
|
|
79
|
+
.default('KAFKA_ACCESS_CERT')
|
|
80
|
+
.describe('Env var your app reads for the SSL client certificate (raw PEM string, NOT base64). ' +
|
|
81
|
+
'Set to match your app. Default: "KAFKA_ACCESS_CERT".'),
|
|
82
|
+
ca_cert_env: z
|
|
83
|
+
.string()
|
|
84
|
+
.default('KAFKA_CA_CERT')
|
|
85
|
+
.describe('Env var your app reads for the CA certificate (raw PEM string, NOT base64). ' +
|
|
86
|
+
'Set to match your app. Default: "KAFKA_CA_CERT".'),
|
|
87
|
+
}),
|
|
88
|
+
]);
|
|
89
|
+
export const deployApplicationInput = z
|
|
90
|
+
.object({
|
|
91
|
+
project: z.string().describe('Aiven project name — use aiven_project_list to get valid names'),
|
|
92
|
+
service_name: z
|
|
93
|
+
.string()
|
|
94
|
+
.describe('Unique name for this application service within the project. ' +
|
|
95
|
+
'Use lowercase letters, numbers, and dashes only (e.g. "my-todo-app").'),
|
|
96
|
+
repository_url: z
|
|
97
|
+
.string()
|
|
98
|
+
.describe('Git repository HTTPS URL (e.g. https://github.com/user/repo). ' +
|
|
99
|
+
'IMPORTANT: NEVER assume the repository URL — always ask the user to confirm or provide it. ' +
|
|
100
|
+
'You may push code for the user, but ALWAYS ask for confirmation before pushing.'),
|
|
101
|
+
vcs_integration_id: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe('VCS integration ID for private repository access. ' +
|
|
105
|
+
'Auto-resolved via aiven_vcs_integration_list + aiven_vcs_integration_repository_list — do NOT ask the user for this value.'),
|
|
106
|
+
remote_repository_id: z
|
|
107
|
+
.string()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe('Repository ID within the VCS integration. ' +
|
|
110
|
+
'Auto-resolved by matching source_url in aiven_vcs_integration_repository_list — do NOT ask the user for this value.'),
|
|
111
|
+
branch: z
|
|
112
|
+
.string()
|
|
113
|
+
.describe('Git branch to deploy from (required — no default). ' +
|
|
114
|
+
'IMPORTANT: NEVER assume the branch — always ask the user to confirm which branch to deploy from.'),
|
|
115
|
+
build_path: z
|
|
116
|
+
.string()
|
|
117
|
+
.default('')
|
|
118
|
+
.describe('Path within the repository where the Dockerfile is located. ' +
|
|
119
|
+
'Default: "." (repository root). Use a subdirectory if the Dockerfile is not at the root (e.g. "./backend").'),
|
|
120
|
+
port: z.coerce
|
|
121
|
+
.number()
|
|
122
|
+
.int()
|
|
123
|
+
.min(1)
|
|
124
|
+
.max(65535)
|
|
125
|
+
.describe('The port the application listens on inside the container. ' +
|
|
126
|
+
'This MUST match the port in the Dockerfile EXPOSE directive AND the port the app binds to in code. ' +
|
|
127
|
+
'The app MUST listen on 0.0.0.0 (not 127.0.0.1 or localhost). Common values: 3000, 8000, 8080.'),
|
|
128
|
+
port_name: z
|
|
129
|
+
.string()
|
|
130
|
+
.default('default')
|
|
131
|
+
.describe('Logical name for the port. Default: "default". Rarely needs changing.'),
|
|
132
|
+
plan: z
|
|
133
|
+
.string()
|
|
134
|
+
.default('startup-50-1024')
|
|
135
|
+
.describe('Service plan. Default: "startup-50-1024" (0.5 vCPU, 1024 MB RAM). ' +
|
|
136
|
+
'Use aiven_service_type_plans with service_type="application" to list available plans.'),
|
|
137
|
+
cloud: z
|
|
138
|
+
.string()
|
|
139
|
+
.default('aws-eu-west-1')
|
|
140
|
+
.describe('Cloud region for deployment. Always confirm with the user before proceeding unless they have already explicitly specified a region. If service_integrations are provided, call aiven_service_get on each integrated service first and check their cloud_name: if all share the same cloud, propose that cloud and ask the user to confirm; if they differ, list the options and ask the user to choose. If there are no integrated services, ask the user which cloud region to deploy into.'),
|
|
141
|
+
environment_variables: z
|
|
142
|
+
.array(environmentVariableItem)
|
|
143
|
+
.optional()
|
|
144
|
+
.describe('Additional environment variables to inject into the running container. ' +
|
|
145
|
+
'Do NOT include credentials for services listed in service_integrations — those are auto-injected by the platform. ' +
|
|
146
|
+
'Common additions: NODE_ENV=production, PORT (matching the port param).'),
|
|
147
|
+
service_integrations: z
|
|
148
|
+
.array(serviceIntegrationItem)
|
|
149
|
+
.optional()
|
|
150
|
+
.describe('Aiven services to connect to this application. The platform automatically injects credentials ' +
|
|
151
|
+
'as environment variables — no manual connection strings needed, and your app code does not need to change. ' +
|
|
152
|
+
'Set env var names to match what your application already reads.\n\n' +
|
|
153
|
+
'Supported service types: "pg", "valkey", "opensearch", "kafka".\n' +
|
|
154
|
+
'Each service must already exist in the same project and be in RUNNING state (verify with aiven_service_get).\n\n' +
|
|
155
|
+
'Example — connect to Postgres and Kafka:\n' +
|
|
156
|
+
' service_integrations: [\n' +
|
|
157
|
+
' { service_type: "pg", service_name: "my-pg", env_key: "DATABASE_URL" },\n' +
|
|
158
|
+
' { service_type: "kafka", service_name: "my-kafka", bootstrap_servers_env: "KAFKA_BROKERS" }\n' +
|
|
159
|
+
' ]'),
|
|
160
|
+
app_service_name: z
|
|
161
|
+
.string()
|
|
162
|
+
.optional()
|
|
163
|
+
.describe('Name of an EXISTING Aiven Application service in the same project whose public URL ' +
|
|
164
|
+
'should be injected as an environment variable. The target service must be in RUNNING state ' +
|
|
165
|
+
'with a public URL available. Use aiven_service_get to verify before deploying.'),
|
|
166
|
+
app_env_key: z
|
|
167
|
+
.string()
|
|
168
|
+
.default('API_URL')
|
|
169
|
+
.describe('Environment variable name for the connected application URL. Default: "API_URL". ' +
|
|
170
|
+
'Only relevant when app_service_name is set.'),
|
|
171
|
+
project_vpc_id: z
|
|
172
|
+
.string()
|
|
173
|
+
.optional()
|
|
174
|
+
.describe('VPC to deploy this application into. Normally omit this — the backend auto-selects the VPC ' +
|
|
175
|
+
'when the project has exactly one active VPC in the target cloud. ' +
|
|
176
|
+
'Only provide this if the API returns a CONFLICT error saying the project has multiple VPCs ' +
|
|
177
|
+
'and you must specify one. In that case, call aiven_project_vpc_list to list available VPCs ' +
|
|
178
|
+
'and ask the user which to use.'),
|
|
179
|
+
})
|
|
180
|
+
.strict();
|
|
181
|
+
export const redeployApplicationInput = z
|
|
182
|
+
.object({
|
|
183
|
+
project: z.string().describe('Aiven project name'),
|
|
184
|
+
service_name: z.string().describe('Name of the existing application service to redeploy'),
|
|
185
|
+
})
|
|
186
|
+
.strict();
|
|
187
|
+
export const vcsIntegrationListInput = z
|
|
188
|
+
.object({
|
|
189
|
+
project: z
|
|
190
|
+
.string()
|
|
191
|
+
.describe('Aiven project name. The organization_id is resolved internally from this project.'),
|
|
192
|
+
})
|
|
193
|
+
.strict();
|
|
194
|
+
export const vcsIntegrationRepositoryListInput = z
|
|
195
|
+
.object({
|
|
196
|
+
organization_id: z
|
|
197
|
+
.string()
|
|
198
|
+
.describe('Organization ID returned by aiven_vcs_integration_list. Use that tool first to obtain this value.'),
|
|
199
|
+
vcs_integration_id: z
|
|
200
|
+
.string()
|
|
201
|
+
.describe('VCS integration ID returned by aiven_vcs_integration_list (e.g. "vcs-abc123").'),
|
|
202
|
+
})
|
|
203
|
+
.strict();
|
|
204
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/tools/applications/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACxD,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;SAC5B,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CAAC,0FAA0F,CAAC;CACxG,CAAC,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CA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6F;QAC3F,mEAAmE;QACnE,6FAA6F;QAC7F,6FAA6F;QAC7F,gCAAgC,CACnC;CACJ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAClD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;CAC1F,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CACP,mFAAmF,CACpF;CACJ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,CACP,mGAAmG,CACpG;IACH,kBAAkB,EAAE,CAAC;SAClB,MAAM,EAAE;SACR,QAAQ,CACP,gFAAgF,CACjF;CACJ,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-to-zod.d.ts","sourceRoot":"","sources":["../../src/tools/json-schema-to-zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,GAAE,OAAc,GAAG,CAAC,CAAC,OAAO,CAErF"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function jsonSchemaToZod(schema, strict = true) {
|
|
3
|
+
return convert(schema, strict, true);
|
|
4
|
+
}
|
|
5
|
+
function convert(schema, strict, isRoot) {
|
|
6
|
+
if (schema.enum) {
|
|
7
|
+
if (schema.enum.length === 0)
|
|
8
|
+
return withDescription(z.string(), schema.description);
|
|
9
|
+
const enumSchema = z.enum(schema.enum);
|
|
10
|
+
return withMeta(enumSchema, schema);
|
|
11
|
+
}
|
|
12
|
+
if (schema.oneOf ?? schema.anyOf) {
|
|
13
|
+
const variants = (schema.oneOf ?? schema.anyOf ?? []).map((s) => convert(s, true, false));
|
|
14
|
+
if (variants.length === 0)
|
|
15
|
+
return z.unknown();
|
|
16
|
+
if (variants.length === 1) {
|
|
17
|
+
const first = variants[0];
|
|
18
|
+
if (first !== undefined)
|
|
19
|
+
return first;
|
|
20
|
+
}
|
|
21
|
+
return z.union(variants);
|
|
22
|
+
}
|
|
23
|
+
switch (schema.type) {
|
|
24
|
+
case 'string':
|
|
25
|
+
return buildString(schema);
|
|
26
|
+
case 'integer':
|
|
27
|
+
return buildInteger(schema);
|
|
28
|
+
case 'number':
|
|
29
|
+
return buildNumber(schema);
|
|
30
|
+
case 'boolean':
|
|
31
|
+
return buildBoolean(schema);
|
|
32
|
+
case 'array':
|
|
33
|
+
return buildArray(schema, strict);
|
|
34
|
+
case 'object':
|
|
35
|
+
default:
|
|
36
|
+
return buildObject(schema, strict, isRoot);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function buildString(schema) {
|
|
40
|
+
let s = z.string();
|
|
41
|
+
if (schema.minLength !== undefined)
|
|
42
|
+
s = s.min(schema.minLength);
|
|
43
|
+
if (schema.maxLength !== undefined)
|
|
44
|
+
s = s.max(schema.maxLength);
|
|
45
|
+
// eslint-disable-next-line security/detect-non-literal-regexp -- pattern comes from trusted OpenAPI schema
|
|
46
|
+
if (schema.pattern !== undefined)
|
|
47
|
+
s = s.regex(new RegExp(schema.pattern));
|
|
48
|
+
let result = s;
|
|
49
|
+
if (schema.default !== undefined)
|
|
50
|
+
result = s.default(schema.default);
|
|
51
|
+
if (schema.nullable)
|
|
52
|
+
result = result.nullable();
|
|
53
|
+
return withDescription(result, schema.description);
|
|
54
|
+
}
|
|
55
|
+
function buildInteger(schema) {
|
|
56
|
+
let n = z.number().int();
|
|
57
|
+
if (schema.minimum !== undefined)
|
|
58
|
+
n = n.min(schema.minimum);
|
|
59
|
+
if (schema.maximum !== undefined)
|
|
60
|
+
n = n.max(schema.maximum);
|
|
61
|
+
let result = n;
|
|
62
|
+
if (schema.default !== undefined)
|
|
63
|
+
result = n.default(schema.default);
|
|
64
|
+
return withDescription(result, schema.description);
|
|
65
|
+
}
|
|
66
|
+
function buildNumber(schema) {
|
|
67
|
+
let n = z.number();
|
|
68
|
+
if (schema.minimum !== undefined)
|
|
69
|
+
n = n.min(schema.minimum);
|
|
70
|
+
if (schema.maximum !== undefined)
|
|
71
|
+
n = n.max(schema.maximum);
|
|
72
|
+
let result = n;
|
|
73
|
+
if (schema.default !== undefined)
|
|
74
|
+
result = n.default(schema.default);
|
|
75
|
+
return withDescription(result, schema.description);
|
|
76
|
+
}
|
|
77
|
+
function buildBoolean(schema) {
|
|
78
|
+
let b = z.boolean();
|
|
79
|
+
if (schema.default !== undefined)
|
|
80
|
+
b = z.boolean().default(schema.default);
|
|
81
|
+
return withDescription(b, schema.description);
|
|
82
|
+
}
|
|
83
|
+
function buildArray(schema, strict) {
|
|
84
|
+
const items = schema.items ? convert(schema.items, strict, false) : z.unknown();
|
|
85
|
+
const result = z.array(items);
|
|
86
|
+
return withDescription(result, schema.description);
|
|
87
|
+
}
|
|
88
|
+
function buildObject(schema, strict, isRoot) {
|
|
89
|
+
if (!schema.properties || Object.keys(schema.properties).length === 0) {
|
|
90
|
+
return z.record(z.unknown());
|
|
91
|
+
}
|
|
92
|
+
const requiredSet = new Set(schema.required ?? []);
|
|
93
|
+
const shape = {};
|
|
94
|
+
for (const [name, prop] of Object.entries(schema.properties)) {
|
|
95
|
+
let field = convert(prop, true, false);
|
|
96
|
+
if (!requiredSet.has(name)) {
|
|
97
|
+
field = field.optional();
|
|
98
|
+
}
|
|
99
|
+
shape[name] = field;
|
|
100
|
+
}
|
|
101
|
+
const obj = z.object(shape);
|
|
102
|
+
if (isRoot) {
|
|
103
|
+
return strict ? obj.strict() : obj.passthrough();
|
|
104
|
+
}
|
|
105
|
+
return obj;
|
|
106
|
+
}
|
|
107
|
+
function withDescription(schema, description) {
|
|
108
|
+
if (description)
|
|
109
|
+
return schema.describe(description);
|
|
110
|
+
return schema;
|
|
111
|
+
}
|
|
112
|
+
function withMeta(schema, jsonSchema) {
|
|
113
|
+
let result = schema;
|
|
114
|
+
if (jsonSchema.description)
|
|
115
|
+
result = result.describe(jsonSchema.description);
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=json-schema-to-zod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-to-zod.js","sourceRoot":"","sources":["../../src/tools/json-schema-to-zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,eAAe,CAAC,MAAkB,EAAE,SAAkB,IAAI;IACxE,OAAO,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,OAAO,CAAC,MAAkB,EAAE,MAAe,EAAE,MAAe;IACnE,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,eAAe,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACrF,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAA6B,CAAC,CAAC;QAChE,OAAO,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjC,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M,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const CREATE_CONNECTOR_DESCRIPTION = "Create a Kafka Connect connector.\n\n**Kafka Connect plan gate \u2014 call `aiven_service_get` first.** Read `service.plan`. On **free** Kafka plans (e.g. `free-0`), Kafka Connect is usually **not** available and the API returns **403** (e.g. \"Kafka Connect API disabled\"). Do **not** call Kafka Connect tools when `service.plan` is `free-*` or you know the tier lacks Connect; explain upgrade instead of invoking the API.\n\n**Plans that typically include Kafka Connect:** `startup-*` (e.g. `startup-2`, `startup-4`), `business-*`, `premium-*`. A 403 mentioning Connect being **disabled** is typically a **plan** limitation, not token RBAC.\n\nWhen `source_service` is provided, connection credentials (hostname, port, user, password) are automatically resolved from that Aiven service \u2014 no need to look up or provide passwords manually.\n\nSupports Debezium CDC connectors (PostgreSQL, MySQL), JDBC source/sink, and any connector class. Extra configuration fields are passed through as-is.\n\n**Prerequisites:** On a **supported** plan, the Kafka service must have Kafka Connect enabled (`user_config.kafka_connect: true`). If using Schema Registry for value/key converters, enable it too (`user_config.schema_registry: true`).\n\n**IMPORTANT \u2014 Kafka Connect takes time to initialize.** After enabling via `aiven_service_update`, call `aiven_service_get` once to check if `state` is `RUNNING` and `components` includes `kafka_connect` in state `running`. If not ready, tell the user and let them decide when to re-check. Do NOT poll in a loop or retry on 503.\n\n**IMPORTANT \u2014 topics must exist before the connector starts.** Aiven Kafka does not auto-create topics. Create all required topics using `aiven_kafka_topic_create` before or immediately after creating the connector. Topic naming depends on the connector type (e.g. Debezium uses `{topic.prefix}.{schema}.{table}`).\n\n**Assistant:** If you suggest enabling public access for Kafka (e.g. `user_config.public_access`), include this line for the user:\n- \u26A0\uFE0F WARNING: This makes the Kafka service reachable from the internet.\n\n**Lists & picks:** When turning this tool\u2019s output into user choices, curate **2\u20135** options at a time unless they explicitly ask for the full catalog. In **Claude Code**, prefer `AskUserQuestion` when appropriate.\n\n**Example \u2014 Debezium PostgreSQL CDC:**\n```\naiven_kafka_connect_create_connector(\n project=\"my-project\",\n service_name=\"my-kafka\",\n source_service=\"my-pg\",\n name=\"pg-cdc\",\n connector_class=\"io.debezium.connector.postgresql.PostgresConnector\",\n topic.prefix=\"cdc\",\n table.include.list=\"public.orders,public.users\",\n plugin.name=\"pgoutput\",\n slot.name=\"debezium_slot\",\n database.sslmode=\"require\",\n publication.autocreate.mode=\"filtered\"\n)\n```";
|
|
2
|
+
export declare const EDIT_CONNECTOR_DESCRIPTION = "Edit an existing Kafka Connect connector configuration.\n\n**Kafka Connect plan gate \u2014 call `aiven_service_get` first.** Read `service.plan`. On **free** Kafka plans (e.g. `free-0`), Kafka Connect is usually **not** available and the API returns **403** (e.g. \"Kafka Connect API disabled\"). Do **not** call Kafka Connect tools when `service.plan` is `free-*` or you know the tier lacks Connect; explain upgrade instead of invoking the API.\n\n**Plans that typically include Kafka Connect:** `startup-*` (e.g. `startup-2`, `startup-4`), `business-*`, `premium-*`. A 403 mentioning Connect being **disabled** is typically a **plan** limitation, not token RBAC.\n\nWhen `source_service` is provided, connection credentials (hostname, port, user, password) are automatically resolved from that Aiven service \u2014 no need to look up or provide passwords manually.\n\nSupports Debezium CDC connectors (PostgreSQL, MySQL), JDBC source/sink, and any connector class. Extra configuration fields are passed through as-is.\n\n**Prerequisites:** On a **supported** plan, the Kafka service must have Kafka Connect enabled (`user_config.kafka_connect: true`). If using Schema Registry for value/key converters, enable it too (`user_config.schema_registry: true`).\n\n**IMPORTANT \u2014 Kafka Connect takes time to initialize.** After enabling via `aiven_service_update`, call `aiven_service_get` once to check if `state` is `RUNNING` and `components` includes `kafka_connect` in state `running`. If not ready, tell the user and let them decide when to re-check. Do NOT poll in a loop or retry on 503.\n\n**IMPORTANT \u2014 topics must exist before the connector starts.** Aiven Kafka does not auto-create topics. Create all required topics using `aiven_kafka_topic_create` before or immediately after creating the connector. Topic naming depends on the connector type (e.g. Debezium uses `{topic.prefix}.{schema}.{table}`).\n\n**Assistant:** If you suggest enabling public access for Kafka (e.g. `user_config.public_access`), include this line for the user:\n- \u26A0\uFE0F WARNING: This makes the Kafka service reachable from the internet.\n\n**Lists & picks:** When turning this tool\u2019s output into user choices, curate **2\u20135** options at a time unless they explicitly ask for the full catalog. In **Claude Code**, prefer `AskUserQuestion` when appropriate.";
|
|
3
|
+
//# sourceMappingURL=descriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptions.d.ts","sourceRoot":"","sources":["../../../src/tools/kafka/descriptions.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,4BAA4B,2xFAmBlC,CAAC;AAER,eAAO,MAAM,0BAA0B,g0EAEnB,CAAC"}
|