@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
|
@@ -1568,16 +1568,64 @@ function createDriftEventsClient(projEnv) {
|
|
|
1568
1568
|
};
|
|
1569
1569
|
}
|
|
1570
1570
|
|
|
1571
|
-
// src/
|
|
1571
|
+
// src/conformance-findings.ts
|
|
1572
1572
|
import { z as z17 } from "zod";
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
function createStatsClient(proj) {
|
|
1573
|
+
import { FindingStatusSchema, FindingSeveritySchema } from "@terrantula/types";
|
|
1574
|
+
function createConformanceFindingsClient(projEnv) {
|
|
1576
1575
|
return {
|
|
1577
|
-
|
|
1576
|
+
list: withSchema(
|
|
1577
|
+
z17.object({
|
|
1578
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1579
|
+
projectId: z17.string().describe("Project name"),
|
|
1580
|
+
envName: z17.string().describe("Environment name"),
|
|
1581
|
+
status: FindingStatusSchema.optional(),
|
|
1582
|
+
severity: FindingSeveritySchema.optional(),
|
|
1583
|
+
kind: z17.string().optional().describe("Filter by entity type name"),
|
|
1584
|
+
findingKind: z17.string().optional().describe("Filter by finding kind (e.g. MISSING_REQUIRED_PROPERTY)"),
|
|
1585
|
+
entityName: z17.string().optional().describe("Filter by entity name"),
|
|
1586
|
+
limit: z17.coerce.number().int().min(1).max(500).optional()
|
|
1587
|
+
}),
|
|
1588
|
+
(params) => {
|
|
1589
|
+
const { orgId, projectId, envName, ...query } = params;
|
|
1590
|
+
return call(
|
|
1591
|
+
projEnv(orgId, projectId, envName)["conformance-findings"].$get({ query: stringifyQuery(query) })
|
|
1592
|
+
);
|
|
1593
|
+
}
|
|
1594
|
+
),
|
|
1595
|
+
count: withSchema(
|
|
1596
|
+
z17.object({
|
|
1597
|
+
orgId: z17.string().describe("Organization slug"),
|
|
1598
|
+
projectId: z17.string().describe("Project name"),
|
|
1599
|
+
envName: z17.string().describe("Environment name")
|
|
1600
|
+
}),
|
|
1601
|
+
(params) => call(projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"].count.$get())
|
|
1602
|
+
),
|
|
1603
|
+
get: withSchema(
|
|
1578
1604
|
z17.object({
|
|
1579
1605
|
orgId: z17.string().describe("Organization slug"),
|
|
1580
1606
|
projectId: z17.string().describe("Project name"),
|
|
1607
|
+
envName: z17.string().describe("Environment name"),
|
|
1608
|
+
id: z17.string().uuid()
|
|
1609
|
+
}),
|
|
1610
|
+
(params) => call(
|
|
1611
|
+
projEnv(params.orgId, params.projectId, params.envName)["conformance-findings"][":id"].$get({
|
|
1612
|
+
param: { id: params.id }
|
|
1613
|
+
})
|
|
1614
|
+
)
|
|
1615
|
+
)
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// src/stats.ts
|
|
1620
|
+
import { z as z18 } from "zod";
|
|
1621
|
+
var WindowSchema = z18.enum(["1h", "24h", "7d"]).optional().describe("Time window \u2014 default 24h");
|
|
1622
|
+
var BucketSchema = z18.enum(["1m", "5m", "1h", "1d"]).optional().describe("Bucket granularity \u2014 default 1h");
|
|
1623
|
+
function createStatsClient(proj) {
|
|
1624
|
+
return {
|
|
1625
|
+
entitiesByState: withSchema(
|
|
1626
|
+
z18.object({
|
|
1627
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1628
|
+
projectId: z18.string().describe("Project name"),
|
|
1581
1629
|
window: WindowSchema,
|
|
1582
1630
|
bucket: BucketSchema
|
|
1583
1631
|
}),
|
|
@@ -1587,9 +1635,9 @@ function createStatsClient(proj) {
|
|
|
1587
1635
|
}
|
|
1588
1636
|
),
|
|
1589
1637
|
runsByType: withSchema(
|
|
1590
|
-
|
|
1591
|
-
orgId:
|
|
1592
|
-
projectId:
|
|
1638
|
+
z18.object({
|
|
1639
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1640
|
+
projectId: z18.string().describe("Project name"),
|
|
1593
1641
|
window: WindowSchema
|
|
1594
1642
|
}),
|
|
1595
1643
|
(params) => {
|
|
@@ -1598,9 +1646,9 @@ function createStatsClient(proj) {
|
|
|
1598
1646
|
}
|
|
1599
1647
|
),
|
|
1600
1648
|
failingKinds: withSchema(
|
|
1601
|
-
|
|
1602
|
-
orgId:
|
|
1603
|
-
projectId:
|
|
1649
|
+
z18.object({
|
|
1650
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1651
|
+
projectId: z18.string().describe("Project name"),
|
|
1604
1652
|
window: WindowSchema
|
|
1605
1653
|
}),
|
|
1606
1654
|
(params) => {
|
|
@@ -1609,10 +1657,10 @@ function createStatsClient(proj) {
|
|
|
1609
1657
|
}
|
|
1610
1658
|
),
|
|
1611
1659
|
driftDensity: withSchema(
|
|
1612
|
-
|
|
1613
|
-
orgId:
|
|
1614
|
-
projectId:
|
|
1615
|
-
dim:
|
|
1660
|
+
z18.object({
|
|
1661
|
+
orgId: z18.string().describe("Organization slug"),
|
|
1662
|
+
projectId: z18.string().describe("Project name"),
|
|
1663
|
+
dim: z18.string().optional().describe('Dimensions to bucket \u2014 e.g. "kind,cell"')
|
|
1616
1664
|
}),
|
|
1617
1665
|
(params) => {
|
|
1618
1666
|
const { orgId, projectId, ...query } = params;
|
|
@@ -1623,34 +1671,34 @@ function createStatsClient(proj) {
|
|
|
1623
1671
|
}
|
|
1624
1672
|
|
|
1625
1673
|
// src/graph-views.ts
|
|
1626
|
-
import { z as
|
|
1627
|
-
var
|
|
1628
|
-
var
|
|
1674
|
+
import { z as z19 } from "zod";
|
|
1675
|
+
var PinnedPositionsSchema = z19.record(z19.string(), z19.object({ x: z19.number(), y: z19.number() })).nullable();
|
|
1676
|
+
var ViewSpecSchema = z19.unknown().nullable();
|
|
1629
1677
|
function createGraphViewsClient(proj) {
|
|
1630
1678
|
return {
|
|
1631
1679
|
list: withSchema(
|
|
1632
|
-
|
|
1633
|
-
orgId:
|
|
1634
|
-
projectId:
|
|
1680
|
+
z19.object({
|
|
1681
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1682
|
+
projectId: z19.string().describe("Project ID")
|
|
1635
1683
|
}),
|
|
1636
1684
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"].$get())
|
|
1637
1685
|
),
|
|
1638
1686
|
get: withSchema(
|
|
1639
|
-
|
|
1640
|
-
orgId:
|
|
1641
|
-
projectId:
|
|
1642
|
-
id:
|
|
1687
|
+
z19.object({
|
|
1688
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1689
|
+
projectId: z19.string().describe("Project ID"),
|
|
1690
|
+
id: z19.string().describe("View id")
|
|
1643
1691
|
}),
|
|
1644
1692
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$get({ param: { id: params.id } }))
|
|
1645
1693
|
),
|
|
1646
1694
|
create: withSchema(
|
|
1647
|
-
|
|
1648
|
-
orgId:
|
|
1649
|
-
projectId:
|
|
1650
|
-
name:
|
|
1651
|
-
scope:
|
|
1652
|
-
|
|
1653
|
-
|
|
1695
|
+
z19.object({
|
|
1696
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1697
|
+
projectId: z19.string().describe("Project ID"),
|
|
1698
|
+
name: z19.string().describe("View name"),
|
|
1699
|
+
scope: z19.enum(["user", "project"]).describe("Personal or project scope"),
|
|
1700
|
+
pinnedPositions: PinnedPositionsSchema.optional().describe("Pinned node positions"),
|
|
1701
|
+
viewSpec: ViewSpecSchema.optional().describe("ViewSpec JSON (opaque passthrough)")
|
|
1654
1702
|
}),
|
|
1655
1703
|
(params) => {
|
|
1656
1704
|
const { orgId, projectId, ...body } = params;
|
|
@@ -1658,13 +1706,13 @@ function createGraphViewsClient(proj) {
|
|
|
1658
1706
|
}
|
|
1659
1707
|
),
|
|
1660
1708
|
update: withSchema(
|
|
1661
|
-
|
|
1662
|
-
orgId:
|
|
1663
|
-
projectId:
|
|
1664
|
-
id:
|
|
1665
|
-
name:
|
|
1666
|
-
|
|
1667
|
-
|
|
1709
|
+
z19.object({
|
|
1710
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1711
|
+
projectId: z19.string().describe("Project ID"),
|
|
1712
|
+
id: z19.string().describe("View id"),
|
|
1713
|
+
name: z19.string().optional().describe("New name"),
|
|
1714
|
+
pinnedPositions: PinnedPositionsSchema.optional().describe("Replacement pinned positions"),
|
|
1715
|
+
viewSpec: ViewSpecSchema.optional().describe("Replacement ViewSpec JSON (opaque passthrough)")
|
|
1668
1716
|
}),
|
|
1669
1717
|
(params) => {
|
|
1670
1718
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1674,18 +1722,18 @@ function createGraphViewsClient(proj) {
|
|
|
1674
1722
|
}
|
|
1675
1723
|
),
|
|
1676
1724
|
delete: withSchema(
|
|
1677
|
-
|
|
1678
|
-
orgId:
|
|
1679
|
-
projectId:
|
|
1680
|
-
id:
|
|
1725
|
+
z19.object({
|
|
1726
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1727
|
+
projectId: z19.string().describe("Project ID"),
|
|
1728
|
+
id: z19.string().describe("View id")
|
|
1681
1729
|
}),
|
|
1682
1730
|
(params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$delete({ param: { id: params.id } }))
|
|
1683
1731
|
),
|
|
1684
1732
|
setDefault: withSchema(
|
|
1685
|
-
|
|
1686
|
-
orgId:
|
|
1687
|
-
projectId:
|
|
1688
|
-
id:
|
|
1733
|
+
z19.object({
|
|
1734
|
+
orgId: z19.string().describe("Organization slug"),
|
|
1735
|
+
projectId: z19.string().describe("Project ID"),
|
|
1736
|
+
id: z19.string().describe("View id")
|
|
1689
1737
|
}),
|
|
1690
1738
|
(params) => call(
|
|
1691
1739
|
proj(params.orgId, params.projectId)["graph-views"][":id"]["default"].$patch({
|
|
@@ -1697,15 +1745,15 @@ function createGraphViewsClient(proj) {
|
|
|
1697
1745
|
}
|
|
1698
1746
|
|
|
1699
1747
|
// src/notifications.ts
|
|
1700
|
-
import { z as
|
|
1748
|
+
import { z as z20 } from "zod";
|
|
1701
1749
|
import { hc as hc2 } from "hono/client";
|
|
1702
1750
|
function createNotificationsClient(baseUrl, hcOpts) {
|
|
1703
1751
|
const c = hc2(`${baseUrl}/notifications`, hcOpts);
|
|
1704
1752
|
return {
|
|
1705
1753
|
list: withSchema(
|
|
1706
|
-
|
|
1707
|
-
limit:
|
|
1708
|
-
unread:
|
|
1754
|
+
z20.object({
|
|
1755
|
+
limit: z20.coerce.number().int().min(1).max(100).optional(),
|
|
1756
|
+
unread: z20.boolean().optional()
|
|
1709
1757
|
}),
|
|
1710
1758
|
(params) => {
|
|
1711
1759
|
const query = {};
|
|
@@ -1715,18 +1763,18 @@ function createNotificationsClient(baseUrl, hcOpts) {
|
|
|
1715
1763
|
}
|
|
1716
1764
|
),
|
|
1717
1765
|
read: withSchema(
|
|
1718
|
-
|
|
1766
|
+
z20.object({ id: z20.string().uuid() }),
|
|
1719
1767
|
(params) => call(c[":id"].read.$post({ param: { id: params.id } }))
|
|
1720
1768
|
),
|
|
1721
1769
|
readAll: withSchema(
|
|
1722
|
-
|
|
1770
|
+
z20.object({}),
|
|
1723
1771
|
() => call(c["read-all"].$post())
|
|
1724
1772
|
)
|
|
1725
1773
|
};
|
|
1726
1774
|
}
|
|
1727
1775
|
|
|
1728
1776
|
// src/audit-export.ts
|
|
1729
|
-
import { z as
|
|
1777
|
+
import { z as z21 } from "zod";
|
|
1730
1778
|
async function rawRequest(baseUrl, hcOpts, path, init = {}) {
|
|
1731
1779
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1732
1780
|
const rawHeaders = hcOpts?.headers;
|
|
@@ -1755,19 +1803,19 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1755
1803
|
return {
|
|
1756
1804
|
/** GET /orgs/:orgId/audit-export/config — returns current config or throws 404. */
|
|
1757
1805
|
getConfig: withSchema(
|
|
1758
|
-
|
|
1806
|
+
z21.object({ orgId: z21.string().describe("Organization ID") }),
|
|
1759
1807
|
async (params) => callRaw(
|
|
1760
1808
|
await rawRequest(baseUrl, hcOpts, `/orgs/${params.orgId}/audit-export/config`)
|
|
1761
1809
|
)
|
|
1762
1810
|
),
|
|
1763
1811
|
/** POST /orgs/:orgId/audit-export/config — upsert the S3 export config. */
|
|
1764
1812
|
setConfig: withSchema(
|
|
1765
|
-
|
|
1766
|
-
orgId:
|
|
1767
|
-
bucket:
|
|
1768
|
-
region:
|
|
1769
|
-
roleArn:
|
|
1770
|
-
enabled:
|
|
1813
|
+
z21.object({
|
|
1814
|
+
orgId: z21.string().describe("Organization ID"),
|
|
1815
|
+
bucket: z21.string().describe("S3 bucket name"),
|
|
1816
|
+
region: z21.string().describe("AWS region"),
|
|
1817
|
+
roleArn: z21.string().describe("IAM role ARN for assume-role"),
|
|
1818
|
+
enabled: z21.boolean().optional().describe("Enable/disable export")
|
|
1771
1819
|
}),
|
|
1772
1820
|
async (params) => {
|
|
1773
1821
|
const { orgId, ...body } = params;
|
|
@@ -1782,11 +1830,11 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1782
1830
|
),
|
|
1783
1831
|
/** POST /orgs/:orgId/audit-export/test-connection — dry-run write+delete. */
|
|
1784
1832
|
testConnection: withSchema(
|
|
1785
|
-
|
|
1786
|
-
orgId:
|
|
1787
|
-
bucket:
|
|
1788
|
-
region:
|
|
1789
|
-
roleArn:
|
|
1833
|
+
z21.object({
|
|
1834
|
+
orgId: z21.string().describe("Organization ID"),
|
|
1835
|
+
bucket: z21.string().describe("S3 bucket name"),
|
|
1836
|
+
region: z21.string().describe("AWS region"),
|
|
1837
|
+
roleArn: z21.string().describe("IAM role ARN for assume-role")
|
|
1790
1838
|
}),
|
|
1791
1839
|
async (params) => {
|
|
1792
1840
|
const { orgId, ...body } = params;
|
|
@@ -1801,9 +1849,9 @@ function createAuditExportClient(baseUrl, hcOpts) {
|
|
|
1801
1849
|
),
|
|
1802
1850
|
/** GET /orgs/:orgId/audit-export/runs — recent batch run history. */
|
|
1803
1851
|
listRuns: withSchema(
|
|
1804
|
-
|
|
1805
|
-
orgId:
|
|
1806
|
-
limit:
|
|
1852
|
+
z21.object({
|
|
1853
|
+
orgId: z21.string().describe("Organization ID"),
|
|
1854
|
+
limit: z21.number().optional().describe("Max results (default 20, max 100)")
|
|
1807
1855
|
}),
|
|
1808
1856
|
async (params) => {
|
|
1809
1857
|
const qs = params.limit ? `?limit=${params.limit}` : "";
|
|
@@ -1847,33 +1895,33 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
|
|
|
1847
1895
|
}
|
|
1848
1896
|
|
|
1849
1897
|
// src/import-sources.ts
|
|
1850
|
-
import { z as
|
|
1851
|
-
var SourceKindEnum =
|
|
1852
|
-
var PolicyEnum =
|
|
1898
|
+
import { z as z22 } from "zod";
|
|
1899
|
+
var SourceKindEnum = z22.enum(["tf-state", "atmos-manifests"]);
|
|
1900
|
+
var PolicyEnum = z22.enum(["auto-update", "human-approval"]);
|
|
1853
1901
|
function createImportSourcesClient(proj) {
|
|
1854
1902
|
return {
|
|
1855
1903
|
list: withSchema(
|
|
1856
|
-
|
|
1857
|
-
orgId:
|
|
1858
|
-
projectId:
|
|
1904
|
+
z22.object({
|
|
1905
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1906
|
+
projectId: z22.string().describe("Project ID")
|
|
1859
1907
|
}),
|
|
1860
1908
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"].$get())
|
|
1861
1909
|
),
|
|
1862
1910
|
get: withSchema(
|
|
1863
|
-
|
|
1864
|
-
orgId:
|
|
1865
|
-
projectId:
|
|
1866
|
-
id:
|
|
1911
|
+
z22.object({
|
|
1912
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1913
|
+
projectId: z22.string().describe("Project ID"),
|
|
1914
|
+
id: z22.string().uuid().describe("ImportSource ID")
|
|
1867
1915
|
}),
|
|
1868
1916
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
|
|
1869
1917
|
),
|
|
1870
1918
|
registerOrUpdate: withSchema(
|
|
1871
|
-
|
|
1872
|
-
orgId:
|
|
1873
|
-
projectId:
|
|
1874
|
-
envName:
|
|
1919
|
+
z22.object({
|
|
1920
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1921
|
+
projectId: z22.string().describe("Project ID"),
|
|
1922
|
+
envName: z22.string().describe("Env name the source belongs to"),
|
|
1875
1923
|
sourceKind: SourceKindEnum,
|
|
1876
|
-
sourceUri:
|
|
1924
|
+
sourceUri: z22.string().describe("Stable URI identifying the source"),
|
|
1877
1925
|
reconciliationPolicy: PolicyEnum.optional()
|
|
1878
1926
|
}),
|
|
1879
1927
|
(params) => {
|
|
@@ -1882,13 +1930,13 @@ function createImportSourcesClient(proj) {
|
|
|
1882
1930
|
}
|
|
1883
1931
|
),
|
|
1884
1932
|
rescan: withSchema(
|
|
1885
|
-
|
|
1886
|
-
orgId:
|
|
1887
|
-
projectId:
|
|
1888
|
-
id:
|
|
1889
|
-
envName:
|
|
1890
|
-
items:
|
|
1891
|
-
deletions:
|
|
1933
|
+
z22.object({
|
|
1934
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1935
|
+
projectId: z22.string().describe("Project ID"),
|
|
1936
|
+
id: z22.string().uuid(),
|
|
1937
|
+
envName: z22.string(),
|
|
1938
|
+
items: z22.array(z22.unknown()),
|
|
1939
|
+
deletions: z22.array(z22.object({ kind: z22.string(), name: z22.string() })).optional()
|
|
1892
1940
|
}),
|
|
1893
1941
|
(params) => {
|
|
1894
1942
|
const { orgId, projectId, id, ...body } = params;
|
|
@@ -1904,19 +1952,19 @@ function createImportSourcesClient(proj) {
|
|
|
1904
1952
|
}
|
|
1905
1953
|
),
|
|
1906
1954
|
drift: withSchema(
|
|
1907
|
-
|
|
1908
|
-
orgId:
|
|
1909
|
-
projectId:
|
|
1910
|
-
id:
|
|
1955
|
+
z22.object({
|
|
1956
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1957
|
+
projectId: z22.string().describe("Project ID"),
|
|
1958
|
+
id: z22.string().uuid()
|
|
1911
1959
|
}),
|
|
1912
1960
|
(params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
|
|
1913
1961
|
),
|
|
1914
1962
|
approveProposal: withSchema(
|
|
1915
|
-
|
|
1916
|
-
orgId:
|
|
1917
|
-
projectId:
|
|
1918
|
-
id:
|
|
1919
|
-
proposalId:
|
|
1963
|
+
z22.object({
|
|
1964
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1965
|
+
projectId: z22.string().describe("Project ID"),
|
|
1966
|
+
id: z22.string().uuid(),
|
|
1967
|
+
proposalId: z22.string().uuid()
|
|
1920
1968
|
}),
|
|
1921
1969
|
(params) => call(
|
|
1922
1970
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
|
|
@@ -1925,11 +1973,11 @@ function createImportSourcesClient(proj) {
|
|
|
1925
1973
|
)
|
|
1926
1974
|
),
|
|
1927
1975
|
rejectProposal: withSchema(
|
|
1928
|
-
|
|
1929
|
-
orgId:
|
|
1930
|
-
projectId:
|
|
1931
|
-
id:
|
|
1932
|
-
proposalId:
|
|
1976
|
+
z22.object({
|
|
1977
|
+
orgId: z22.string().describe("Organization slug"),
|
|
1978
|
+
projectId: z22.string().describe("Project ID"),
|
|
1979
|
+
id: z22.string().uuid(),
|
|
1980
|
+
proposalId: z22.string().uuid()
|
|
1933
1981
|
}),
|
|
1934
1982
|
(params) => call(
|
|
1935
1983
|
proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
|
|
@@ -1941,7 +1989,7 @@ function createImportSourcesClient(proj) {
|
|
|
1941
1989
|
}
|
|
1942
1990
|
|
|
1943
1991
|
// src/admin.ts
|
|
1944
|
-
import { z as
|
|
1992
|
+
import { z as z23 } from "zod";
|
|
1945
1993
|
async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
|
|
1946
1994
|
const fetchImpl = hcOpts?.fetch ?? fetch;
|
|
1947
1995
|
const rawHeaders = hcOpts?.headers;
|
|
@@ -1974,14 +2022,14 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
1974
2022
|
* List super-admin audit events with optional filters.
|
|
1975
2023
|
*/
|
|
1976
2024
|
list: withSchema(
|
|
1977
|
-
|
|
1978
|
-
actor:
|
|
1979
|
-
action:
|
|
1980
|
-
resourceKind:
|
|
1981
|
-
since:
|
|
1982
|
-
until:
|
|
1983
|
-
limit:
|
|
1984
|
-
offset:
|
|
2025
|
+
z23.object({
|
|
2026
|
+
actor: z23.string().optional().describe("Filter by actor user ID"),
|
|
2027
|
+
action: z23.string().optional().describe("Filter by action name"),
|
|
2028
|
+
resourceKind: z23.string().optional().describe("Filter by resource kind"),
|
|
2029
|
+
since: z23.string().optional().describe("ISO 8601 datetime lower bound"),
|
|
2030
|
+
until: z23.string().optional().describe("ISO 8601 datetime upper bound"),
|
|
2031
|
+
limit: z23.coerce.number().int().min(1).max(200).optional().describe("Max results (1-200)"),
|
|
2032
|
+
offset: z23.coerce.number().int().min(0).optional().describe("Pagination offset")
|
|
1985
2033
|
}),
|
|
1986
2034
|
async (params) => {
|
|
1987
2035
|
const qs = new URLSearchParams();
|
|
@@ -2005,7 +2053,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2005
2053
|
* List all organizations across tenants with member + project counts.
|
|
2006
2054
|
*/
|
|
2007
2055
|
list: withSchema(
|
|
2008
|
-
|
|
2056
|
+
z23.object({}),
|
|
2009
2057
|
async () => callRaw2(
|
|
2010
2058
|
await rawRequest2(baseUrl, hcOpts, "/admin/orgs")
|
|
2011
2059
|
)
|
|
@@ -2015,7 +2063,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2015
2063
|
* Detail view: org fields + member list + project list.
|
|
2016
2064
|
*/
|
|
2017
2065
|
get: withSchema(
|
|
2018
|
-
|
|
2066
|
+
z23.object({ id: z23.string().describe("Organization ID") }),
|
|
2019
2067
|
async (params) => callRaw2(
|
|
2020
2068
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}`)
|
|
2021
2069
|
)
|
|
@@ -2025,7 +2073,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2025
2073
|
* Set suspended_at = now(). Idempotent.
|
|
2026
2074
|
*/
|
|
2027
2075
|
suspend: withSchema(
|
|
2028
|
-
|
|
2076
|
+
z23.object({ id: z23.string().describe("Organization ID") }),
|
|
2029
2077
|
async (params) => callRaw2(
|
|
2030
2078
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/suspend`, {
|
|
2031
2079
|
method: "POST"
|
|
@@ -2037,7 +2085,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2037
2085
|
* Clear suspended_at.
|
|
2038
2086
|
*/
|
|
2039
2087
|
unsuspend: withSchema(
|
|
2040
|
-
|
|
2088
|
+
z23.object({ id: z23.string().describe("Organization ID") }),
|
|
2041
2089
|
async (params) => callRaw2(
|
|
2042
2090
|
await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/unsuspend`, {
|
|
2043
2091
|
method: "POST"
|
|
@@ -2053,7 +2101,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2053
2101
|
* api tokens, and environments. Idempotent. Super-admin only.
|
|
2054
2102
|
*/
|
|
2055
2103
|
nuke: withSchema(
|
|
2056
|
-
|
|
2104
|
+
z23.object({ projectId: z23.string().describe("Project ID to nuke") }),
|
|
2057
2105
|
async (params) => callRaw2(
|
|
2058
2106
|
await rawRequest2(
|
|
2059
2107
|
baseUrl,
|
|
@@ -2071,7 +2119,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2071
2119
|
* all derived from single-table COUNT queries.
|
|
2072
2120
|
*/
|
|
2073
2121
|
overview: withSchema(
|
|
2074
|
-
|
|
2122
|
+
z23.object({}),
|
|
2075
2123
|
async () => callRaw2(
|
|
2076
2124
|
await rawRequest2(baseUrl, hcOpts, "/admin/metrics/overview")
|
|
2077
2125
|
)
|
|
@@ -2086,7 +2134,7 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2086
2134
|
* Requires super-admin.
|
|
2087
2135
|
*/
|
|
2088
2136
|
list: withSchema(
|
|
2089
|
-
|
|
2137
|
+
z23.object({}),
|
|
2090
2138
|
async () => callRaw2(
|
|
2091
2139
|
await rawRequest2(
|
|
2092
2140
|
baseUrl,
|
|
@@ -2101,15 +2149,15 @@ function createAdminClient(baseUrl, hcOpts) {
|
|
|
2101
2149
|
}
|
|
2102
2150
|
|
|
2103
2151
|
// src/resolve-source.ts
|
|
2104
|
-
import { z as
|
|
2152
|
+
import { z as z24 } from "zod";
|
|
2105
2153
|
function createResolveSourceFn(proj) {
|
|
2106
2154
|
return withSchema(
|
|
2107
|
-
|
|
2108
|
-
orgId:
|
|
2109
|
-
projectId:
|
|
2110
|
-
kind:
|
|
2111
|
-
ref:
|
|
2112
|
-
version:
|
|
2155
|
+
z24.object({
|
|
2156
|
+
orgId: z24.string().describe("Organization slug"),
|
|
2157
|
+
projectId: z24.string().describe("Project ID"),
|
|
2158
|
+
kind: z24.literal("registry").describe('Source kind \u2014 only "registry" is supported today'),
|
|
2159
|
+
ref: z24.string().regex(/^[^/]+\/[^/]+\/[^/]+$/, { message: "ref must be <namespace>/<name>/<provider>" }).describe("Terraform Registry module ref (<namespace>/<name>/<provider>)"),
|
|
2160
|
+
version: z24.string().optional().describe("Module version semver \u2014 resolves latest if omitted")
|
|
2113
2161
|
}),
|
|
2114
2162
|
(params) => {
|
|
2115
2163
|
const { orgId, projectId, kind, ref, version } = params;
|
|
@@ -2153,6 +2201,7 @@ var createClient = (baseUrl, options = {}) => {
|
|
|
2153
2201
|
catalogRevisions,
|
|
2154
2202
|
auditEvents: createAuditEventsClient(proj),
|
|
2155
2203
|
driftEvents: createDriftEventsClient(projEnv),
|
|
2204
|
+
conformanceFindings: createConformanceFindingsClient(projEnv),
|
|
2156
2205
|
stats: createStatsClient(proj),
|
|
2157
2206
|
graphViews: createGraphViewsClient(proj),
|
|
2158
2207
|
notifications: createNotificationsClient(baseUrl, hcOpts),
|