@terrantula/sdk 0.11.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/local.js CHANGED
@@ -1287,9 +1287,12 @@ function createExportCatalogFn(proj, projEnv) {
1287
1287
  ...entityTypes.map(
1288
1288
  (r) => ({ kind: "EntityType", ...stripServerFields(r) })
1289
1289
  ),
1290
- ...cells.map(
1291
- (r) => ({ kind: "Cell", ...stripServerFields(r) })
1292
- ),
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
+ }),
1293
1296
  ...relationshipTypes.map((r) => {
1294
1297
  const { fromEntityTypeName, toEntityTypeName, ...rest } = r;
1295
1298
  const stripped = stripServerFields(rest);
@@ -2055,6 +2058,27 @@ function createAdminClient(baseUrl, hcOpts) {
2055
2058
  };
2056
2059
  }
2057
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
+
2058
2082
  // src/index.ts
2059
2083
  var createClient = (baseUrl, options = {}) => {
2060
2084
  const opts = typeof options === "string" || typeof options === "function" ? { token: options } : options;
@@ -2092,6 +2116,7 @@ var createClient = (baseUrl, options = {}) => {
2092
2116
  auditExport: createAuditExportClient(baseUrl, hcOpts),
2093
2117
  userPreferences: createUserPreferencesClient(baseUrl, hcOpts),
2094
2118
  importSources: createImportSourcesClient(proj),
2119
+ resolveSource: createResolveSourceFn(proj),
2095
2120
  exportCatalog,
2096
2121
  admin: createAdminClient(baseUrl, hcOpts)
2097
2122
  };
package/dist/local.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createClient
3
- } from "./chunk-5JCSB6F5.mjs";
3
+ } from "./chunk-773V5YNO.mjs";
4
4
 
5
5
  // src/local.ts
6
6
  import { createLocalApp, openLocalDb } from "@terrantula/local";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terrantula/sdk",
3
- "version": "0.11.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.4.0",
64
- "@terrantula/types": "^0.4.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
  },