@thinkai/tai-api-contract 2.42.0 → 2.44.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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.42.0
4
+ version: 2.44.0
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -1355,6 +1355,61 @@ paths:
1355
1355
  "404":
1356
1356
  description: Workspace does not exist or malformed workspaceId
1357
1357
 
1358
+ /workspaces/{workspaceId}/insights/persons/{personId}/erase:
1359
+ post:
1360
+ tags: [Workspace]
1361
+ summary: Erase person-level insights data (workspace admin)
1362
+ description: >
1363
+ Workspace admin only. Deletes or anonymizes a person's developer-insights rows
1364
+ for the workspace: org-chart node, person-scope dashboard metrics, AI-tool fact rows,
1365
+ HRIS absences, and readiness run requester linkage. Granular categories default to
1366
+ all enabled when the body is omitted. `personId` is the org-chart `person_id`
1367
+ (typically work email); URL-encode the path segment (e.g. `alice%40example.com`).
1368
+ operationId: eraseInsightsPerson
1369
+ parameters:
1370
+ - $ref: "#/components/parameters/WorkspaceId"
1371
+ - name: personId
1372
+ in: path
1373
+ required: true
1374
+ description: Org-chart person_id (URL-encoded when it contains `@`).
1375
+ schema:
1376
+ type: string
1377
+ requestBody:
1378
+ required: false
1379
+ content:
1380
+ application/json:
1381
+ schema:
1382
+ $ref: "#/components/schemas/EraseInsightsPersonBodyDto"
1383
+ example:
1384
+ orgChart: true
1385
+ dashboardMetrics: true
1386
+ aiToolData: true
1387
+ absences: true
1388
+ readinessAnonymize: true
1389
+ responses:
1390
+ "200":
1391
+ description: Person data erased or anonymized
1392
+ content:
1393
+ application/json:
1394
+ schema:
1395
+ $ref: "#/components/schemas/EraseInsightsPersonResultDto"
1396
+ "400":
1397
+ description: Invalid body or personId
1398
+ content:
1399
+ application/json:
1400
+ schema:
1401
+ $ref: "#/components/schemas/ErrorMessageDto"
1402
+ "401":
1403
+ $ref: "#/components/responses/Unauthorized"
1404
+ "403":
1405
+ $ref: "#/components/responses/Forbidden"
1406
+ "404":
1407
+ description: Workspace not found, malformed workspaceId, or person not in org chart
1408
+ content:
1409
+ application/json:
1410
+ schema:
1411
+ $ref: "#/components/schemas/ErrorMessageDto"
1412
+
1358
1413
  /workspaces/{workspaceId}/insights/ai-usage-spend/aggregated-teams:
1359
1414
  get:
1360
1415
  tags: [Workspace]
@@ -2404,6 +2459,10 @@ paths:
2404
2459
  description: >
2405
2460
  Provider-agnostic refresh. Returns 409 when an advisory-lock refresh is already in progress.
2406
2461
  On upstream auth/rate/network failures, returns `200` with `{ ok:false, error }` so the SPA can render inline error.
2462
+ Pass `full=true` to force a full re-sync that ignores the incremental daily-usage watermark and
2463
+ re-pulls the full initial window (six calendar months for Claude Enterprise) — used to backfill
2464
+ historical months after an ingestion-granularity change. Omitted/false performs a normal
2465
+ incremental refresh.
2407
2466
  parameters:
2408
2467
  - $ref: "#/components/parameters/WorkspaceId"
2409
2468
  - name: provider
@@ -2412,6 +2471,15 @@ paths:
2412
2471
  schema:
2413
2472
  type: string
2414
2473
  enum: [cursor, claude]
2474
+ - name: full
2475
+ in: query
2476
+ required: false
2477
+ description: >
2478
+ Force a full re-sync (ignore the daily-usage watermark, re-pull the full initial window).
2479
+ Truthy only for `true` or `1`.
2480
+ schema:
2481
+ type: string
2482
+ enum: ["true", "1"]
2415
2483
  responses:
2416
2484
  "200":
2417
2485
  description: Refresh result
@@ -5750,6 +5818,52 @@ components:
5750
5818
  type: string
5751
5819
  enum: [admin, editor, viewer]
5752
5820
 
5821
+ EraseInsightsPersonBodyDto:
5822
+ type: object
5823
+ description: >
5824
+ Granular person erasure categories. All default to true when omitted.
5825
+ properties:
5826
+ orgChart:
5827
+ type: boolean
5828
+ description: Remove the person node from `tai_workspace_config.org_chart`.
5829
+ dashboardMetrics:
5830
+ type: boolean
5831
+ description: Delete person-scope rows in `tai_workspace_dashboard_metrics`.
5832
+ aiToolData:
5833
+ type: boolean
5834
+ description: Delete AI-tool seats and fact rows keyed to the person.
5835
+ absences:
5836
+ type: boolean
5837
+ description: Delete HRIS absence rows for the person's email.
5838
+ readinessAnonymize:
5839
+ type: boolean
5840
+ description: Clear `requested_by_user_id` on readiness runs for matching app users.
5841
+
5842
+ EraseInsightsPersonResultDto:
5843
+ type: object
5844
+ required:
5845
+ - deleted
5846
+ - aiToolRowsDeleted
5847
+ - absencesDeleted
5848
+ - readinessRunsAnonymized
5849
+ - auditEntriesAnonymized
5850
+ properties:
5851
+ deleted:
5852
+ type: boolean
5853
+ enum: [true]
5854
+ aiToolRowsDeleted:
5855
+ type: integer
5856
+ minimum: 0
5857
+ absencesDeleted:
5858
+ type: integer
5859
+ minimum: 0
5860
+ readinessRunsAnonymized:
5861
+ type: integer
5862
+ minimum: 0
5863
+ auditEntriesAnonymized:
5864
+ type: integer
5865
+ minimum: 0
5866
+
5753
5867
  OrgChartNodeDto:
5754
5868
  type: object
5755
5869
  additionalProperties: false
@@ -9912,6 +10026,11 @@ components:
9912
10026
  type: string
9913
10027
  enum: [light, dark, system]
9914
10028
 
10029
+ DataRefreshInterval:
10030
+ type: string
10031
+ enum: [off, 1m, 5m, 10m]
10032
+ description: User-configured dashboard background refresh cadence.
10033
+
9915
10034
  NotificationPreferencesDto:
9916
10035
  type: object
9917
10036
  additionalProperties: false
@@ -9933,7 +10052,7 @@ components:
9933
10052
  PreferencesDto:
9934
10053
  type: object
9935
10054
  additionalProperties: false
9936
- required: [theme, sidebarCollapsed, timezone, notifications]
10055
+ required: [theme, sidebarCollapsed, timezone, dataRefreshInterval, notifications]
9937
10056
  properties:
9938
10057
  theme:
9939
10058
  $ref: "#/components/schemas/ThemePreference"
@@ -9942,6 +10061,8 @@ components:
9942
10061
  timezone:
9943
10062
  type: string
9944
10063
  description: IANA timezone name
10064
+ dataRefreshInterval:
10065
+ $ref: "#/components/schemas/DataRefreshInterval"
9945
10066
  notifications:
9946
10067
  $ref: "#/components/schemas/NotificationPreferencesDto"
9947
10068
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.42.0",
3
+ "version": "2.44.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -446,6 +446,26 @@ export interface paths {
446
446
  patch?: never;
447
447
  trace?: never;
448
448
  };
449
+ "/workspaces/{workspaceId}/insights/persons/{personId}/erase": {
450
+ parameters: {
451
+ query?: never;
452
+ header?: never;
453
+ path?: never;
454
+ cookie?: never;
455
+ };
456
+ get?: never;
457
+ put?: never;
458
+ /**
459
+ * Erase person-level insights data (workspace admin)
460
+ * @description Workspace admin only. Deletes or anonymizes a person's developer-insights rows for the workspace: org-chart node, person-scope dashboard metrics, AI-tool fact rows, HRIS absences, and readiness run requester linkage. Granular categories default to all enabled when the body is omitted. `personId` is the org-chart `person_id` (typically work email); URL-encode the path segment (e.g. `alice%40example.com`).
461
+ */
462
+ post: operations["eraseInsightsPerson"];
463
+ delete?: never;
464
+ options?: never;
465
+ head?: never;
466
+ patch?: never;
467
+ trace?: never;
468
+ };
449
469
  "/workspaces/{workspaceId}/insights/ai-usage-spend/aggregated-teams": {
450
470
  parameters: {
451
471
  query?: never;
@@ -822,7 +842,7 @@ export interface paths {
822
842
  put?: never;
823
843
  /**
824
844
  * Refresh AI tool integration snapshots
825
- * @description Provider-agnostic refresh. Returns 409 when an advisory-lock refresh is already in progress. On upstream auth/rate/network failures, returns `200` with `{ ok:false, error }` so the SPA can render inline error.
845
+ * @description Provider-agnostic refresh. Returns 409 when an advisory-lock refresh is already in progress. On upstream auth/rate/network failures, returns `200` with `{ ok:false, error }` so the SPA can render inline error. Pass `full=true` to force a full re-sync that ignores the incremental daily-usage watermark and re-pulls the full initial window (six calendar months for Claude Enterprise) — used to backfill historical months after an ingestion-granularity change. Omitted/false performs a normal incremental refresh.
826
846
  */
827
847
  post: operations["refreshWorkspaceAiTool"];
828
848
  delete?: never;
@@ -2205,6 +2225,27 @@ export interface components {
2205
2225
  /** @enum {string} */
2206
2226
  role: "admin" | "editor" | "viewer";
2207
2227
  };
2228
+ /** @description Granular person erasure categories. All default to true when omitted. */
2229
+ EraseInsightsPersonBodyDto: {
2230
+ /** @description Remove the person node from `tai_workspace_config.org_chart`. */
2231
+ orgChart?: boolean;
2232
+ /** @description Delete person-scope rows in `tai_workspace_dashboard_metrics`. */
2233
+ dashboardMetrics?: boolean;
2234
+ /** @description Delete AI-tool seats and fact rows keyed to the person. */
2235
+ aiToolData?: boolean;
2236
+ /** @description Delete HRIS absence rows for the person's email. */
2237
+ absences?: boolean;
2238
+ /** @description Clear `requested_by_user_id` on readiness runs for matching app users. */
2239
+ readinessAnonymize?: boolean;
2240
+ };
2241
+ EraseInsightsPersonResultDto: {
2242
+ /** @enum {boolean} */
2243
+ deleted: true;
2244
+ aiToolRowsDeleted: number;
2245
+ absencesDeleted: number;
2246
+ readinessRunsAnonymized: number;
2247
+ auditEntriesAnonymized: number;
2248
+ };
2208
2249
  OrgChartNodeDto: {
2209
2250
  id: string;
2210
2251
  name: string;
@@ -4059,6 +4100,11 @@ export interface components {
4059
4100
  } | unknown | unknown;
4060
4101
  /** @enum {string} */
4061
4102
  ThemePreference: "light" | "dark" | "system";
4103
+ /**
4104
+ * @description User-configured dashboard background refresh cadence.
4105
+ * @enum {string}
4106
+ */
4107
+ DataRefreshInterval: "off" | "1m" | "5m" | "10m";
4062
4108
  NotificationPreferencesDto: {
4063
4109
  /** @description Sync/health status notifications. */
4064
4110
  status: boolean;
@@ -4074,6 +4120,7 @@ export interface components {
4074
4120
  sidebarCollapsed: boolean;
4075
4121
  /** @description IANA timezone name */
4076
4122
  timezone: string;
4123
+ dataRefreshInterval: components["schemas"]["DataRefreshInterval"];
4077
4124
  notifications: components["schemas"]["NotificationPreferencesDto"];
4078
4125
  };
4079
4126
  ValidationIssueDto: {
@@ -4562,6 +4609,8 @@ export type TeamMemberDto = components['schemas']['TeamMemberDto'];
4562
4609
  export type TeamMemberListDto = components['schemas']['TeamMemberListDto'];
4563
4610
  export type InviteTeamMemberBodyDto = components['schemas']['InviteTeamMemberBodyDto'];
4564
4611
  export type UpdateTeamMemberRoleBodyDto = components['schemas']['UpdateTeamMemberRoleBodyDto'];
4612
+ export type EraseInsightsPersonBodyDto = components['schemas']['EraseInsightsPersonBodyDto'];
4613
+ export type EraseInsightsPersonResultDto = components['schemas']['EraseInsightsPersonResultDto'];
4565
4614
  export type OrgChartNodeDto = components['schemas']['OrgChartNodeDto'];
4566
4615
  export type OrgChartTreeNodeDto = components['schemas']['OrgChartTreeNodeDto'];
4567
4616
  export type ScoringOrgChartDto = components['schemas']['ScoringOrgChartDto'];
@@ -4740,6 +4789,7 @@ export type JourneyStepId = components['schemas']['JourneyStepId'];
4740
4789
  export type JourneyProgressDto = components['schemas']['JourneyProgressDto'];
4741
4790
  export type JourneyProgressUpdateDto = components['schemas']['JourneyProgressUpdateDto'];
4742
4791
  export type ThemePreference = components['schemas']['ThemePreference'];
4792
+ export type DataRefreshInterval = components['schemas']['DataRefreshInterval'];
4743
4793
  export type NotificationPreferencesDto = components['schemas']['NotificationPreferencesDto'];
4744
4794
  export type PreferencesDto = components['schemas']['PreferencesDto'];
4745
4795
  export type ValidationIssueDto = components['schemas']['ValidationIssueDto'];
@@ -5977,6 +6027,63 @@ export interface operations {
5977
6027
  };
5978
6028
  };
5979
6029
  };
6030
+ eraseInsightsPerson: {
6031
+ parameters: {
6032
+ query?: never;
6033
+ header?: never;
6034
+ path: {
6035
+ workspaceId: components["parameters"]["WorkspaceId"];
6036
+ /** @description Org-chart person_id (URL-encoded when it contains `@`). */
6037
+ personId: string;
6038
+ };
6039
+ cookie?: never;
6040
+ };
6041
+ requestBody?: {
6042
+ content: {
6043
+ /**
6044
+ * @example {
6045
+ * "orgChart": true,
6046
+ * "dashboardMetrics": true,
6047
+ * "aiToolData": true,
6048
+ * "absences": true,
6049
+ * "readinessAnonymize": true
6050
+ * }
6051
+ */
6052
+ "application/json": components["schemas"]["EraseInsightsPersonBodyDto"];
6053
+ };
6054
+ };
6055
+ responses: {
6056
+ /** @description Person data erased or anonymized */
6057
+ 200: {
6058
+ headers: {
6059
+ [name: string]: unknown;
6060
+ };
6061
+ content: {
6062
+ "application/json": components["schemas"]["EraseInsightsPersonResultDto"];
6063
+ };
6064
+ };
6065
+ /** @description Invalid body or personId */
6066
+ 400: {
6067
+ headers: {
6068
+ [name: string]: unknown;
6069
+ };
6070
+ content: {
6071
+ "application/json": components["schemas"]["ErrorMessageDto"];
6072
+ };
6073
+ };
6074
+ 401: components["responses"]["Unauthorized"];
6075
+ 403: components["responses"]["Forbidden"];
6076
+ /** @description Workspace not found, malformed workspaceId, or person not in org chart */
6077
+ 404: {
6078
+ headers: {
6079
+ [name: string]: unknown;
6080
+ };
6081
+ content: {
6082
+ "application/json": components["schemas"]["ErrorMessageDto"];
6083
+ };
6084
+ };
6085
+ };
6086
+ };
5980
6087
  getAiUsageSpendAggregatedTeams: {
5981
6088
  parameters: {
5982
6089
  query?: {
@@ -6977,7 +7084,10 @@ export interface operations {
6977
7084
  };
6978
7085
  refreshWorkspaceAiTool: {
6979
7086
  parameters: {
6980
- query?: never;
7087
+ query?: {
7088
+ /** @description Force a full re-sync (ignore the daily-usage watermark, re-pull the full initial window). Truthy only for `true` or `1`. */
7089
+ full?: "true" | "1";
7090
+ };
6981
7091
  header?: never;
6982
7092
  path: {
6983
7093
  workspaceId: components["parameters"]["WorkspaceId"];