@terrantula/sdk 0.13.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-E3CKS754.mjs → chunk-46T35MSS.mjs} +365 -292
- package/dist/index.d.mts +153 -2
- package/dist/index.d.ts +153 -2
- package/dist/index.js +368 -295
- package/dist/index.mjs +1 -1
- package/dist/local.d.mts +136 -1
- package/dist/local.d.ts +136 -1
- package/dist/local.js +368 -295
- 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 +1 -1
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({
|
|
@@ -1592,21 +1664,21 @@ function createDriftEventsClient(projEnv) {
|
|
|
1592
1664
|
}
|
|
1593
1665
|
|
|
1594
1666
|
// src/conformance-findings.ts
|
|
1595
|
-
var
|
|
1596
|
-
var
|
|
1667
|
+
var import_zod18 = require("zod");
|
|
1668
|
+
var import_types9 = require("@terrantula/types");
|
|
1597
1669
|
function createConformanceFindingsClient(projEnv) {
|
|
1598
1670
|
return {
|
|
1599
1671
|
list: withSchema(
|
|
1600
|
-
|
|
1601
|
-
orgId:
|
|
1602
|
-
projectId:
|
|
1603
|
-
envName:
|
|
1604
|
-
status:
|
|
1605
|
-
severity:
|
|
1606
|
-
kind:
|
|
1607
|
-
findingKind:
|
|
1608
|
-
entityName:
|
|
1609
|
-
limit:
|
|
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()
|
|
1610
1682
|
}),
|
|
1611
1683
|
(params) => {
|
|
1612
1684
|
const { orgId, projectId, envName, ...query } = params;
|
|
@@ -1616,19 +1688,19 @@ function createConformanceFindingsClient(projEnv) {
|
|
|
1616
1688
|
}
|
|
1617
1689
|
),
|
|
1618
1690
|
count: withSchema(
|
|
1619
|
-
|
|
1620
|
-
orgId:
|
|
1621
|
-
projectId:
|
|
1622
|
-
envName:
|
|
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")
|
|
1623
1695
|
}),
|
|
1624
1696
|
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"].count.$get())
|
|
1625
1697
|
),
|
|
1626
1698
|
get: withSchema(
|
|
1627
|
-
|
|
1628
|
-
orgId:
|
|
1629
|
-
projectId:
|
|
1630
|
-
envName:
|
|
1631
|
-
id:
|
|
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()
|
|
1632
1704
|
}),
|
|
1633
1705
|
(params) => call(
|
|
1634
1706
|
projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"][":id"].$get({
|
|
@@ -1640,15 +1712,15 @@ function createConformanceFindingsClient(projEnv) {
|
|
|
1640
1712
|
}
|
|
1641
1713
|
|
|
1642
1714
|
// src/stats.ts
|
|
1643
|
-
var
|
|
1644
|
-
var WindowSchema =
|
|
1645
|
-
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");
|
|
1646
1718
|
function createStatsClient(proj) {
|
|
1647
1719
|
return {
|
|
1648
1720
|
entitiesByState: withSchema(
|
|
1649
|
-
|
|
1650
|
-
orgId:
|
|
1651
|
-
projectId:
|
|
1721
|
+
import_zod19.z.object({
|
|
1722
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1723
|
+
projectId: import_zod19.z.string().describe("Project name"),
|
|
1652
1724
|
window: WindowSchema,
|
|
1653
1725
|
bucket: BucketSchema
|
|
1654
1726
|
}),
|
|
@@ -1658,9 +1730,9 @@ function createStatsClient(proj) {
|
|
|
1658
1730
|
}
|
|
1659
1731
|
),
|
|
1660
1732
|
runsByType: withSchema(
|
|
1661
|
-
|
|
1662
|
-
orgId:
|
|
1663
|
-
projectId:
|
|
1733
|
+
import_zod19.z.object({
|
|
1734
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1735
|
+
projectId: import_zod19.z.string().describe("Project name"),
|
|
1664
1736
|
window: WindowSchema
|
|
1665
1737
|
}),
|
|
1666
1738
|
(params) => {
|
|
@@ -1669,9 +1741,9 @@ function createStatsClient(proj) {
|
|
|
1669
1741
|
}
|
|
1670
1742
|
),
|
|
1671
1743
|
failingKinds: withSchema(
|
|
1672
|
-
|
|
1673
|
-
orgId:
|
|
1674
|
-
projectId:
|
|
1744
|
+
import_zod19.z.object({
|
|
1745
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1746
|
+
projectId: import_zod19.z.string().describe("Project name"),
|
|
1675
1747
|
window: WindowSchema
|
|
1676
1748
|
}),
|
|
1677
1749
|
(params) => {
|
|
@@ -1680,10 +1752,10 @@ function createStatsClient(proj) {
|
|
|
1680
1752
|
}
|
|
1681
1753
|
),
|
|
1682
1754
|
driftDensity: withSchema(
|
|
1683
|
-
|
|
1684
|
-
orgId:
|
|
1685
|
-
projectId:
|
|
1686
|
-
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"')
|
|
1687
1759
|
}),
|
|
1688
1760
|
(params) => {
|
|
1689
1761
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1694,32 +1766,32 @@ function createStatsClient(proj) {
|
|
|
1694
1766
|
}
|
|
1695
1767
|
|
|
1696
1768
|
// src/graph-views.ts
|
|
1697
|
-
var
|
|
1698
|
-
var PinnedPositionsSchema =
|
|
1699
|
-
var ViewSpecSchema =
|
|
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();
|
|
1700
1772
|
function createGraphViewsClient(proj) {
|
|
1701
1773
|
return {
|
|
1702
1774
|
list: withSchema(
|
|
1703
|
-
|
|
1704
|
-
orgId:
|
|
1705
|
-
projectId:
|
|
1775
|
+
import_zod20.z.object({
|
|
1776
|
+
orgId: import_zod20.z.string().describe("Organization slug"),
|
|
1777
|
+
projectId: import_zod20.z.string().describe("Project ID")
|
|
1706
1778
|
}),
|
|
1707
1779
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"].$get())
|
|
1708
1780
|
),
|
|
1709
1781
|
get: withSchema(
|
|
1710
|
-
|
|
1711
|
-
orgId:
|
|
1712
|
-
projectId:
|
|
1713
|
-
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")
|
|
1714
1786
|
}),
|
|
1715
1787
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$get({ param: { id: params.id } }))
|
|
1716
1788
|
),
|
|
1717
1789
|
create: withSchema(
|
|
1718
|
-
|
|
1719
|
-
orgId:
|
|
1720
|
-
projectId:
|
|
1721
|
-
name:
|
|
1722
|
-
scope:
|
|
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"),
|
|
1723
1795
|
pinnedPositions: PinnedPositionsSchema.optional().describe("Pinned node positions"),
|
|
1724
1796
|
viewSpec: ViewSpecSchema.optional().describe("ViewSpec JSON (opaque passthrough)")
|
|
1725
1797
|
}),
|
|
@@ -1729,11 +1801,11 @@ function createGraphViewsClient(proj) {
|
|
|
1729
1801
|
}
|
|
1730
1802
|
),
|
|
1731
1803
|
update: withSchema(
|
|
1732
|
-
|
|
1733
|
-
orgId:
|
|
1734
|
-
projectId:
|
|
1735
|
-
id:
|
|
1736
|
-
name:
|
|
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"),
|
|
1737
1809
|
pinnedPositions: PinnedPositionsSchema.optional().describe("Replacement pinned positions"),
|
|
1738
1810
|
viewSpec: ViewSpecSchema.optional().describe("Replacement ViewSpec JSON (opaque passthrough)")
|
|
1739
1811
|
}),
|
|
@@ -1745,18 +1817,18 @@ function createGraphViewsClient(proj) {
|
|
|
1745
1817
|
}
|
|
1746
1818
|
),
|
|
1747
1819
|
delete: withSchema(
|
|
1748
|
-
|
|
1749
|
-
orgId:
|
|
1750
|
-
projectId:
|
|
1751
|
-
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")
|
|
1752
1824
|
}),
|
|
1753
1825
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$delete({ param: { id: params.id } }))
|
|
1754
1826
|
),
|
|
1755
1827
|
setDefault: withSchema(
|
|
1756
|
-
|
|
1757
|
-
orgId:
|
|
1758
|
-
projectId:
|
|
1759
|
-
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")
|
|
1760
1832
|
}),
|
|
1761
1833
|
(params) => call(
|
|
1762
1834
|
proj(params.orgId, params.projectId)["graph-views"][":id"]["default"].$patch({
|
|
@@ -1768,15 +1840,15 @@ function createGraphViewsClient(proj) {
|
|
|
1768
1840
|
}
|
|
1769
1841
|
|
|
1770
1842
|
// src/notifications.ts
|
|
1771
|
-
var
|
|
1843
|
+
var import_zod21 = require("zod");
|
|
1772
1844
|
var import_client2 = require("hono/client");
|
|
1773
1845
|
function createNotificationsClient(baseUrl, hcOpts) {
|
|
1774
1846
|
const c = (0, import_client2.hc)(`${baseUrl}/notifications`, hcOpts);
|
|
1775
1847
|
return {
|
|
1776
1848
|
list: withSchema(
|
|
1777
|
-
|
|
1778
|
-
limit:
|
|
1779
|
-
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()
|
|
1780
1852
|
}),
|
|
1781
1853
|
(params) => {
|
|
1782
1854
|
const query = {};
|
|
@@ -1786,19 +1858,19 @@ function createNotificationsClient(baseUrl, hcOpts) {
|
|
|
1786
1858
|
}
|
|
1787
1859
|
),
|
|
1788
1860
|
read: withSchema(
|
|
1789
|
-
|
|
1861
|
+
import_zod21.z.object({ id: import_zod21.z.string().uuid() }),
|
|
1790
1862
|
(params) => call(c[":id"].read.$post({ param: { id: params.id } }))
|
|
1791
1863
|
),
|
|
1792
1864
|
readAll: withSchema(
|
|
1793
|
-
|
|
1865
|
+
import_zod21.z.object({}),
|
|
1794
1866
|
() => call(c["read-all"].$post())
|
|
1795
1867
|
)
|
|
1796
1868
|
};
|
|
1797
1869
|
}
|
|
1798
1870
|
|
|
1799
1871
|
// src/audit-export.ts
|
|
1800
|
-
var
|
|
1801
|
-
async function
|
|
1872
|
+
var import_zod22 = require("zod");
|
|
1873
|
+
async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
1802
1874
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1803
1875
|
const rawHeaders = hcOpts?.headers;
|
|
1804
1876
|
const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
|
|
@@ -1810,7 +1882,7 @@ async function rawRequest(baseUrl, hcOpts, path, init = {}) {
|
|
|
1810
1882
|
}
|
|
1811
1883
|
});
|
|
1812
1884
|
}
|
|
1813
|
-
async function
|
|
1885
|
+
async function callRaw2(res) {
|
|
1814
1886
|
if (!res.ok) {
|
|
1815
1887
|
let message = fallbackMessage(res.status);
|
|
1816
1888
|
try {
|
|
@@ -1826,24 +1898,24 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1826
1898
|
return {
|
|
1827
1899
|
/** GET /orgs/:orgId/audit-export/config — returns current config or throws 404. */
|
|
1828
1900
|
getConfig: withSchema(
|
|
1829
|
-
|
|
1830
|
-
async (params) =>
|
|
1831
|
-
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`)
|
|
1832
1904
|
)
|
|
1833
1905
|
),
|
|
1834
1906
|
/** POST /orgs/:orgId/audit-export/config — upsert the S3 export config. */
|
|
1835
1907
|
setConfig: withSchema(
|
|
1836
|
-
|
|
1837
|
-
orgId:
|
|
1838
|
-
bucket:
|
|
1839
|
-
region:
|
|
1840
|
-
roleArn:
|
|
1841
|
-
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")
|
|
1842
1914
|
}),
|
|
1843
1915
|
async (params) => {
|
|
1844
1916
|
const { orgId, ...body } = params;
|
|
1845
|
-
return
|
|
1846
|
-
await
|
|
1917
|
+
return callRaw2(
|
|
1918
|
+
await rawRequest2(baseUrl, hcOpts, `/orgs/${orgId}/audit-export/config`, {
|
|
1847
1919
|
method: "POST",
|
|
1848
1920
|
headers: { "Content-Type": "application/json" },
|
|
1849
1921
|
body: JSON.stringify(body)
|
|
@@ -1853,16 +1925,16 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1853
1925
|
),
|
|
1854
1926
|
/** POST /orgs/:orgId/audit-export/test-connection — dry-run write+delete. */
|
|
1855
1927
|
testConnection: withSchema(
|
|
1856
|
-
|
|
1857
|
-
orgId:
|
|
1858
|
-
bucket:
|
|
1859
|
-
region:
|
|
1860
|
-
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")
|
|
1861
1933
|
}),
|
|
1862
1934
|
async (params) => {
|
|
1863
1935
|
const { orgId, ...body } = params;
|
|
1864
|
-
return
|
|
1865
|
-
await
|
|
1936
|
+
return callRaw2(
|
|
1937
|
+
await rawRequest2(baseUrl, hcOpts, `/orgs/${orgId}/audit-export/test-connection`, {
|
|
1866
1938
|
method: "POST",
|
|
1867
1939
|
headers: { "Content-Type": "application/json" },
|
|
1868
1940
|
body: JSON.stringify(body)
|
|
@@ -1872,14 +1944,14 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1872
1944
|
),
|
|
1873
1945
|
/** GET /orgs/:orgId/audit-export/runs — recent batch run history. */
|
|
1874
1946
|
listRuns: withSchema(
|
|
1875
|
-
|
|
1876
|
-
orgId:
|
|
1877
|
-
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)")
|
|
1878
1950
|
}),
|
|
1879
1951
|
async (params) => {
|
|
1880
1952
|
const qs = params.limit ? `?limit=${params.limit}` : "";
|
|
1881
|
-
return
|
|
1882
|
-
await
|
|
1953
|
+
return callRaw2(
|
|
1954
|
+
await rawRequest2(
|
|
1883
1955
|
baseUrl,
|
|
1884
1956
|
hcOpts,
|
|
1885
1957
|
`/orgs/${params.orgId}/audit-export/runs${qs}`
|
|
@@ -1918,33 +1990,33 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
|
|
|
1918
1990
|
}
|
|
1919
1991
|
|
|
1920
1992
|
// src/import-sources.ts
|
|
1921
|
-
var
|
|
1922
|
-
var SourceKindEnum =
|
|
1923
|
-
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"]);
|
|
1924
1996
|
function createImportSourcesClient(proj) {
|
|
1925
1997
|
return {
|
|
1926
1998
|
list: withSchema(
|
|
1927
|
-
|
|
1928
|
-
orgId:
|
|
1929
|
-
projectId:
|
|
1999
|
+
import_zod23.z.object({
|
|
2000
|
+
orgId: import_zod23.z.string().describe("Organization slug"),
|
|
2001
|
+
projectId: import_zod23.z.string().describe("Project ID")
|
|
1930
2002
|
}),
|
|
1931
2003
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"].$get())
|
|
1932
2004
|
),
|
|
1933
2005
|
get: withSchema(
|
|
1934
|
-
|
|
1935
|
-
orgId:
|
|
1936
|
-
projectId:
|
|
1937
|
-
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")
|
|
1938
2010
|
}),
|
|
1939
2011
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
|
|
1940
2012
|
),
|
|
1941
2013
|
registerOrUpdate: withSchema(
|
|
1942
|
-
|
|
1943
|
-
orgId:
|
|
1944
|
-
projectId:
|
|
1945
|
-
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"),
|
|
1946
2018
|
sourceKind: SourceKindEnum,
|
|
1947
|
-
sourceUri:
|
|
2019
|
+
sourceUri: import_zod23.z.string().describe("Stable URI identifying the source"),
|
|
1948
2020
|
reconciliationPolicy: PolicyEnum.optional()
|
|
1949
2021
|
}),
|
|
1950
2022
|
(params) => {
|
|
@@ -1953,13 +2025,13 @@ function createImportSourcesClient(proj) {
|
|
|
1953
2025
|
}
|
|
1954
2026
|
),
|
|
1955
2027
|
rescan: withSchema(
|
|
1956
|
-
|
|
1957
|
-
orgId:
|
|
1958
|
-
projectId:
|
|
1959
|
-
id:
|
|
1960
|
-
envName:
|
|
1961
|
-
items:
|
|
1962
|
-
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()
|
|
1963
2035
|
}),
|
|
1964
2036
|
(params) => {
|
|
1965
2037
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1975,19 +2047,19 @@ function createImportSourcesClient(proj) {
|
|
|
1975
2047
|
}
|
|
1976
2048
|
),
|
|
1977
2049
|
drift: withSchema(
|
|
1978
|
-
|
|
1979
|
-
orgId:
|
|
1980
|
-
projectId:
|
|
1981
|
-
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()
|
|
1982
2054
|
}),
|
|
1983
2055
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
|
|
1984
2056
|
),
|
|
1985
2057
|
approveProposal: withSchema(
|
|
1986
|
-
|
|
1987
|
-
orgId:
|
|
1988
|
-
projectId:
|
|
1989
|
-
id:
|
|
1990
|
-
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()
|
|
1991
2063
|
}),
|
|
1992
2064
|
(params) => call(
|
|
1993
2065
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
|
|
@@ -1996,11 +2068,11 @@ function createImportSourcesClient(proj) {
|
|
|
1996
2068
|
)
|
|
1997
2069
|
),
|
|
1998
2070
|
rejectProposal: withSchema(
|
|
1999
|
-
|
|
2000
|
-
orgId:
|
|
2001
|
-
projectId:
|
|
2002
|
-
id:
|
|
2003
|
-
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()
|
|
2004
2076
|
}),
|
|
2005
2077
|
(params) => call(
|
|
2006
2078
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
|
|
@@ -2012,8 +2084,8 @@ function createImportSourcesClient(proj) {
|
|
|
2012
2084
|
}
|
|
2013
2085
|
|
|
2014
2086
|
// src/admin.ts
|
|
2015
|
-
var
|
|
2016
|
-
async function
|
|
2087
|
+
var import_zod24 = require("zod");
|
|
2088
|
+
async function rawRequest3(baseUrl, hcOpts, path, init = {}) {
|
|
2017
2089
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
2018
2090
|
const rawHeaders = hcOpts?.headers;
|
|
2019
2091
|
const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
|
|
@@ -2025,7 +2097,7 @@ async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
|
2025
2097
|
}
|
|
2026
2098
|
});
|
|
2027
2099
|
}
|
|
2028
|
-
async function
|
|
2100
|
+
async function callRaw3(res) {
|
|
2029
2101
|
if (!res.ok) {
|
|
2030
2102
|
let message = fallbackMessage(res.status);
|
|
2031
2103
|
try {
|
|
@@ -2045,14 +2117,14 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2045
2117
|
* List super-admin audit events with optional filters.
|
|
2046
2118
|
*/
|
|
2047
2119
|
list: withSchema(
|
|
2048
|
-
|
|
2049
|
-
actor:
|
|
2050
|
-
action:
|
|
2051
|
-
resourceKind:
|
|
2052
|
-
since:
|
|
2053
|
-
until:
|
|
2054
|
-
limit:
|
|
2055
|
-
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")
|
|
2056
2128
|
}),
|
|
2057
2129
|
async (params) => {
|
|
2058
2130
|
const qs = new URLSearchParams();
|
|
@@ -2064,8 +2136,8 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2064
2136
|
if (params.limit !== void 0) qs.set("limit", String(params.limit));
|
|
2065
2137
|
if (params.offset !== void 0) qs.set("offset", String(params.offset));
|
|
2066
2138
|
const search = qs.toString();
|
|
2067
|
-
return
|
|
2068
|
-
await
|
|
2139
|
+
return callRaw3(
|
|
2140
|
+
await rawRequest3(baseUrl, hcOpts, `/admin/audit${search ? `?${search}` : ""}`)
|
|
2069
2141
|
);
|
|
2070
2142
|
}
|
|
2071
2143
|
)
|
|
@@ -2076,9 +2148,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2076
2148
|
* List all organizations across tenants with member + project counts.
|
|
2077
2149
|
*/
|
|
2078
2150
|
list: withSchema(
|
|
2079
|
-
|
|
2080
|
-
async () =>
|
|
2081
|
-
await
|
|
2151
|
+
import_zod24.z.object({}),
|
|
2152
|
+
async () => callRaw3(
|
|
2153
|
+
await rawRequest3(baseUrl, hcOpts, "/admin/orgs")
|
|
2082
2154
|
)
|
|
2083
2155
|
),
|
|
2084
2156
|
/**
|
|
@@ -2086,9 +2158,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2086
2158
|
* Detail view: org fields + member list + project list.
|
|
2087
2159
|
*/
|
|
2088
2160
|
get: withSchema(
|
|
2089
|
-
|
|
2090
|
-
async (params) =>
|
|
2091
|
-
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}`)
|
|
2092
2164
|
)
|
|
2093
2165
|
),
|
|
2094
2166
|
/**
|
|
@@ -2096,9 +2168,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2096
2168
|
* Set suspended_at = now(). Idempotent.
|
|
2097
2169
|
*/
|
|
2098
2170
|
suspend: withSchema(
|
|
2099
|
-
|
|
2100
|
-
async (params) =>
|
|
2101
|
-
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`, {
|
|
2102
2174
|
method: "POST"
|
|
2103
2175
|
})
|
|
2104
2176
|
)
|
|
@@ -2108,9 +2180,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2108
2180
|
* Clear suspended_at.
|
|
2109
2181
|
*/
|
|
2110
2182
|
unsuspend: withSchema(
|
|
2111
|
-
|
|
2112
|
-
async (params) =>
|
|
2113
|
-
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`, {
|
|
2114
2186
|
method: "POST"
|
|
2115
2187
|
})
|
|
2116
2188
|
)
|
|
@@ -2124,9 +2196,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2124
2196
|
* api tokens, and environments. Idempotent. Super-admin only.
|
|
2125
2197
|
*/
|
|
2126
2198
|
nuke: withSchema(
|
|
2127
|
-
|
|
2128
|
-
async (params) =>
|
|
2129
|
-
await
|
|
2199
|
+
import_zod24.z.object({ projectId: import_zod24.z.string().describe("Project ID to nuke") }),
|
|
2200
|
+
async (params) => callRaw3(
|
|
2201
|
+
await rawRequest3(
|
|
2130
2202
|
baseUrl,
|
|
2131
2203
|
hcOpts,
|
|
2132
2204
|
`/admin/projects/${encodeURIComponent(params.projectId)}/nuke`,
|
|
@@ -2142,9 +2214,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2142
2214
|
* all derived from single-table COUNT queries.
|
|
2143
2215
|
*/
|
|
2144
2216
|
overview: withSchema(
|
|
2145
|
-
|
|
2146
|
-
async () =>
|
|
2147
|
-
await
|
|
2217
|
+
import_zod24.z.object({}),
|
|
2218
|
+
async () => callRaw3(
|
|
2219
|
+
await rawRequest3(baseUrl, hcOpts, "/admin/metrics/overview")
|
|
2148
2220
|
)
|
|
2149
2221
|
)
|
|
2150
2222
|
},
|
|
@@ -2157,9 +2229,9 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2157
2229
|
* Requires super-admin.
|
|
2158
2230
|
*/
|
|
2159
2231
|
list: withSchema(
|
|
2160
|
-
|
|
2161
|
-
async () =>
|
|
2162
|
-
await
|
|
2232
|
+
import_zod24.z.object({}),
|
|
2233
|
+
async () => callRaw3(
|
|
2234
|
+
await rawRequest3(
|
|
2163
2235
|
baseUrl,
|
|
2164
2236
|
hcOpts,
|
|
2165
2237
|
"/admin/integrations/github-installations"
|
|
@@ -2172,15 +2244,15 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2172
2244
|
}
|
|
2173
2245
|
|
|
2174
2246
|
// src/resolve-source.ts
|
|
2175
|
-
var
|
|
2247
|
+
var import_zod25 = require("zod");
|
|
2176
2248
|
function createResolveSourceFn(proj) {
|
|
2177
2249
|
return withSchema(
|
|
2178
|
-
|
|
2179
|
-
orgId:
|
|
2180
|
-
projectId:
|
|
2181
|
-
kind:
|
|
2182
|
-
ref:
|
|
2183
|
-
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")
|
|
2184
2256
|
}),
|
|
2185
2257
|
(params) => {
|
|
2186
2258
|
const { orgId, projectId, kind, ref, version } = params;
|
|
@@ -2221,6 +2293,7 @@ var createClient = (baseUrl, options = {}) => {
|
|
|
2221
2293
|
actionRuns: createActionRunsClient(projEnv),
|
|
2222
2294
|
secrets: createSecretsClient(projEnv),
|
|
2223
2295
|
apply: createApplyClient(projEnv),
|
|
2296
|
+
observations: createObservationsClient(baseUrl, hcOpts),
|
|
2224
2297
|
catalogRevisions,
|
|
2225
2298
|
auditEvents: createAuditEventsClient(proj),
|
|
2226
2299
|
driftEvents: createDriftEventsClient(projEnv),
|