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