@terrantula/sdk 0.3.0 → 0.5.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.
@@ -19,7 +19,9 @@ interface AdminAuditEvent {
19
19
  action: string;
20
20
  resourceKind: string;
21
21
  resourceId: string | null;
22
- metadata: unknown;
22
+ /** Drizzle returns the jsonb column under its DB-side name. The route does
23
+ * not alias it, so consumers read it as `payload`. */
24
+ payload: unknown;
23
25
  createdAt: string;
24
26
  }
25
27
  interface AdminAuditListResponse {
@@ -70,6 +72,21 @@ interface AdminMetricsOverview {
70
72
  activeSessions: number;
71
73
  mauApprox: number;
72
74
  }
75
+ interface AdminGitHubInstallation {
76
+ id: string;
77
+ /** Stringified GitHub installation ID (bigint → text from the DB). */
78
+ githubInstallationId: string;
79
+ githubOrgLogin: string;
80
+ status: string;
81
+ grantedReposCount: number;
82
+ installedAt: string;
83
+ lastEventAt: string;
84
+ orgName: string | null;
85
+ orgSlug: string | null;
86
+ }
87
+ interface AdminGitHubInstallationListResponse {
88
+ data: AdminGitHubInstallation[];
89
+ }
73
90
 
74
91
  type SnapshotOp = 'created' | 'updated' | 'deleted' | 'unchanged' | 'failed';
75
92
 
@@ -111,4 +128,4 @@ interface TestConnectionResponse {
111
128
  error?: string;
112
129
  }
113
130
 
114
- 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 AdminAuditEvent as i, type AdminOrgMember as j, type AdminOrgProject as k, type AdminOrgSummary as l, TerrantulaError as m, withSchema as w };
131
+ 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 };
@@ -19,7 +19,9 @@ interface AdminAuditEvent {
19
19
  action: string;
20
20
  resourceKind: string;
21
21
  resourceId: string | null;
22
- metadata: unknown;
22
+ /** Drizzle returns the jsonb column under its DB-side name. The route does
23
+ * not alias it, so consumers read it as `payload`. */
24
+ payload: unknown;
23
25
  createdAt: string;
24
26
  }
25
27
  interface AdminAuditListResponse {
@@ -70,6 +72,21 @@ interface AdminMetricsOverview {
70
72
  activeSessions: number;
71
73
  mauApprox: number;
72
74
  }
75
+ interface AdminGitHubInstallation {
76
+ id: string;
77
+ /** Stringified GitHub installation ID (bigint → text from the DB). */
78
+ githubInstallationId: string;
79
+ githubOrgLogin: string;
80
+ status: string;
81
+ grantedReposCount: number;
82
+ installedAt: string;
83
+ lastEventAt: string;
84
+ orgName: string | null;
85
+ orgSlug: string | null;
86
+ }
87
+ interface AdminGitHubInstallationListResponse {
88
+ data: AdminGitHubInstallation[];
89
+ }
73
90
 
74
91
  type SnapshotOp = 'created' | 'updated' | 'deleted' | 'unchanged' | 'failed';
75
92
 
@@ -111,4 +128,4 @@ interface TestConnectionResponse {
111
128
  error?: string;
112
129
  }
113
130
 
114
- 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 AdminAuditEvent as i, type AdminOrgMember as j, type AdminOrgProject as k, type AdminOrgSummary as l, TerrantulaError as m, withSchema as w };
131
+ 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
  )
@@ -1632,6 +1641,26 @@ function createAdminClient(baseUrl, hcOpts) {
1632
1641
  await rawRequest2(baseUrl, hcOpts, "/admin/metrics/overview")
1633
1642
  )
1634
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
+ }
1635
1664
  }
1636
1665
  };
1637
1666
  }