@terrantula/sdk 0.12.0 → 0.14.0
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-665GEJRV.mjs → chunk-46T35MSS.mjs} +400 -278
- package/dist/index.d.mts +1291 -559
- package/dist/index.d.ts +1291 -559
- package/dist/index.js +400 -278
- package/dist/index.mjs +1 -1
- package/dist/local.d.mts +796 -311
- package/dist/local.d.ts +796 -311
- package/dist/local.js +400 -278
- package/dist/local.mjs +1 -1
- package/dist/{projects-D-LiD32g.d.mts → projects-DmWHHY1a.d.mts} +6 -1
- package/dist/{projects-D-LiD32g.d.ts → projects-DmWHHY1a.d.ts} +6 -1
- package/package.json +3 -3
|
@@ -716,6 +716,18 @@ function createDeploymentTargetSetsClient(proj) {
|
|
|
716
716
|
param: { name: params.name }
|
|
717
717
|
})
|
|
718
718
|
)
|
|
719
|
+
),
|
|
720
|
+
listMembers: withSchema(
|
|
721
|
+
z5.object({
|
|
722
|
+
orgId: z5.string().describe("Organization slug"),
|
|
723
|
+
projectId: z5.string().describe("Project ID"),
|
|
724
|
+
name: z5.string().describe("Deployment target set name")
|
|
725
|
+
}),
|
|
726
|
+
(params) => call(
|
|
727
|
+
proj(params.orgId, params.projectId)["deployment-target-sets"][":name"]["members"].$get({
|
|
728
|
+
param: { name: params.name }
|
|
729
|
+
})
|
|
730
|
+
)
|
|
719
731
|
)
|
|
720
732
|
};
|
|
721
733
|
}
|
|
@@ -1163,13 +1175,73 @@ function createApplyClient(projEnv) {
|
|
|
1163
1175
|
);
|
|
1164
1176
|
}
|
|
1165
1177
|
|
|
1166
|
-
// src/
|
|
1178
|
+
// src/observations.ts
|
|
1167
1179
|
import { z as z10 } from "zod";
|
|
1180
|
+
import { ObservationImportPayloadSchema } from "@terrantula/types";
|
|
1181
|
+
async function rawRequest(baseUrl, hcOpts, path, init = {}) {
|
|
1182
|
+
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1183
|
+
const rawHeaders = hcOpts?.headers;
|
|
1184
|
+
const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
|
|
1185
|
+
return fetchImpl(`${baseUrl}${path}`, {
|
|
1186
|
+
...init,
|
|
1187
|
+
headers: {
|
|
1188
|
+
...resolvedHeaders,
|
|
1189
|
+
...init.headers
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
async function callRaw(res) {
|
|
1194
|
+
if (!res.ok) {
|
|
1195
|
+
let message = fallbackMessage(res.status);
|
|
1196
|
+
try {
|
|
1197
|
+
const body = await res.json();
|
|
1198
|
+
if (body.error) message = body.error;
|
|
1199
|
+
} catch {
|
|
1200
|
+
}
|
|
1201
|
+
throw new TerrantulaError(res.status, { error: message });
|
|
1202
|
+
}
|
|
1203
|
+
return res.json();
|
|
1204
|
+
}
|
|
1205
|
+
function createObservationsClient(baseUrl, hcOpts) {
|
|
1206
|
+
return {
|
|
1207
|
+
/**
|
|
1208
|
+
* POST /{orgId}/{projectId}/envs/{envName}/import
|
|
1209
|
+
*
|
|
1210
|
+
* Persists a full observation snapshot (resources + dependency edges)
|
|
1211
|
+
* for a given environment. Requires `data:write` permission.
|
|
1212
|
+
*/
|
|
1213
|
+
importPayload: withSchema(
|
|
1214
|
+
ObservationImportPayloadSchema.extend({
|
|
1215
|
+
orgId: z10.string().describe("Organization slug"),
|
|
1216
|
+
projectId: z10.string().describe("Project ID"),
|
|
1217
|
+
envName: z10.string().describe("Environment name")
|
|
1218
|
+
}),
|
|
1219
|
+
async (params) => {
|
|
1220
|
+
const { orgId, projectId, envName, ...body } = params;
|
|
1221
|
+
return callRaw(
|
|
1222
|
+
await rawRequest(
|
|
1223
|
+
baseUrl,
|
|
1224
|
+
hcOpts,
|
|
1225
|
+
`/${orgId}/${projectId}/envs/${envName}/import`,
|
|
1226
|
+
{
|
|
1227
|
+
method: "POST",
|
|
1228
|
+
headers: { "Content-Type": "application/json" },
|
|
1229
|
+
body: JSON.stringify(body)
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
);
|
|
1233
|
+
}
|
|
1234
|
+
)
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
// src/github.ts
|
|
1239
|
+
import { z as z11 } from "zod";
|
|
1168
1240
|
function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
1169
1241
|
return {
|
|
1170
1242
|
connect: withSchema(
|
|
1171
|
-
|
|
1172
|
-
projectId:
|
|
1243
|
+
z11.object({
|
|
1244
|
+
projectId: z11.string().describe("Project name")
|
|
1173
1245
|
}),
|
|
1174
1246
|
// why: the install-url route has a "GitHub App not configured" branch
|
|
1175
1247
|
// that returns a bare `new Response(...)` (see notConfiguredResponse in
|
|
@@ -1179,14 +1251,14 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1179
1251
|
),
|
|
1180
1252
|
installations: {
|
|
1181
1253
|
list: withSchema(
|
|
1182
|
-
|
|
1183
|
-
orgId:
|
|
1254
|
+
z11.object({
|
|
1255
|
+
orgId: z11.string().describe("Organization slug")
|
|
1184
1256
|
}),
|
|
1185
1257
|
(params) => call(cloud.github.installations.$get({ query: params }))
|
|
1186
1258
|
),
|
|
1187
1259
|
repos: withSchema(
|
|
1188
|
-
|
|
1189
|
-
installationId:
|
|
1260
|
+
z11.object({
|
|
1261
|
+
installationId: z11.string().describe("Installation row ID")
|
|
1190
1262
|
}),
|
|
1191
1263
|
(params) => call(
|
|
1192
1264
|
cloud.github.installations[":installationId"].repos.$get({
|
|
@@ -1195,8 +1267,8 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1195
1267
|
)
|
|
1196
1268
|
),
|
|
1197
1269
|
disconnect: withSchema(
|
|
1198
|
-
|
|
1199
|
-
installationId:
|
|
1270
|
+
z11.object({
|
|
1271
|
+
installationId: z11.string().describe("Installation row ID")
|
|
1200
1272
|
}),
|
|
1201
1273
|
(params) => call(
|
|
1202
1274
|
cloud.github.installations[":installationId"].$delete({
|
|
@@ -1205,9 +1277,9 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1205
1277
|
)
|
|
1206
1278
|
),
|
|
1207
1279
|
recover: withSchema(
|
|
1208
|
-
|
|
1209
|
-
orgId:
|
|
1210
|
-
installationId:
|
|
1280
|
+
z11.object({
|
|
1281
|
+
orgId: z11.string().describe("Organization slug"),
|
|
1282
|
+
installationId: z11.number().int().positive().describe("GitHub installation ID (from the GitHub install URL)")
|
|
1211
1283
|
}),
|
|
1212
1284
|
// why: same bare-Response inference break as `connect` (the route's
|
|
1213
1285
|
// not-configured branch returns `new Response(...)`), so the 200 body
|
|
@@ -1217,9 +1289,9 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1217
1289
|
},
|
|
1218
1290
|
projects: {
|
|
1219
1291
|
list: withSchema(
|
|
1220
|
-
|
|
1221
|
-
orgId:
|
|
1222
|
-
projectId:
|
|
1292
|
+
z11.object({
|
|
1293
|
+
orgId: z11.string().describe("Organization slug"),
|
|
1294
|
+
projectId: z11.string().describe("Project name")
|
|
1223
1295
|
}),
|
|
1224
1296
|
(params) => call(
|
|
1225
1297
|
cloud.orgs[":orgId"].projects[":projectId"]["github-repos"].$get({
|
|
@@ -1228,11 +1300,11 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1228
1300
|
)
|
|
1229
1301
|
),
|
|
1230
1302
|
linkRepo: withSchema(
|
|
1231
|
-
|
|
1232
|
-
orgId:
|
|
1233
|
-
projectId:
|
|
1234
|
-
installationId:
|
|
1235
|
-
repoFullName:
|
|
1303
|
+
z11.object({
|
|
1304
|
+
orgId: z11.string().describe("Organization slug"),
|
|
1305
|
+
projectId: z11.string().describe("Project name"),
|
|
1306
|
+
installationId: z11.string().describe("github_installations.id (UUID)"),
|
|
1307
|
+
repoFullName: z11.string().describe('GitHub repo "owner/name"')
|
|
1236
1308
|
}),
|
|
1237
1309
|
(params) => {
|
|
1238
1310
|
const { orgId, projectId, ...body } = params;
|
|
@@ -1245,10 +1317,10 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1245
1317
|
}
|
|
1246
1318
|
),
|
|
1247
1319
|
unlinkRepo: withSchema(
|
|
1248
|
-
|
|
1249
|
-
orgId:
|
|
1250
|
-
projectId:
|
|
1251
|
-
id:
|
|
1320
|
+
z11.object({
|
|
1321
|
+
orgId: z11.string().describe("Organization slug"),
|
|
1322
|
+
projectId: z11.string().describe("Project name"),
|
|
1323
|
+
id: z11.string().describe("project_github_repos.id (UUID) \u2014 returned by linkRepo")
|
|
1252
1324
|
}),
|
|
1253
1325
|
(params) => call(
|
|
1254
1326
|
cloud.orgs[":orgId"].projects[":projectId"]["github-repos"][":id"].$delete({
|
|
@@ -1261,23 +1333,23 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
|
|
|
1261
1333
|
}
|
|
1262
1334
|
|
|
1263
1335
|
// src/blueprints.ts
|
|
1264
|
-
import { z as
|
|
1265
|
-
var SpinInputSchema =
|
|
1266
|
-
orgId:
|
|
1267
|
-
blueprint:
|
|
1268
|
-
substrate:
|
|
1269
|
-
repo:
|
|
1270
|
-
prBase:
|
|
1271
|
-
githubToken:
|
|
1272
|
-
createRepo:
|
|
1273
|
-
createWorkspace:
|
|
1274
|
-
vars:
|
|
1336
|
+
import { z as z12 } from "zod";
|
|
1337
|
+
var SpinInputSchema = z12.object({
|
|
1338
|
+
orgId: z12.string().describe("Organization slug"),
|
|
1339
|
+
blueprint: z12.string().describe("First-party blueprint name (e.g. k8s-fleet)"),
|
|
1340
|
+
substrate: z12.enum(["bare-tf", "tfc", "atmos"]).optional(),
|
|
1341
|
+
repo: z12.string().optional().describe("owner/repo to open the spin PR into (omit when createRepo is set)"),
|
|
1342
|
+
prBase: z12.string().optional(),
|
|
1343
|
+
githubToken: z12.string().optional(),
|
|
1344
|
+
createRepo: z12.object({ name: z12.string(), private: z12.boolean().optional() }).optional().describe("Cloud opt-in: auto-create the target GitHub repo before spinning"),
|
|
1345
|
+
createWorkspace: z12.object({ organization: z12.string(), name: z12.string(), apiToken: z12.string(), apiBaseUrl: z12.string().optional() }).optional().describe("Cloud opt-in: auto-create the TFC workspace shell before spinning"),
|
|
1346
|
+
vars: z12.record(z12.string()).default({})
|
|
1275
1347
|
});
|
|
1276
1348
|
function createBlueprintsClient(cloud) {
|
|
1277
1349
|
return {
|
|
1278
1350
|
list: () => call(cloud.blueprints.$get()),
|
|
1279
1351
|
get: withSchema(
|
|
1280
|
-
|
|
1352
|
+
z12.object({ name: z12.string().describe("Blueprint name") }),
|
|
1281
1353
|
(params) => call(cloud.blueprints[":name"].$get({ param: params }))
|
|
1282
1354
|
),
|
|
1283
1355
|
spin: withSchema(SpinInputSchema, (params) => {
|
|
@@ -1288,7 +1360,7 @@ function createBlueprintsClient(cloud) {
|
|
|
1288
1360
|
}
|
|
1289
1361
|
|
|
1290
1362
|
// src/export.ts
|
|
1291
|
-
import { z as
|
|
1363
|
+
import { z as z13 } from "zod";
|
|
1292
1364
|
var SERVER_FIELDS = /* @__PURE__ */ new Set(["id", "projectId", "envId", "createdAt", "updatedAt"]);
|
|
1293
1365
|
function stripServerFields(row) {
|
|
1294
1366
|
const out = {};
|
|
@@ -1299,10 +1371,10 @@ function stripServerFields(row) {
|
|
|
1299
1371
|
}
|
|
1300
1372
|
function createExportCatalogFn(proj, projEnv) {
|
|
1301
1373
|
return withSchema(
|
|
1302
|
-
|
|
1303
|
-
orgId:
|
|
1304
|
-
projectId:
|
|
1305
|
-
envName:
|
|
1374
|
+
z13.object({
|
|
1375
|
+
orgId: z13.string().describe("Organization slug"),
|
|
1376
|
+
projectId: z13.string().describe("Project ID"),
|
|
1377
|
+
envName: z13.string().describe("Environment name to export secret declarations from")
|
|
1306
1378
|
}).describe("Export every catalog kind as a single apply-shaped payload"),
|
|
1307
1379
|
async (params) => {
|
|
1308
1380
|
const projClient = proj(params.orgId, params.projectId);
|
|
@@ -1352,15 +1424,15 @@ function createExportCatalogFn(proj, projEnv) {
|
|
|
1352
1424
|
}
|
|
1353
1425
|
|
|
1354
1426
|
// src/catalog-revisions.ts
|
|
1355
|
-
import { z as
|
|
1427
|
+
import { z as z14 } from "zod";
|
|
1356
1428
|
function createCatalogRevisionsClient(proj) {
|
|
1357
1429
|
return {
|
|
1358
1430
|
list: withSchema(
|
|
1359
|
-
|
|
1360
|
-
orgId:
|
|
1361
|
-
projectId:
|
|
1362
|
-
limit:
|
|
1363
|
-
before:
|
|
1431
|
+
z14.object({
|
|
1432
|
+
orgId: z14.string().describe("Organization slug"),
|
|
1433
|
+
projectId: z14.string().describe("Project ID"),
|
|
1434
|
+
limit: z14.coerce.number().int().min(1).max(200).optional().describe("Max revisions to return (1-200)"),
|
|
1435
|
+
before: z14.string().datetime().optional().describe("ISO timestamp; only revisions with appliedAt strictly before this are returned (keyset upper-bound)")
|
|
1364
1436
|
}),
|
|
1365
1437
|
(params) => {
|
|
1366
1438
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1370,20 +1442,20 @@ function createCatalogRevisionsClient(proj) {
|
|
|
1370
1442
|
}
|
|
1371
1443
|
),
|
|
1372
1444
|
get: withSchema(
|
|
1373
|
-
|
|
1374
|
-
orgId:
|
|
1375
|
-
projectId:
|
|
1376
|
-
id:
|
|
1445
|
+
z14.object({
|
|
1446
|
+
orgId: z14.string().describe("Organization slug"),
|
|
1447
|
+
projectId: z14.string().describe("Project ID"),
|
|
1448
|
+
id: z14.string().uuid().describe("Revision ID")
|
|
1377
1449
|
}),
|
|
1378
1450
|
(params) => call(
|
|
1379
1451
|
proj(params.orgId, params.projectId)["catalog-revisions"][":id"].$get({ param: { id: params.id } })
|
|
1380
1452
|
)
|
|
1381
1453
|
),
|
|
1382
1454
|
snapshots: withSchema(
|
|
1383
|
-
|
|
1384
|
-
orgId:
|
|
1385
|
-
projectId:
|
|
1386
|
-
id:
|
|
1455
|
+
z14.object({
|
|
1456
|
+
orgId: z14.string().describe("Organization slug"),
|
|
1457
|
+
projectId: z14.string().describe("Project ID"),
|
|
1458
|
+
id: z14.string().uuid().describe("Revision ID to read snapshots for")
|
|
1387
1459
|
}),
|
|
1388
1460
|
(params) => call(
|
|
1389
1461
|
proj(params.orgId, params.projectId)["catalog-revisions"][":id"]["snapshots"].$get({
|
|
@@ -1397,12 +1469,12 @@ function createCatalogRevisionsClient(proj) {
|
|
|
1397
1469
|
* `force: true`, mirroring POST /apply.
|
|
1398
1470
|
*/
|
|
1399
1471
|
rollback: withSchema(
|
|
1400
|
-
|
|
1401
|
-
orgId:
|
|
1402
|
-
projectId:
|
|
1403
|
-
id:
|
|
1404
|
-
hunkId:
|
|
1405
|
-
force:
|
|
1472
|
+
z14.object({
|
|
1473
|
+
orgId: z14.string().describe("Organization slug"),
|
|
1474
|
+
projectId: z14.string().describe("Project ID"),
|
|
1475
|
+
id: z14.string().uuid().describe("Revision ID to roll back to"),
|
|
1476
|
+
hunkId: z14.string().uuid().optional().describe("Single-hunk filter"),
|
|
1477
|
+
force: z14.boolean().optional().describe("Required if the inverse diff is destructive")
|
|
1406
1478
|
}),
|
|
1407
1479
|
(params) => {
|
|
1408
1480
|
const { orgId, projectId, id, hunkId, force } = params;
|
|
@@ -1419,21 +1491,21 @@ function createCatalogRevisionsClient(proj) {
|
|
|
1419
1491
|
}
|
|
1420
1492
|
|
|
1421
1493
|
// src/audit-events.ts
|
|
1422
|
-
import { z as
|
|
1494
|
+
import { z as z15 } from "zod";
|
|
1423
1495
|
function createAuditEventsClient(proj) {
|
|
1424
1496
|
return {
|
|
1425
1497
|
list: withSchema(
|
|
1426
|
-
|
|
1427
|
-
orgId:
|
|
1428
|
-
projectId:
|
|
1429
|
-
envName:
|
|
1430
|
-
actorType:
|
|
1431
|
-
actorId:
|
|
1432
|
-
action:
|
|
1433
|
-
resourceKind:
|
|
1434
|
-
since:
|
|
1435
|
-
before:
|
|
1436
|
-
limit:
|
|
1498
|
+
z15.object({
|
|
1499
|
+
orgId: z15.string().describe("Organization slug"),
|
|
1500
|
+
projectId: z15.string().describe("Project name"),
|
|
1501
|
+
envName: z15.string().optional().describe("Filter to a single env"),
|
|
1502
|
+
actorType: z15.enum(["user", "token"]).optional().describe("Filter by actor type"),
|
|
1503
|
+
actorId: z15.string().optional().describe("Filter by actor (user.id or apikey.id)"),
|
|
1504
|
+
action: z15.string().optional().describe('Comma-separated actions (e.g. "create,delete")'),
|
|
1505
|
+
resourceKind: z15.string().optional().describe("Filter to one resource kind (Entity | Token | Member | \u2026)"),
|
|
1506
|
+
since: z15.string().datetime().optional().describe("ISO timestamp; only events strictly after this are returned"),
|
|
1507
|
+
before: z15.string().datetime().optional().describe("ISO timestamp; only events strictly before this are returned (keyset upper-bound)"),
|
|
1508
|
+
limit: z15.coerce.number().int().min(1).max(500).optional().describe("Max rows (1-500)")
|
|
1437
1509
|
}).describe("List audit events for a project \u2014 auditor-friendly read-only feed"),
|
|
1438
1510
|
(params) => {
|
|
1439
1511
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1444,21 +1516,21 @@ function createAuditEventsClient(proj) {
|
|
|
1444
1516
|
}
|
|
1445
1517
|
|
|
1446
1518
|
// src/environments.ts
|
|
1447
|
-
import { z as
|
|
1519
|
+
import { z as z16 } from "zod";
|
|
1448
1520
|
function createEnvironmentsClient(proj) {
|
|
1449
1521
|
return {
|
|
1450
1522
|
list: withSchema(
|
|
1451
|
-
|
|
1452
|
-
orgId:
|
|
1453
|
-
projectId:
|
|
1523
|
+
z16.object({
|
|
1524
|
+
orgId: z16.string().describe("Organization slug"),
|
|
1525
|
+
projectId: z16.string().describe("Project name")
|
|
1454
1526
|
}),
|
|
1455
1527
|
(params) => call(proj(params.orgId, params.projectId)["environments"].$get())
|
|
1456
1528
|
),
|
|
1457
1529
|
create: withSchema(
|
|
1458
|
-
|
|
1459
|
-
orgId:
|
|
1460
|
-
projectId:
|
|
1461
|
-
name:
|
|
1530
|
+
z16.object({
|
|
1531
|
+
orgId: z16.string().describe("Organization slug"),
|
|
1532
|
+
projectId: z16.string().describe("Project name"),
|
|
1533
|
+
name: z16.string().min(1).max(31).regex(/^[a-z0-9][a-z0-9-]{0,30}$/).describe("Environment name (lowercase letters, digits, hyphens; max 31 chars)")
|
|
1462
1534
|
}),
|
|
1463
1535
|
(params) => {
|
|
1464
1536
|
const { orgId, projectId, name } = params;
|
|
@@ -1466,10 +1538,10 @@ function createEnvironmentsClient(proj) {
|
|
|
1466
1538
|
}
|
|
1467
1539
|
),
|
|
1468
1540
|
delete: withSchema(
|
|
1469
|
-
|
|
1470
|
-
orgId:
|
|
1471
|
-
projectId:
|
|
1472
|
-
name:
|
|
1541
|
+
z16.object({
|
|
1542
|
+
orgId: z16.string().describe("Organization slug"),
|
|
1543
|
+
projectId: z16.string().describe("Project name"),
|
|
1544
|
+
name: z16.string().describe("Environment name")
|
|
1473
1545
|
}),
|
|
1474
1546
|
(params) => call(
|
|
1475
1547
|
proj(params.orgId, params.projectId)["environments"][":envName"].$delete({
|
|
@@ -1481,20 +1553,20 @@ function createEnvironmentsClient(proj) {
|
|
|
1481
1553
|
}
|
|
1482
1554
|
|
|
1483
1555
|
// src/drift-events.ts
|
|
1484
|
-
import { z as
|
|
1556
|
+
import { z as z17 } from "zod";
|
|
1485
1557
|
function createDriftEventsClient(projEnv) {
|
|
1486
1558
|
return {
|
|
1487
1559
|
list: withSchema(
|
|
1488
|
-
|
|
1489
|
-
orgId:
|
|
1490
|
-
projectId:
|
|
1491
|
-
envName:
|
|
1492
|
-
status:
|
|
1493
|
-
kind:
|
|
1494
|
-
entityName:
|
|
1495
|
-
since:
|
|
1496
|
-
before:
|
|
1497
|
-
limit:
|
|
1560
|
+
z17.object({
|
|
1561
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1562
|
+
projectId: z17.string().describe("Project name"),
|
|
1563
|
+
envName: z17.string().describe("Environment name"),
|
|
1564
|
+
status: z17.enum(["open", "accepted", "reapplied", "snoozed"]).optional(),
|
|
1565
|
+
kind: z17.string().optional().describe("Filter by entity type name"),
|
|
1566
|
+
entityName: z17.string().optional().describe("Filter by entity name"),
|
|
1567
|
+
since: z17.string().optional().describe("ISO timestamp lower bound on detectedAt"),
|
|
1568
|
+
before: z17.string().datetime().optional().describe("ISO timestamp upper bound on detectedAt (keyset cursor)"),
|
|
1569
|
+
limit: z17.coerce.number().int().min(1).max(500).optional()
|
|
1498
1570
|
}),
|
|
1499
1571
|
(params) => {
|
|
1500
1572
|
const { orgId, projectId, envName, ...query } = params;
|
|
@@ -1504,19 +1576,19 @@ function createDriftEventsClient(projEnv) {
|
|
|
1504
1576
|
}
|
|
1505
1577
|
),
|
|
1506
1578
|
count: withSchema(
|
|
1507
|
-
|
|
1508
|
-
orgId:
|
|
1509
|
-
projectId:
|
|
1510
|
-
envName:
|
|
1579
|
+
z17.object({
|
|
1580
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1581
|
+
projectId: z17.string().describe("Project name"),
|
|
1582
|
+
envName: z17.string().describe("Environment name")
|
|
1511
1583
|
}),
|
|
1512
1584
|
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["drift-events"].count.$get())
|
|
1513
1585
|
),
|
|
1514
1586
|
get: withSchema(
|
|
1515
|
-
|
|
1516
|
-
orgId:
|
|
1517
|
-
projectId:
|
|
1518
|
-
envName:
|
|
1519
|
-
id:
|
|
1587
|
+
z17.object({
|
|
1588
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1589
|
+
projectId: z17.string().describe("Project name"),
|
|
1590
|
+
envName: z17.string().describe("Environment name"),
|
|
1591
|
+
id: z17.string().uuid()
|
|
1520
1592
|
}),
|
|
1521
1593
|
(params) => call(
|
|
1522
1594
|
projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].$get({
|
|
@@ -1525,11 +1597,11 @@ function createDriftEventsClient(projEnv) {
|
|
|
1525
1597
|
)
|
|
1526
1598
|
),
|
|
1527
1599
|
accept: withSchema(
|
|
1528
|
-
|
|
1529
|
-
orgId:
|
|
1530
|
-
projectId:
|
|
1531
|
-
envName:
|
|
1532
|
-
id:
|
|
1600
|
+
z17.object({
|
|
1601
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1602
|
+
projectId: z17.string().describe("Project name"),
|
|
1603
|
+
envName: z17.string().describe("Environment name"),
|
|
1604
|
+
id: z17.string().uuid()
|
|
1533
1605
|
}),
|
|
1534
1606
|
(params) => call(
|
|
1535
1607
|
projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].accept.$post({
|
|
@@ -1538,11 +1610,11 @@ function createDriftEventsClient(projEnv) {
|
|
|
1538
1610
|
)
|
|
1539
1611
|
),
|
|
1540
1612
|
reapply: withSchema(
|
|
1541
|
-
|
|
1542
|
-
orgId:
|
|
1543
|
-
projectId:
|
|
1544
|
-
envName:
|
|
1545
|
-
id:
|
|
1613
|
+
z17.object({
|
|
1614
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1615
|
+
projectId: z17.string().describe("Project name"),
|
|
1616
|
+
envName: z17.string().describe("Environment name"),
|
|
1617
|
+
id: z17.string().uuid()
|
|
1546
1618
|
}),
|
|
1547
1619
|
(params) => call(
|
|
1548
1620
|
projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].reapply.$post({
|
|
@@ -1551,12 +1623,12 @@ function createDriftEventsClient(projEnv) {
|
|
|
1551
1623
|
)
|
|
1552
1624
|
),
|
|
1553
1625
|
snooze: withSchema(
|
|
1554
|
-
|
|
1555
|
-
orgId:
|
|
1556
|
-
projectId:
|
|
1557
|
-
envName:
|
|
1558
|
-
id:
|
|
1559
|
-
untilSeconds:
|
|
1626
|
+
z17.object({
|
|
1627
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1628
|
+
projectId: z17.string().describe("Project name"),
|
|
1629
|
+
envName: z17.string().describe("Environment name"),
|
|
1630
|
+
id: z17.string().uuid(),
|
|
1631
|
+
untilSeconds: z17.number().int().positive().optional()
|
|
1560
1632
|
}),
|
|
1561
1633
|
(params) => call(
|
|
1562
1634
|
projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].snooze.$post({
|
|
@@ -1568,16 +1640,64 @@ function createDriftEventsClient(projEnv) {
|
|
|
1568
1640
|
};
|
|
1569
1641
|
}
|
|
1570
1642
|
|
|
1643
|
+
// src/conformance-findings.ts
|
|
1644
|
+
import { z as z18 } from "zod";
|
|
1645
|
+
import { FindingStatusSchema, FindingSeveritySchema } from "@terrantula/types";
|
|
1646
|
+
function createConformanceFindingsClient(projEnv) {
|
|
1647
|
+
return {
|
|
1648
|
+
list: withSchema(
|
|
1649
|
+
z18.object({
|
|
1650
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1651
|
+
projectId: z18.string().describe("Project name"),
|
|
1652
|
+
envName: z18.string().describe("Environment name"),
|
|
1653
|
+
status: FindingStatusSchema.optional(),
|
|
1654
|
+
severity: FindingSeveritySchema.optional(),
|
|
1655
|
+
kind: z18.string().optional().describe("Filter by entity type name"),
|
|
1656
|
+
findingKind: z18.string().optional().describe("Filter by finding kind (e.g. MISSING_REQUIRED_PROPERTY)"),
|
|
1657
|
+
entityName: z18.string().optional().describe("Filter by entity name"),
|
|
1658
|
+
limit: z18.coerce.number().int().min(1).max(500).optional()
|
|
1659
|
+
}),
|
|
1660
|
+
(params) => {
|
|
1661
|
+
const { orgId, projectId, envName, ...query } = params;
|
|
1662
|
+
return call(
|
|
1663
|
+
projEnv(orgId, projectId, envName)["conformance-findings"].$get({ query: stringifyQuery(query) })
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
),
|
|
1667
|
+
count: withSchema(
|
|
1668
|
+
z18.object({
|
|
1669
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1670
|
+
projectId: z18.string().describe("Project name"),
|
|
1671
|
+
envName: z18.string().describe("Environment name")
|
|
1672
|
+
}),
|
|
1673
|
+
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"].count.$get())
|
|
1674
|
+
),
|
|
1675
|
+
get: withSchema(
|
|
1676
|
+
z18.object({
|
|
1677
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1678
|
+
projectId: z18.string().describe("Project name"),
|
|
1679
|
+
envName: z18.string().describe("Environment name"),
|
|
1680
|
+
id: z18.string().uuid()
|
|
1681
|
+
}),
|
|
1682
|
+
(params) => call(
|
|
1683
|
+
projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"][":id"].$get({
|
|
1684
|
+
param: { id: params.id }
|
|
1685
|
+
})
|
|
1686
|
+
)
|
|
1687
|
+
)
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1571
1691
|
// src/stats.ts
|
|
1572
|
-
import { z as
|
|
1573
|
-
var WindowSchema =
|
|
1574
|
-
var BucketSchema =
|
|
1692
|
+
import { z as z19 } from "zod";
|
|
1693
|
+
var WindowSchema = z19.enum(["1h", "24h", "7d"]).optional().describe("Time window \u2014 default 24h");
|
|
1694
|
+
var BucketSchema = z19.enum(["1m", "5m", "1h", "1d"]).optional().describe("Bucket granularity \u2014 default 1h");
|
|
1575
1695
|
function createStatsClient(proj) {
|
|
1576
1696
|
return {
|
|
1577
1697
|
entitiesByState: withSchema(
|
|
1578
|
-
|
|
1579
|
-
orgId:
|
|
1580
|
-
projectId:
|
|
1698
|
+
z19.object({
|
|
1699
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1700
|
+
projectId: z19.string().describe("Project name"),
|
|
1581
1701
|
window: WindowSchema,
|
|
1582
1702
|
bucket: BucketSchema
|
|
1583
1703
|
}),
|
|
@@ -1587,9 +1707,9 @@ function createStatsClient(proj) {
|
|
|
1587
1707
|
}
|
|
1588
1708
|
),
|
|
1589
1709
|
runsByType: withSchema(
|
|
1590
|
-
|
|
1591
|
-
orgId:
|
|
1592
|
-
projectId:
|
|
1710
|
+
z19.object({
|
|
1711
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1712
|
+
projectId: z19.string().describe("Project name"),
|
|
1593
1713
|
window: WindowSchema
|
|
1594
1714
|
}),
|
|
1595
1715
|
(params) => {
|
|
@@ -1598,9 +1718,9 @@ function createStatsClient(proj) {
|
|
|
1598
1718
|
}
|
|
1599
1719
|
),
|
|
1600
1720
|
failingKinds: withSchema(
|
|
1601
|
-
|
|
1602
|
-
orgId:
|
|
1603
|
-
projectId:
|
|
1721
|
+
z19.object({
|
|
1722
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1723
|
+
projectId: z19.string().describe("Project name"),
|
|
1604
1724
|
window: WindowSchema
|
|
1605
1725
|
}),
|
|
1606
1726
|
(params) => {
|
|
@@ -1609,10 +1729,10 @@ function createStatsClient(proj) {
|
|
|
1609
1729
|
}
|
|
1610
1730
|
),
|
|
1611
1731
|
driftDensity: withSchema(
|
|
1612
|
-
|
|
1613
|
-
orgId:
|
|
1614
|
-
projectId:
|
|
1615
|
-
dim:
|
|
1732
|
+
z19.object({
|
|
1733
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1734
|
+
projectId: z19.string().describe("Project name"),
|
|
1735
|
+
dim: z19.string().optional().describe('Dimensions to bucket \u2014 e.g. "kind,cell"')
|
|
1616
1736
|
}),
|
|
1617
1737
|
(params) => {
|
|
1618
1738
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1623,34 +1743,34 @@ function createStatsClient(proj) {
|
|
|
1623
1743
|
}
|
|
1624
1744
|
|
|
1625
1745
|
// src/graph-views.ts
|
|
1626
|
-
import { z as
|
|
1627
|
-
var
|
|
1628
|
-
var
|
|
1746
|
+
import { z as z20 } from "zod";
|
|
1747
|
+
var PinnedPositionsSchema = z20.record(z20.string(), z20.object({ x: z20.number(), y: z20.number() })).nullable();
|
|
1748
|
+
var ViewSpecSchema = z20.unknown().nullable();
|
|
1629
1749
|
function createGraphViewsClient(proj) {
|
|
1630
1750
|
return {
|
|
1631
1751
|
list: withSchema(
|
|
1632
|
-
|
|
1633
|
-
orgId:
|
|
1634
|
-
projectId:
|
|
1752
|
+
z20.object({
|
|
1753
|
+
orgId: z20.string().describe("Organization slug"),
|
|
1754
|
+
projectId: z20.string().describe("Project ID")
|
|
1635
1755
|
}),
|
|
1636
1756
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"].$get())
|
|
1637
1757
|
),
|
|
1638
1758
|
get: withSchema(
|
|
1639
|
-
|
|
1640
|
-
orgId:
|
|
1641
|
-
projectId:
|
|
1642
|
-
id:
|
|
1759
|
+
z20.object({
|
|
1760
|
+
orgId: z20.string().describe("Organization slug"),
|
|
1761
|
+
projectId: z20.string().describe("Project ID"),
|
|
1762
|
+
id: z20.string().describe("View id")
|
|
1643
1763
|
}),
|
|
1644
1764
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$get({ param: { id: params.id } }))
|
|
1645
1765
|
),
|
|
1646
1766
|
create: withSchema(
|
|
1647
|
-
|
|
1648
|
-
orgId:
|
|
1649
|
-
projectId:
|
|
1650
|
-
name:
|
|
1651
|
-
scope:
|
|
1652
|
-
|
|
1653
|
-
|
|
1767
|
+
z20.object({
|
|
1768
|
+
orgId: z20.string().describe("Organization slug"),
|
|
1769
|
+
projectId: z20.string().describe("Project ID"),
|
|
1770
|
+
name: z20.string().describe("View name"),
|
|
1771
|
+
scope: z20.enum(["user", "project"]).describe("Personal or project scope"),
|
|
1772
|
+
pinnedPositions: PinnedPositionsSchema.optional().describe("Pinned node positions"),
|
|
1773
|
+
viewSpec: ViewSpecSchema.optional().describe("ViewSpec JSON (opaque passthrough)")
|
|
1654
1774
|
}),
|
|
1655
1775
|
(params) => {
|
|
1656
1776
|
const { orgId, projectId, ...body } = params;
|
|
@@ -1658,13 +1778,13 @@ function createGraphViewsClient(proj) {
|
|
|
1658
1778
|
}
|
|
1659
1779
|
),
|
|
1660
1780
|
update: withSchema(
|
|
1661
|
-
|
|
1662
|
-
orgId:
|
|
1663
|
-
projectId:
|
|
1664
|
-
id:
|
|
1665
|
-
name:
|
|
1666
|
-
|
|
1667
|
-
|
|
1781
|
+
z20.object({
|
|
1782
|
+
orgId: z20.string().describe("Organization slug"),
|
|
1783
|
+
projectId: z20.string().describe("Project ID"),
|
|
1784
|
+
id: z20.string().describe("View id"),
|
|
1785
|
+
name: z20.string().optional().describe("New name"),
|
|
1786
|
+
pinnedPositions: PinnedPositionsSchema.optional().describe("Replacement pinned positions"),
|
|
1787
|
+
viewSpec: ViewSpecSchema.optional().describe("Replacement ViewSpec JSON (opaque passthrough)")
|
|
1668
1788
|
}),
|
|
1669
1789
|
(params) => {
|
|
1670
1790
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1674,18 +1794,18 @@ function createGraphViewsClient(proj) {
|
|
|
1674
1794
|
}
|
|
1675
1795
|
),
|
|
1676
1796
|
delete: withSchema(
|
|
1677
|
-
|
|
1678
|
-
orgId:
|
|
1679
|
-
projectId:
|
|
1680
|
-
id:
|
|
1797
|
+
z20.object({
|
|
1798
|
+
orgId: z20.string().describe("Organization slug"),
|
|
1799
|
+
projectId: z20.string().describe("Project ID"),
|
|
1800
|
+
id: z20.string().describe("View id")
|
|
1681
1801
|
}),
|
|
1682
1802
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$delete({ param: { id: params.id } }))
|
|
1683
1803
|
),
|
|
1684
1804
|
setDefault: withSchema(
|
|
1685
|
-
|
|
1686
|
-
orgId:
|
|
1687
|
-
projectId:
|
|
1688
|
-
id:
|
|
1805
|
+
z20.object({
|
|
1806
|
+
orgId: z20.string().describe("Organization slug"),
|
|
1807
|
+
projectId: z20.string().describe("Project ID"),
|
|
1808
|
+
id: z20.string().describe("View id")
|
|
1689
1809
|
}),
|
|
1690
1810
|
(params) => call(
|
|
1691
1811
|
proj(params.orgId, params.projectId)["graph-views"][":id"]["default"].$patch({
|
|
@@ -1697,15 +1817,15 @@ function createGraphViewsClient(proj) {
|
|
|
1697
1817
|
}
|
|
1698
1818
|
|
|
1699
1819
|
// src/notifications.ts
|
|
1700
|
-
import { z as
|
|
1820
|
+
import { z as z21 } from "zod";
|
|
1701
1821
|
import { hc as hc2 } from "hono/client";
|
|
1702
1822
|
function createNotificationsClient(baseUrl, hcOpts) {
|
|
1703
1823
|
const c = hc2(`${baseUrl}/notifications`, hcOpts);
|
|
1704
1824
|
return {
|
|
1705
1825
|
list: withSchema(
|
|
1706
|
-
|
|
1707
|
-
limit:
|
|
1708
|
-
unread:
|
|
1826
|
+
z21.object({
|
|
1827
|
+
limit: z21.coerce.number().int().min(1).max(100).optional(),
|
|
1828
|
+
unread: z21.boolean().optional()
|
|
1709
1829
|
}),
|
|
1710
1830
|
(params) => {
|
|
1711
1831
|
const query = {};
|
|
@@ -1715,19 +1835,19 @@ function createNotificationsClient(baseUrl, hcOpts) {
|
|
|
1715
1835
|
}
|
|
1716
1836
|
),
|
|
1717
1837
|
read: withSchema(
|
|
1718
|
-
|
|
1838
|
+
z21.object({ id: z21.string().uuid() }),
|
|
1719
1839
|
(params) => call(c[":id"].read.$post({ param: { id: params.id } }))
|
|
1720
1840
|
),
|
|
1721
1841
|
readAll: withSchema(
|
|
1722
|
-
|
|
1842
|
+
z21.object({}),
|
|
1723
1843
|
() => call(c["read-all"].$post())
|
|
1724
1844
|
)
|
|
1725
1845
|
};
|
|
1726
1846
|
}
|
|
1727
1847
|
|
|
1728
1848
|
// src/audit-export.ts
|
|
1729
|
-
import { z as
|
|
1730
|
-
async function
|
|
1849
|
+
import { z as z22 } from "zod";
|
|
1850
|
+
async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
1731
1851
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1732
1852
|
const rawHeaders = hcOpts?.headers;
|
|
1733
1853
|
const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
|
|
@@ -1739,7 +1859,7 @@ async function rawRequest(baseUrl, hcOpts, path, init = {}) {
|
|
|
1739
1859
|
}
|
|
1740
1860
|
});
|
|
1741
1861
|
}
|
|
1742
|
-
async function
|
|
1862
|
+
async function callRaw2(res) {
|
|
1743
1863
|
if (!res.ok) {
|
|
1744
1864
|
let message = fallbackMessage(res.status);
|
|
1745
1865
|
try {
|
|
@@ -1755,24 +1875,24 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1755
1875
|
return {
|
|
1756
1876
|
/** GET /orgs/:orgId/audit-export/config — returns current config or throws 404. */
|
|
1757
1877
|
getConfig: withSchema(
|
|
1758
|
-
|
|
1759
|
-
async (params) =>
|
|
1760
|
-
await
|
|
1878
|
+
z22.object({ orgId: z22.string().describe("Organization ID") }),
|
|
1879
|
+
async (params) => callRaw2(
|
|
1880
|
+
await rawRequest2(baseUrl, hcOpts, `/orgs/${params.orgId}/audit-export/config`)
|
|
1761
1881
|
)
|
|
1762
1882
|
),
|
|
1763
1883
|
/** POST /orgs/:orgId/audit-export/config — upsert the S3 export config. */
|
|
1764
1884
|
setConfig: withSchema(
|
|
1765
|
-
|
|
1766
|
-
orgId:
|
|
1767
|
-
bucket:
|
|
1768
|
-
region:
|
|
1769
|
-
roleArn:
|
|
1770
|
-
enabled:
|
|
1885
|
+
z22.object({
|
|
1886
|
+
orgId: z22.string().describe("Organization ID"),
|
|
1887
|
+
bucket: z22.string().describe("S3 bucket name"),
|
|
1888
|
+
region: z22.string().describe("AWS region"),
|
|
1889
|
+
roleArn: z22.string().describe("IAM role ARN for assume-role"),
|
|
1890
|
+
enabled: z22.boolean().optional().describe("Enable/disable export")
|
|
1771
1891
|
}),
|
|
1772
1892
|
async (params) => {
|
|
1773
1893
|
const { orgId, ...body } = params;
|
|
1774
|
-
return
|
|
1775
|
-
await
|
|
1894
|
+
return callRaw2(
|
|
1895
|
+
await rawRequest2(baseUrl, hcOpts, `/orgs/${orgId}/audit-export/config`, {
|
|
1776
1896
|
method: "POST",
|
|
1777
1897
|
headers: { "Content-Type": "application/json" },
|
|
1778
1898
|
body: JSON.stringify(body)
|
|
@@ -1782,16 +1902,16 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1782
1902
|
),
|
|
1783
1903
|
/** POST /orgs/:orgId/audit-export/test-connection — dry-run write+delete. */
|
|
1784
1904
|
testConnection: withSchema(
|
|
1785
|
-
|
|
1786
|
-
orgId:
|
|
1787
|
-
bucket:
|
|
1788
|
-
region:
|
|
1789
|
-
roleArn:
|
|
1905
|
+
z22.object({
|
|
1906
|
+
orgId: z22.string().describe("Organization ID"),
|
|
1907
|
+
bucket: z22.string().describe("S3 bucket name"),
|
|
1908
|
+
region: z22.string().describe("AWS region"),
|
|
1909
|
+
roleArn: z22.string().describe("IAM role ARN for assume-role")
|
|
1790
1910
|
}),
|
|
1791
1911
|
async (params) => {
|
|
1792
1912
|
const { orgId, ...body } = params;
|
|
1793
|
-
return
|
|
1794
|
-
await
|
|
1913
|
+
return callRaw2(
|
|
1914
|
+
await rawRequest2(baseUrl, hcOpts, `/orgs/${orgId}/audit-export/test-connection`, {
|
|
1795
1915
|
method: "POST",
|
|
1796
1916
|
headers: { "Content-Type": "application/json" },
|
|
1797
1917
|
body: JSON.stringify(body)
|
|
@@ -1801,14 +1921,14 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1801
1921
|
),
|
|
1802
1922
|
/** GET /orgs/:orgId/audit-export/runs — recent batch run history. */
|
|
1803
1923
|
listRuns: withSchema(
|
|
1804
|
-
|
|
1805
|
-
orgId:
|
|
1806
|
-
limit:
|
|
1924
|
+
z22.object({
|
|
1925
|
+
orgId: z22.string().describe("Organization ID"),
|
|
1926
|
+
limit: z22.number().optional().describe("Max results (default 20, max 100)")
|
|
1807
1927
|
}),
|
|
1808
1928
|
async (params) => {
|
|
1809
1929
|
const qs = params.limit ? `?limit=${params.limit}` : "";
|
|
1810
|
-
return
|
|
1811
|
-
await
|
|
1930
|
+
return callRaw2(
|
|
1931
|
+
await rawRequest2(
|
|
1812
1932
|
baseUrl,
|
|
1813
1933
|
hcOpts,
|
|
1814
1934
|
`/orgs/${params.orgId}/audit-export/runs${qs}`
|
|
@@ -1847,33 +1967,33 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
|
|
|
1847
1967
|
}
|
|
1848
1968
|
|
|
1849
1969
|
// src/import-sources.ts
|
|
1850
|
-
import { z as
|
|
1851
|
-
var SourceKindEnum =
|
|
1852
|
-
var PolicyEnum =
|
|
1970
|
+
import { z as z23 } from "zod";
|
|
1971
|
+
var SourceKindEnum = z23.enum(["tf-state", "atmos-manifests"]);
|
|
1972
|
+
var PolicyEnum = z23.enum(["auto-update", "human-approval"]);
|
|
1853
1973
|
function createImportSourcesClient(proj) {
|
|
1854
1974
|
return {
|
|
1855
1975
|
list: withSchema(
|
|
1856
|
-
|
|
1857
|
-
orgId:
|
|
1858
|
-
projectId:
|
|
1976
|
+
z23.object({
|
|
1977
|
+
orgId: z23.string().describe("Organization slug"),
|
|
1978
|
+
projectId: z23.string().describe("Project ID")
|
|
1859
1979
|
}),
|
|
1860
1980
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"].$get())
|
|
1861
1981
|
),
|
|
1862
1982
|
get: withSchema(
|
|
1863
|
-
|
|
1864
|
-
orgId:
|
|
1865
|
-
projectId:
|
|
1866
|
-
id:
|
|
1983
|
+
z23.object({
|
|
1984
|
+
orgId: z23.string().describe("Organization slug"),
|
|
1985
|
+
projectId: z23.string().describe("Project ID"),
|
|
1986
|
+
id: z23.string().uuid().describe("ImportSource ID")
|
|
1867
1987
|
}),
|
|
1868
1988
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
|
|
1869
1989
|
),
|
|
1870
1990
|
registerOrUpdate: withSchema(
|
|
1871
|
-
|
|
1872
|
-
orgId:
|
|
1873
|
-
projectId:
|
|
1874
|
-
envName:
|
|
1991
|
+
z23.object({
|
|
1992
|
+
orgId: z23.string().describe("Organization slug"),
|
|
1993
|
+
projectId: z23.string().describe("Project ID"),
|
|
1994
|
+
envName: z23.string().describe("Env name the source belongs to"),
|
|
1875
1995
|
sourceKind: SourceKindEnum,
|
|
1876
|
-
sourceUri:
|
|
1996
|
+
sourceUri: z23.string().describe("Stable URI identifying the source"),
|
|
1877
1997
|
reconciliationPolicy: PolicyEnum.optional()
|
|
1878
1998
|
}),
|
|
1879
1999
|
(params) => {
|
|
@@ -1882,13 +2002,13 @@ function createImportSourcesClient(proj) {
|
|
|
1882
2002
|
}
|
|
1883
2003
|
),
|
|
1884
2004
|
rescan: withSchema(
|
|
1885
|
-
|
|
1886
|
-
orgId:
|
|
1887
|
-
projectId:
|
|
1888
|
-
id:
|
|
1889
|
-
envName:
|
|
1890
|
-
items:
|
|
1891
|
-
deletions:
|
|
2005
|
+
z23.object({
|
|
2006
|
+
orgId: z23.string().describe("Organization slug"),
|
|
2007
|
+
projectId: z23.string().describe("Project ID"),
|
|
2008
|
+
id: z23.string().uuid(),
|
|
2009
|
+
envName: z23.string(),
|
|
2010
|
+
items: z23.array(z23.unknown()),
|
|
2011
|
+
deletions: z23.array(z23.object({ kind: z23.string(), name: z23.string() })).optional()
|
|
1892
2012
|
}),
|
|
1893
2013
|
(params) => {
|
|
1894
2014
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1904,19 +2024,19 @@ function createImportSourcesClient(proj) {
|
|
|
1904
2024
|
}
|
|
1905
2025
|
),
|
|
1906
2026
|
drift: withSchema(
|
|
1907
|
-
|
|
1908
|
-
orgId:
|
|
1909
|
-
projectId:
|
|
1910
|
-
id:
|
|
2027
|
+
z23.object({
|
|
2028
|
+
orgId: z23.string().describe("Organization slug"),
|
|
2029
|
+
projectId: z23.string().describe("Project ID"),
|
|
2030
|
+
id: z23.string().uuid()
|
|
1911
2031
|
}),
|
|
1912
2032
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
|
|
1913
2033
|
),
|
|
1914
2034
|
approveProposal: withSchema(
|
|
1915
|
-
|
|
1916
|
-
orgId:
|
|
1917
|
-
projectId:
|
|
1918
|
-
id:
|
|
1919
|
-
proposalId:
|
|
2035
|
+
z23.object({
|
|
2036
|
+
orgId: z23.string().describe("Organization slug"),
|
|
2037
|
+
projectId: z23.string().describe("Project ID"),
|
|
2038
|
+
id: z23.string().uuid(),
|
|
2039
|
+
proposalId: z23.string().uuid()
|
|
1920
2040
|
}),
|
|
1921
2041
|
(params) => call(
|
|
1922
2042
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
|
|
@@ -1925,11 +2045,11 @@ function createImportSourcesClient(proj) {
|
|
|
1925
2045
|
)
|
|
1926
2046
|
),
|
|
1927
2047
|
rejectProposal: withSchema(
|
|
1928
|
-
|
|
1929
|
-
orgId:
|
|
1930
|
-
projectId:
|
|
1931
|
-
id:
|
|
1932
|
-
proposalId:
|
|
2048
|
+
z23.object({
|
|
2049
|
+
orgId: z23.string().describe("Organization slug"),
|
|
2050
|
+
projectId: z23.string().describe("Project ID"),
|
|
2051
|
+
id: z23.string().uuid(),
|
|
2052
|
+
proposalId: z23.string().uuid()
|
|
1933
2053
|
}),
|
|
1934
2054
|
(params) => call(
|
|
1935
2055
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
|
|
@@ -1941,8 +2061,8 @@ function createImportSourcesClient(proj) {
|
|
|
1941
2061
|
}
|
|
1942
2062
|
|
|
1943
2063
|
// src/admin.ts
|
|
1944
|
-
import { z as
|
|
1945
|
-
async function
|
|
2064
|
+
import { z as z24 } from "zod";
|
|
2065
|
+
async function rawRequest3(baseUrl, hcOpts, path, init = {}) {
|
|
1946
2066
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1947
2067
|
const rawHeaders = hcOpts?.headers;
|
|
1948
2068
|
const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
|
|
@@ -1954,7 +2074,7 @@ async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
|
1954
2074
|
}
|
|
1955
2075
|
});
|
|
1956
2076
|
}
|
|
1957
|
-
async function
|
|
2077
|
+
async function callRaw3(res) {
|
|
1958
2078
|
if (!res.ok) {
|
|
1959
2079
|
let message = fallbackMessage(res.status);
|
|
1960
2080
|
try {
|
|
@@ -1974,14 +2094,14 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
1974
2094
|
* List super-admin audit events with optional filters.
|
|
1975
2095
|
*/
|
|
1976
2096
|
list: withSchema(
|
|
1977
|
-
|
|
1978
|
-
actor:
|
|
1979
|
-
action:
|
|
1980
|
-
resourceKind:
|
|
1981
|
-
since:
|
|
1982
|
-
until:
|
|
1983
|
-
limit:
|
|
1984
|
-
offset:
|
|
2097
|
+
z24.object({
|
|
2098
|
+
actor: z24.string().optional().describe("Filter by actor user ID"),
|
|
2099
|
+
action: z24.string().optional().describe("Filter by action name"),
|
|
2100
|
+
resourceKind: z24.string().optional().describe("Filter by resource kind"),
|
|
2101
|
+
since: z24.string().optional().describe("ISO 8601 datetime lower bound"),
|
|
2102
|
+
until: z24.string().optional().describe("ISO 8601 datetime upper bound"),
|
|
2103
|
+
limit: z24.coerce.number().int().min(1).max(200).optional().describe("Max results (1-200)"),
|
|
2104
|
+
offset: z24.coerce.number().int().min(0).optional().describe("Pagination offset")
|
|
1985
2105
|
}),
|
|
1986
2106
|
async (params) => {
|
|
1987
2107
|
const qs = new URLSearchParams();
|
|
@@ -1993,8 +2113,8 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
1993
2113
|
if (params.limit !== void 0) qs.set("limit", String(params.limit));
|
|
1994
2114
|
if (params.offset !== void 0) qs.set("offset", String(params.offset));
|
|
1995
2115
|
const search = qs.toString();
|
|
1996
|
-
return
|
|
1997
|
-
await
|
|
2116
|
+
return callRaw3(
|
|
2117
|
+
await rawRequest3(baseUrl, hcOpts, `/admin/audit${search ? `?${search}` : ""}`)
|
|
1998
2118
|
);
|
|
1999
2119
|
}
|
|
2000
2120
|
)
|
|
@@ -2005,9 +2125,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2005
2125
|
* List all organizations across tenants with member + project counts.
|
|
2006
2126
|
*/
|
|
2007
2127
|
list: withSchema(
|
|
2008
|
-
|
|
2009
|
-
async () =>
|
|
2010
|
-
await
|
|
2128
|
+
z24.object({}),
|
|
2129
|
+
async () => callRaw3(
|
|
2130
|
+
await rawRequest3(baseUrl, hcOpts, "/admin/orgs")
|
|
2011
2131
|
)
|
|
2012
2132
|
),
|
|
2013
2133
|
/**
|
|
@@ -2015,9 +2135,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2015
2135
|
* Detail view: org fields + member list + project list.
|
|
2016
2136
|
*/
|
|
2017
2137
|
get: withSchema(
|
|
2018
|
-
|
|
2019
|
-
async (params) =>
|
|
2020
|
-
await
|
|
2138
|
+
z24.object({ id: z24.string().describe("Organization ID") }),
|
|
2139
|
+
async (params) => callRaw3(
|
|
2140
|
+
await rawRequest3(baseUrl, hcOpts, `/admin/orgs/${params.id}`)
|
|
2021
2141
|
)
|
|
2022
2142
|
),
|
|
2023
2143
|
/**
|
|
@@ -2025,9 +2145,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2025
2145
|
* Set suspended_at = now(). Idempotent.
|
|
2026
2146
|
*/
|
|
2027
2147
|
suspend: withSchema(
|
|
2028
|
-
|
|
2029
|
-
async (params) =>
|
|
2030
|
-
await
|
|
2148
|
+
z24.object({ id: z24.string().describe("Organization ID") }),
|
|
2149
|
+
async (params) => callRaw3(
|
|
2150
|
+
await rawRequest3(baseUrl, hcOpts, `/admin/orgs/${params.id}/suspend`, {
|
|
2031
2151
|
method: "POST"
|
|
2032
2152
|
})
|
|
2033
2153
|
)
|
|
@@ -2037,9 +2157,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2037
2157
|
* Clear suspended_at.
|
|
2038
2158
|
*/
|
|
2039
2159
|
unsuspend: withSchema(
|
|
2040
|
-
|
|
2041
|
-
async (params) =>
|
|
2042
|
-
await
|
|
2160
|
+
z24.object({ id: z24.string().describe("Organization ID") }),
|
|
2161
|
+
async (params) => callRaw3(
|
|
2162
|
+
await rawRequest3(baseUrl, hcOpts, `/admin/orgs/${params.id}/unsuspend`, {
|
|
2043
2163
|
method: "POST"
|
|
2044
2164
|
})
|
|
2045
2165
|
)
|
|
@@ -2053,9 +2173,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2053
2173
|
* api tokens, and environments. Idempotent. Super-admin only.
|
|
2054
2174
|
*/
|
|
2055
2175
|
nuke: withSchema(
|
|
2056
|
-
|
|
2057
|
-
async (params) =>
|
|
2058
|
-
await
|
|
2176
|
+
z24.object({ projectId: z24.string().describe("Project ID to nuke") }),
|
|
2177
|
+
async (params) => callRaw3(
|
|
2178
|
+
await rawRequest3(
|
|
2059
2179
|
baseUrl,
|
|
2060
2180
|
hcOpts,
|
|
2061
2181
|
`/admin/projects/${encodeURIComponent(params.projectId)}/nuke`,
|
|
@@ -2071,9 +2191,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2071
2191
|
* all derived from single-table COUNT queries.
|
|
2072
2192
|
*/
|
|
2073
2193
|
overview: withSchema(
|
|
2074
|
-
|
|
2075
|
-
async () =>
|
|
2076
|
-
await
|
|
2194
|
+
z24.object({}),
|
|
2195
|
+
async () => callRaw3(
|
|
2196
|
+
await rawRequest3(baseUrl, hcOpts, "/admin/metrics/overview")
|
|
2077
2197
|
)
|
|
2078
2198
|
)
|
|
2079
2199
|
},
|
|
@@ -2086,9 +2206,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2086
2206
|
* Requires super-admin.
|
|
2087
2207
|
*/
|
|
2088
2208
|
list: withSchema(
|
|
2089
|
-
|
|
2090
|
-
async () =>
|
|
2091
|
-
await
|
|
2209
|
+
z24.object({}),
|
|
2210
|
+
async () => callRaw3(
|
|
2211
|
+
await rawRequest3(
|
|
2092
2212
|
baseUrl,
|
|
2093
2213
|
hcOpts,
|
|
2094
2214
|
"/admin/integrations/github-installations"
|
|
@@ -2101,15 +2221,15 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2101
2221
|
}
|
|
2102
2222
|
|
|
2103
2223
|
// src/resolve-source.ts
|
|
2104
|
-
import { z as
|
|
2224
|
+
import { z as z25 } from "zod";
|
|
2105
2225
|
function createResolveSourceFn(proj) {
|
|
2106
2226
|
return withSchema(
|
|
2107
|
-
|
|
2108
|
-
orgId:
|
|
2109
|
-
projectId:
|
|
2110
|
-
kind:
|
|
2111
|
-
ref:
|
|
2112
|
-
version:
|
|
2227
|
+
z25.object({
|
|
2228
|
+
orgId: z25.string().describe("Organization slug"),
|
|
2229
|
+
projectId: z25.string().describe("Project ID"),
|
|
2230
|
+
kind: z25.literal("registry").describe('Source kind \u2014 only "registry" is supported today'),
|
|
2231
|
+
ref: z25.string().regex(/^[^/]+\/[^/]+\/[^/]+$/, { message: "ref must be <namespace>/<name>/<provider>" }).describe("Terraform Registry module ref (<namespace>/<name>/<provider>)"),
|
|
2232
|
+
version: z25.string().optional().describe("Module version semver \u2014 resolves latest if omitted")
|
|
2113
2233
|
}),
|
|
2114
2234
|
(params) => {
|
|
2115
2235
|
const { orgId, projectId, kind, ref, version } = params;
|
|
@@ -2150,9 +2270,11 @@ var createClient = (baseUrl, options = {}) => {
|
|
|
2150
2270
|
actionRuns: createActionRunsClient(projEnv),
|
|
2151
2271
|
secrets: createSecretsClient(projEnv),
|
|
2152
2272
|
apply: createApplyClient(projEnv),
|
|
2273
|
+
observations: createObservationsClient(baseUrl, hcOpts),
|
|
2153
2274
|
catalogRevisions,
|
|
2154
2275
|
auditEvents: createAuditEventsClient(proj),
|
|
2155
2276
|
driftEvents: createDriftEventsClient(projEnv),
|
|
2277
|
+
conformanceFindings: createConformanceFindingsClient(projEnv),
|
|
2156
2278
|
stats: createStatsClient(proj),
|
|
2157
2279
|
graphViews: createGraphViewsClient(proj),
|
|
2158
2280
|
notifications: createNotificationsClient(baseUrl, hcOpts),
|