@terrantula/sdk 0.5.2 → 0.5.3

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.
@@ -349,6 +349,35 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
349
349
  hcOpts
350
350
  )[":tokenId"].$delete({ param: { tokenId: params.tokenId } })
351
351
  )
352
+ ),
353
+ /**
354
+ * DELETE /projects/:projectId/nuke
355
+ * Wipe all project-scoped runtime + catalog rows. Callable with a project
356
+ * API token (terr_*) at admin or owner role. Preserves the project row,
357
+ * members, GitHub repo links, API tokens, and environments. Idempotent.
358
+ */
359
+ nuke: withSchema(
360
+ z2.object({ projectId: z2.string().describe("Project ID to nuke") }),
361
+ async (params) => {
362
+ const url = `${baseUrl}/projects/${encodeURIComponent(params.projectId)}/nuke`;
363
+ const fetchImpl = hcOpts?.fetch ?? fetch;
364
+ const rawHeaders = hcOpts?.headers;
365
+ const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
366
+ const res = await fetchImpl(url, {
367
+ method: "DELETE",
368
+ headers: resolvedHeaders
369
+ });
370
+ if (!res.ok) {
371
+ let message = fallbackMessage(res.status);
372
+ try {
373
+ const body = await res.json();
374
+ if (body.error) message = body.error;
375
+ } catch {
376
+ }
377
+ throw new TerrantulaError(res.status, { error: message });
378
+ }
379
+ return res.json();
380
+ }
352
381
  )
353
382
  };
354
383
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SnapshotOp, T as TokenSource, a as SchemaFn, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './audit-export-D9TTRZOB.mjs';
2
- export { k as AdminAuditEvent, l as AdminGitHubInstallation, m as AdminOrgMember, n as AdminOrgProject, o as AdminOrgSummary, p as TerrantulaError, w as withSchema } from './audit-export-D9TTRZOB.mjs';
1
+ import { S as SnapshotOp, T as TokenSource, a as SchemaFn, P as ProjectNukeResponse, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './projects-BxDuMQLR.mjs';
2
+ export { k as AdminAuditEvent, l as AdminGitHubInstallation, m as AdminOrgMember, n as AdminOrgProject, o as AdminOrgSummary, p as TerrantulaError, w as withSchema } from './projects-BxDuMQLR.mjs';
3
3
  import * as _terrantula_types from '@terrantula/types';
4
4
  import * as zod from 'zod';
5
5
  import * as hono_hono_base from 'hono/hono-base';
@@ -6481,6 +6481,13 @@ declare const createClient: (baseUrl: string, options?: CreateClientOptions | To
6481
6481
  revoked: true;
6482
6482
  id: string;
6483
6483
  }>;
6484
+ nuke: SchemaFn<zod.ZodObject<{
6485
+ projectId: zod.ZodString;
6486
+ }, "strip", zod.ZodTypeAny, {
6487
+ projectId: string;
6488
+ }, {
6489
+ projectId: string;
6490
+ }>, ProjectNukeResponse>;
6484
6491
  };
6485
6492
  github: {
6486
6493
  connect: SchemaFn<zod.ZodObject<{
@@ -23184,4 +23191,4 @@ declare const createClient: (baseUrl: string, options?: CreateClientOptions | To
23184
23191
  };
23185
23192
  type TerrantulaCloudClient = ReturnType<typeof createClient>;
23186
23193
 
23187
- export { AdminAuditListResponse, AdminGitHubInstallationListResponse, AdminMetricsOverview, AdminOrgDetail, AdminOrgListResponse, AdminProjectNukeResponse, AdminSuspendResponse, AuditExportConfigResponse, AuditExportRunResponse, type CloudAppType, type CreateClientOptions, type ProjectAppType, SchemaFn, type TerrantulaCloudClient, TestConnectionResponse, TokenSource, createClient };
23194
+ export { AdminAuditListResponse, AdminGitHubInstallationListResponse, AdminMetricsOverview, AdminOrgDetail, AdminOrgListResponse, AdminProjectNukeResponse, AdminSuspendResponse, AuditExportConfigResponse, AuditExportRunResponse, type CloudAppType, type CreateClientOptions, type ProjectAppType, ProjectNukeResponse, SchemaFn, type TerrantulaCloudClient, TestConnectionResponse, TokenSource, createClient };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SnapshotOp, T as TokenSource, a as SchemaFn, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './audit-export-D9TTRZOB.js';
2
- export { k as AdminAuditEvent, l as AdminGitHubInstallation, m as AdminOrgMember, n as AdminOrgProject, o as AdminOrgSummary, p as TerrantulaError, w as withSchema } from './audit-export-D9TTRZOB.js';
1
+ import { S as SnapshotOp, T as TokenSource, a as SchemaFn, P as ProjectNukeResponse, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './projects-BxDuMQLR.js';
2
+ export { k as AdminAuditEvent, l as AdminGitHubInstallation, m as AdminOrgMember, n as AdminOrgProject, o as AdminOrgSummary, p as TerrantulaError, w as withSchema } from './projects-BxDuMQLR.js';
3
3
  import * as _terrantula_types from '@terrantula/types';
4
4
  import * as zod from 'zod';
5
5
  import * as hono_hono_base from 'hono/hono-base';
@@ -6481,6 +6481,13 @@ declare const createClient: (baseUrl: string, options?: CreateClientOptions | To
6481
6481
  revoked: true;
6482
6482
  id: string;
6483
6483
  }>;
6484
+ nuke: SchemaFn<zod.ZodObject<{
6485
+ projectId: zod.ZodString;
6486
+ }, "strip", zod.ZodTypeAny, {
6487
+ projectId: string;
6488
+ }, {
6489
+ projectId: string;
6490
+ }>, ProjectNukeResponse>;
6484
6491
  };
6485
6492
  github: {
6486
6493
  connect: SchemaFn<zod.ZodObject<{
@@ -23184,4 +23191,4 @@ declare const createClient: (baseUrl: string, options?: CreateClientOptions | To
23184
23191
  };
23185
23192
  type TerrantulaCloudClient = ReturnType<typeof createClient>;
23186
23193
 
23187
- export { AdminAuditListResponse, AdminGitHubInstallationListResponse, AdminMetricsOverview, AdminOrgDetail, AdminOrgListResponse, AdminProjectNukeResponse, AdminSuspendResponse, AuditExportConfigResponse, AuditExportRunResponse, type CloudAppType, type CreateClientOptions, type ProjectAppType, SchemaFn, type TerrantulaCloudClient, TestConnectionResponse, TokenSource, createClient };
23194
+ export { AdminAuditListResponse, AdminGitHubInstallationListResponse, AdminMetricsOverview, AdminOrgDetail, AdminOrgListResponse, AdminProjectNukeResponse, AdminSuspendResponse, AuditExportConfigResponse, AuditExportRunResponse, type CloudAppType, type CreateClientOptions, type ProjectAppType, ProjectNukeResponse, SchemaFn, type TerrantulaCloudClient, TestConnectionResponse, TokenSource, createClient };
package/dist/index.js CHANGED
@@ -375,6 +375,35 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
375
375
  hcOpts
376
376
  )[":tokenId"].$delete({ param: { tokenId: params.tokenId } })
377
377
  )
378
+ ),
379
+ /**
380
+ * DELETE /projects/:projectId/nuke
381
+ * Wipe all project-scoped runtime + catalog rows. Callable with a project
382
+ * API token (terr_*) at admin or owner role. Preserves the project row,
383
+ * members, GitHub repo links, API tokens, and environments. Idempotent.
384
+ */
385
+ nuke: withSchema(
386
+ import_zod2.z.object({ projectId: import_zod2.z.string().describe("Project ID to nuke") }),
387
+ async (params) => {
388
+ const url = `${baseUrl}/projects/${encodeURIComponent(params.projectId)}/nuke`;
389
+ const fetchImpl = hcOpts?.fetch ?? fetch;
390
+ const rawHeaders = hcOpts?.headers;
391
+ const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
392
+ const res = await fetchImpl(url, {
393
+ method: "DELETE",
394
+ headers: resolvedHeaders
395
+ });
396
+ if (!res.ok) {
397
+ let message = fallbackMessage(res.status);
398
+ try {
399
+ const body = await res.json();
400
+ if (body.error) message = body.error;
401
+ } catch {
402
+ }
403
+ throw new TerrantulaError(res.status, { error: message });
404
+ }
405
+ return res.json();
406
+ }
378
407
  )
379
408
  };
380
409
  }
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  TerrantulaError,
3
3
  createClient,
4
4
  withSchema
5
- } from "./chunk-UKBDIIOX.mjs";
5
+ } from "./chunk-ZHZROIL5.mjs";
6
6
  export {
7
7
  TerrantulaError,
8
8
  createClient,
package/dist/local.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as SchemaFn, S as SnapshotOp, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './audit-export-D9TTRZOB.mjs';
1
+ import { a as SchemaFn, P as ProjectNukeResponse, S as SnapshotOp, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './projects-BxDuMQLR.mjs';
2
2
  import * as _terrantula_types from '@terrantula/types';
3
3
  import * as hono_utils_types from 'hono/utils/types';
4
4
  import * as zod from 'zod';
@@ -549,6 +549,13 @@ declare const createLocalClient: (options?: CreateLocalClientOptions) => {
549
549
  revoked: true;
550
550
  id: string;
551
551
  }>;
552
+ nuke: SchemaFn<zod.ZodObject<{
553
+ projectId: zod.ZodString;
554
+ }, "strip", zod.ZodTypeAny, {
555
+ projectId: string;
556
+ }, {
557
+ projectId: string;
558
+ }>, ProjectNukeResponse>;
552
559
  };
553
560
  github: {
554
561
  connect: SchemaFn<zod.ZodObject<{
package/dist/local.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as SchemaFn, S as SnapshotOp, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './audit-export-D9TTRZOB.js';
1
+ import { a as SchemaFn, P as ProjectNukeResponse, S as SnapshotOp, A as AuditExportConfigResponse, b as TestConnectionResponse, c as AuditExportRunResponse, E as ExportCatalogResult, d as AdminAuditListResponse, e as AdminOrgListResponse, f as AdminOrgDetail, g as AdminSuspendResponse, h as AdminProjectNukeResponse, i as AdminMetricsOverview, j as AdminGitHubInstallationListResponse } from './projects-BxDuMQLR.js';
2
2
  import * as _terrantula_types from '@terrantula/types';
3
3
  import * as hono_utils_types from 'hono/utils/types';
4
4
  import * as zod from 'zod';
@@ -549,6 +549,13 @@ declare const createLocalClient: (options?: CreateLocalClientOptions) => {
549
549
  revoked: true;
550
550
  id: string;
551
551
  }>;
552
+ nuke: SchemaFn<zod.ZodObject<{
553
+ projectId: zod.ZodString;
554
+ }, "strip", zod.ZodTypeAny, {
555
+ projectId: string;
556
+ }, {
557
+ projectId: string;
558
+ }>, ProjectNukeResponse>;
552
559
  };
553
560
  github: {
554
561
  connect: SchemaFn<zod.ZodObject<{
package/dist/local.js CHANGED
@@ -375,6 +375,35 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
375
375
  hcOpts
376
376
  )[":tokenId"].$delete({ param: { tokenId: params.tokenId } })
377
377
  )
378
+ ),
379
+ /**
380
+ * DELETE /projects/:projectId/nuke
381
+ * Wipe all project-scoped runtime + catalog rows. Callable with a project
382
+ * API token (terr_*) at admin or owner role. Preserves the project row,
383
+ * members, GitHub repo links, API tokens, and environments. Idempotent.
384
+ */
385
+ nuke: withSchema(
386
+ import_zod2.z.object({ projectId: import_zod2.z.string().describe("Project ID to nuke") }),
387
+ async (params) => {
388
+ const url = `${baseUrl}/projects/${encodeURIComponent(params.projectId)}/nuke`;
389
+ const fetchImpl = hcOpts?.fetch ?? fetch;
390
+ const rawHeaders = hcOpts?.headers;
391
+ const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
392
+ const res = await fetchImpl(url, {
393
+ method: "DELETE",
394
+ headers: resolvedHeaders
395
+ });
396
+ if (!res.ok) {
397
+ let message = fallbackMessage(res.status);
398
+ try {
399
+ const body = await res.json();
400
+ if (body.error) message = body.error;
401
+ } catch {
402
+ }
403
+ throw new TerrantulaError(res.status, { error: message });
404
+ }
405
+ return res.json();
406
+ }
378
407
  )
379
408
  };
380
409
  }
package/dist/local.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createClient
3
- } from "./chunk-UKBDIIOX.mjs";
3
+ } from "./chunk-ZHZROIL5.mjs";
4
4
 
5
5
  // src/local.ts
6
6
  import { createLocalApp, openLocalDb } from "@terrantula/local";
@@ -148,4 +148,25 @@ interface TestConnectionResponse {
148
148
  error?: string;
149
149
  }
150
150
 
151
- export { type AuditExportConfigResponse as A, type ExportCatalogResult as E, type SnapshotOp as S, type TokenSource as T, type SchemaFn as a, type TestConnectionResponse as b, type AuditExportRunResponse as c, type AdminAuditListResponse as d, type AdminOrgListResponse as e, type AdminOrgDetail as f, type AdminSuspendResponse as g, type AdminProjectNukeResponse as h, type AdminMetricsOverview as i, type AdminGitHubInstallationListResponse as j, type AdminAuditEvent as k, type AdminGitHubInstallation as l, type AdminOrgMember as m, type AdminOrgProject as n, type AdminOrgSummary as o, TerrantulaError as p, withSchema as w };
151
+ interface ProjectNukeResponse {
152
+ projectId: string;
153
+ rowCountsDeleted: {
154
+ entities: number;
155
+ entityMetricValues: number;
156
+ relationships: number;
157
+ actionRuns: number;
158
+ cells: number;
159
+ relationshipTypes: number;
160
+ actions: number;
161
+ entityTypes: number;
162
+ catalogRevisions: number;
163
+ applyHunkSnapshots: number;
164
+ auditEvents: number;
165
+ driftEvents: number;
166
+ driftProposals: number;
167
+ importSources: number;
168
+ secrets: number;
169
+ };
170
+ }
171
+
172
+ export { type AuditExportConfigResponse as A, type ExportCatalogResult as E, type ProjectNukeResponse as P, type SnapshotOp as S, type TokenSource as T, type SchemaFn as a, type TestConnectionResponse as b, type AuditExportRunResponse as c, type AdminAuditListResponse as d, type AdminOrgListResponse as e, type AdminOrgDetail as f, type AdminSuspendResponse as g, type AdminProjectNukeResponse as h, type AdminMetricsOverview as i, type AdminGitHubInstallationListResponse as j, type AdminAuditEvent as k, type AdminGitHubInstallation as l, type AdminOrgMember as m, type AdminOrgProject as n, type AdminOrgSummary as o, TerrantulaError as p, withSchema as w };
@@ -148,4 +148,25 @@ interface TestConnectionResponse {
148
148
  error?: string;
149
149
  }
150
150
 
151
- export { type AuditExportConfigResponse as A, type ExportCatalogResult as E, type SnapshotOp as S, type TokenSource as T, type SchemaFn as a, type TestConnectionResponse as b, type AuditExportRunResponse as c, type AdminAuditListResponse as d, type AdminOrgListResponse as e, type AdminOrgDetail as f, type AdminSuspendResponse as g, type AdminProjectNukeResponse as h, type AdminMetricsOverview as i, type AdminGitHubInstallationListResponse as j, type AdminAuditEvent as k, type AdminGitHubInstallation as l, type AdminOrgMember as m, type AdminOrgProject as n, type AdminOrgSummary as o, TerrantulaError as p, withSchema as w };
151
+ interface ProjectNukeResponse {
152
+ projectId: string;
153
+ rowCountsDeleted: {
154
+ entities: number;
155
+ entityMetricValues: number;
156
+ relationships: number;
157
+ actionRuns: number;
158
+ cells: number;
159
+ relationshipTypes: number;
160
+ actions: number;
161
+ entityTypes: number;
162
+ catalogRevisions: number;
163
+ applyHunkSnapshots: number;
164
+ auditEvents: number;
165
+ driftEvents: number;
166
+ driftProposals: number;
167
+ importSources: number;
168
+ secrets: number;
169
+ };
170
+ }
171
+
172
+ export { type AuditExportConfigResponse as A, type ExportCatalogResult as E, type ProjectNukeResponse as P, type SnapshotOp as S, type TokenSource as T, type SchemaFn as a, type TestConnectionResponse as b, type AuditExportRunResponse as c, type AdminAuditListResponse as d, type AdminOrgListResponse as e, type AdminOrgDetail as f, type AdminSuspendResponse as g, type AdminProjectNukeResponse as h, type AdminMetricsOverview as i, type AdminGitHubInstallationListResponse as j, type AdminAuditEvent as k, type AdminGitHubInstallation as l, type AdminOrgMember as m, type AdminOrgProject as n, type AdminOrgSummary as o, TerrantulaError as p, withSchema as w };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terrantula/sdk",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
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",