@thinkai/tai-api-contract 2.7.0 → 2.7.2

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.
@@ -3,6 +3,27 @@
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
  export interface paths {
6
+ "/admin/users/{userId}": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ get?: never;
14
+ put?: never;
15
+ post?: never;
16
+ /**
17
+ * Delete user and all workspace data
18
+ * @description Hard-deletes a user account and all data they own in a single atomic transaction: owned workspaces (and all workspace-level child tables via CASCADE), membership rows in other workspaces, invitations where the user is `invited_by`, and the user row itself. After the DB commit, removes the corresponding Supabase Auth user via the service-role key; Auth deletion failure is logged but does not roll back the DB changes.
19
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS` (comma-separated env var). All other callers receive `403 Forbidden`.
20
+ */
21
+ delete: operations["adminDeleteUser"];
22
+ options?: never;
23
+ head?: never;
24
+ patch?: never;
25
+ trace?: never;
26
+ };
6
27
  "/me": {
7
28
  parameters: {
8
29
  query?: never;
@@ -248,7 +269,7 @@ export interface paths {
248
269
  };
249
270
  /**
250
271
  * Productivity insights — aggregated team weekly metrics
251
- * @description Team-level rollup for Productivity insights (Aggregated Teams view on /phase-c/c4). Returns weekly merged PR counts and fail rates per engineering team, filtered by the same department, team, and range controls as the Measure UI.
272
+ * @description Team-level rollup for Productivity insights (Aggregated Teams view on /phase-c/c4). Returns weekly merged PR counts and fail rates per engineering team, filtered by the same department, team, and range controls as the Measure UI. When filters are `All departments` / `All teams`, appends a synthetic **Other** team (`teamId` `__other`) aggregating GitHub contributors not mapped in the org chart (`notInOrgChart: true`).
252
273
  */
253
274
  get: operations["getProductivityInsightsAggregatedTeams"];
254
275
  put?: never;
@@ -308,7 +329,7 @@ export interface paths {
308
329
  };
309
330
  /**
310
331
  * Productivity insights — contributor drilldown
311
- * @description Weekly and daily activity rollups for a single contributor on `/phase-c/c4/contributors/:id`. Distributes weekly merged PR counts from precomputed person metrics across weekdays; includes fail-rate signals and period-over-period summary deltas. Uses org-chart person ids (typically email).
332
+ * @description Weekly and daily activity rollups for a single contributor on `/phase-c/c4/contributors/:id`. Distributes weekly merged PR counts from precomputed person metrics across weekdays; includes fail-rate signals and period-over-period summary deltas. Accepts org-chart person ids (typically email) and synthetic GitHub scopes (`__github:{login}`) for contributors not in the org chart.
312
333
  */
313
334
  get: operations["getProductivityInsightsContributor"];
314
335
  put?: never;
@@ -1700,6 +1721,8 @@ export interface components {
1700
1721
  teamName: string;
1701
1722
  headcount: number;
1702
1723
  managerLabel?: string;
1724
+ /** @description True when the team aggregates GitHub logins not mapped in the org chart (`teamId` `__other`). */
1725
+ notInOrgChart?: boolean;
1703
1726
  weeks: components["schemas"]["ProductivityInsightsAggregatedTeamWeekDto"][];
1704
1727
  };
1705
1728
  ProductivityInsightsAggregatedTeamsDto: {
@@ -1792,6 +1815,10 @@ export interface components {
1792
1815
  title?: string;
1793
1816
  team?: string;
1794
1817
  department?: string;
1818
+ /** @description True when the contributor is a GitHub login not mapped in the org chart. */
1819
+ notInOrgChart?: boolean;
1820
+ /** @description GitHub login for unattributed contributors (`notInOrgChart` true). */
1821
+ githubLogin?: string;
1795
1822
  };
1796
1823
  ProductivityInsightsContributorActivityDayDto: {
1797
1824
  /** Format: date */
@@ -2373,23 +2400,6 @@ export interface components {
2373
2400
  issueCount: number;
2374
2401
  criticalIssueCount: number;
2375
2402
  };
2376
- AgenticFoundationDashboardIssueDto: {
2377
- /** Format: uuid */
2378
- id: string;
2379
- /** Format: uuid */
2380
- repoId: string;
2381
- repoName: string;
2382
- provider: components["schemas"]["RepoProviderDto"];
2383
- dimensionId: components["schemas"]["ReadinessDimensionId"];
2384
- /** @enum {string} */
2385
- severity: "critical" | "high" | "medium" | "low";
2386
- title: string;
2387
- description: string;
2388
- rubricId?: string | null;
2389
- filePath: string | null;
2390
- /** @enum {string} */
2391
- fixStatus: "open" | "pr-pending" | "fixed";
2392
- };
2393
2403
  PageMetaDto: {
2394
2404
  /** @description Total rows matching filters (full workspace, not just this page). */
2395
2405
  total: number;
@@ -2897,7 +2907,6 @@ export type ReadinessIssueDto = components['schemas']['ReadinessIssueDto'];
2897
2907
  export type DimensionScoreDto = components['schemas']['DimensionScoreDto'];
2898
2908
  export type RepoReadinessScoreDto = components['schemas']['RepoReadinessScoreDto'];
2899
2909
  export type AgenticFoundationDashboardSummaryDto = components['schemas']['AgenticFoundationDashboardSummaryDto'];
2900
- export type AgenticFoundationDashboardIssueDto = components['schemas']['AgenticFoundationDashboardIssueDto'];
2901
2910
  export type PageMetaDto = components['schemas']['PageMetaDto'];
2902
2911
  export type ReadinessRepoListDto = components['schemas']['ReadinessRepoListDto'];
2903
2912
  export type ReadinessFixListDto = components['schemas']['ReadinessFixListDto'];
@@ -2964,6 +2973,81 @@ export type ParameterGithubRepoSort = components['parameters']['GithubRepoSort']
2964
2973
  export type ParameterGithubRepoOrder = components['parameters']['GithubRepoOrder'];
2965
2974
  export type $defs = Record<string, never>;
2966
2975
  export interface operations {
2976
+ adminDeleteUser: {
2977
+ parameters: {
2978
+ query?: never;
2979
+ header?: never;
2980
+ path: {
2981
+ /** @description `tai_users.id` of the account to delete. */
2982
+ userId: string;
2983
+ };
2984
+ cookie?: never;
2985
+ };
2986
+ requestBody?: never;
2987
+ responses: {
2988
+ /** @description User and all workspace data deleted. */
2989
+ 204: {
2990
+ headers: {
2991
+ [name: string]: unknown;
2992
+ };
2993
+ content?: never;
2994
+ };
2995
+ /** @description Invalid UUID format. */
2996
+ 400: {
2997
+ headers: {
2998
+ [name: string]: unknown;
2999
+ };
3000
+ content: {
3001
+ /**
3002
+ * @example {
3003
+ * "error": "Invalid user ID format",
3004
+ * "code": "invalid_user_id"
3005
+ * }
3006
+ */
3007
+ "application/json": components["schemas"]["ErrorMessageDto"];
3008
+ };
3009
+ };
3010
+ /** @description Missing or invalid JWT. */
3011
+ 401: {
3012
+ headers: {
3013
+ [name: string]: unknown;
3014
+ };
3015
+ content: {
3016
+ "application/json": components["schemas"]["ErrorMessageDto"];
3017
+ };
3018
+ };
3019
+ /** @description Caller is not a platform admin. */
3020
+ 403: {
3021
+ headers: {
3022
+ [name: string]: unknown;
3023
+ };
3024
+ content: {
3025
+ /**
3026
+ * @example {
3027
+ * "error": "Forbidden",
3028
+ * "code": "forbidden"
3029
+ * }
3030
+ */
3031
+ "application/json": components["schemas"]["ErrorMessageDto"];
3032
+ };
3033
+ };
3034
+ /** @description User not found. */
3035
+ 404: {
3036
+ headers: {
3037
+ [name: string]: unknown;
3038
+ };
3039
+ content: {
3040
+ /**
3041
+ * @example {
3042
+ * "error": "User not found",
3043
+ * "code": "user_not_found"
3044
+ * }
3045
+ */
3046
+ "application/json": components["schemas"]["ErrorMessageDto"];
3047
+ };
3048
+ };
3049
+ };
3050
+ };
2967
3051
  getMe: {
2968
3052
  parameters: {
2969
3053
  query?: never;
@@ -3735,7 +3819,7 @@ export interface operations {
3735
3819
  header?: never;
3736
3820
  path: {
3737
3821
  workspaceId: components["parameters"]["WorkspaceId"];
3738
- /** @description Org-chart person id (e.g. email from `person_id` external id). */
3822
+ /** @description Org-chart person id or synthetic GitHub scope id (`__github:{login}`). */
3739
3823
  contributorId: string;
3740
3824
  };
3741
3825
  cookie?: never;