@terrantula/sdk 0.8.1 → 0.9.1
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/dist/{chunk-NVHWMOWP.mjs → chunk-OXOF623W.mjs} +128 -114
- package/dist/index.d.mts +430 -246
- package/dist/index.d.ts +430 -246
- package/dist/index.js +128 -114
- package/dist/index.mjs +1 -1
- package/dist/local.d.mts +301 -209
- package/dist/local.d.ts +301 -209
- package/dist/local.js +128 -114
- package/dist/local.mjs +1 -1
- package/dist/{projects-BxDuMQLR.d.mts → projects-CT3fGCOp.d.mts} +2 -2
- package/dist/{projects-BxDuMQLR.d.ts → projects-CT3fGCOp.d.ts} +2 -2
- package/package.json +7 -7
|
@@ -73,19 +73,19 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
73
73
|
),
|
|
74
74
|
get: withSchema(
|
|
75
75
|
z.object({
|
|
76
|
-
id: z.string().describe("Organization ID")
|
|
76
|
+
id: z.string().describe("Organization ID or slug")
|
|
77
77
|
}),
|
|
78
78
|
(params) => call(cloud.orgs[":id"].$get({ param: params }))
|
|
79
79
|
),
|
|
80
80
|
listUsers: withSchema(
|
|
81
81
|
z.object({
|
|
82
|
-
id: z.string().describe("Organization ID")
|
|
82
|
+
id: z.string().describe("Organization ID or slug")
|
|
83
83
|
}),
|
|
84
84
|
(params) => call(cloud.orgs[":id"].users.$get({ param: params }))
|
|
85
85
|
),
|
|
86
86
|
inviteUser: withSchema(
|
|
87
87
|
z.object({
|
|
88
|
-
id: z.string().describe("Organization ID"),
|
|
88
|
+
id: z.string().describe("Organization ID or slug"),
|
|
89
89
|
email: z.string().describe("User email"),
|
|
90
90
|
name: z.string().describe("User full name"),
|
|
91
91
|
role: z.enum(["owner", "admin", "member"]).optional().describe("Role (owner|admin|member)")
|
|
@@ -97,7 +97,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
97
97
|
),
|
|
98
98
|
updateUserRole: withSchema(
|
|
99
99
|
z.object({
|
|
100
|
-
id: z.string().describe("Organization ID"),
|
|
100
|
+
id: z.string().describe("Organization ID or slug"),
|
|
101
101
|
userId: z.string().describe("User ID"),
|
|
102
102
|
role: z.enum(["owner", "admin", "member"]).describe("New role")
|
|
103
103
|
}),
|
|
@@ -110,26 +110,26 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
110
110
|
),
|
|
111
111
|
removeUser: withSchema(
|
|
112
112
|
z.object({
|
|
113
|
-
id: z.string().describe("Organization ID"),
|
|
113
|
+
id: z.string().describe("Organization ID or slug"),
|
|
114
114
|
userId: z.string().describe("User ID")
|
|
115
115
|
}),
|
|
116
116
|
(params) => call(cloud.orgs[":id"].users[":userId"].$delete({ param: params }))
|
|
117
117
|
),
|
|
118
118
|
leave: withSchema(
|
|
119
119
|
z.object({
|
|
120
|
-
id: z.string().describe("Organization ID")
|
|
120
|
+
id: z.string().describe("Organization ID or slug")
|
|
121
121
|
}),
|
|
122
122
|
(params) => call(cloud.orgs[":id"].leave.$post({ param: params }))
|
|
123
123
|
),
|
|
124
124
|
delete: withSchema(
|
|
125
125
|
z.object({
|
|
126
|
-
id: z.string().describe("Organization ID")
|
|
126
|
+
id: z.string().describe("Organization ID or slug")
|
|
127
127
|
}),
|
|
128
128
|
(params) => call(cloud.orgs[":id"].$delete({ param: params }))
|
|
129
129
|
),
|
|
130
130
|
listPersonalTokens: withSchema(
|
|
131
131
|
z.object({
|
|
132
|
-
id: z.string().describe("Organization ID")
|
|
132
|
+
id: z.string().describe("Organization ID or slug")
|
|
133
133
|
}),
|
|
134
134
|
async (params) => callPersonalTokens(
|
|
135
135
|
await personalTokensRequest(baseUrl, hcOpts, `/orgs/${params.id}/personal-tokens`)
|
|
@@ -137,7 +137,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
137
137
|
),
|
|
138
138
|
createPersonalToken: withSchema(
|
|
139
139
|
z.object({
|
|
140
|
-
id: z.string().describe("Organization ID"),
|
|
140
|
+
id: z.string().describe("Organization ID or slug"),
|
|
141
141
|
name: z.string().describe("Token label"),
|
|
142
142
|
expiresAt: z.string().datetime().optional().describe("Optional ISO expiry")
|
|
143
143
|
}),
|
|
@@ -154,7 +154,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
154
154
|
),
|
|
155
155
|
revokePersonalToken: withSchema(
|
|
156
156
|
z.object({
|
|
157
|
-
id: z.string().describe("Organization ID"),
|
|
157
|
+
id: z.string().describe("Organization ID or slug"),
|
|
158
158
|
tokenId: z.string().describe("Personal token ID")
|
|
159
159
|
}),
|
|
160
160
|
async (params) => callPersonalTokens(
|
|
@@ -168,7 +168,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
168
168
|
),
|
|
169
169
|
listSsoExtras: withSchema(
|
|
170
170
|
z.object({
|
|
171
|
-
id: z.string().describe("Organization ID")
|
|
171
|
+
id: z.string().describe("Organization ID or slug")
|
|
172
172
|
}),
|
|
173
173
|
async (params) => callPersonalTokens(
|
|
174
174
|
await personalTokensRequest(baseUrl, hcOpts, `/orgs/${params.id}/sso-extras`)
|
|
@@ -176,7 +176,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
|
|
|
176
176
|
),
|
|
177
177
|
setSsoForce: withSchema(
|
|
178
178
|
z.object({
|
|
179
|
-
id: z.string().describe("Organization ID"),
|
|
179
|
+
id: z.string().describe("Organization ID or slug"),
|
|
180
180
|
providerId: z.string().describe("SSO provider ID"),
|
|
181
181
|
forceSso: z.boolean().describe("Force-SSO toggle for this provider")
|
|
182
182
|
}),
|
|
@@ -203,13 +203,13 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
203
203
|
return {
|
|
204
204
|
list: withSchema(
|
|
205
205
|
z2.object({
|
|
206
|
-
orgId: z2.string().describe("Organization
|
|
206
|
+
orgId: z2.string().describe("Organization slug")
|
|
207
207
|
}),
|
|
208
208
|
(params) => call(cloud.orgs[":orgId"].projects.$get({ param: params }))
|
|
209
209
|
),
|
|
210
210
|
create: withSchema(
|
|
211
211
|
z2.object({
|
|
212
|
-
orgId: z2.string().describe("Organization
|
|
212
|
+
orgId: z2.string().describe("Organization slug"),
|
|
213
213
|
name: z2.string().describe("Project name"),
|
|
214
214
|
slug: z2.string().describe("URL slug (lowercase, hyphens only)")
|
|
215
215
|
}),
|
|
@@ -220,22 +220,22 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
220
220
|
),
|
|
221
221
|
get: withSchema(
|
|
222
222
|
z2.object({
|
|
223
|
-
orgId: z2.string().describe("Organization
|
|
224
|
-
projectId: z2.string().describe("Project
|
|
223
|
+
orgId: z2.string().describe("Organization slug"),
|
|
224
|
+
projectId: z2.string().describe("Project name")
|
|
225
225
|
}),
|
|
226
226
|
(params) => call(cloud.orgs[":orgId"].projects[":projectId"].$get({ param: params }))
|
|
227
227
|
),
|
|
228
228
|
delete: withSchema(
|
|
229
229
|
z2.object({
|
|
230
|
-
orgId: z2.string().describe("Organization
|
|
231
|
-
projectId: z2.string().describe("Project
|
|
230
|
+
orgId: z2.string().describe("Organization slug"),
|
|
231
|
+
projectId: z2.string().describe("Project name")
|
|
232
232
|
}),
|
|
233
233
|
(params) => call(cloud.orgs[":orgId"].projects[":projectId"].$delete({ param: params }))
|
|
234
234
|
),
|
|
235
235
|
update: withSchema(
|
|
236
236
|
z2.object({
|
|
237
|
-
orgId: z2.string().describe("Organization
|
|
238
|
-
projectId: z2.string().describe("Project
|
|
237
|
+
orgId: z2.string().describe("Organization slug"),
|
|
238
|
+
projectId: z2.string().describe("Project name"),
|
|
239
239
|
name: z2.string().optional().describe("New project name"),
|
|
240
240
|
metadata: z2.record(z2.unknown()).optional().describe("Per-project UI settings")
|
|
241
241
|
}),
|
|
@@ -251,15 +251,15 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
251
251
|
),
|
|
252
252
|
listMembers: withSchema(
|
|
253
253
|
z2.object({
|
|
254
|
-
orgId: z2.string().describe("Organization
|
|
255
|
-
projectId: z2.string().describe("Project
|
|
254
|
+
orgId: z2.string().describe("Organization slug"),
|
|
255
|
+
projectId: z2.string().describe("Project name")
|
|
256
256
|
}),
|
|
257
257
|
(params) => call(cloud.orgs[":orgId"].projects[":projectId"].members.$get({ param: params }))
|
|
258
258
|
),
|
|
259
259
|
addMember: withSchema(
|
|
260
260
|
z2.object({
|
|
261
|
-
orgId: z2.string().describe("Organization
|
|
262
|
-
projectId: z2.string().describe("Project
|
|
261
|
+
orgId: z2.string().describe("Organization slug"),
|
|
262
|
+
projectId: z2.string().describe("Project name"),
|
|
263
263
|
userId: z2.string().describe("User ID"),
|
|
264
264
|
role: z2.enum(["owner", "admin", "member", "viewer"]).optional().describe("Role (owner|admin|member|viewer)"),
|
|
265
265
|
envName: z2.string().optional().describe("Optional env scope; omit for project-wide access")
|
|
@@ -276,8 +276,8 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
276
276
|
),
|
|
277
277
|
removeMember: withSchema(
|
|
278
278
|
z2.object({
|
|
279
|
-
orgId: z2.string().describe("Organization
|
|
280
|
-
projectId: z2.string().describe("Project
|
|
279
|
+
orgId: z2.string().describe("Organization slug"),
|
|
280
|
+
projectId: z2.string().describe("Project name"),
|
|
281
281
|
userId: z2.string().describe("User ID")
|
|
282
282
|
}),
|
|
283
283
|
(params) => call(
|
|
@@ -288,8 +288,8 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
288
288
|
),
|
|
289
289
|
updateCellScopes: withSchema(
|
|
290
290
|
z2.object({
|
|
291
|
-
orgId: z2.string().describe("Organization
|
|
292
|
-
projectId: z2.string().describe("Project
|
|
291
|
+
orgId: z2.string().describe("Organization slug"),
|
|
292
|
+
projectId: z2.string().describe("Project name"),
|
|
293
293
|
userId: z2.string().describe("User ID"),
|
|
294
294
|
cellScopes: z2.union([z2.array(z2.string()), z2.null()]).describe("null = all cells; array = restrict to listed cell-label values")
|
|
295
295
|
}),
|
|
@@ -305,8 +305,8 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
305
305
|
),
|
|
306
306
|
listTokens: withSchema(
|
|
307
307
|
z2.object({
|
|
308
|
-
orgId: z2.string().describe("Organization
|
|
309
|
-
projectId: z2.string().describe("Project
|
|
308
|
+
orgId: z2.string().describe("Organization slug"),
|
|
309
|
+
projectId: z2.string().describe("Project name")
|
|
310
310
|
}),
|
|
311
311
|
(params) => call(
|
|
312
312
|
hc(
|
|
@@ -317,8 +317,8 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
317
317
|
),
|
|
318
318
|
createToken: withSchema(
|
|
319
319
|
z2.object({
|
|
320
|
-
orgId: z2.string().describe("Organization
|
|
321
|
-
projectId: z2.string().describe("Project
|
|
320
|
+
orgId: z2.string().describe("Organization slug"),
|
|
321
|
+
projectId: z2.string().describe("Project name"),
|
|
322
322
|
name: z2.string().describe("Token name"),
|
|
323
323
|
role: z2.enum(["owner", "admin", "member", "viewer"]).optional().describe("Role (owner|admin|member|viewer)"),
|
|
324
324
|
expiresAt: z2.string().optional().describe("Expiry timestamp (ISO 8601)"),
|
|
@@ -339,8 +339,8 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
339
339
|
),
|
|
340
340
|
revokeToken: withSchema(
|
|
341
341
|
z2.object({
|
|
342
|
-
orgId: z2.string().describe("Organization
|
|
343
|
-
projectId: z2.string().describe("Project
|
|
342
|
+
orgId: z2.string().describe("Organization slug"),
|
|
343
|
+
projectId: z2.string().describe("Project name"),
|
|
344
344
|
tokenId: z2.string().describe("Token ID")
|
|
345
345
|
}),
|
|
346
346
|
(params) => call(
|
|
@@ -359,7 +359,7 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
|
|
|
359
359
|
nuke: withSchema(
|
|
360
360
|
z2.object({
|
|
361
361
|
orgId: z2.string().describe("Organization slug"),
|
|
362
|
-
projectId: z2.string().describe("Project
|
|
362
|
+
projectId: z2.string().describe("Project name to nuke")
|
|
363
363
|
}),
|
|
364
364
|
async (params) => {
|
|
365
365
|
const url = `${baseUrl}/${encodeURIComponent(params.orgId)}/${encodeURIComponent(params.projectId)}/nuke`;
|
|
@@ -396,14 +396,14 @@ function createEntityTypesClient(proj) {
|
|
|
396
396
|
list: withSchema(
|
|
397
397
|
z3.object({
|
|
398
398
|
orgId: z3.string().describe("Organization slug"),
|
|
399
|
-
projectId: z3.string().describe("Project
|
|
399
|
+
projectId: z3.string().describe("Project name")
|
|
400
400
|
}),
|
|
401
401
|
(params) => call(proj(params.orgId, params.projectId)["entity-types"].$get())
|
|
402
402
|
),
|
|
403
403
|
get: withSchema(
|
|
404
404
|
z3.object({
|
|
405
405
|
orgId: z3.string().describe("Organization slug"),
|
|
406
|
-
projectId: z3.string().describe("Project
|
|
406
|
+
projectId: z3.string().describe("Project name"),
|
|
407
407
|
name: z3.string().describe("Entity type name")
|
|
408
408
|
}),
|
|
409
409
|
(params) => call(proj(params.orgId, params.projectId)["entity-types"][":name"].$get({ param: { name: params.name } }))
|
|
@@ -411,7 +411,7 @@ function createEntityTypesClient(proj) {
|
|
|
411
411
|
create: withSchema(
|
|
412
412
|
EntityTypeSchema.extend({
|
|
413
413
|
orgId: z3.string().describe("Organization slug"),
|
|
414
|
-
projectId: z3.string().describe("Project
|
|
414
|
+
projectId: z3.string().describe("Project name")
|
|
415
415
|
}),
|
|
416
416
|
(params) => {
|
|
417
417
|
const { orgId, projectId, ...body } = params;
|
|
@@ -421,7 +421,7 @@ function createEntityTypesClient(proj) {
|
|
|
421
421
|
update: withSchema(
|
|
422
422
|
EntityTypeSchema.extend({
|
|
423
423
|
orgId: z3.string().describe("Organization slug"),
|
|
424
|
-
projectId: z3.string().describe("Project
|
|
424
|
+
projectId: z3.string().describe("Project name")
|
|
425
425
|
}),
|
|
426
426
|
(params) => {
|
|
427
427
|
const { orgId, projectId, ...body } = params;
|
|
@@ -433,7 +433,7 @@ function createEntityTypesClient(proj) {
|
|
|
433
433
|
delete: withSchema(
|
|
434
434
|
z3.object({
|
|
435
435
|
orgId: z3.string().describe("Organization slug"),
|
|
436
|
-
projectId: z3.string().describe("Project
|
|
436
|
+
projectId: z3.string().describe("Project name"),
|
|
437
437
|
name: z3.string().describe("Entity type name")
|
|
438
438
|
}),
|
|
439
439
|
(params) => call(
|
|
@@ -447,11 +447,10 @@ function createEntitiesClient(projEnv) {
|
|
|
447
447
|
list: withSchema(
|
|
448
448
|
z3.object({
|
|
449
449
|
orgId: z3.string().describe("Organization slug"),
|
|
450
|
-
projectId: z3.string().describe("Project
|
|
450
|
+
projectId: z3.string().describe("Project name"),
|
|
451
451
|
envName: z3.string().describe("Environment name"),
|
|
452
452
|
entityType: z3.string().optional().describe("Filter by entity type"),
|
|
453
453
|
state: z3.string().optional().describe("Filter by state"),
|
|
454
|
-
pool: z3.string().optional().describe("Filter by pool membership"),
|
|
455
454
|
limit: z3.coerce.number().int().min(1).max(100).optional().describe("Max results (1-100)"),
|
|
456
455
|
cursor: z3.string().optional().describe("Pagination cursor")
|
|
457
456
|
}),
|
|
@@ -465,16 +464,16 @@ function createEntitiesClient(projEnv) {
|
|
|
465
464
|
get: withSchema(
|
|
466
465
|
z3.object({
|
|
467
466
|
orgId: z3.string().describe("Organization slug"),
|
|
468
|
-
projectId: z3.string().describe("Project
|
|
467
|
+
projectId: z3.string().describe("Project name"),
|
|
469
468
|
envName: z3.string().describe("Environment name"),
|
|
470
|
-
|
|
469
|
+
name: z3.string().describe("Entity name")
|
|
471
470
|
}),
|
|
472
|
-
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["entities"][":
|
|
471
|
+
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["entities"][":name"].$get({ param: { name: params.name } }))
|
|
473
472
|
),
|
|
474
473
|
create: withSchema(
|
|
475
474
|
EntitySchema.extend({
|
|
476
475
|
orgId: z3.string().describe("Organization slug"),
|
|
477
|
-
projectId: z3.string().describe("Project
|
|
476
|
+
projectId: z3.string().describe("Project name"),
|
|
478
477
|
envName: z3.string().describe("Environment name")
|
|
479
478
|
}),
|
|
480
479
|
(params) => {
|
|
@@ -485,28 +484,28 @@ function createEntitiesClient(projEnv) {
|
|
|
485
484
|
delete: withSchema(
|
|
486
485
|
z3.object({
|
|
487
486
|
orgId: z3.string().describe("Organization slug"),
|
|
488
|
-
projectId: z3.string().describe("Project
|
|
487
|
+
projectId: z3.string().describe("Project name"),
|
|
489
488
|
envName: z3.string().describe("Environment name"),
|
|
490
|
-
|
|
489
|
+
name: z3.string().describe("Entity name")
|
|
491
490
|
}),
|
|
492
491
|
(params) => call(
|
|
493
|
-
projEnv(params.orgId, params.projectId, params.envName)["entities"][":
|
|
492
|
+
projEnv(params.orgId, params.projectId, params.envName)["entities"][":name"].$delete({ param: { name: params.name } })
|
|
494
493
|
)
|
|
495
494
|
),
|
|
496
495
|
setMetric: withSchema(
|
|
497
496
|
z3.object({
|
|
498
497
|
orgId: z3.string().describe("Organization slug"),
|
|
499
|
-
projectId: z3.string().describe("Project
|
|
498
|
+
projectId: z3.string().describe("Project name"),
|
|
500
499
|
envName: z3.string().describe("Environment name"),
|
|
501
|
-
|
|
500
|
+
name: z3.string().describe("Entity name"),
|
|
502
501
|
metricName: z3.string().describe("Metric name"),
|
|
503
502
|
value: z3.number().describe("Metric value")
|
|
504
503
|
}),
|
|
505
504
|
(params) => {
|
|
506
|
-
const { orgId, projectId, envName,
|
|
505
|
+
const { orgId, projectId, envName, name, metricName, value } = params;
|
|
507
506
|
return call(
|
|
508
|
-
projEnv(orgId, projectId, envName)["entities"][":
|
|
509
|
-
param: {
|
|
507
|
+
projEnv(orgId, projectId, envName)["entities"][":name"]["metrics"][":metricName"].$put({
|
|
508
|
+
param: { name, metricName },
|
|
510
509
|
json: { value }
|
|
511
510
|
})
|
|
512
511
|
);
|
|
@@ -515,18 +514,18 @@ function createEntitiesClient(projEnv) {
|
|
|
515
514
|
trigger: withSchema(
|
|
516
515
|
z3.object({
|
|
517
516
|
orgId: z3.string().describe("Organization slug"),
|
|
518
|
-
projectId: z3.string().describe("Project
|
|
517
|
+
projectId: z3.string().describe("Project name"),
|
|
519
518
|
envName: z3.string().describe("Environment name"),
|
|
520
|
-
|
|
519
|
+
name: z3.string().describe("Entity name"),
|
|
521
520
|
actionName: z3.string().describe("Action name"),
|
|
522
521
|
parameters: z3.record(z3.unknown()).optional().describe("Action parameters as JSON"),
|
|
523
522
|
recommendations: z3.record(z3.string()).optional().describe("Recommendation selections as JSON")
|
|
524
523
|
}).describe("Trigger an instance-scope action on a single entity"),
|
|
525
524
|
(params) => {
|
|
526
|
-
const { orgId, projectId, envName,
|
|
525
|
+
const { orgId, projectId, envName, name, actionName, parameters, recommendations } = params;
|
|
527
526
|
return call(
|
|
528
|
-
projEnv(orgId, projectId, envName)["entities"][":
|
|
529
|
-
param: {
|
|
527
|
+
projEnv(orgId, projectId, envName)["entities"][":name"]["actions"][":actionName"].$post({
|
|
528
|
+
param: { name, actionName },
|
|
530
529
|
json: { parameters, recommendations }
|
|
531
530
|
})
|
|
532
531
|
);
|
|
@@ -535,24 +534,24 @@ function createEntitiesClient(projEnv) {
|
|
|
535
534
|
getMetrics: withSchema(
|
|
536
535
|
z3.object({
|
|
537
536
|
orgId: z3.string().describe("Organization slug"),
|
|
538
|
-
projectId: z3.string().describe("Project
|
|
537
|
+
projectId: z3.string().describe("Project name"),
|
|
539
538
|
envName: z3.string().describe("Environment name"),
|
|
540
|
-
|
|
539
|
+
name: z3.string().describe("Entity name")
|
|
541
540
|
}),
|
|
542
|
-
(params) => call(projEnv(params.orgId, params.projectId, params.envName).entities[":
|
|
541
|
+
(params) => call(projEnv(params.orgId, params.projectId, params.envName).entities[":name"].metrics.$get({ param: { name: params.name } }))
|
|
543
542
|
),
|
|
544
543
|
getMetricsBatch: withSchema(
|
|
545
544
|
z3.object({
|
|
546
545
|
orgId: z3.string().describe("Organization slug"),
|
|
547
|
-
projectId: z3.string().describe("Project
|
|
546
|
+
projectId: z3.string().describe("Project name"),
|
|
548
547
|
envName: z3.string().describe("Environment name"),
|
|
549
|
-
|
|
548
|
+
names: z3.array(z3.string()).min(1).max(500).describe("Entity names to fetch metrics for (max 500)")
|
|
550
549
|
}),
|
|
551
550
|
(params) => {
|
|
552
|
-
const { orgId, projectId, envName,
|
|
551
|
+
const { orgId, projectId, envName, names } = params;
|
|
553
552
|
return call(
|
|
554
553
|
projEnv(orgId, projectId, envName).entities.metrics.$get({
|
|
555
|
-
query: {
|
|
554
|
+
query: { names: names.join(",") }
|
|
556
555
|
})
|
|
557
556
|
);
|
|
558
557
|
}
|
|
@@ -560,26 +559,26 @@ function createEntitiesClient(projEnv) {
|
|
|
560
559
|
getRelationships: withSchema(
|
|
561
560
|
z3.object({
|
|
562
561
|
orgId: z3.string().describe("Organization slug"),
|
|
563
|
-
projectId: z3.string().describe("Project
|
|
562
|
+
projectId: z3.string().describe("Project name"),
|
|
564
563
|
envName: z3.string().describe("Environment name"),
|
|
565
|
-
|
|
564
|
+
name: z3.string().describe("Entity name")
|
|
566
565
|
}),
|
|
567
|
-
(params) => call(projEnv(params.orgId, params.projectId, params.envName).entities[":
|
|
566
|
+
(params) => call(projEnv(params.orgId, params.projectId, params.envName).entities[":name"].relationships.$get({ param: { name: params.name } }))
|
|
568
567
|
),
|
|
569
568
|
syncStamp: withSchema(
|
|
570
569
|
z3.object({
|
|
571
570
|
orgId: z3.string().describe("Organization slug"),
|
|
572
|
-
projectId: z3.string().describe("Project
|
|
571
|
+
projectId: z3.string().describe("Project name"),
|
|
573
572
|
envName: z3.string().describe("Environment name"),
|
|
574
|
-
|
|
573
|
+
name: z3.string().describe("Entity name"),
|
|
575
574
|
source: z3.string().min(1).describe("Source-of-truth name (e.g. argo, k8s, aws)"),
|
|
576
575
|
observedAt: z3.string().datetime().optional().describe("ISO-8601 observation timestamp; defaults to server time")
|
|
577
576
|
}),
|
|
578
577
|
(params) => {
|
|
579
|
-
const { orgId, projectId, envName,
|
|
578
|
+
const { orgId, projectId, envName, name, source, observedAt } = params;
|
|
580
579
|
return call(
|
|
581
|
-
projEnv(orgId, projectId, envName)["entities"][":
|
|
582
|
-
param: {
|
|
580
|
+
projEnv(orgId, projectId, envName)["entities"][":name"]["sync-stamp"].$post({
|
|
581
|
+
param: { name },
|
|
583
582
|
json: { source, observedAt }
|
|
584
583
|
})
|
|
585
584
|
);
|
|
@@ -757,14 +756,14 @@ function createRelationshipTypesClient(proj) {
|
|
|
757
756
|
list: withSchema(
|
|
758
757
|
z6.object({
|
|
759
758
|
orgId: z6.string().describe("Organization slug"),
|
|
760
|
-
projectId: z6.string().describe("Project
|
|
759
|
+
projectId: z6.string().describe("Project name")
|
|
761
760
|
}),
|
|
762
761
|
(params) => call(proj(params.orgId, params.projectId)["relationship-types"].$get())
|
|
763
762
|
),
|
|
764
763
|
get: withSchema(
|
|
765
764
|
z6.object({
|
|
766
765
|
orgId: z6.string().describe("Organization slug"),
|
|
767
|
-
projectId: z6.string().describe("Project
|
|
766
|
+
projectId: z6.string().describe("Project name"),
|
|
768
767
|
name: z6.string().describe("Relationship type name")
|
|
769
768
|
}),
|
|
770
769
|
(params) => call(
|
|
@@ -776,7 +775,7 @@ function createRelationshipTypesClient(proj) {
|
|
|
776
775
|
create: withSchema(
|
|
777
776
|
RelationshipTypeSchema.extend({
|
|
778
777
|
orgId: z6.string().describe("Organization slug"),
|
|
779
|
-
projectId: z6.string().describe("Project
|
|
778
|
+
projectId: z6.string().describe("Project name")
|
|
780
779
|
}),
|
|
781
780
|
(params) => {
|
|
782
781
|
const { orgId, projectId, ...body } = params;
|
|
@@ -786,7 +785,7 @@ function createRelationshipTypesClient(proj) {
|
|
|
786
785
|
update: withSchema(
|
|
787
786
|
RelationshipTypeSchema.extend({
|
|
788
787
|
orgId: z6.string().describe("Organization slug"),
|
|
789
|
-
projectId: z6.string().describe("Project
|
|
788
|
+
projectId: z6.string().describe("Project name")
|
|
790
789
|
}),
|
|
791
790
|
(params) => {
|
|
792
791
|
const { orgId, projectId, ...body } = params;
|
|
@@ -801,7 +800,7 @@ function createRelationshipTypesClient(proj) {
|
|
|
801
800
|
delete: withSchema(
|
|
802
801
|
z6.object({
|
|
803
802
|
orgId: z6.string().describe("Organization slug"),
|
|
804
|
-
projectId: z6.string().describe("Project
|
|
803
|
+
projectId: z6.string().describe("Project name"),
|
|
805
804
|
name: z6.string().describe("Relationship type name")
|
|
806
805
|
}),
|
|
807
806
|
(params) => call(
|
|
@@ -817,14 +816,14 @@ function createRelationshipsClient(projEnv) {
|
|
|
817
816
|
list: withSchema(
|
|
818
817
|
z6.object({
|
|
819
818
|
orgId: z6.string().describe("Organization slug"),
|
|
820
|
-
projectId: z6.string().describe("Project
|
|
819
|
+
projectId: z6.string().describe("Project name"),
|
|
821
820
|
envName: z6.string().describe("Environment name"),
|
|
822
821
|
relationshipType: z6.string().optional().describe("Filter by relationship type"),
|
|
823
822
|
state: z6.string().optional().describe("Filter by state"),
|
|
824
823
|
fromEntity: z6.string().uuid().optional().describe("Filter by from-entity ID"),
|
|
825
824
|
toEntity: z6.string().uuid().optional().describe("Filter by to-entity ID"),
|
|
826
|
-
|
|
827
|
-
|
|
825
|
+
fromEntityCell: z6.string().optional().describe("Filter by from-entity cell membership"),
|
|
826
|
+
toEntityCell: z6.string().optional().describe("Filter by to-entity cell membership"),
|
|
828
827
|
limit: z6.coerce.number().int().min(1).max(100).optional().describe("Max results (1-100)")
|
|
829
828
|
}),
|
|
830
829
|
(params) => {
|
|
@@ -837,7 +836,7 @@ function createRelationshipsClient(projEnv) {
|
|
|
837
836
|
get: withSchema(
|
|
838
837
|
z6.object({
|
|
839
838
|
orgId: z6.string().describe("Organization slug"),
|
|
840
|
-
projectId: z6.string().describe("Project
|
|
839
|
+
projectId: z6.string().describe("Project name"),
|
|
841
840
|
envName: z6.string().describe("Environment name"),
|
|
842
841
|
id: z6.string().uuid().describe("Relationship ID")
|
|
843
842
|
}),
|
|
@@ -848,7 +847,7 @@ function createRelationshipsClient(projEnv) {
|
|
|
848
847
|
create: withSchema(
|
|
849
848
|
RelationshipSchema.extend({
|
|
850
849
|
orgId: z6.string().describe("Organization slug"),
|
|
851
|
-
projectId: z6.string().describe("Project
|
|
850
|
+
projectId: z6.string().describe("Project name"),
|
|
852
851
|
envName: z6.string().describe("Environment name")
|
|
853
852
|
}),
|
|
854
853
|
(params) => {
|
|
@@ -859,7 +858,7 @@ function createRelationshipsClient(projEnv) {
|
|
|
859
858
|
delete: withSchema(
|
|
860
859
|
z6.object({
|
|
861
860
|
orgId: z6.string().describe("Organization slug"),
|
|
862
|
-
projectId: z6.string().describe("Project
|
|
861
|
+
projectId: z6.string().describe("Project name"),
|
|
863
862
|
envName: z6.string().describe("Environment name"),
|
|
864
863
|
id: z6.string().uuid().describe("Relationship ID")
|
|
865
864
|
}),
|
|
@@ -1077,14 +1076,18 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1077
1076
|
return {
|
|
1078
1077
|
connect: withSchema(
|
|
1079
1078
|
z9.object({
|
|
1080
|
-
projectId: z9.string().describe("Project
|
|
1079
|
+
projectId: z9.string().describe("Project name")
|
|
1081
1080
|
}),
|
|
1081
|
+
// why: the install-url route has a "GitHub App not configured" branch
|
|
1082
|
+
// that returns a bare `new Response(...)` (see notConfiguredResponse in
|
|
1083
|
+
// @terrantula/github), which defeats Hono RPC JSON-body inference and
|
|
1084
|
+
// collapses the success type to `unknown`. The 200 body is { url }.
|
|
1082
1085
|
(params) => call(cloud.github["install-url"].$post({ json: params }))
|
|
1083
1086
|
),
|
|
1084
1087
|
installations: {
|
|
1085
1088
|
list: withSchema(
|
|
1086
1089
|
z9.object({
|
|
1087
|
-
orgId: z9.string().describe("Organization
|
|
1090
|
+
orgId: z9.string().describe("Organization slug")
|
|
1088
1091
|
}),
|
|
1089
1092
|
(params) => call(cloud.github.installations.$get({ query: params }))
|
|
1090
1093
|
),
|
|
@@ -1110,17 +1113,20 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1110
1113
|
),
|
|
1111
1114
|
recover: withSchema(
|
|
1112
1115
|
z9.object({
|
|
1113
|
-
orgId: z9.string().describe("Organization
|
|
1116
|
+
orgId: z9.string().describe("Organization slug"),
|
|
1114
1117
|
installationId: z9.number().int().positive().describe("GitHub installation ID (from the GitHub install URL)")
|
|
1115
1118
|
}),
|
|
1119
|
+
// why: same bare-Response inference break as `connect` (the route's
|
|
1120
|
+
// not-configured branch returns `new Response(...)`), so the 200 body
|
|
1121
|
+
// type collapses to `unknown`. The success body is the claimed row.
|
|
1116
1122
|
(params) => call(cloud.github.installations.recover.$post({ json: params }))
|
|
1117
1123
|
)
|
|
1118
1124
|
},
|
|
1119
1125
|
projects: {
|
|
1120
1126
|
list: withSchema(
|
|
1121
1127
|
z9.object({
|
|
1122
|
-
orgId: z9.string().describe("Organization
|
|
1123
|
-
projectId: z9.string().describe("Project
|
|
1128
|
+
orgId: z9.string().describe("Organization slug"),
|
|
1129
|
+
projectId: z9.string().describe("Project name")
|
|
1124
1130
|
}),
|
|
1125
1131
|
(params) => call(
|
|
1126
1132
|
cloud.orgs[":orgId"].projects[":projectId"]["github-repos"].$get({
|
|
@@ -1130,8 +1136,8 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1130
1136
|
),
|
|
1131
1137
|
linkRepo: withSchema(
|
|
1132
1138
|
z9.object({
|
|
1133
|
-
orgId: z9.string().describe("Organization
|
|
1134
|
-
projectId: z9.string().describe("Project
|
|
1139
|
+
orgId: z9.string().describe("Organization slug"),
|
|
1140
|
+
projectId: z9.string().describe("Project name"),
|
|
1135
1141
|
installationId: z9.string().describe("github_installations.id (UUID)"),
|
|
1136
1142
|
repoFullName: z9.string().describe('GitHub repo "owner/name"')
|
|
1137
1143
|
}),
|
|
@@ -1147,8 +1153,8 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1147
1153
|
),
|
|
1148
1154
|
unlinkRepo: withSchema(
|
|
1149
1155
|
z9.object({
|
|
1150
|
-
orgId: z9.string().describe("Organization
|
|
1151
|
-
projectId: z9.string().describe("Project
|
|
1156
|
+
orgId: z9.string().describe("Organization slug"),
|
|
1157
|
+
projectId: z9.string().describe("Project name"),
|
|
1152
1158
|
id: z9.string().describe("project_github_repos.id (UUID) \u2014 returned by linkRepo")
|
|
1153
1159
|
}),
|
|
1154
1160
|
(params) => call(
|
|
@@ -1314,7 +1320,7 @@ function createAuditEventsClient(proj) {
|
|
|
1314
1320
|
list: withSchema(
|
|
1315
1321
|
z13.object({
|
|
1316
1322
|
orgId: z13.string().describe("Organization slug"),
|
|
1317
|
-
projectId: z13.string().describe("Project
|
|
1323
|
+
projectId: z13.string().describe("Project name"),
|
|
1318
1324
|
envName: z13.string().optional().describe("Filter to a single env"),
|
|
1319
1325
|
actorType: z13.enum(["user", "token"]).optional().describe("Filter by actor type"),
|
|
1320
1326
|
actorId: z13.string().optional().describe("Filter by actor (user.id or apikey.id)"),
|
|
@@ -1338,14 +1344,14 @@ function createEnvironmentsClient(proj) {
|
|
|
1338
1344
|
list: withSchema(
|
|
1339
1345
|
z14.object({
|
|
1340
1346
|
orgId: z14.string().describe("Organization slug"),
|
|
1341
|
-
projectId: z14.string().describe("Project
|
|
1347
|
+
projectId: z14.string().describe("Project name")
|
|
1342
1348
|
}),
|
|
1343
1349
|
(params) => call(proj(params.orgId, params.projectId)["environments"].$get())
|
|
1344
1350
|
),
|
|
1345
1351
|
create: withSchema(
|
|
1346
1352
|
z14.object({
|
|
1347
1353
|
orgId: z14.string().describe("Organization slug"),
|
|
1348
|
-
projectId: z14.string().describe("Project
|
|
1354
|
+
projectId: z14.string().describe("Project name"),
|
|
1349
1355
|
name: z14.string().min(1).max(31).regex(/^[a-z0-9][a-z0-9-]{0,30}$/).describe("Environment name (lowercase letters, digits, hyphens; max 31 chars)")
|
|
1350
1356
|
}),
|
|
1351
1357
|
(params) => {
|
|
@@ -1356,7 +1362,7 @@ function createEnvironmentsClient(proj) {
|
|
|
1356
1362
|
delete: withSchema(
|
|
1357
1363
|
z14.object({
|
|
1358
1364
|
orgId: z14.string().describe("Organization slug"),
|
|
1359
|
-
projectId: z14.string().describe("Project
|
|
1365
|
+
projectId: z14.string().describe("Project name"),
|
|
1360
1366
|
name: z14.string().describe("Environment name")
|
|
1361
1367
|
}),
|
|
1362
1368
|
(params) => call(
|
|
@@ -1375,11 +1381,11 @@ function createDriftEventsClient(projEnv) {
|
|
|
1375
1381
|
list: withSchema(
|
|
1376
1382
|
z15.object({
|
|
1377
1383
|
orgId: z15.string().describe("Organization slug"),
|
|
1378
|
-
projectId: z15.string().describe("Project
|
|
1384
|
+
projectId: z15.string().describe("Project name"),
|
|
1379
1385
|
envName: z15.string().describe("Environment name"),
|
|
1380
1386
|
status: z15.enum(["open", "accepted", "reapplied", "snoozed"]).optional(),
|
|
1381
1387
|
kind: z15.string().optional().describe("Filter by entity type name"),
|
|
1382
|
-
|
|
1388
|
+
entityName: z15.string().optional().describe("Filter by entity name"),
|
|
1383
1389
|
since: z15.string().optional().describe("ISO timestamp lower bound on detectedAt"),
|
|
1384
1390
|
limit: z15.coerce.number().int().min(1).max(500).optional()
|
|
1385
1391
|
}),
|
|
@@ -1393,7 +1399,7 @@ function createDriftEventsClient(projEnv) {
|
|
|
1393
1399
|
count: withSchema(
|
|
1394
1400
|
z15.object({
|
|
1395
1401
|
orgId: z15.string().describe("Organization slug"),
|
|
1396
|
-
projectId: z15.string().describe("Project
|
|
1402
|
+
projectId: z15.string().describe("Project name"),
|
|
1397
1403
|
envName: z15.string().describe("Environment name")
|
|
1398
1404
|
}),
|
|
1399
1405
|
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["drift-events"].count.$get())
|
|
@@ -1401,7 +1407,7 @@ function createDriftEventsClient(projEnv) {
|
|
|
1401
1407
|
get: withSchema(
|
|
1402
1408
|
z15.object({
|
|
1403
1409
|
orgId: z15.string().describe("Organization slug"),
|
|
1404
|
-
projectId: z15.string().describe("Project
|
|
1410
|
+
projectId: z15.string().describe("Project name"),
|
|
1405
1411
|
envName: z15.string().describe("Environment name"),
|
|
1406
1412
|
id: z15.string().uuid()
|
|
1407
1413
|
}),
|
|
@@ -1414,7 +1420,7 @@ function createDriftEventsClient(projEnv) {
|
|
|
1414
1420
|
accept: withSchema(
|
|
1415
1421
|
z15.object({
|
|
1416
1422
|
orgId: z15.string().describe("Organization slug"),
|
|
1417
|
-
projectId: z15.string().describe("Project
|
|
1423
|
+
projectId: z15.string().describe("Project name"),
|
|
1418
1424
|
envName: z15.string().describe("Environment name"),
|
|
1419
1425
|
id: z15.string().uuid()
|
|
1420
1426
|
}),
|
|
@@ -1427,7 +1433,7 @@ function createDriftEventsClient(projEnv) {
|
|
|
1427
1433
|
reapply: withSchema(
|
|
1428
1434
|
z15.object({
|
|
1429
1435
|
orgId: z15.string().describe("Organization slug"),
|
|
1430
|
-
projectId: z15.string().describe("Project
|
|
1436
|
+
projectId: z15.string().describe("Project name"),
|
|
1431
1437
|
envName: z15.string().describe("Environment name"),
|
|
1432
1438
|
id: z15.string().uuid()
|
|
1433
1439
|
}),
|
|
@@ -1440,7 +1446,7 @@ function createDriftEventsClient(projEnv) {
|
|
|
1440
1446
|
snooze: withSchema(
|
|
1441
1447
|
z15.object({
|
|
1442
1448
|
orgId: z15.string().describe("Organization slug"),
|
|
1443
|
-
projectId: z15.string().describe("Project
|
|
1449
|
+
projectId: z15.string().describe("Project name"),
|
|
1444
1450
|
envName: z15.string().describe("Environment name"),
|
|
1445
1451
|
id: z15.string().uuid(),
|
|
1446
1452
|
untilSeconds: z15.number().int().positive().optional()
|
|
@@ -1464,7 +1470,7 @@ function createStatsClient(proj) {
|
|
|
1464
1470
|
entitiesByState: withSchema(
|
|
1465
1471
|
z16.object({
|
|
1466
1472
|
orgId: z16.string().describe("Organization slug"),
|
|
1467
|
-
projectId: z16.string().describe("Project
|
|
1473
|
+
projectId: z16.string().describe("Project name"),
|
|
1468
1474
|
window: WindowSchema,
|
|
1469
1475
|
bucket: BucketSchema
|
|
1470
1476
|
}),
|
|
@@ -1476,7 +1482,7 @@ function createStatsClient(proj) {
|
|
|
1476
1482
|
runsByType: withSchema(
|
|
1477
1483
|
z16.object({
|
|
1478
1484
|
orgId: z16.string().describe("Organization slug"),
|
|
1479
|
-
projectId: z16.string().describe("Project
|
|
1485
|
+
projectId: z16.string().describe("Project name"),
|
|
1480
1486
|
window: WindowSchema
|
|
1481
1487
|
}),
|
|
1482
1488
|
(params) => {
|
|
@@ -1487,7 +1493,7 @@ function createStatsClient(proj) {
|
|
|
1487
1493
|
failingKinds: withSchema(
|
|
1488
1494
|
z16.object({
|
|
1489
1495
|
orgId: z16.string().describe("Organization slug"),
|
|
1490
|
-
projectId: z16.string().describe("Project
|
|
1496
|
+
projectId: z16.string().describe("Project name"),
|
|
1491
1497
|
window: WindowSchema
|
|
1492
1498
|
}),
|
|
1493
1499
|
(params) => {
|
|
@@ -1498,7 +1504,7 @@ function createStatsClient(proj) {
|
|
|
1498
1504
|
driftDensity: withSchema(
|
|
1499
1505
|
z16.object({
|
|
1500
1506
|
orgId: z16.string().describe("Organization slug"),
|
|
1501
|
-
projectId: z16.string().describe("Project
|
|
1507
|
+
projectId: z16.string().describe("Project name"),
|
|
1502
1508
|
dim: z16.string().optional().describe('Dimensions to bucket \u2014 e.g. "kind,cell"')
|
|
1503
1509
|
}),
|
|
1504
1510
|
(params) => {
|
|
@@ -1715,11 +1721,19 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
|
|
|
1715
1721
|
);
|
|
1716
1722
|
return {
|
|
1717
1723
|
get: (key) => call(c[":key"].$get({ param: { key } })),
|
|
1718
|
-
set: (key, value) =>
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1724
|
+
set: (key, value) => (
|
|
1725
|
+
// why: PUT /:key reads the body via c.req.text() (it enforces a 64KB cap
|
|
1726
|
+
// before parsing JSON), so it has no zValidator('json') and the Hono RPC
|
|
1727
|
+
// type doesn't surface a `json` arg. The route does accept a JSON body —
|
|
1728
|
+
// the cast restores the real wire shape the server expects. Switching the
|
|
1729
|
+
// route to zValidator would parse before the size check and break the
|
|
1730
|
+
// 64KB-limit guard, so the fix belongs here.
|
|
1731
|
+
call(
|
|
1732
|
+
c[":key"].$put({
|
|
1733
|
+
param: { key },
|
|
1734
|
+
json: { value }
|
|
1735
|
+
})
|
|
1736
|
+
)
|
|
1723
1737
|
),
|
|
1724
1738
|
delete: (key) => call(c[":key"].$delete({ param: { key } }))
|
|
1725
1739
|
};
|