@terrantula/sdk 0.11.2 → 0.13.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-M7S27EER.mjs → chunk-E3CKS754.mjs} +181 -129
- package/dist/index.d.mts +1437 -606
- package/dist/index.d.ts +1437 -606
- package/dist/index.js +181 -129
- package/dist/index.mjs +1 -1
- package/dist/local.d.mts +870 -352
- package/dist/local.d.ts +870 -352
- package/dist/local.js +181 -129
- package/dist/local.mjs +1 -1
- package/package.json +3 -3
package/dist/local.js
CHANGED
|
@@ -1382,7 +1382,8 @@ function createCatalogRevisionsClient(proj) {
|
|
|
1382
1382
|
import_zod13.z.object({
|
|
1383
1383
|
orgId: import_zod13.z.string().describe("Organization slug"),
|
|
1384
1384
|
projectId: import_zod13.z.string().describe("Project ID"),
|
|
1385
|
-
limit: import_zod13.z.coerce.number().int().min(1).max(200).optional().describe("Max revisions to return (1-200)")
|
|
1385
|
+
limit: import_zod13.z.coerce.number().int().min(1).max(200).optional().describe("Max revisions to return (1-200)"),
|
|
1386
|
+
before: import_zod13.z.string().datetime().optional().describe("ISO timestamp; only revisions with appliedAt strictly before this are returned (keyset upper-bound)")
|
|
1386
1387
|
}),
|
|
1387
1388
|
(params) => {
|
|
1388
1389
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1454,6 +1455,7 @@ function createAuditEventsClient(proj) {
|
|
|
1454
1455
|
action: import_zod14.z.string().optional().describe('Comma-separated actions (e.g. "create,delete")'),
|
|
1455
1456
|
resourceKind: import_zod14.z.string().optional().describe("Filter to one resource kind (Entity | Token | Member | \u2026)"),
|
|
1456
1457
|
since: import_zod14.z.string().datetime().optional().describe("ISO timestamp; only events strictly after this are returned"),
|
|
1458
|
+
before: import_zod14.z.string().datetime().optional().describe("ISO timestamp; only events strictly before this are returned (keyset upper-bound)"),
|
|
1457
1459
|
limit: import_zod14.z.coerce.number().int().min(1).max(500).optional().describe("Max rows (1-500)")
|
|
1458
1460
|
}).describe("List audit events for a project \u2014 auditor-friendly read-only feed"),
|
|
1459
1461
|
(params) => {
|
|
@@ -1514,6 +1516,7 @@ function createDriftEventsClient(projEnv) {
|
|
|
1514
1516
|
kind: import_zod16.z.string().optional().describe("Filter by entity type name"),
|
|
1515
1517
|
entityName: import_zod16.z.string().optional().describe("Filter by entity name"),
|
|
1516
1518
|
since: import_zod16.z.string().optional().describe("ISO timestamp lower bound on detectedAt"),
|
|
1519
|
+
before: import_zod16.z.string().datetime().optional().describe("ISO timestamp upper bound on detectedAt (keyset cursor)"),
|
|
1517
1520
|
limit: import_zod16.z.coerce.number().int().min(1).max(500).optional()
|
|
1518
1521
|
}),
|
|
1519
1522
|
(params) => {
|
|
@@ -1588,16 +1591,64 @@ function createDriftEventsClient(projEnv) {
|
|
|
1588
1591
|
};
|
|
1589
1592
|
}
|
|
1590
1593
|
|
|
1591
|
-
// src/
|
|
1594
|
+
// src/conformance-findings.ts
|
|
1592
1595
|
var import_zod17 = require("zod");
|
|
1593
|
-
var
|
|
1594
|
-
|
|
1595
|
-
function createStatsClient(proj) {
|
|
1596
|
+
var import_types8 = require("@terrantula/types");
|
|
1597
|
+
function createConformanceFindingsClient(projEnv) {
|
|
1596
1598
|
return {
|
|
1597
|
-
|
|
1599
|
+
list: withSchema(
|
|
1600
|
+
import_zod17.z.object({
|
|
1601
|
+
orgId: import_zod17.z.string().describe("Organization slug"),
|
|
1602
|
+
projectId: import_zod17.z.string().describe("Project name"),
|
|
1603
|
+
envName: import_zod17.z.string().describe("Environment name"),
|
|
1604
|
+
status: import_types8.FindingStatusSchema.optional(),
|
|
1605
|
+
severity: import_types8.FindingSeveritySchema.optional(),
|
|
1606
|
+
kind: import_zod17.z.string().optional().describe("Filter by entity type name"),
|
|
1607
|
+
findingKind: import_zod17.z.string().optional().describe("Filter by finding kind (e.g. MISSING_REQUIRED_PROPERTY)"),
|
|
1608
|
+
entityName: import_zod17.z.string().optional().describe("Filter by entity name"),
|
|
1609
|
+
limit: import_zod17.z.coerce.number().int().min(1).max(500).optional()
|
|
1610
|
+
}),
|
|
1611
|
+
(params) => {
|
|
1612
|
+
const { orgId, projectId, envName, ...query } = params;
|
|
1613
|
+
return call(
|
|
1614
|
+
projEnv(orgId, projectId, envName)["conformance-findings"].$get({ query: stringifyQuery(query) })
|
|
1615
|
+
);
|
|
1616
|
+
}
|
|
1617
|
+
),
|
|
1618
|
+
count: withSchema(
|
|
1619
|
+
import_zod17.z.object({
|
|
1620
|
+
orgId: import_zod17.z.string().describe("Organization slug"),
|
|
1621
|
+
projectId: import_zod17.z.string().describe("Project name"),
|
|
1622
|
+
envName: import_zod17.z.string().describe("Environment name")
|
|
1623
|
+
}),
|
|
1624
|
+
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"].count.$get())
|
|
1625
|
+
),
|
|
1626
|
+
get: withSchema(
|
|
1598
1627
|
import_zod17.z.object({
|
|
1599
1628
|
orgId: import_zod17.z.string().describe("Organization slug"),
|
|
1600
1629
|
projectId: import_zod17.z.string().describe("Project name"),
|
|
1630
|
+
envName: import_zod17.z.string().describe("Environment name"),
|
|
1631
|
+
id: import_zod17.z.string().uuid()
|
|
1632
|
+
}),
|
|
1633
|
+
(params) => call(
|
|
1634
|
+
projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"][":id"].$get({
|
|
1635
|
+
param: { id: params.id }
|
|
1636
|
+
})
|
|
1637
|
+
)
|
|
1638
|
+
)
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
// src/stats.ts
|
|
1643
|
+
var import_zod18 = require("zod");
|
|
1644
|
+
var WindowSchema = import_zod18.z.enum(["1h", "24h", "7d"]).optional().describe("Time window \u2014 default 24h");
|
|
1645
|
+
var BucketSchema = import_zod18.z.enum(["1m", "5m", "1h", "1d"]).optional().describe("Bucket granularity \u2014 default 1h");
|
|
1646
|
+
function createStatsClient(proj) {
|
|
1647
|
+
return {
|
|
1648
|
+
entitiesByState: withSchema(
|
|
1649
|
+
import_zod18.z.object({
|
|
1650
|
+
orgId: import_zod18.z.string().describe("Organization slug"),
|
|
1651
|
+
projectId: import_zod18.z.string().describe("Project name"),
|
|
1601
1652
|
window: WindowSchema,
|
|
1602
1653
|
bucket: BucketSchema
|
|
1603
1654
|
}),
|
|
@@ -1607,9 +1658,9 @@ function createStatsClient(proj) {
|
|
|
1607
1658
|
}
|
|
1608
1659
|
),
|
|
1609
1660
|
runsByType: withSchema(
|
|
1610
|
-
|
|
1611
|
-
orgId:
|
|
1612
|
-
projectId:
|
|
1661
|
+
import_zod18.z.object({
|
|
1662
|
+
orgId: import_zod18.z.string().describe("Organization slug"),
|
|
1663
|
+
projectId: import_zod18.z.string().describe("Project name"),
|
|
1613
1664
|
window: WindowSchema
|
|
1614
1665
|
}),
|
|
1615
1666
|
(params) => {
|
|
@@ -1618,9 +1669,9 @@ function createStatsClient(proj) {
|
|
|
1618
1669
|
}
|
|
1619
1670
|
),
|
|
1620
1671
|
failingKinds: withSchema(
|
|
1621
|
-
|
|
1622
|
-
orgId:
|
|
1623
|
-
projectId:
|
|
1672
|
+
import_zod18.z.object({
|
|
1673
|
+
orgId: import_zod18.z.string().describe("Organization slug"),
|
|
1674
|
+
projectId: import_zod18.z.string().describe("Project name"),
|
|
1624
1675
|
window: WindowSchema
|
|
1625
1676
|
}),
|
|
1626
1677
|
(params) => {
|
|
@@ -1629,10 +1680,10 @@ function createStatsClient(proj) {
|
|
|
1629
1680
|
}
|
|
1630
1681
|
),
|
|
1631
1682
|
driftDensity: withSchema(
|
|
1632
|
-
|
|
1633
|
-
orgId:
|
|
1634
|
-
projectId:
|
|
1635
|
-
dim:
|
|
1683
|
+
import_zod18.z.object({
|
|
1684
|
+
orgId: import_zod18.z.string().describe("Organization slug"),
|
|
1685
|
+
projectId: import_zod18.z.string().describe("Project name"),
|
|
1686
|
+
dim: import_zod18.z.string().optional().describe('Dimensions to bucket \u2014 e.g. "kind,cell"')
|
|
1636
1687
|
}),
|
|
1637
1688
|
(params) => {
|
|
1638
1689
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1643,34 +1694,34 @@ function createStatsClient(proj) {
|
|
|
1643
1694
|
}
|
|
1644
1695
|
|
|
1645
1696
|
// src/graph-views.ts
|
|
1646
|
-
var
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1697
|
+
var import_zod19 = require("zod");
|
|
1698
|
+
var PinnedPositionsSchema = import_zod19.z.record(import_zod19.z.string(), import_zod19.z.object({ x: import_zod19.z.number(), y: import_zod19.z.number() })).nullable();
|
|
1699
|
+
var ViewSpecSchema = import_zod19.z.unknown().nullable();
|
|
1649
1700
|
function createGraphViewsClient(proj) {
|
|
1650
1701
|
return {
|
|
1651
1702
|
list: withSchema(
|
|
1652
|
-
|
|
1653
|
-
orgId:
|
|
1654
|
-
projectId:
|
|
1703
|
+
import_zod19.z.object({
|
|
1704
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1705
|
+
projectId: import_zod19.z.string().describe("Project ID")
|
|
1655
1706
|
}),
|
|
1656
1707
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"].$get())
|
|
1657
1708
|
),
|
|
1658
1709
|
get: withSchema(
|
|
1659
|
-
|
|
1660
|
-
orgId:
|
|
1661
|
-
projectId:
|
|
1662
|
-
id:
|
|
1710
|
+
import_zod19.z.object({
|
|
1711
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1712
|
+
projectId: import_zod19.z.string().describe("Project ID"),
|
|
1713
|
+
id: import_zod19.z.string().describe("View id")
|
|
1663
1714
|
}),
|
|
1664
1715
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$get({ param: { id: params.id } }))
|
|
1665
1716
|
),
|
|
1666
1717
|
create: withSchema(
|
|
1667
|
-
|
|
1668
|
-
orgId:
|
|
1669
|
-
projectId:
|
|
1670
|
-
name:
|
|
1671
|
-
scope:
|
|
1672
|
-
|
|
1673
|
-
|
|
1718
|
+
import_zod19.z.object({
|
|
1719
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1720
|
+
projectId: import_zod19.z.string().describe("Project ID"),
|
|
1721
|
+
name: import_zod19.z.string().describe("View name"),
|
|
1722
|
+
scope: import_zod19.z.enum(["user", "project"]).describe("Personal or project scope"),
|
|
1723
|
+
pinnedPositions: PinnedPositionsSchema.optional().describe("Pinned node positions"),
|
|
1724
|
+
viewSpec: ViewSpecSchema.optional().describe("ViewSpec JSON (opaque passthrough)")
|
|
1674
1725
|
}),
|
|
1675
1726
|
(params) => {
|
|
1676
1727
|
const { orgId, projectId, ...body } = params;
|
|
@@ -1678,13 +1729,13 @@ function createGraphViewsClient(proj) {
|
|
|
1678
1729
|
}
|
|
1679
1730
|
),
|
|
1680
1731
|
update: withSchema(
|
|
1681
|
-
|
|
1682
|
-
orgId:
|
|
1683
|
-
projectId:
|
|
1684
|
-
id:
|
|
1685
|
-
name:
|
|
1686
|
-
|
|
1687
|
-
|
|
1732
|
+
import_zod19.z.object({
|
|
1733
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1734
|
+
projectId: import_zod19.z.string().describe("Project ID"),
|
|
1735
|
+
id: import_zod19.z.string().describe("View id"),
|
|
1736
|
+
name: import_zod19.z.string().optional().describe("New name"),
|
|
1737
|
+
pinnedPositions: PinnedPositionsSchema.optional().describe("Replacement pinned positions"),
|
|
1738
|
+
viewSpec: ViewSpecSchema.optional().describe("Replacement ViewSpec JSON (opaque passthrough)")
|
|
1688
1739
|
}),
|
|
1689
1740
|
(params) => {
|
|
1690
1741
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1694,18 +1745,18 @@ function createGraphViewsClient(proj) {
|
|
|
1694
1745
|
}
|
|
1695
1746
|
),
|
|
1696
1747
|
delete: withSchema(
|
|
1697
|
-
|
|
1698
|
-
orgId:
|
|
1699
|
-
projectId:
|
|
1700
|
-
id:
|
|
1748
|
+
import_zod19.z.object({
|
|
1749
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1750
|
+
projectId: import_zod19.z.string().describe("Project ID"),
|
|
1751
|
+
id: import_zod19.z.string().describe("View id")
|
|
1701
1752
|
}),
|
|
1702
1753
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$delete({ param: { id: params.id } }))
|
|
1703
1754
|
),
|
|
1704
1755
|
setDefault: withSchema(
|
|
1705
|
-
|
|
1706
|
-
orgId:
|
|
1707
|
-
projectId:
|
|
1708
|
-
id:
|
|
1756
|
+
import_zod19.z.object({
|
|
1757
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1758
|
+
projectId: import_zod19.z.string().describe("Project ID"),
|
|
1759
|
+
id: import_zod19.z.string().describe("View id")
|
|
1709
1760
|
}),
|
|
1710
1761
|
(params) => call(
|
|
1711
1762
|
proj(params.orgId, params.projectId)["graph-views"][":id"]["default"].$patch({
|
|
@@ -1717,15 +1768,15 @@ function createGraphViewsClient(proj) {
|
|
|
1717
1768
|
}
|
|
1718
1769
|
|
|
1719
1770
|
// src/notifications.ts
|
|
1720
|
-
var
|
|
1771
|
+
var import_zod20 = require("zod");
|
|
1721
1772
|
var import_client2 = require("hono/client");
|
|
1722
1773
|
function createNotificationsClient(baseUrl, hcOpts) {
|
|
1723
1774
|
const c = (0, import_client2.hc)(`${baseUrl}/notifications`, hcOpts);
|
|
1724
1775
|
return {
|
|
1725
1776
|
list: withSchema(
|
|
1726
|
-
|
|
1727
|
-
limit:
|
|
1728
|
-
unread:
|
|
1777
|
+
import_zod20.z.object({
|
|
1778
|
+
limit: import_zod20.z.coerce.number().int().min(1).max(100).optional(),
|
|
1779
|
+
unread: import_zod20.z.boolean().optional()
|
|
1729
1780
|
}),
|
|
1730
1781
|
(params) => {
|
|
1731
1782
|
const query = {};
|
|
@@ -1735,18 +1786,18 @@ function createNotificationsClient(baseUrl, hcOpts) {
|
|
|
1735
1786
|
}
|
|
1736
1787
|
),
|
|
1737
1788
|
read: withSchema(
|
|
1738
|
-
|
|
1789
|
+
import_zod20.z.object({ id: import_zod20.z.string().uuid() }),
|
|
1739
1790
|
(params) => call(c[":id"].read.$post({ param: { id: params.id } }))
|
|
1740
1791
|
),
|
|
1741
1792
|
readAll: withSchema(
|
|
1742
|
-
|
|
1793
|
+
import_zod20.z.object({}),
|
|
1743
1794
|
() => call(c["read-all"].$post())
|
|
1744
1795
|
)
|
|
1745
1796
|
};
|
|
1746
1797
|
}
|
|
1747
1798
|
|
|
1748
1799
|
// src/audit-export.ts
|
|
1749
|
-
var
|
|
1800
|
+
var import_zod21 = require("zod");
|
|
1750
1801
|
async function rawRequest(baseUrl, hcOpts, path, init = {}) {
|
|
1751
1802
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1752
1803
|
const rawHeaders = hcOpts?.headers;
|
|
@@ -1775,19 +1826,19 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1775
1826
|
return {
|
|
1776
1827
|
/** GET /orgs/:orgId/audit-export/config — returns current config or throws 404. */
|
|
1777
1828
|
getConfig: withSchema(
|
|
1778
|
-
|
|
1829
|
+
import_zod21.z.object({ orgId: import_zod21.z.string().describe("Organization ID") }),
|
|
1779
1830
|
async (params) => callRaw(
|
|
1780
1831
|
await rawRequest(baseUrl, hcOpts, `/orgs/${params.orgId}/audit-export/config`)
|
|
1781
1832
|
)
|
|
1782
1833
|
),
|
|
1783
1834
|
/** POST /orgs/:orgId/audit-export/config — upsert the S3 export config. */
|
|
1784
1835
|
setConfig: withSchema(
|
|
1785
|
-
|
|
1786
|
-
orgId:
|
|
1787
|
-
bucket:
|
|
1788
|
-
region:
|
|
1789
|
-
roleArn:
|
|
1790
|
-
enabled:
|
|
1836
|
+
import_zod21.z.object({
|
|
1837
|
+
orgId: import_zod21.z.string().describe("Organization ID"),
|
|
1838
|
+
bucket: import_zod21.z.string().describe("S3 bucket name"),
|
|
1839
|
+
region: import_zod21.z.string().describe("AWS region"),
|
|
1840
|
+
roleArn: import_zod21.z.string().describe("IAM role ARN for assume-role"),
|
|
1841
|
+
enabled: import_zod21.z.boolean().optional().describe("Enable/disable export")
|
|
1791
1842
|
}),
|
|
1792
1843
|
async (params) => {
|
|
1793
1844
|
const { orgId, ...body } = params;
|
|
@@ -1802,11 +1853,11 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1802
1853
|
),
|
|
1803
1854
|
/** POST /orgs/:orgId/audit-export/test-connection — dry-run write+delete. */
|
|
1804
1855
|
testConnection: withSchema(
|
|
1805
|
-
|
|
1806
|
-
orgId:
|
|
1807
|
-
bucket:
|
|
1808
|
-
region:
|
|
1809
|
-
roleArn:
|
|
1856
|
+
import_zod21.z.object({
|
|
1857
|
+
orgId: import_zod21.z.string().describe("Organization ID"),
|
|
1858
|
+
bucket: import_zod21.z.string().describe("S3 bucket name"),
|
|
1859
|
+
region: import_zod21.z.string().describe("AWS region"),
|
|
1860
|
+
roleArn: import_zod21.z.string().describe("IAM role ARN for assume-role")
|
|
1810
1861
|
}),
|
|
1811
1862
|
async (params) => {
|
|
1812
1863
|
const { orgId, ...body } = params;
|
|
@@ -1821,9 +1872,9 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1821
1872
|
),
|
|
1822
1873
|
/** GET /orgs/:orgId/audit-export/runs — recent batch run history. */
|
|
1823
1874
|
listRuns: withSchema(
|
|
1824
|
-
|
|
1825
|
-
orgId:
|
|
1826
|
-
limit:
|
|
1875
|
+
import_zod21.z.object({
|
|
1876
|
+
orgId: import_zod21.z.string().describe("Organization ID"),
|
|
1877
|
+
limit: import_zod21.z.number().optional().describe("Max results (default 20, max 100)")
|
|
1827
1878
|
}),
|
|
1828
1879
|
async (params) => {
|
|
1829
1880
|
const qs = params.limit ? `?limit=${params.limit}` : "";
|
|
@@ -1867,33 +1918,33 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
|
|
|
1867
1918
|
}
|
|
1868
1919
|
|
|
1869
1920
|
// src/import-sources.ts
|
|
1870
|
-
var
|
|
1871
|
-
var SourceKindEnum =
|
|
1872
|
-
var PolicyEnum =
|
|
1921
|
+
var import_zod22 = require("zod");
|
|
1922
|
+
var SourceKindEnum = import_zod22.z.enum(["tf-state", "atmos-manifests"]);
|
|
1923
|
+
var PolicyEnum = import_zod22.z.enum(["auto-update", "human-approval"]);
|
|
1873
1924
|
function createImportSourcesClient(proj) {
|
|
1874
1925
|
return {
|
|
1875
1926
|
list: withSchema(
|
|
1876
|
-
|
|
1877
|
-
orgId:
|
|
1878
|
-
projectId:
|
|
1927
|
+
import_zod22.z.object({
|
|
1928
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1929
|
+
projectId: import_zod22.z.string().describe("Project ID")
|
|
1879
1930
|
}),
|
|
1880
1931
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"].$get())
|
|
1881
1932
|
),
|
|
1882
1933
|
get: withSchema(
|
|
1883
|
-
|
|
1884
|
-
orgId:
|
|
1885
|
-
projectId:
|
|
1886
|
-
id:
|
|
1934
|
+
import_zod22.z.object({
|
|
1935
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1936
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
1937
|
+
id: import_zod22.z.string().uuid().describe("ImportSource ID")
|
|
1887
1938
|
}),
|
|
1888
1939
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
|
|
1889
1940
|
),
|
|
1890
1941
|
registerOrUpdate: withSchema(
|
|
1891
|
-
|
|
1892
|
-
orgId:
|
|
1893
|
-
projectId:
|
|
1894
|
-
envName:
|
|
1942
|
+
import_zod22.z.object({
|
|
1943
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1944
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
1945
|
+
envName: import_zod22.z.string().describe("Env name the source belongs to"),
|
|
1895
1946
|
sourceKind: SourceKindEnum,
|
|
1896
|
-
sourceUri:
|
|
1947
|
+
sourceUri: import_zod22.z.string().describe("Stable URI identifying the source"),
|
|
1897
1948
|
reconciliationPolicy: PolicyEnum.optional()
|
|
1898
1949
|
}),
|
|
1899
1950
|
(params) => {
|
|
@@ -1902,13 +1953,13 @@ function createImportSourcesClient(proj) {
|
|
|
1902
1953
|
}
|
|
1903
1954
|
),
|
|
1904
1955
|
rescan: withSchema(
|
|
1905
|
-
|
|
1906
|
-
orgId:
|
|
1907
|
-
projectId:
|
|
1908
|
-
id:
|
|
1909
|
-
envName:
|
|
1910
|
-
items:
|
|
1911
|
-
deletions:
|
|
1956
|
+
import_zod22.z.object({
|
|
1957
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1958
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
1959
|
+
id: import_zod22.z.string().uuid(),
|
|
1960
|
+
envName: import_zod22.z.string(),
|
|
1961
|
+
items: import_zod22.z.array(import_zod22.z.unknown()),
|
|
1962
|
+
deletions: import_zod22.z.array(import_zod22.z.object({ kind: import_zod22.z.string(), name: import_zod22.z.string() })).optional()
|
|
1912
1963
|
}),
|
|
1913
1964
|
(params) => {
|
|
1914
1965
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1924,19 +1975,19 @@ function createImportSourcesClient(proj) {
|
|
|
1924
1975
|
}
|
|
1925
1976
|
),
|
|
1926
1977
|
drift: withSchema(
|
|
1927
|
-
|
|
1928
|
-
orgId:
|
|
1929
|
-
projectId:
|
|
1930
|
-
id:
|
|
1978
|
+
import_zod22.z.object({
|
|
1979
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1980
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
1981
|
+
id: import_zod22.z.string().uuid()
|
|
1931
1982
|
}),
|
|
1932
1983
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
|
|
1933
1984
|
),
|
|
1934
1985
|
approveProposal: withSchema(
|
|
1935
|
-
|
|
1936
|
-
orgId:
|
|
1937
|
-
projectId:
|
|
1938
|
-
id:
|
|
1939
|
-
proposalId:
|
|
1986
|
+
import_zod22.z.object({
|
|
1987
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1988
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
1989
|
+
id: import_zod22.z.string().uuid(),
|
|
1990
|
+
proposalId: import_zod22.z.string().uuid()
|
|
1940
1991
|
}),
|
|
1941
1992
|
(params) => call(
|
|
1942
1993
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
|
|
@@ -1945,11 +1996,11 @@ function createImportSourcesClient(proj) {
|
|
|
1945
1996
|
)
|
|
1946
1997
|
),
|
|
1947
1998
|
rejectProposal: withSchema(
|
|
1948
|
-
|
|
1949
|
-
orgId:
|
|
1950
|
-
projectId:
|
|
1951
|
-
id:
|
|
1952
|
-
proposalId:
|
|
1999
|
+
import_zod22.z.object({
|
|
2000
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
2001
|
+
projectId: import_zod22.z.string().describe("Project ID"),
|
|
2002
|
+
id: import_zod22.z.string().uuid(),
|
|
2003
|
+
proposalId: import_zod22.z.string().uuid()
|
|
1953
2004
|
}),
|
|
1954
2005
|
(params) => call(
|
|
1955
2006
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
|
|
@@ -1961,7 +2012,7 @@ function createImportSourcesClient(proj) {
|
|
|
1961
2012
|
}
|
|
1962
2013
|
|
|
1963
2014
|
// src/admin.ts
|
|
1964
|
-
var
|
|
2015
|
+
var import_zod23 = require("zod");
|
|
1965
2016
|
async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
1966
2017
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1967
2018
|
const rawHeaders = hcOpts?.headers;
|
|
@@ -1994,14 +2045,14 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
1994
2045
|
* List super-admin audit events with optional filters.
|
|
1995
2046
|
*/
|
|
1996
2047
|
list: withSchema(
|
|
1997
|
-
|
|
1998
|
-
actor:
|
|
1999
|
-
action:
|
|
2000
|
-
resourceKind:
|
|
2001
|
-
since:
|
|
2002
|
-
until:
|
|
2003
|
-
limit:
|
|
2004
|
-
offset:
|
|
2048
|
+
import_zod23.z.object({
|
|
2049
|
+
actor: import_zod23.z.string().optional().describe("Filter by actor user ID"),
|
|
2050
|
+
action: import_zod23.z.string().optional().describe("Filter by action name"),
|
|
2051
|
+
resourceKind: import_zod23.z.string().optional().describe("Filter by resource kind"),
|
|
2052
|
+
since: import_zod23.z.string().optional().describe("ISO 8601 datetime lower bound"),
|
|
2053
|
+
until: import_zod23.z.string().optional().describe("ISO 8601 datetime upper bound"),
|
|
2054
|
+
limit: import_zod23.z.coerce.number().int().min(1).max(200).optional().describe("Max results (1-200)"),
|
|
2055
|
+
offset: import_zod23.z.coerce.number().int().min(0).optional().describe("Pagination offset")
|
|
2005
2056
|
}),
|
|
2006
2057
|
async (params) => {
|
|
2007
2058
|
const qs = new URLSearchParams();
|
|
@@ -2025,7 +2076,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2025
2076
|
* List all organizations across tenants with member + project counts.
|
|
2026
2077
|
*/
|
|
2027
2078
|
list: withSchema(
|
|
2028
|
-
|
|
2079
|
+
import_zod23.z.object({}),
|
|
2029
2080
|
async () => callRaw2(
|
|
2030
2081
|
await rawRequest2(baseUrl, hcOpts, "/admin/orgs")
|
|
2031
2082
|
)
|
|
@@ -2035,7 +2086,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2035
2086
|
* Detail view: org fields + member list + project list.
|
|
2036
2087
|
*/
|
|
2037
2088
|
get: withSchema(
|
|
2038
|
-
|
|
2089
|
+
import_zod23.z.object({ id: import_zod23.z.string().describe("Organization ID") }),
|
|
2039
2090
|
async (params) => callRaw2(
|
|
2040
2091
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}`)
|
|
2041
2092
|
)
|
|
@@ -2045,7 +2096,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2045
2096
|
* Set suspended_at = now(). Idempotent.
|
|
2046
2097
|
*/
|
|
2047
2098
|
suspend: withSchema(
|
|
2048
|
-
|
|
2099
|
+
import_zod23.z.object({ id: import_zod23.z.string().describe("Organization ID") }),
|
|
2049
2100
|
async (params) => callRaw2(
|
|
2050
2101
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/suspend`, {
|
|
2051
2102
|
method: "POST"
|
|
@@ -2057,7 +2108,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2057
2108
|
* Clear suspended_at.
|
|
2058
2109
|
*/
|
|
2059
2110
|
unsuspend: withSchema(
|
|
2060
|
-
|
|
2111
|
+
import_zod23.z.object({ id: import_zod23.z.string().describe("Organization ID") }),
|
|
2061
2112
|
async (params) => callRaw2(
|
|
2062
2113
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/unsuspend`, {
|
|
2063
2114
|
method: "POST"
|
|
@@ -2073,7 +2124,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2073
2124
|
* api tokens, and environments. Idempotent. Super-admin only.
|
|
2074
2125
|
*/
|
|
2075
2126
|
nuke: withSchema(
|
|
2076
|
-
|
|
2127
|
+
import_zod23.z.object({ projectId: import_zod23.z.string().describe("Project ID to nuke") }),
|
|
2077
2128
|
async (params) => callRaw2(
|
|
2078
2129
|
await rawRequest2(
|
|
2079
2130
|
baseUrl,
|
|
@@ -2091,7 +2142,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2091
2142
|
* all derived from single-table COUNT queries.
|
|
2092
2143
|
*/
|
|
2093
2144
|
overview: withSchema(
|
|
2094
|
-
|
|
2145
|
+
import_zod23.z.object({}),
|
|
2095
2146
|
async () => callRaw2(
|
|
2096
2147
|
await rawRequest2(baseUrl, hcOpts, "/admin/metrics/overview")
|
|
2097
2148
|
)
|
|
@@ -2106,7 +2157,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2106
2157
|
* Requires super-admin.
|
|
2107
2158
|
*/
|
|
2108
2159
|
list: withSchema(
|
|
2109
|
-
|
|
2160
|
+
import_zod23.z.object({}),
|
|
2110
2161
|
async () => callRaw2(
|
|
2111
2162
|
await rawRequest2(
|
|
2112
2163
|
baseUrl,
|
|
@@ -2121,15 +2172,15 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2121
2172
|
}
|
|
2122
2173
|
|
|
2123
2174
|
// src/resolve-source.ts
|
|
2124
|
-
var
|
|
2175
|
+
var import_zod24 = require("zod");
|
|
2125
2176
|
function createResolveSourceFn(proj) {
|
|
2126
2177
|
return withSchema(
|
|
2127
|
-
|
|
2128
|
-
orgId:
|
|
2129
|
-
projectId:
|
|
2130
|
-
kind:
|
|
2131
|
-
ref:
|
|
2132
|
-
version:
|
|
2178
|
+
import_zod24.z.object({
|
|
2179
|
+
orgId: import_zod24.z.string().describe("Organization slug"),
|
|
2180
|
+
projectId: import_zod24.z.string().describe("Project ID"),
|
|
2181
|
+
kind: import_zod24.z.literal("registry").describe('Source kind \u2014 only "registry" is supported today'),
|
|
2182
|
+
ref: import_zod24.z.string().regex(/^[^/]+\/[^/]+\/[^/]+$/, { message: "ref must be <namespace>/<name>/<provider>" }).describe("Terraform Registry module ref (<namespace>/<name>/<provider>)"),
|
|
2183
|
+
version: import_zod24.z.string().optional().describe("Module version semver \u2014 resolves latest if omitted")
|
|
2133
2184
|
}),
|
|
2134
2185
|
(params) => {
|
|
2135
2186
|
const { orgId, projectId, kind, ref, version } = params;
|
|
@@ -2173,6 +2224,7 @@ var createClient = (baseUrl, options = {}) => {
|
|
|
2173
2224
|
catalogRevisions,
|
|
2174
2225
|
auditEvents: createAuditEventsClient(proj),
|
|
2175
2226
|
driftEvents: createDriftEventsClient(projEnv),
|
|
2227
|
+
conformanceFindings: createConformanceFindingsClient(projEnv),
|
|
2176
2228
|
stats: createStatsClient(proj),
|
|
2177
2229
|
graphViews: createGraphViewsClient(proj),
|
|
2178
2230
|
notifications: createNotificationsClient(baseUrl, hcOpts),
|
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.13.0",
|
|
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": "
|
|
64
|
-
"@terrantula/types": "
|
|
63
|
+
"@terrantula/local": "0.6.1",
|
|
64
|
+
"@terrantula/types": "0.8.0",
|
|
65
65
|
"hono": "^4.4.0",
|
|
66
66
|
"zod": "^3.22.0"
|
|
67
67
|
},
|