@terrantula/sdk 0.2.0 → 0.4.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.
@@ -62,6 +62,29 @@ interface AdminSuspendResponse {
62
62
  id: string;
63
63
  suspendedAt: string | null;
64
64
  }
65
+ interface AdminMetricsOverview {
66
+ totalUsers: number;
67
+ signups24h: number;
68
+ signups7d: number;
69
+ signups30d: number;
70
+ activeSessions: number;
71
+ mauApprox: number;
72
+ }
73
+ interface AdminGitHubInstallation {
74
+ id: string;
75
+ /** Stringified GitHub installation ID (bigint → text from the DB). */
76
+ githubInstallationId: string;
77
+ githubOrgLogin: string;
78
+ status: string;
79
+ grantedReposCount: number;
80
+ installedAt: string;
81
+ lastEventAt: string;
82
+ orgName: string | null;
83
+ orgSlug: string | null;
84
+ }
85
+ interface AdminGitHubInstallationListResponse {
86
+ data: AdminGitHubInstallation[];
87
+ }
65
88
 
66
89
  type SnapshotOp = 'created' | 'updated' | 'deleted' | 'unchanged' | 'failed';
67
90
 
@@ -103,4 +126,4 @@ interface TestConnectionResponse {
103
126
  error?: string;
104
127
  }
105
128
 
106
- 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 AdminAuditEvent as h, type AdminOrgMember as i, type AdminOrgProject as j, type AdminOrgSummary as k, TerrantulaError as l, withSchema as w };
129
+ 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 AdminMetricsOverview as h, type AdminGitHubInstallationListResponse as i, type AdminAuditEvent as j, type AdminGitHubInstallation as k, type AdminOrgMember as l, type AdminOrgProject as m, type AdminOrgSummary as n, TerrantulaError as o, withSchema as w };
@@ -62,6 +62,29 @@ interface AdminSuspendResponse {
62
62
  id: string;
63
63
  suspendedAt: string | null;
64
64
  }
65
+ interface AdminMetricsOverview {
66
+ totalUsers: number;
67
+ signups24h: number;
68
+ signups7d: number;
69
+ signups30d: number;
70
+ activeSessions: number;
71
+ mauApprox: number;
72
+ }
73
+ interface AdminGitHubInstallation {
74
+ id: string;
75
+ /** Stringified GitHub installation ID (bigint → text from the DB). */
76
+ githubInstallationId: string;
77
+ githubOrgLogin: string;
78
+ status: string;
79
+ grantedReposCount: number;
80
+ installedAt: string;
81
+ lastEventAt: string;
82
+ orgName: string | null;
83
+ orgSlug: string | null;
84
+ }
85
+ interface AdminGitHubInstallationListResponse {
86
+ data: AdminGitHubInstallation[];
87
+ }
65
88
 
66
89
  type SnapshotOp = 'created' | 'updated' | 'deleted' | 'unchanged' | 'failed';
67
90
 
@@ -103,4 +126,4 @@ interface TestConnectionResponse {
103
126
  error?: string;
104
127
  }
105
128
 
106
- 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 AdminAuditEvent as h, type AdminOrgMember as i, type AdminOrgProject as j, type AdminOrgSummary as k, TerrantulaError as l, withSchema as w };
129
+ 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 AdminMetricsOverview as h, type AdminGitHubInstallationListResponse as i, type AdminAuditEvent as j, type AdminGitHubInstallation as k, type AdminOrgMember as l, type AdminOrgProject as m, type AdminOrgSummary as n, TerrantulaError as o, withSchema as w };
@@ -954,13 +954,23 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
954
954
  )
955
955
  },
956
956
  projects: {
957
+ list: withSchema(
958
+ z8.object({
959
+ orgId: z8.string().describe("Organization ID"),
960
+ projectId: z8.string().describe("Project ID")
961
+ }),
962
+ (params) => call(
963
+ cloud.orgs[":orgId"].projects[":projectId"]["github-repos"].$get({
964
+ param: params
965
+ })
966
+ )
967
+ ),
957
968
  linkRepo: withSchema(
958
969
  z8.object({
959
970
  orgId: z8.string().describe("Organization ID"),
960
971
  projectId: z8.string().describe("Project ID"),
961
- installationId: z8.string().describe("Installation row ID"),
962
- owner: z8.string().describe("GitHub repo owner"),
963
- name: z8.string().describe("GitHub repo name")
972
+ installationId: z8.string().describe("github_installations.id (UUID)"),
973
+ repoFullName: z8.string().describe('GitHub repo "owner/name"')
964
974
  }),
965
975
  (params) => {
966
976
  const { orgId, projectId, ...body } = params;
@@ -976,11 +986,10 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
976
986
  z8.object({
977
987
  orgId: z8.string().describe("Organization ID"),
978
988
  projectId: z8.string().describe("Project ID"),
979
- owner: z8.string().describe("GitHub repo owner"),
980
- name: z8.string().describe("GitHub repo name")
989
+ id: z8.string().describe("project_github_repos.id (UUID) \u2014 returned by linkRepo")
981
990
  }),
982
991
  (params) => call(
983
- cloud.orgs[":orgId"].projects[":projectId"]["github-repos"][":owner"][":name"].$delete({
992
+ cloud.orgs[":orgId"].projects[":projectId"]["github-repos"][":id"].$delete({
984
993
  param: params
985
994
  })
986
995
  )
@@ -1619,6 +1628,39 @@ function createAdminClient(baseUrl, hcOpts) {
1619
1628
  })
1620
1629
  )
1621
1630
  )
1631
+ },
1632
+ metrics: {
1633
+ /**
1634
+ * GET /admin/metrics/overview
1635
+ * Cheap-counts overview for the control-plane dashboard. Six scalars,
1636
+ * all derived from single-table COUNT queries.
1637
+ */
1638
+ overview: withSchema(
1639
+ z18.object({}),
1640
+ async () => callRaw2(
1641
+ await rawRequest2(baseUrl, hcOpts, "/admin/metrics/overview")
1642
+ )
1643
+ )
1644
+ },
1645
+ integrations: {
1646
+ githubInstallations: {
1647
+ /**
1648
+ * GET /admin/integrations/github-installations
1649
+ * Cross-tenant list of all GitHub App installations with status,
1650
+ * granted-repo count, and last lifecycle event timestamp.
1651
+ * Requires super-admin.
1652
+ */
1653
+ list: withSchema(
1654
+ z18.object({}),
1655
+ async () => callRaw2(
1656
+ await rawRequest2(
1657
+ baseUrl,
1658
+ hcOpts,
1659
+ "/admin/integrations/github-installations"
1660
+ )
1661
+ )
1662
+ )
1663
+ }
1622
1664
  }
1623
1665
  };
1624
1666
  }