@terrantula/sdk 0.12.0 → 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-665GEJRV.mjs → chunk-E3CKS754.mjs} +177 -128
- package/dist/index.d.mts +1139 -558
- package/dist/index.d.ts +1139 -558
- package/dist/index.js +177 -128
- package/dist/index.mjs +1 -1
- package/dist/local.d.mts +650 -300
- package/dist/local.d.ts +650 -300
- package/dist/local.js +177 -128
- package/dist/local.mjs +1 -1
- package/package.json +3 -3
package/dist/local.js
CHANGED
|
@@ -1591,16 +1591,64 @@ function createDriftEventsClient(projEnv) {
|
|
|
1591
1591
|
};
|
|
1592
1592
|
}
|
|
1593
1593
|
|
|
1594
|
-
// src/
|
|
1594
|
+
// src/conformance-findings.ts
|
|
1595
1595
|
var import_zod17 = require("zod");
|
|
1596
|
-
var
|
|
1597
|
-
|
|
1598
|
-
function createStatsClient(proj) {
|
|
1596
|
+
var import_types8 = require("@terrantula/types");
|
|
1597
|
+
function createConformanceFindingsClient(projEnv) {
|
|
1599
1598
|
return {
|
|
1600
|
-
|
|
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(
|
|
1601
1627
|
import_zod17.z.object({
|
|
1602
1628
|
orgId: import_zod17.z.string().describe("Organization slug"),
|
|
1603
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"),
|
|
1604
1652
|
window: WindowSchema,
|
|
1605
1653
|
bucket: BucketSchema
|
|
1606
1654
|
}),
|
|
@@ -1610,9 +1658,9 @@ function createStatsClient(proj) {
|
|
|
1610
1658
|
}
|
|
1611
1659
|
),
|
|
1612
1660
|
runsByType: withSchema(
|
|
1613
|
-
|
|
1614
|
-
orgId:
|
|
1615
|
-
projectId:
|
|
1661
|
+
import_zod18.z.object({
|
|
1662
|
+
orgId: import_zod18.z.string().describe("Organization slug"),
|
|
1663
|
+
projectId: import_zod18.z.string().describe("Project name"),
|
|
1616
1664
|
window: WindowSchema
|
|
1617
1665
|
}),
|
|
1618
1666
|
(params) => {
|
|
@@ -1621,9 +1669,9 @@ function createStatsClient(proj) {
|
|
|
1621
1669
|
}
|
|
1622
1670
|
),
|
|
1623
1671
|
failingKinds: withSchema(
|
|
1624
|
-
|
|
1625
|
-
orgId:
|
|
1626
|
-
projectId:
|
|
1672
|
+
import_zod18.z.object({
|
|
1673
|
+
orgId: import_zod18.z.string().describe("Organization slug"),
|
|
1674
|
+
projectId: import_zod18.z.string().describe("Project name"),
|
|
1627
1675
|
window: WindowSchema
|
|
1628
1676
|
}),
|
|
1629
1677
|
(params) => {
|
|
@@ -1632,10 +1680,10 @@ function createStatsClient(proj) {
|
|
|
1632
1680
|
}
|
|
1633
1681
|
),
|
|
1634
1682
|
driftDensity: withSchema(
|
|
1635
|
-
|
|
1636
|
-
orgId:
|
|
1637
|
-
projectId:
|
|
1638
|
-
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"')
|
|
1639
1687
|
}),
|
|
1640
1688
|
(params) => {
|
|
1641
1689
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1646,34 +1694,34 @@ function createStatsClient(proj) {
|
|
|
1646
1694
|
}
|
|
1647
1695
|
|
|
1648
1696
|
// src/graph-views.ts
|
|
1649
|
-
var
|
|
1650
|
-
var
|
|
1651
|
-
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();
|
|
1652
1700
|
function createGraphViewsClient(proj) {
|
|
1653
1701
|
return {
|
|
1654
1702
|
list: withSchema(
|
|
1655
|
-
|
|
1656
|
-
orgId:
|
|
1657
|
-
projectId:
|
|
1703
|
+
import_zod19.z.object({
|
|
1704
|
+
orgId: import_zod19.z.string().describe("Organization slug"),
|
|
1705
|
+
projectId: import_zod19.z.string().describe("Project ID")
|
|
1658
1706
|
}),
|
|
1659
1707
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"].$get())
|
|
1660
1708
|
),
|
|
1661
1709
|
get: withSchema(
|
|
1662
|
-
|
|
1663
|
-
orgId:
|
|
1664
|
-
projectId:
|
|
1665
|
-
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")
|
|
1666
1714
|
}),
|
|
1667
1715
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$get({ param: { id: params.id } }))
|
|
1668
1716
|
),
|
|
1669
1717
|
create: withSchema(
|
|
1670
|
-
|
|
1671
|
-
orgId:
|
|
1672
|
-
projectId:
|
|
1673
|
-
name:
|
|
1674
|
-
scope:
|
|
1675
|
-
|
|
1676
|
-
|
|
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)")
|
|
1677
1725
|
}),
|
|
1678
1726
|
(params) => {
|
|
1679
1727
|
const { orgId, projectId, ...body } = params;
|
|
@@ -1681,13 +1729,13 @@ function createGraphViewsClient(proj) {
|
|
|
1681
1729
|
}
|
|
1682
1730
|
),
|
|
1683
1731
|
update: withSchema(
|
|
1684
|
-
|
|
1685
|
-
orgId:
|
|
1686
|
-
projectId:
|
|
1687
|
-
id:
|
|
1688
|
-
name:
|
|
1689
|
-
|
|
1690
|
-
|
|
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)")
|
|
1691
1739
|
}),
|
|
1692
1740
|
(params) => {
|
|
1693
1741
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1697,18 +1745,18 @@ function createGraphViewsClient(proj) {
|
|
|
1697
1745
|
}
|
|
1698
1746
|
),
|
|
1699
1747
|
delete: withSchema(
|
|
1700
|
-
|
|
1701
|
-
orgId:
|
|
1702
|
-
projectId:
|
|
1703
|
-
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")
|
|
1704
1752
|
}),
|
|
1705
1753
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$delete({ param: { id: params.id } }))
|
|
1706
1754
|
),
|
|
1707
1755
|
setDefault: withSchema(
|
|
1708
|
-
|
|
1709
|
-
orgId:
|
|
1710
|
-
projectId:
|
|
1711
|
-
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")
|
|
1712
1760
|
}),
|
|
1713
1761
|
(params) => call(
|
|
1714
1762
|
proj(params.orgId, params.projectId)["graph-views"][":id"]["default"].$patch({
|
|
@@ -1720,15 +1768,15 @@ function createGraphViewsClient(proj) {
|
|
|
1720
1768
|
}
|
|
1721
1769
|
|
|
1722
1770
|
// src/notifications.ts
|
|
1723
|
-
var
|
|
1771
|
+
var import_zod20 = require("zod");
|
|
1724
1772
|
var import_client2 = require("hono/client");
|
|
1725
1773
|
function createNotificationsClient(baseUrl, hcOpts) {
|
|
1726
1774
|
const c = (0, import_client2.hc)(`${baseUrl}/notifications`, hcOpts);
|
|
1727
1775
|
return {
|
|
1728
1776
|
list: withSchema(
|
|
1729
|
-
|
|
1730
|
-
limit:
|
|
1731
|
-
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()
|
|
1732
1780
|
}),
|
|
1733
1781
|
(params) => {
|
|
1734
1782
|
const query = {};
|
|
@@ -1738,18 +1786,18 @@ function createNotificationsClient(baseUrl, hcOpts) {
|
|
|
1738
1786
|
}
|
|
1739
1787
|
),
|
|
1740
1788
|
read: withSchema(
|
|
1741
|
-
|
|
1789
|
+
import_zod20.z.object({ id: import_zod20.z.string().uuid() }),
|
|
1742
1790
|
(params) => call(c[":id"].read.$post({ param: { id: params.id } }))
|
|
1743
1791
|
),
|
|
1744
1792
|
readAll: withSchema(
|
|
1745
|
-
|
|
1793
|
+
import_zod20.z.object({}),
|
|
1746
1794
|
() => call(c["read-all"].$post())
|
|
1747
1795
|
)
|
|
1748
1796
|
};
|
|
1749
1797
|
}
|
|
1750
1798
|
|
|
1751
1799
|
// src/audit-export.ts
|
|
1752
|
-
var
|
|
1800
|
+
var import_zod21 = require("zod");
|
|
1753
1801
|
async function rawRequest(baseUrl, hcOpts, path, init = {}) {
|
|
1754
1802
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1755
1803
|
const rawHeaders = hcOpts?.headers;
|
|
@@ -1778,19 +1826,19 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1778
1826
|
return {
|
|
1779
1827
|
/** GET /orgs/:orgId/audit-export/config — returns current config or throws 404. */
|
|
1780
1828
|
getConfig: withSchema(
|
|
1781
|
-
|
|
1829
|
+
import_zod21.z.object({ orgId: import_zod21.z.string().describe("Organization ID") }),
|
|
1782
1830
|
async (params) => callRaw(
|
|
1783
1831
|
await rawRequest(baseUrl, hcOpts, `/orgs/${params.orgId}/audit-export/config`)
|
|
1784
1832
|
)
|
|
1785
1833
|
),
|
|
1786
1834
|
/** POST /orgs/:orgId/audit-export/config — upsert the S3 export config. */
|
|
1787
1835
|
setConfig: withSchema(
|
|
1788
|
-
|
|
1789
|
-
orgId:
|
|
1790
|
-
bucket:
|
|
1791
|
-
region:
|
|
1792
|
-
roleArn:
|
|
1793
|
-
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")
|
|
1794
1842
|
}),
|
|
1795
1843
|
async (params) => {
|
|
1796
1844
|
const { orgId, ...body } = params;
|
|
@@ -1805,11 +1853,11 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1805
1853
|
),
|
|
1806
1854
|
/** POST /orgs/:orgId/audit-export/test-connection — dry-run write+delete. */
|
|
1807
1855
|
testConnection: withSchema(
|
|
1808
|
-
|
|
1809
|
-
orgId:
|
|
1810
|
-
bucket:
|
|
1811
|
-
region:
|
|
1812
|
-
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")
|
|
1813
1861
|
}),
|
|
1814
1862
|
async (params) => {
|
|
1815
1863
|
const { orgId, ...body } = params;
|
|
@@ -1824,9 +1872,9 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1824
1872
|
),
|
|
1825
1873
|
/** GET /orgs/:orgId/audit-export/runs — recent batch run history. */
|
|
1826
1874
|
listRuns: withSchema(
|
|
1827
|
-
|
|
1828
|
-
orgId:
|
|
1829
|
-
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)")
|
|
1830
1878
|
}),
|
|
1831
1879
|
async (params) => {
|
|
1832
1880
|
const qs = params.limit ? `?limit=${params.limit}` : "";
|
|
@@ -1870,33 +1918,33 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
|
|
|
1870
1918
|
}
|
|
1871
1919
|
|
|
1872
1920
|
// src/import-sources.ts
|
|
1873
|
-
var
|
|
1874
|
-
var SourceKindEnum =
|
|
1875
|
-
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"]);
|
|
1876
1924
|
function createImportSourcesClient(proj) {
|
|
1877
1925
|
return {
|
|
1878
1926
|
list: withSchema(
|
|
1879
|
-
|
|
1880
|
-
orgId:
|
|
1881
|
-
projectId:
|
|
1927
|
+
import_zod22.z.object({
|
|
1928
|
+
orgId: import_zod22.z.string().describe("Organization slug"),
|
|
1929
|
+
projectId: import_zod22.z.string().describe("Project ID")
|
|
1882
1930
|
}),
|
|
1883
1931
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"].$get())
|
|
1884
1932
|
),
|
|
1885
1933
|
get: withSchema(
|
|
1886
|
-
|
|
1887
|
-
orgId:
|
|
1888
|
-
projectId:
|
|
1889
|
-
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")
|
|
1890
1938
|
}),
|
|
1891
1939
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
|
|
1892
1940
|
),
|
|
1893
1941
|
registerOrUpdate: withSchema(
|
|
1894
|
-
|
|
1895
|
-
orgId:
|
|
1896
|
-
projectId:
|
|
1897
|
-
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"),
|
|
1898
1946
|
sourceKind: SourceKindEnum,
|
|
1899
|
-
sourceUri:
|
|
1947
|
+
sourceUri: import_zod22.z.string().describe("Stable URI identifying the source"),
|
|
1900
1948
|
reconciliationPolicy: PolicyEnum.optional()
|
|
1901
1949
|
}),
|
|
1902
1950
|
(params) => {
|
|
@@ -1905,13 +1953,13 @@ function createImportSourcesClient(proj) {
|
|
|
1905
1953
|
}
|
|
1906
1954
|
),
|
|
1907
1955
|
rescan: withSchema(
|
|
1908
|
-
|
|
1909
|
-
orgId:
|
|
1910
|
-
projectId:
|
|
1911
|
-
id:
|
|
1912
|
-
envName:
|
|
1913
|
-
items:
|
|
1914
|
-
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()
|
|
1915
1963
|
}),
|
|
1916
1964
|
(params) => {
|
|
1917
1965
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1927,19 +1975,19 @@ function createImportSourcesClient(proj) {
|
|
|
1927
1975
|
}
|
|
1928
1976
|
),
|
|
1929
1977
|
drift: withSchema(
|
|
1930
|
-
|
|
1931
|
-
orgId:
|
|
1932
|
-
projectId:
|
|
1933
|
-
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()
|
|
1934
1982
|
}),
|
|
1935
1983
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
|
|
1936
1984
|
),
|
|
1937
1985
|
approveProposal: withSchema(
|
|
1938
|
-
|
|
1939
|
-
orgId:
|
|
1940
|
-
projectId:
|
|
1941
|
-
id:
|
|
1942
|
-
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()
|
|
1943
1991
|
}),
|
|
1944
1992
|
(params) => call(
|
|
1945
1993
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
|
|
@@ -1948,11 +1996,11 @@ function createImportSourcesClient(proj) {
|
|
|
1948
1996
|
)
|
|
1949
1997
|
),
|
|
1950
1998
|
rejectProposal: withSchema(
|
|
1951
|
-
|
|
1952
|
-
orgId:
|
|
1953
|
-
projectId:
|
|
1954
|
-
id:
|
|
1955
|
-
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()
|
|
1956
2004
|
}),
|
|
1957
2005
|
(params) => call(
|
|
1958
2006
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
|
|
@@ -1964,7 +2012,7 @@ function createImportSourcesClient(proj) {
|
|
|
1964
2012
|
}
|
|
1965
2013
|
|
|
1966
2014
|
// src/admin.ts
|
|
1967
|
-
var
|
|
2015
|
+
var import_zod23 = require("zod");
|
|
1968
2016
|
async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
1969
2017
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1970
2018
|
const rawHeaders = hcOpts?.headers;
|
|
@@ -1997,14 +2045,14 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
1997
2045
|
* List super-admin audit events with optional filters.
|
|
1998
2046
|
*/
|
|
1999
2047
|
list: withSchema(
|
|
2000
|
-
|
|
2001
|
-
actor:
|
|
2002
|
-
action:
|
|
2003
|
-
resourceKind:
|
|
2004
|
-
since:
|
|
2005
|
-
until:
|
|
2006
|
-
limit:
|
|
2007
|
-
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")
|
|
2008
2056
|
}),
|
|
2009
2057
|
async (params) => {
|
|
2010
2058
|
const qs = new URLSearchParams();
|
|
@@ -2028,7 +2076,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2028
2076
|
* List all organizations across tenants with member + project counts.
|
|
2029
2077
|
*/
|
|
2030
2078
|
list: withSchema(
|
|
2031
|
-
|
|
2079
|
+
import_zod23.z.object({}),
|
|
2032
2080
|
async () => callRaw2(
|
|
2033
2081
|
await rawRequest2(baseUrl, hcOpts, "/admin/orgs")
|
|
2034
2082
|
)
|
|
@@ -2038,7 +2086,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2038
2086
|
* Detail view: org fields + member list + project list.
|
|
2039
2087
|
*/
|
|
2040
2088
|
get: withSchema(
|
|
2041
|
-
|
|
2089
|
+
import_zod23.z.object({ id: import_zod23.z.string().describe("Organization ID") }),
|
|
2042
2090
|
async (params) => callRaw2(
|
|
2043
2091
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}`)
|
|
2044
2092
|
)
|
|
@@ -2048,7 +2096,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2048
2096
|
* Set suspended_at = now(). Idempotent.
|
|
2049
2097
|
*/
|
|
2050
2098
|
suspend: withSchema(
|
|
2051
|
-
|
|
2099
|
+
import_zod23.z.object({ id: import_zod23.z.string().describe("Organization ID") }),
|
|
2052
2100
|
async (params) => callRaw2(
|
|
2053
2101
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/suspend`, {
|
|
2054
2102
|
method: "POST"
|
|
@@ -2060,7 +2108,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2060
2108
|
* Clear suspended_at.
|
|
2061
2109
|
*/
|
|
2062
2110
|
unsuspend: withSchema(
|
|
2063
|
-
|
|
2111
|
+
import_zod23.z.object({ id: import_zod23.z.string().describe("Organization ID") }),
|
|
2064
2112
|
async (params) => callRaw2(
|
|
2065
2113
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/unsuspend`, {
|
|
2066
2114
|
method: "POST"
|
|
@@ -2076,7 +2124,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2076
2124
|
* api tokens, and environments. Idempotent. Super-admin only.
|
|
2077
2125
|
*/
|
|
2078
2126
|
nuke: withSchema(
|
|
2079
|
-
|
|
2127
|
+
import_zod23.z.object({ projectId: import_zod23.z.string().describe("Project ID to nuke") }),
|
|
2080
2128
|
async (params) => callRaw2(
|
|
2081
2129
|
await rawRequest2(
|
|
2082
2130
|
baseUrl,
|
|
@@ -2094,7 +2142,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2094
2142
|
* all derived from single-table COUNT queries.
|
|
2095
2143
|
*/
|
|
2096
2144
|
overview: withSchema(
|
|
2097
|
-
|
|
2145
|
+
import_zod23.z.object({}),
|
|
2098
2146
|
async () => callRaw2(
|
|
2099
2147
|
await rawRequest2(baseUrl, hcOpts, "/admin/metrics/overview")
|
|
2100
2148
|
)
|
|
@@ -2109,7 +2157,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2109
2157
|
* Requires super-admin.
|
|
2110
2158
|
*/
|
|
2111
2159
|
list: withSchema(
|
|
2112
|
-
|
|
2160
|
+
import_zod23.z.object({}),
|
|
2113
2161
|
async () => callRaw2(
|
|
2114
2162
|
await rawRequest2(
|
|
2115
2163
|
baseUrl,
|
|
@@ -2124,15 +2172,15 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2124
2172
|
}
|
|
2125
2173
|
|
|
2126
2174
|
// src/resolve-source.ts
|
|
2127
|
-
var
|
|
2175
|
+
var import_zod24 = require("zod");
|
|
2128
2176
|
function createResolveSourceFn(proj) {
|
|
2129
2177
|
return withSchema(
|
|
2130
|
-
|
|
2131
|
-
orgId:
|
|
2132
|
-
projectId:
|
|
2133
|
-
kind:
|
|
2134
|
-
ref:
|
|
2135
|
-
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")
|
|
2136
2184
|
}),
|
|
2137
2185
|
(params) => {
|
|
2138
2186
|
const { orgId, projectId, kind, ref, version } = params;
|
|
@@ -2176,6 +2224,7 @@ var createClient = (baseUrl, options = {}) => {
|
|
|
2176
2224
|
catalogRevisions,
|
|
2177
2225
|
auditEvents: createAuditEventsClient(proj),
|
|
2178
2226
|
driftEvents: createDriftEventsClient(projEnv),
|
|
2227
|
+
conformanceFindings: createConformanceFindingsClient(projEnv),
|
|
2179
2228
|
stats: createStatsClient(proj),
|
|
2180
2229
|
graphViews: createGraphViewsClient(proj),
|
|
2181
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": "0.
|
|
64
|
-
"@terrantula/types": "0.
|
|
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
|
},
|