@bpmnkit/cli 0.0.9

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.
@@ -0,0 +1,407 @@
1
+ // This file is auto-generated by packages/api/scripts/generate.mjs
2
+ // Do not edit manually.
3
+ import { dateTransform } from "../output.js";
4
+ import { DATA_FLAG, DATA_OPT_FLAG, makeListCmd, makeGetCmd, makeCreateCmd, makeUpdateCmd, makeDeleteCmd, parseJson, } from "../commands/admin-shared.js";
5
+ // ── Meta ──
6
+ export const metaGroup = {
7
+ name: "meta",
8
+ description: "Meta",
9
+ commands: [
10
+ {
11
+ name: "get",
12
+ description: "This endpoint only exposes egress IP addresses for the related services.",
13
+ async run(ctx) {
14
+ const client = await ctx.getAdminClient();
15
+ const result = await client.meta.getMeta();
16
+ ctx.output.printItem(result);
17
+ },
18
+ },
19
+ ],
20
+ };
21
+ // ── Members ──
22
+ export const membersGroup = {
23
+ name: "members",
24
+ description: "Members",
25
+ commands: [
26
+ {
27
+ name: "get",
28
+ description: "get",
29
+ async run(ctx) {
30
+ const client = await ctx.getAdminClient();
31
+ const result = await client.members.getMembers();
32
+ ctx.output.printItem(result);
33
+ },
34
+ },
35
+ {
36
+ name: "update",
37
+ description: "update",
38
+ args: [{ name: "email", description: "email", required: true }],
39
+ flags: [DATA_FLAG],
40
+ async run(ctx) {
41
+ const email = ctx.positional[0];
42
+ if (!email)
43
+ throw new Error("Missing required argument: <email>");
44
+ const body = parseJson(ctx.flags.data, "data");
45
+ const client = await ctx.getAdminClient();
46
+ await client.members.updateMembers(email, body);
47
+ ctx.output.ok("update completed.");
48
+ },
49
+ },
50
+ makeDeleteCmd({
51
+ name: "delete-member",
52
+ description: "delete-member",
53
+ argName: "email",
54
+ delete: (client, key) => client.members.deleteMember(key),
55
+ }),
56
+ ],
57
+ };
58
+ // ── Clusters ──
59
+ export const clustersGroup = {
60
+ name: "clusters",
61
+ description: "Clusters",
62
+ commands: [
63
+ makeGetCmd({
64
+ name: "get-secure-connectivity-status",
65
+ description: "Get Secure Connectivity status for a cluster",
66
+ argName: "clusterUuid",
67
+ get: (client, key) => client.clusters.getSecureConnectivityStatus(key),
68
+ }),
69
+ {
70
+ name: "activate-secure-connectivity",
71
+ description: "Activates Secure Connectivity for a cluster",
72
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }],
73
+ flags: [DATA_FLAG],
74
+ async run(ctx) {
75
+ const clusterUuid = ctx.positional[0];
76
+ if (!clusterUuid)
77
+ throw new Error("Missing required argument: <clusterUuid>");
78
+ const body = parseJson(ctx.flags.data, "data");
79
+ const client = await ctx.getAdminClient();
80
+ await client.clusters.activateSecureConnectivity(clusterUuid, body);
81
+ ctx.output.ok("activate-secure-connectivity completed.");
82
+ },
83
+ },
84
+ makeDeleteCmd({
85
+ name: "deactivate-secure-connectivity",
86
+ description: "Deactivates Secure Connectivity for a cluster",
87
+ argName: "clusterUuid",
88
+ delete: (client, key) => client.clusters.deactivateSecureConnectivity(key),
89
+ }),
90
+ makeGetCmd({
91
+ name: "get-secrets",
92
+ description: "get-secrets",
93
+ argName: "clusterUuid",
94
+ get: (client, key) => client.clusters.getSecrets(key),
95
+ }),
96
+ {
97
+ name: "create-secret",
98
+ description: "Creates a new secret",
99
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }],
100
+ flags: [DATA_FLAG],
101
+ async run(ctx) {
102
+ const clusterUuid = ctx.positional[0];
103
+ if (!clusterUuid)
104
+ throw new Error("Missing required argument: <clusterUuid>");
105
+ const body = parseJson(ctx.flags.data, "data");
106
+ const client = await ctx.getAdminClient();
107
+ await client.clusters.createSecret(clusterUuid, body);
108
+ ctx.output.ok("create-secret completed.");
109
+ },
110
+ },
111
+ {
112
+ name: "update-secret",
113
+ description: "Updates a secret",
114
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "secretName", description: "secretName", required: true }],
115
+ flags: [DATA_FLAG],
116
+ async run(ctx) {
117
+ const clusterUuid = ctx.positional[0];
118
+ if (!clusterUuid)
119
+ throw new Error("Missing required argument: <clusterUuid>");
120
+ const secretName = ctx.positional[1];
121
+ if (!secretName)
122
+ throw new Error("Missing required argument: <secretName>");
123
+ const body = parseJson(ctx.flags.data, "data");
124
+ const client = await ctx.getAdminClient();
125
+ await client.clusters.updateSecret(clusterUuid, secretName, body);
126
+ ctx.output.ok("update-secret completed.");
127
+ },
128
+ },
129
+ {
130
+ name: "delete-secret",
131
+ description: "Irreversibly deletes a secret",
132
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "secretName", description: "secretName", required: true }],
133
+ async run(ctx) {
134
+ const clusterUuid = ctx.positional[0];
135
+ if (!clusterUuid)
136
+ throw new Error("Missing required argument: <clusterUuid>");
137
+ const secretName = ctx.positional[1];
138
+ if (!secretName)
139
+ throw new Error("Missing required argument: <secretName>");
140
+ const client = await ctx.getAdminClient();
141
+ await client.clusters.deleteSecret(clusterUuid, secretName);
142
+ ctx.output.ok("delete-secret completed.");
143
+ },
144
+ },
145
+ {
146
+ name: "get",
147
+ description: "get",
148
+ async run(ctx) {
149
+ const client = await ctx.getAdminClient();
150
+ const result = await client.clusters.getClusters();
151
+ ctx.output.printItem(result);
152
+ },
153
+ },
154
+ makeCreateCmd({
155
+ name: "create-cluster",
156
+ description: "create-cluster",
157
+ create: (client, body) => client.clusters.createCluster(body),
158
+ bodyFields: [{ name: "identityBackendChecksEnabled", type: "boolean" }],
159
+ }),
160
+ makeGetCmd({
161
+ name: "get-cluster",
162
+ description: "get-cluster",
163
+ argName: "clusterUuid",
164
+ get: (client, key) => client.clusters.getCluster(key),
165
+ }),
166
+ makeUpdateCmd({
167
+ name: "update-cluster",
168
+ description: "Updates name or labels of a cluster identified by the given clusterUuid.",
169
+ argName: "clusterUuid",
170
+ update: (client, key, body) => client.clusters.updateCluster(key, body),
171
+ bodyFields: [{ name: "name", type: "string", description: "The name of your cluster." }, { name: "description", type: "string", description: "Optional description for the cluster (max 150 characters)." }, { name: "stageLabel", type: "string", enum: ["dev", "test", "stage", "prod"] }, { name: "numberOfAllocatedHwPackages", type: "number", description: "Optional number uf hardware packages, defaults to 1. Only availabe on request and for Advanced offering cluster types." }],
172
+ }),
173
+ makeDeleteCmd({
174
+ name: "delete-cluster",
175
+ description: "Irreversibly deletes a cluster identified by the given clusterUuid.",
176
+ argName: "clusterUuid",
177
+ delete: (client, key) => client.clusters.deleteCluster(key),
178
+ }),
179
+ makeUpdateCmd({
180
+ name: "upgrade-cluster",
181
+ description: "upgrades a cluster identified by the given clusterUuid to the latest generation available.",
182
+ argName: "clusterUuid",
183
+ update: (client, key) => client.clusters.upgradeCluster(key),
184
+ }),
185
+ {
186
+ name: "get-parameters",
187
+ description: "Gets all possible options to create a Camunda cluster.",
188
+ async run(ctx) {
189
+ const client = await ctx.getAdminClient();
190
+ const result = await client.clusters.getParameters();
191
+ ctx.output.printItem(result);
192
+ },
193
+ },
194
+ makeUpdateCmd({
195
+ name: "update-ip-allowlist",
196
+ description: "Updates the IP Allowlist rules for your cluster. Each entry in the array must be a valid comma separated list of CIDRs.",
197
+ argName: "clusterUuid",
198
+ update: (client, key, body) => client.clusters.updateIpAllowlist(key, body),
199
+ bodyFields: [{ name: "ipallowlist", type: "array", required: true }],
200
+ }),
201
+ makeUpdateCmd({
202
+ name: "update-ip-whitelist",
203
+ description: "Updates the IP Whitelist rules for your cluster. Each entry in the array must be a valid comma separated list of CIDRs.",
204
+ argName: "clusterUuid",
205
+ update: (client, key, body) => client.clusters.updateIpWhitelist(key, body),
206
+ bodyFields: [{ name: "ipwhitelist", type: "array", required: true }],
207
+ }),
208
+ makeUpdateCmd({
209
+ name: "wake",
210
+ description: "Resumes a 'Suspended' Cluster.",
211
+ argName: "clusterUuid",
212
+ update: (client, key) => client.clusters.wake(key),
213
+ }),
214
+ makeGetCmd({
215
+ name: "get-clients",
216
+ description: "get-clients",
217
+ argName: "clusterUuid",
218
+ get: (client, key) => client.clusters.getClients(key),
219
+ }),
220
+ {
221
+ name: "create-client",
222
+ description: "create-client",
223
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }],
224
+ flags: [DATA_FLAG],
225
+ async run(ctx) {
226
+ const clusterUuid = ctx.positional[0];
227
+ if (!clusterUuid)
228
+ throw new Error("Missing required argument: <clusterUuid>");
229
+ const body = parseJson(ctx.flags.data, "data");
230
+ const client = await ctx.getAdminClient();
231
+ const result = await client.clusters.createClient(clusterUuid, body);
232
+ ctx.output.printItem(result);
233
+ },
234
+ },
235
+ {
236
+ name: "get-client",
237
+ description: "get-client",
238
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "clientId", description: "clientId", required: true }],
239
+ async run(ctx) {
240
+ const clusterUuid = ctx.positional[0];
241
+ if (!clusterUuid)
242
+ throw new Error("Missing required argument: <clusterUuid>");
243
+ const clientId = ctx.positional[1];
244
+ if (!clientId)
245
+ throw new Error("Missing required argument: <clientId>");
246
+ const client = await ctx.getAdminClient();
247
+ const result = await client.clusters.getClient(clusterUuid, clientId);
248
+ ctx.output.printItem(result);
249
+ },
250
+ },
251
+ {
252
+ name: "delete-client",
253
+ description: "Irreversibly deletes a cluster client.",
254
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "clientId", description: "clientId", required: true }],
255
+ async run(ctx) {
256
+ const clusterUuid = ctx.positional[0];
257
+ if (!clusterUuid)
258
+ throw new Error("Missing required argument: <clusterUuid>");
259
+ const clientId = ctx.positional[1];
260
+ if (!clientId)
261
+ throw new Error("Missing required argument: <clientId>");
262
+ const client = await ctx.getAdminClient();
263
+ await client.clusters.deleteClient(clusterUuid, clientId);
264
+ ctx.output.ok("delete-client completed.");
265
+ },
266
+ },
267
+ {
268
+ name: "activate-monitoring",
269
+ description: "Activates External Monitoring for a cluster",
270
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }],
271
+ async run(ctx) {
272
+ const clusterUuid = ctx.positional[0];
273
+ if (!clusterUuid)
274
+ throw new Error("Missing required argument: <clusterUuid>");
275
+ const client = await ctx.getAdminClient();
276
+ await client.clusters.activateMonitoring(clusterUuid);
277
+ ctx.output.ok("activate-monitoring completed.");
278
+ },
279
+ },
280
+ makeDeleteCmd({
281
+ name: "deactivate-monitoring",
282
+ description: "Deactivates External Monitoring for a cluster",
283
+ argName: "clusterUuid",
284
+ delete: (client, key) => client.clusters.deactivateMonitoring(key),
285
+ }),
286
+ makeGetCmd({
287
+ name: "get-monitoring-clients",
288
+ description: "Get all External Monitoring clients for a cluster",
289
+ argName: "clusterUuid",
290
+ get: (client, key) => client.clusters.getMonitoringClients(key),
291
+ }),
292
+ {
293
+ name: "create-monitoring-client",
294
+ description: "Creates a new External Monitoring client",
295
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }],
296
+ flags: [DATA_FLAG],
297
+ async run(ctx) {
298
+ const clusterUuid = ctx.positional[0];
299
+ if (!clusterUuid)
300
+ throw new Error("Missing required argument: <clusterUuid>");
301
+ const body = parseJson(ctx.flags.data, "data");
302
+ const client = await ctx.getAdminClient();
303
+ const result = await client.clusters.createMonitoringClient(clusterUuid, body);
304
+ ctx.output.printItem(result);
305
+ },
306
+ },
307
+ {
308
+ name: "rotate-monitoring-client-password",
309
+ description: "Rotates the password for an External Monitoring client",
310
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "clientUuid", description: "clientUuid", required: true }],
311
+ async run(ctx) {
312
+ const clusterUuid = ctx.positional[0];
313
+ if (!clusterUuid)
314
+ throw new Error("Missing required argument: <clusterUuid>");
315
+ const clientUuid = ctx.positional[1];
316
+ if (!clientUuid)
317
+ throw new Error("Missing required argument: <clientUuid>");
318
+ const client = await ctx.getAdminClient();
319
+ const result = await client.clusters.rotateMonitoringClientPassword(clusterUuid, clientUuid);
320
+ ctx.output.printItem(result);
321
+ },
322
+ },
323
+ {
324
+ name: "delete-monitoring-client",
325
+ description: "Deletes an External Monitoring client",
326
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "clientUuid", description: "clientUuid", required: true }],
327
+ async run(ctx) {
328
+ const clusterUuid = ctx.positional[0];
329
+ if (!clusterUuid)
330
+ throw new Error("Missing required argument: <clusterUuid>");
331
+ const clientUuid = ctx.positional[1];
332
+ if (!clientUuid)
333
+ throw new Error("Missing required argument: <clientUuid>");
334
+ const client = await ctx.getAdminClient();
335
+ await client.clusters.deleteMonitoringClient(clusterUuid, clientUuid);
336
+ ctx.output.ok("delete-monitoring-client completed.");
337
+ },
338
+ },
339
+ makeGetCmd({
340
+ name: "get-backups",
341
+ description: "get-backups",
342
+ argName: "clusterUuid",
343
+ get: (client, key) => client.clusters.getBackups(key),
344
+ }),
345
+ {
346
+ name: "create-backup",
347
+ description: "Creates a new backup",
348
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }],
349
+ async run(ctx) {
350
+ const clusterUuid = ctx.positional[0];
351
+ if (!clusterUuid)
352
+ throw new Error("Missing required argument: <clusterUuid>");
353
+ const client = await ctx.getAdminClient();
354
+ const result = await client.clusters.createBackup(clusterUuid);
355
+ ctx.output.printItem(result);
356
+ },
357
+ },
358
+ {
359
+ name: "delete-backup",
360
+ description: "Irreversibly deletes a cluster",
361
+ args: [{ name: "clusterUuid", description: "clusterUuid", required: true }, { name: "backupId", description: "backupId", required: true }],
362
+ async run(ctx) {
363
+ const clusterUuid = ctx.positional[0];
364
+ if (!clusterUuid)
365
+ throw new Error("Missing required argument: <clusterUuid>");
366
+ const backupId = ctx.positional[1];
367
+ if (!backupId)
368
+ throw new Error("Missing required argument: <backupId>");
369
+ const client = await ctx.getAdminClient();
370
+ const result = await client.clusters.deleteBackup(clusterUuid, backupId);
371
+ ctx.output.printItem(result);
372
+ },
373
+ },
374
+ ],
375
+ };
376
+ // ── Activity ──
377
+ export const activityGroup = {
378
+ name: "activity",
379
+ description: "Activity",
380
+ commands: [
381
+ {
382
+ name: "get-json",
383
+ description: "get-json",
384
+ async run(ctx) {
385
+ const client = await ctx.getAdminClient();
386
+ const result = await client.activity.getJson();
387
+ ctx.output.printItem(result);
388
+ },
389
+ },
390
+ {
391
+ name: "get-csv",
392
+ description: "get-csv",
393
+ async run(ctx) {
394
+ const client = await ctx.getAdminClient();
395
+ const result = await client.activity.getCsv();
396
+ ctx.output.printItem(result);
397
+ },
398
+ },
399
+ ],
400
+ };
401
+ export const adminCommandGroups = [
402
+ metaGroup,
403
+ membersGroup,
404
+ clustersGroup,
405
+ activityGroup,
406
+ ];
407
+ //# sourceMappingURL=admin-commands.js.map