@terrantula/sdk 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-D2JXYF4W.mjs → chunk-773V5YNO.mjs} +56 -4
- package/dist/index.d.mts +439 -60
- package/dist/index.d.ts +439 -60
- package/dist/index.js +56 -4
- package/dist/index.mjs +1 -1
- package/dist/local.d.mts +308 -52
- package/dist/local.d.ts +308 -52
- package/dist/local.js +56 -4
- package/dist/local.mjs +1 -1
- package/package.json +3 -3
package/dist/local.js
CHANGED
|
@@ -484,6 +484,32 @@ function createEntitiesClient(projEnv) {
|
|
|
484
484
|
);
|
|
485
485
|
}
|
|
486
486
|
),
|
|
487
|
+
facets: withSchema(
|
|
488
|
+
import_zod3.z.object({
|
|
489
|
+
orgId: import_zod3.z.string().describe("Organization slug"),
|
|
490
|
+
projectId: import_zod3.z.string().describe("Project name"),
|
|
491
|
+
envName: import_zod3.z.string().describe("Environment name"),
|
|
492
|
+
kind: import_zod3.z.array(import_zod3.z.string()).optional().describe("Filter: entity type names"),
|
|
493
|
+
state: import_zod3.z.array(import_zod3.z.string()).optional().describe("Filter: states"),
|
|
494
|
+
owner: import_zod3.z.array(import_zod3.z.string()).optional().describe("Filter: owner label values ('' = unset)"),
|
|
495
|
+
cell: import_zod3.z.array(import_zod3.z.string()).optional().describe("Filter: cell label values ('' = unset)"),
|
|
496
|
+
search: import_zod3.z.string().optional().describe("Substring match on name + entity type"),
|
|
497
|
+
cellKey: import_zod3.z.string().optional().describe("Project cell label key; omit to skip the cell dimension")
|
|
498
|
+
}),
|
|
499
|
+
(params) => {
|
|
500
|
+
const { orgId, projectId, envName, kind, state, owner, cell, search, cellKey } = params;
|
|
501
|
+
const query = {};
|
|
502
|
+
if (kind?.length) query.kind = JSON.stringify(kind);
|
|
503
|
+
if (state?.length) query.state = JSON.stringify(state);
|
|
504
|
+
if (owner?.length) query.owner = JSON.stringify(owner);
|
|
505
|
+
if (cell?.length) query.cell = JSON.stringify(cell);
|
|
506
|
+
if (search) query.search = search;
|
|
507
|
+
if (cellKey) query.cellKey = cellKey;
|
|
508
|
+
return call(
|
|
509
|
+
projEnv(orgId, projectId, envName)["entities"]["facets"].$get({ query })
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
),
|
|
487
513
|
get: withSchema(
|
|
488
514
|
import_zod3.z.object({
|
|
489
515
|
orgId: import_zod3.z.string().describe("Organization slug"),
|
|
@@ -859,7 +885,8 @@ function createRelationshipsClient(projEnv) {
|
|
|
859
885
|
toEntity: import_zod6.z.string().uuid().optional().describe("Filter by to-entity ID"),
|
|
860
886
|
fromEntityCell: import_zod6.z.string().optional().describe("Filter by from-entity cell membership"),
|
|
861
887
|
toEntityCell: import_zod6.z.string().optional().describe("Filter by to-entity cell membership"),
|
|
862
|
-
limit: import_zod6.z.coerce.number().int().min(1).max(100).optional().describe("Max results (1-100)")
|
|
888
|
+
limit: import_zod6.z.coerce.number().int().min(1).max(100).optional().describe("Max results (1-100)"),
|
|
889
|
+
cursor: import_zod6.z.string().optional().describe("Pagination cursor")
|
|
863
890
|
}),
|
|
864
891
|
(params) => {
|
|
865
892
|
const { orgId, projectId, envName, ...query } = params;
|
|
@@ -1260,9 +1287,12 @@ function createExportCatalogFn(proj, projEnv) {
|
|
|
1260
1287
|
...entityTypes.map(
|
|
1261
1288
|
(r) => ({ kind: "EntityType", ...stripServerFields(r) })
|
|
1262
1289
|
),
|
|
1263
|
-
...cells.map(
|
|
1264
|
-
|
|
1265
|
-
|
|
1290
|
+
...cells.map((r) => {
|
|
1291
|
+
const { entityTypeName, ...rest } = r;
|
|
1292
|
+
const stripped = stripServerFields(rest);
|
|
1293
|
+
if (entityTypeName != null) stripped.entityType = entityTypeName;
|
|
1294
|
+
return { kind: "Cell", ...stripped };
|
|
1295
|
+
}),
|
|
1266
1296
|
...relationshipTypes.map((r) => {
|
|
1267
1297
|
const { fromEntityTypeName, toEntityTypeName, ...rest } = r;
|
|
1268
1298
|
const stripped = stripServerFields(rest);
|
|
@@ -2028,6 +2058,27 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2028
2058
|
};
|
|
2029
2059
|
}
|
|
2030
2060
|
|
|
2061
|
+
// src/resolve-source.ts
|
|
2062
|
+
var import_zod22 = require("zod");
|
|
2063
|
+
function createResolveSourceFn(proj) {
|
|
2064
|
+
return withSchema(
|
|
2065
|
+
import_zod22.z.object({
|
|
2066
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
2067
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
2068
|
+
kind: import_zod22.z.literal("registry").describe('Source kind \u2014 only "registry" is supported today'),
|
|
2069
|
+
ref: import_zod22.z.string().regex(/^[^/]+\/[^/]+\/[^/]+$/, { message: "ref must be <namespace>/<name>/<provider>" }).describe("Terraform Registry module ref (<namespace>/<name>/<provider>)"),
|
|
2070
|
+
version: import_zod22.z.string().optional().describe("Module version semver \u2014 resolves latest if omitted")
|
|
2071
|
+
}),
|
|
2072
|
+
(params) => {
|
|
2073
|
+
const { orgId, projectId, kind, ref, version } = params;
|
|
2074
|
+
const json = version !== void 0 ? { kind, ref, version } : { kind, ref };
|
|
2075
|
+
return call(
|
|
2076
|
+
proj(orgId, projectId)["resolve-source"].$post({ json })
|
|
2077
|
+
);
|
|
2078
|
+
}
|
|
2079
|
+
);
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2031
2082
|
// src/index.ts
|
|
2032
2083
|
var createClient = (baseUrl, options = {}) => {
|
|
2033
2084
|
const opts = typeof options === "string" || typeof options === "function" ? { token: options } : options;
|
|
@@ -2065,6 +2116,7 @@ var createClient = (baseUrl, options = {}) => {
|
|
|
2065
2116
|
auditExport: createAuditExportClient(baseUrl, hcOpts),
|
|
2066
2117
|
userPreferences: createUserPreferencesClient(baseUrl, hcOpts),
|
|
2067
2118
|
importSources: createImportSourcesClient(proj),
|
|
2119
|
+
resolveSource: createResolveSourceFn(proj),
|
|
2068
2120
|
exportCatalog,
|
|
2069
2121
|
admin: createAdminClient(baseUrl, hcOpts)
|
|
2070
2122
|
};
|
package/dist/local.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrantula/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "TypeScript SDK for Terrantula — the multi-tenant entity-graph control plane that herds Terraform/OpenTofu cattle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"terrantula",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"test": "bun test"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@terrantula/local": "^0.
|
|
64
|
-
"@terrantula/types": "^0.
|
|
63
|
+
"@terrantula/local": "^0.4.1",
|
|
64
|
+
"@terrantula/types": "^0.4.2",
|
|
65
65
|
"hono": "^4.4.0",
|
|
66
66
|
"zod": "^3.22.0"
|
|
67
67
|
},
|