@thinkai/tai-api-contract 2.48.0 → 2.50.0-pr.877.6ff333f6

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.
@@ -67,6 +67,156 @@ export interface paths {
67
67
  patch?: never;
68
68
  trace?: never;
69
69
  };
70
+ "/privacy-requests": {
71
+ parameters: {
72
+ query?: never;
73
+ header?: never;
74
+ path?: never;
75
+ cookie?: never;
76
+ };
77
+ get?: never;
78
+ put?: never;
79
+ /**
80
+ * Submit a privacy rights request (public)
81
+ * @description Public, unauthenticated intake for data subject access, erasure, portability, rectification, restriction, and objection requests (#611). No bearer token required.
82
+ * **Abuse controls:** requests are rate limited per client IP (`429` with `Retry-After` when exceeded). A hidden honeypot field (`companyWebsite`) silently absorbs bot submissions. The response shape is identical whether or not the email matches an existing account, so the endpoint cannot be used to enumerate users. Duplicate open requests for the same email and request type within 24h are rejected with `409`.
83
+ * **Identity is not proven** by this route; privacy ops must verify identity before any export or erasure is fulfilled.
84
+ */
85
+ post: operations["submitPublicPrivacyRequest"];
86
+ delete?: never;
87
+ options?: never;
88
+ head?: never;
89
+ patch?: never;
90
+ trace?: never;
91
+ };
92
+ "/me/privacy-requests": {
93
+ parameters: {
94
+ query?: never;
95
+ header?: never;
96
+ path?: never;
97
+ cookie?: never;
98
+ };
99
+ /**
100
+ * List the caller's privacy requests
101
+ * @description Returns privacy requests whose subject is the authenticated caller (matched by user id or email), limited to a reference code and status so callers can track progress.
102
+ */
103
+ get: operations["listMyPrivacyRequests"];
104
+ put?: never;
105
+ /**
106
+ * Submit a privacy request as the authenticated user
107
+ * @description Authenticated intake. The subject is always the caller's own profile; the request is auto-marked identity-verified because the JWT proves identity. Supplying an `email` that does not match the caller is rejected with `400`.
108
+ */
109
+ post: operations["submitMyPrivacyRequest"];
110
+ delete?: never;
111
+ options?: never;
112
+ head?: never;
113
+ patch?: never;
114
+ trace?: never;
115
+ };
116
+ "/workspaces/{workspaceId}/privacy-requests": {
117
+ parameters: {
118
+ query?: never;
119
+ header?: never;
120
+ path?: never;
121
+ cookie?: never;
122
+ };
123
+ get?: never;
124
+ put?: never;
125
+ /**
126
+ * Submit a privacy request on behalf of a workspace member (B2B controller)
127
+ * @description Workspace-admin route for B2B controllers to raise a privacy request on behalf of an employee (`subjectEmail`). The request is bound to the workspace and requires manual identity verification by privacy ops before fulfillment. Non-admin members receive `403`.
128
+ */
129
+ post: operations["submitWorkspacePrivacyRequest"];
130
+ delete?: never;
131
+ options?: never;
132
+ head?: never;
133
+ patch?: never;
134
+ trace?: never;
135
+ };
136
+ "/admin/privacy-requests": {
137
+ parameters: {
138
+ query?: never;
139
+ header?: never;
140
+ path?: never;
141
+ cookie?: never;
142
+ };
143
+ /**
144
+ * List privacy requests (privacy-ops queue)
145
+ * @description Platform-admin queue of privacy requests, newest first, with SLA due dates for triage.
146
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
147
+ */
148
+ get: operations["adminListPrivacyRequests"];
149
+ put?: never;
150
+ post?: never;
151
+ delete?: never;
152
+ options?: never;
153
+ head?: never;
154
+ patch?: never;
155
+ trace?: never;
156
+ };
157
+ "/admin/privacy-requests/{requestId}": {
158
+ parameters: {
159
+ query?: never;
160
+ header?: never;
161
+ path?: never;
162
+ cookie?: never;
163
+ };
164
+ /** Get a privacy request with its event timeline */
165
+ get: operations["adminGetPrivacyRequest"];
166
+ put?: never;
167
+ post?: never;
168
+ delete?: never;
169
+ options?: never;
170
+ head?: never;
171
+ /**
172
+ * Update a privacy request (status, assignee, notes, identity verification)
173
+ * @description Update workflow fields. Setting `markIdentityVerified: true` records the verifying admin and unlocks export and erasure fulfillment. Transitioning `status` to `completed` requires both `fulfillmentAction` and `fulfillmentRef`.
174
+ */
175
+ patch: operations["adminUpdatePrivacyRequest"];
176
+ trace?: never;
177
+ };
178
+ "/admin/privacy-requests/{requestId}/export": {
179
+ parameters: {
180
+ query?: never;
181
+ header?: never;
182
+ path?: never;
183
+ cookie?: never;
184
+ };
185
+ get?: never;
186
+ put?: never;
187
+ /**
188
+ * Generate a DSAR export bundle for a privacy request
189
+ * @description Assembles the subject's personal data across workspaces into a single JSON bundle for an access or portability request, per the PII inventory scope. The subject is resolved by user id or email. Blocked until identity is verified (`403 identity_not_verified`). Bundles larger than the size cap return `413 export_too_large`; scope by workspace in that case. The bundle is generated on demand and not persisted server-side.
190
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
191
+ */
192
+ post: operations["adminExportPrivacyRequest"];
193
+ delete?: never;
194
+ options?: never;
195
+ head?: never;
196
+ patch?: never;
197
+ trace?: never;
198
+ };
199
+ "/admin/privacy-requests/{requestId}/fulfill/person-erasure": {
200
+ parameters: {
201
+ query?: never;
202
+ header?: never;
203
+ path?: never;
204
+ cookie?: never;
205
+ };
206
+ get?: never;
207
+ put?: never;
208
+ /**
209
+ * Fulfill an erasure request by erasing workspace person-level data
210
+ * @description Thin wrapper around workspace person-level insights erasure (#706) for privacy-request fulfillment. Erases or anonymizes the subject's org-chart, AI-tool, dashboard, absence, and readiness data in one workspace. Blocked until identity is verified. Records an audit event on the privacy request with the categories erased.
211
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
212
+ */
213
+ post: operations["adminFulfillPrivacyRequestPersonErasure"];
214
+ delete?: never;
215
+ options?: never;
216
+ head?: never;
217
+ patch?: never;
218
+ trace?: never;
219
+ };
70
220
  "/me": {
71
221
  parameters: {
72
222
  query?: never;
@@ -598,7 +748,7 @@ export interface paths {
598
748
  };
599
749
  /**
600
750
  * AI usage & spend insights — AI-assisted code percentage
601
- * @description Period and weekly AI-assisted code percentage for the Measure **AI-assisted code** card on `/phase-c/c7` and the **AI impact** curve on `/phase-c/c4`. When scoped productivity metrics include `aiAssistedContributionRatioPercent`, values are **measured** from ingest; otherwise the API falls back to token→LOC heuristics and sets `dataQuality` to **estimated**. Clients should not present estimated series as Cursor-measured signal.
751
+ * @description Period and weekly AI-assisted code percentage for the Measure **AI-assisted code** card on `/phase-c/c7` and the **AI impact** curve on `/phase-c/c4`. When engagement daily rows exist for the scope, values are **measured** from Σ `ai_lines_added` ÷ merged-PR lines (`dashboard_metrics`); otherwise the API falls back to token→LOC heuristics and sets `dataQuality` to **estimated**. Clients should not present estimated series as editor-measured signal.
602
752
  */
603
753
  get: operations["getAiUsageSpendAiAssistedCodePercentage"];
604
754
  put?: never;
@@ -609,6 +759,26 @@ export interface paths {
609
759
  patch?: never;
610
760
  trace?: never;
611
761
  };
762
+ "/workspaces/{workspaceId}/insights/ai-usage-spend/provider-engagement-insights": {
763
+ parameters: {
764
+ query?: never;
765
+ header?: never;
766
+ path?: never;
767
+ cookie?: never;
768
+ };
769
+ /**
770
+ * AI usage & spend insights — provider engagement cards
771
+ * @description Provider-specific engagement insight metrics derived from `tai_workspace_ai_tool_engagement_daily` (accepted AI lines, tab completions, suggestion accept rates, Claude Code sessions, etc.). Metrics are **provider- and data-gated**: structurally absent signals render as N/A, not zero. Claude per-user cards require Enterprise Analytics (`insightsPlan` ≠ team).
772
+ */
773
+ get: operations["getAiUsageSpendProviderEngagementInsights"];
774
+ put?: never;
775
+ post?: never;
776
+ delete?: never;
777
+ options?: never;
778
+ head?: never;
779
+ patch?: never;
780
+ trace?: never;
781
+ };
612
782
  "/workspaces/{workspaceId}/insights/ai-usage-spend/ai-tool-usage-spend": {
613
783
  parameters: {
614
784
  query?: never;
@@ -2631,6 +2801,21 @@ export interface components {
2631
2801
  /** @description Applied team name filter from the Measure UI. */
2632
2802
  team: string;
2633
2803
  };
2804
+ /**
2805
+ * @description Echo of the resolved time bucket for this response. `day` when the request used an `Nd`/`cr:`/`from`+`to` window; `week` for legacy weekly rangeIds or `year` heatmap mode.
2806
+ * @enum {string}
2807
+ */
2808
+ ProductivityInsightsGranularity: "day" | "week";
2809
+ ProductivityInsightsDailyBucketDto: {
2810
+ /**
2811
+ * Format: date
2812
+ * @description UTC calendar day (`YYYY-MM-DD`).
2813
+ */
2814
+ date: string;
2815
+ mergedPrCount: number;
2816
+ /** @description GitHub Actions CI build failures on this day from `ciFailureRuns` ledger when CI ingest is enabled. */
2817
+ ciFailuresCount?: number;
2818
+ };
2634
2819
  ProductivityInsightsAggregatedTeamWeekDto: {
2635
2820
  /** Format: date-time */
2636
2821
  bucketStart: string;
@@ -2663,17 +2848,27 @@ export interface components {
2663
2848
  managerLabel?: string;
2664
2849
  /** @description True when the team aggregates GitHub logins not mapped in the org chart (`teamId` `__other`). */
2665
2850
  notInOrgChart?: boolean;
2666
- weeks: components["schemas"]["ProductivityInsightsAggregatedTeamWeekDto"][];
2851
+ /** @description Present in day-mode responses — daily merged PR and CI failure counts. */
2852
+ days?: components["schemas"]["ProductivityInsightsDailyBucketDto"][];
2853
+ weeks?: components["schemas"]["ProductivityInsightsAggregatedTeamWeekDto"][];
2667
2854
  };
2668
- /**
2669
- * @description Weekly bucket count (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` aliases 12 weeks.
2670
- * @enum {string}
2671
- */
2672
- ProductivityInsightsRangeId: "4w" | "8w" | "q" | "12w" | "16w";
2855
+ /** @description Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. */
2856
+ ProductivityInsightsRangeId: string;
2673
2857
  ProductivityInsightsAggregatedTeamsDto: {
2674
2858
  /** Format: uuid */
2675
2859
  workspaceId: string;
2676
2860
  range: components["schemas"]["ProductivityInsightsRangeId"];
2861
+ granularity?: components["schemas"]["ProductivityInsightsGranularity"];
2862
+ /**
2863
+ * Format: date
2864
+ * @description Inclusive start day when `granularity` is `day`.
2865
+ */
2866
+ from?: string;
2867
+ /**
2868
+ * Format: date
2869
+ * @description Inclusive end day when `granularity` is `day`.
2870
+ */
2871
+ to?: string;
2677
2872
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
2678
2873
  /** Format: date-time */
2679
2874
  generatedAt: string;
@@ -2701,17 +2896,32 @@ export interface components {
2701
2896
  notInOrgChart?: boolean;
2702
2897
  /** @description GitHub login for unattributed contributors (when notInOrgChart is true). */
2703
2898
  githubLogin?: string;
2704
- weeks: components["schemas"]["ProductivityInsightsMergedPrTrendWeekDto"][];
2899
+ /** @description Present in day-mode responses — daily merged PR counts per contributor. */
2900
+ days?: components["schemas"]["ProductivityInsightsDailyBucketDto"][];
2901
+ weeks?: components["schemas"]["ProductivityInsightsMergedPrTrendWeekDto"][];
2705
2902
  };
2706
2903
  ProductivityInsightsMergedPrTrendsDto: {
2707
2904
  /** Format: uuid */
2708
2905
  workspaceId: string;
2709
2906
  range: components["schemas"]["ProductivityInsightsRangeId"];
2907
+ granularity?: components["schemas"]["ProductivityInsightsGranularity"];
2908
+ /**
2909
+ * Format: date
2910
+ * @description Inclusive start day when `granularity` is `day`.
2911
+ */
2912
+ from?: string;
2913
+ /**
2914
+ * Format: date
2915
+ * @description Inclusive end day when `granularity` is `day`.
2916
+ */
2917
+ to?: string;
2710
2918
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
2711
2919
  /** Format: date-time */
2712
2920
  generatedAt: string;
2713
- /** @description Sum of contributor weekly merged PR counts (matches the contributors table). Not deduplicated org-wide unique PRs when the same PR appears on multiple rows. */
2714
- weeks: components["schemas"]["ProductivityInsightsMergedPrTrendWeekDto"][];
2921
+ /** @description Portfolio daily merged PR series in day mode (max of contributor sum and org ledger). */
2922
+ days?: components["schemas"]["ProductivityInsightsDailyBucketDto"][];
2923
+ /** @description Sum of contributor weekly merged PR counts (matches the contributors table). Not deduplicated org-wide unique PRs when the same PR appears on multiple rows. Present in week-mode responses. */
2924
+ weeks?: components["schemas"]["ProductivityInsightsMergedPrTrendWeekDto"][];
2715
2925
  contributors: components["schemas"]["ProductivityInsightsMergedPrContributorRowDto"][];
2716
2926
  };
2717
2927
  ProductivityInsightsTeamLeaderItemDto: {
@@ -2746,18 +2956,31 @@ export interface components {
2746
2956
  notInOrgChart?: boolean;
2747
2957
  /** @description Present when the request included `year` — calendar-year heatmap mode. */
2748
2958
  year?: number;
2959
+ /** @description Daily merged PR and CI failure counts for the selected period when `granularity` is `day` (not present in `year` heatmap mode). */
2960
+ days?: components["schemas"]["ProductivityInsightsDailyBucketDto"][];
2749
2961
  /** @description Daily buckets aggregated from ingested person-level merged PR events for the selected period range or calendar year (same source as memberContributors). */
2750
2962
  heatmapWeeks?: components["schemas"]["ProductivityInsightsContributorActivityWeekDto"][];
2751
2963
  heatmapSummary?: components["schemas"]["ProductivityInsightsContributorActivitySummaryDto"];
2752
2964
  /** @description Per-member merged PR weekly series for the selected period or year — person-level source aligned with heatmapWeeks and the team roster table. */
2753
2965
  memberContributors?: components["schemas"]["ProductivityInsightsMergedPrContributorRowDto"][];
2754
- weeks: components["schemas"]["ProductivityInsightsAggregatedTeamWeekDto"][];
2966
+ weeks?: components["schemas"]["ProductivityInsightsAggregatedTeamWeekDto"][];
2755
2967
  summary: components["schemas"]["ProductivityInsightsTeamSummaryDto"];
2756
2968
  };
2757
2969
  ProductivityInsightsTeamsResponseDto: {
2758
2970
  /** Format: uuid */
2759
2971
  workspaceId: string;
2760
2972
  range: components["schemas"]["ProductivityInsightsRangeId"];
2973
+ granularity?: components["schemas"]["ProductivityInsightsGranularity"];
2974
+ /**
2975
+ * Format: date
2976
+ * @description Inclusive start day when `granularity` is `day`.
2977
+ */
2978
+ from?: string;
2979
+ /**
2980
+ * Format: date
2981
+ * @description Inclusive end day when `granularity` is `day`.
2982
+ */
2983
+ to?: string;
2761
2984
  /** @description Present when the request included `year` — calendar-year heatmap mode. */
2762
2985
  year?: number;
2763
2986
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
@@ -2841,6 +3064,17 @@ export interface components {
2841
3064
  workspaceId: string;
2842
3065
  contributorId: string;
2843
3066
  range: components["schemas"]["ProductivityInsightsRangeId"];
3067
+ granularity?: components["schemas"]["ProductivityInsightsGranularity"];
3068
+ /**
3069
+ * Format: date
3070
+ * @description Inclusive start day when `granularity` is `day`.
3071
+ */
3072
+ from?: string;
3073
+ /**
3074
+ * Format: date
3075
+ * @description Inclusive end day when `granularity` is `day`.
3076
+ */
3077
+ to?: string;
2844
3078
  /** @description Present when the request included `year` — calendar-year heatmap mode. */
2845
3079
  year?: number;
2846
3080
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
@@ -2849,7 +3083,9 @@ export interface components {
2849
3083
  /** @description True when the workspace has opted in to GitHub Actions CI ingest. */
2850
3084
  githubActionsCiEnabled?: boolean;
2851
3085
  contributor: components["schemas"]["ProductivityInsightsContributorProfileDto"];
2852
- weeks: components["schemas"]["ProductivityInsightsContributorActivityWeekDto"][];
3086
+ /** @description Daily merged PR and CI failure counts for the selected period when `granularity` is `day` (not present in `year` heatmap mode). */
3087
+ days?: components["schemas"]["ProductivityInsightsDailyBucketDto"][];
3088
+ weeks?: components["schemas"]["ProductivityInsightsContributorActivityWeekDto"][];
2853
3089
  summary: components["schemas"]["ProductivityInsightsContributorActivitySummaryDto"];
2854
3090
  };
2855
3091
  ProductivityInsightsNeedsAttentionItemDto: {
@@ -2873,6 +3109,17 @@ export interface components {
2873
3109
  /** Format: uuid */
2874
3110
  workspaceId: string;
2875
3111
  range: components["schemas"]["ProductivityInsightsRangeId"];
3112
+ granularity?: components["schemas"]["ProductivityInsightsGranularity"];
3113
+ /**
3114
+ * Format: date
3115
+ * @description Inclusive start day when `granularity` is `day`.
3116
+ */
3117
+ from?: string;
3118
+ /**
3119
+ * Format: date
3120
+ * @description Inclusive end day when `granularity` is `day`.
3121
+ */
3122
+ to?: string;
2876
3123
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
2877
3124
  /** @enum {string} */
2878
3125
  entityType: "teams" | "contributors";
@@ -3022,6 +3269,32 @@ export interface components {
3022
3269
  totalSpendCents?: number;
3023
3270
  weeks: components["schemas"]["AiUsageSpendAiAssistedCodeWeekDto"][];
3024
3271
  };
3272
+ /** @enum {string} */
3273
+ ProviderEngagementInsightAvailability: "measured" | "not_applicable";
3274
+ AiUsageSpendProviderEngagementMetricDto: {
3275
+ id: string;
3276
+ label: string;
3277
+ value: number | null;
3278
+ displayValue: string;
3279
+ availability: components["schemas"]["ProviderEngagementInsightAvailability"];
3280
+ unit?: string;
3281
+ methodologyNote?: string;
3282
+ };
3283
+ AiUsageSpendProviderEngagementCardDto: {
3284
+ providerId: string;
3285
+ providerName: string;
3286
+ metrics: components["schemas"]["AiUsageSpendProviderEngagementMetricDto"][];
3287
+ };
3288
+ AiUsageSpendProviderEngagementInsightsDto: {
3289
+ /** Format: uuid */
3290
+ workspaceId: string;
3291
+ /** @enum {string} */
3292
+ range: "4w" | "8w" | "q";
3293
+ scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3294
+ /** Format: date-time */
3295
+ generatedAt: string;
3296
+ providers: components["schemas"]["AiUsageSpendProviderEngagementCardDto"][];
3297
+ };
3025
3298
  AiUsageSpendAiToolUsageSpendProviderItemDto: {
3026
3299
  providerId: string;
3027
3300
  providerName: string;
@@ -3182,6 +3455,8 @@ export interface components {
3182
3455
  name: string;
3183
3456
  roles: string[];
3184
3457
  defaultWorkspaceId?: string | null;
3458
+ /** @description True when the caller's email is on the `PLATFORM_ADMIN_EMAILS` allowlist. Lets the frontend gate platform-admin surfaces (e.g. the privacy-request queue) without duplicating the allowlist client-side. */
3459
+ isPlatformAdmin?: boolean;
3185
3460
  };
3186
3461
  UpdateMeBodyDto: {
3187
3462
  name?: string;
@@ -3195,6 +3470,190 @@ export interface components {
3195
3470
  */
3196
3471
  email: string;
3197
3472
  };
3473
+ /**
3474
+ * @description Data subject right being exercised (GDPR Arts. 15–21 / UAE PDPL).
3475
+ * @enum {string}
3476
+ */
3477
+ PrivacyRequestType: "access" | "erasure" | "portability" | "rectification" | "restriction" | "objection";
3478
+ /**
3479
+ * @description Workflow status of a privacy request.
3480
+ * @enum {string}
3481
+ */
3482
+ PrivacyRequestStatus: "pending" | "in_progress" | "completed" | "rejected";
3483
+ /**
3484
+ * @description How the request was submitted.
3485
+ * @enum {string}
3486
+ */
3487
+ PrivacyRequestIntakeChannel: "public" | "authenticated" | "workspace_admin";
3488
+ CreatePrivacyRequestBodyDto: {
3489
+ /**
3490
+ * Format: email
3491
+ * @description Subject's email address.
3492
+ */
3493
+ email: string;
3494
+ requestType: components["schemas"]["PrivacyRequestType"];
3495
+ /** @description Optional free-text description of the request (max 4000 chars). */
3496
+ details?: string;
3497
+ /** @description Optional free-text hint (e.g. company or workspace name) to help privacy ops locate the subject. Never bound to a workspace id on the public channel. */
3498
+ workspaceHint?: string;
3499
+ /** @description Honeypot field. Must be left empty by real clients; non-empty submissions are silently accepted but not persisted. Rendered hidden in the UI. */
3500
+ companyWebsite?: string;
3501
+ };
3502
+ CreateMyPrivacyRequestBodyDto: {
3503
+ requestType: components["schemas"]["PrivacyRequestType"];
3504
+ details?: string;
3505
+ /**
3506
+ * Format: email
3507
+ * @description Optional. If provided it must match the caller's own email; a differing value is rejected with `400 email_override_rejected`.
3508
+ */
3509
+ email?: string;
3510
+ };
3511
+ CreateWorkspacePrivacyRequestBodyDto: {
3512
+ /**
3513
+ * Format: email
3514
+ * @description Email of the workspace member the request is raised on behalf of.
3515
+ */
3516
+ subjectEmail: string;
3517
+ requestType: components["schemas"]["PrivacyRequestType"];
3518
+ details?: string;
3519
+ };
3520
+ CreatePrivacyRequestResultDto: {
3521
+ /** @description Human-friendly tracking code (e.g. `PR-2026-00042`). */
3522
+ referenceCode: string;
3523
+ requestType: components["schemas"]["PrivacyRequestType"];
3524
+ status: components["schemas"]["PrivacyRequestStatus"];
3525
+ /**
3526
+ * Format: date-time
3527
+ * @description When the request should be resolved by (default 30 days from submission).
3528
+ */
3529
+ slaDueAt: string;
3530
+ };
3531
+ MyPrivacyRequestSummaryDto: {
3532
+ referenceCode: string;
3533
+ requestType: components["schemas"]["PrivacyRequestType"];
3534
+ status: components["schemas"]["PrivacyRequestStatus"];
3535
+ /** Format: date-time */
3536
+ createdAt: string;
3537
+ /** Format: date-time */
3538
+ slaDueAt: string;
3539
+ /** Format: date-time */
3540
+ completedAt?: string | null;
3541
+ };
3542
+ MyPrivacyRequestListDto: {
3543
+ requests: components["schemas"]["MyPrivacyRequestSummaryDto"][];
3544
+ };
3545
+ PrivacyRequestDto: {
3546
+ /** Format: uuid */
3547
+ id: string;
3548
+ referenceCode: string;
3549
+ requestType: components["schemas"]["PrivacyRequestType"];
3550
+ status: components["schemas"]["PrivacyRequestStatus"];
3551
+ intakeChannel: components["schemas"]["PrivacyRequestIntakeChannel"];
3552
+ subjectEmail: string;
3553
+ /** Format: uuid */
3554
+ subjectUserId?: string | null;
3555
+ /**
3556
+ * Format: uuid
3557
+ * @description Set only for workspace-admin (B2B) submissions.
3558
+ */
3559
+ workspaceId?: string | null;
3560
+ subjectWorkspaceHint?: string | null;
3561
+ /** Format: uuid */
3562
+ requestedByUserId?: string | null;
3563
+ details?: string | null;
3564
+ internalNotes?: string | null;
3565
+ assignedTo?: string | null;
3566
+ /** Format: date-time */
3567
+ identityVerifiedAt?: string | null;
3568
+ verifiedBy?: string | null;
3569
+ fulfillmentAction?: string | null;
3570
+ fulfillmentRef?: string | null;
3571
+ /** Format: date-time */
3572
+ slaDueAt: string;
3573
+ /** Format: date-time */
3574
+ completedAt?: string | null;
3575
+ /** Format: date-time */
3576
+ createdAt: string;
3577
+ /** Format: date-time */
3578
+ updatedAt: string;
3579
+ /** @description True when the SLA due date has passed and the request is not completed/rejected. */
3580
+ overdue?: boolean;
3581
+ };
3582
+ PrivacyRequestEventDto: {
3583
+ /** Format: uuid */
3584
+ id: string;
3585
+ /** @enum {string} */
3586
+ eventType: "submitted" | "identity_verified" | "status_changed" | "assigned" | "export_generated" | "fulfillment_noted" | "duplicate_rejected";
3587
+ actorEmail?: string | null;
3588
+ payload?: {
3589
+ [key: string]: unknown;
3590
+ } | null;
3591
+ /** Format: date-time */
3592
+ createdAt: string;
3593
+ };
3594
+ PrivacyRequestDetailDto: {
3595
+ request: components["schemas"]["PrivacyRequestDto"];
3596
+ events: components["schemas"]["PrivacyRequestEventDto"][];
3597
+ };
3598
+ PrivacyRequestListDto: {
3599
+ requests: components["schemas"]["PrivacyRequestDto"][];
3600
+ };
3601
+ UpdatePrivacyRequestBodyDto: {
3602
+ status?: components["schemas"]["PrivacyRequestStatus"];
3603
+ assignedTo?: string | null;
3604
+ internalNotes?: string | null;
3605
+ /** @description When true, records the caller as the verifier and unlocks export/erasure. */
3606
+ markIdentityVerified?: boolean;
3607
+ /** @description Short label for how the request was fulfilled (required when completing). */
3608
+ fulfillmentAction?: string;
3609
+ /** @description Reference to the fulfillment artifact (e.g. deletion job id; required when completing). */
3610
+ fulfillmentRef?: string;
3611
+ };
3612
+ FulfillPersonErasureBodyDto: {
3613
+ /** Format: uuid */
3614
+ workspaceId: string;
3615
+ /** @description Org-chart person id (usually the subject's email) within the workspace. */
3616
+ personId: string;
3617
+ orgChart?: boolean;
3618
+ dashboardMetrics?: boolean;
3619
+ aiToolData?: boolean;
3620
+ absences?: boolean;
3621
+ readinessAnonymize?: boolean;
3622
+ };
3623
+ PrivacyRequestPersonErasureResultDto: {
3624
+ deleted: boolean;
3625
+ aiToolRowsDeleted?: number;
3626
+ absencesDeleted?: number;
3627
+ readinessRunsAnonymized?: number;
3628
+ auditEntriesAnonymized?: number;
3629
+ };
3630
+ /** @description DSAR export bundle assembled on demand for an access/portability request. `sections` holds the subject's data grouped by source; shapes vary by section, so values are opaque objects. */
3631
+ PrivacyRequestExportDto: {
3632
+ metadata: {
3633
+ referenceCode: string;
3634
+ /** Format: date-time */
3635
+ generatedAt: string;
3636
+ subjectEmail: string;
3637
+ subjectUserId?: string | null;
3638
+ workspaceCount?: number;
3639
+ /** @description Data categories intentionally excluded from the bundle. */
3640
+ excluded?: string[];
3641
+ /** @description Redaction policy applied to readiness runs (e.g. `requester_runs_only`). */
3642
+ readinessRedaction?: string;
3643
+ };
3644
+ /** @description Profile and consent records for the subject. */
3645
+ subject: {
3646
+ [key: string]: unknown;
3647
+ };
3648
+ /** @description Per-source personal data (memberships, AI-tool, dashboard, absences, org chart, activity). */
3649
+ sections?: {
3650
+ [key: string]: unknown;
3651
+ };
3652
+ /** @description Workspaces where person-keyed rows exist but the subject has no membership (#269). */
3653
+ residualPersonData?: {
3654
+ [key: string]: unknown;
3655
+ }[];
3656
+ };
3198
3657
  WorkspaceSummaryDto: {
3199
3658
  id: string;
3200
3659
  slug: string;
@@ -4682,9 +5141,15 @@ export interface components {
4682
5141
  NotificationId: string;
4683
5142
  /** @description Workspace member user id (`tai_users.id`). */
4684
5143
  WorkspaceMemberId: string;
5144
+ /** @description Privacy request id (`tai_privacy_requests.id`). */
5145
+ PrivacyRequestId: string;
4685
5146
  FixId: string;
4686
- /** @description Productivity insights time range in weeks (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` is an alias for 12 weeks. */
4687
- InsightsProductivityRangeId: "4w" | "8w" | "q" | "12w" | "16w";
5147
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
5148
+ InsightsProductivityRangeId: string;
5149
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
5150
+ InsightsProductivityFrom: string;
5151
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
5152
+ InsightsProductivityTo: string;
4688
5153
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
4689
5154
  InsightsDepartmentFilter: string;
4690
5155
  /** @description Page size (default 25, max 100). */
@@ -4759,6 +5224,8 @@ export type DashboardProductivityMetricsDto = components['schemas']['DashboardPr
4759
5224
  export type DashboardProductivityDto = components['schemas']['DashboardProductivityDto'];
4760
5225
  export type DashboardProductivityHistoryDto = components['schemas']['DashboardProductivityHistoryDto'];
4761
5226
  export type ProductivityInsightsAggregatedTeamsScopeDto = components['schemas']['ProductivityInsightsAggregatedTeamsScopeDto'];
5227
+ export type ProductivityInsightsGranularity = components['schemas']['ProductivityInsightsGranularity'];
5228
+ export type ProductivityInsightsDailyBucketDto = components['schemas']['ProductivityInsightsDailyBucketDto'];
4762
5229
  export type ProductivityInsightsAggregatedTeamWeekDto = components['schemas']['ProductivityInsightsAggregatedTeamWeekDto'];
4763
5230
  export type ProductivityInsightsAggregatedTeamRowDto = components['schemas']['ProductivityInsightsAggregatedTeamRowDto'];
4764
5231
  export type ProductivityInsightsRangeId = components['schemas']['ProductivityInsightsRangeId'];
@@ -4792,6 +5259,10 @@ export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDat
4792
5259
  export type AiAssistedCodeEstimationSource = components['schemas']['AiAssistedCodeEstimationSource'];
4793
5260
  export type AiUsageSpendAiAssistedCodeWeekDto = components['schemas']['AiUsageSpendAiAssistedCodeWeekDto'];
4794
5261
  export type AiUsageSpendAiAssistedCodePercentageDto = components['schemas']['AiUsageSpendAiAssistedCodePercentageDto'];
5262
+ export type ProviderEngagementInsightAvailability = components['schemas']['ProviderEngagementInsightAvailability'];
5263
+ export type AiUsageSpendProviderEngagementMetricDto = components['schemas']['AiUsageSpendProviderEngagementMetricDto'];
5264
+ export type AiUsageSpendProviderEngagementCardDto = components['schemas']['AiUsageSpendProviderEngagementCardDto'];
5265
+ export type AiUsageSpendProviderEngagementInsightsDto = components['schemas']['AiUsageSpendProviderEngagementInsightsDto'];
4795
5266
  export type AiUsageSpendAiToolUsageSpendProviderItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendProviderItemDto'];
4796
5267
  export type AiUsageSpendAiToolUsageSpendModelItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendModelItemDto'];
4797
5268
  export type AiUsageSpendAiToolUsageSpendDto = components['schemas']['AiUsageSpendAiToolUsageSpendDto'];
@@ -4812,6 +5283,23 @@ export type AiToolMemberDetailDto = components['schemas']['AiToolMemberDetailDto
4812
5283
  export type MeProfileDto = components['schemas']['MeProfileDto'];
4813
5284
  export type UpdateMeBodyDto = components['schemas']['UpdateMeBodyDto'];
4814
5285
  export type DeleteMeBodyDto = components['schemas']['DeleteMeBodyDto'];
5286
+ export type PrivacyRequestType = components['schemas']['PrivacyRequestType'];
5287
+ export type PrivacyRequestStatus = components['schemas']['PrivacyRequestStatus'];
5288
+ export type PrivacyRequestIntakeChannel = components['schemas']['PrivacyRequestIntakeChannel'];
5289
+ export type CreatePrivacyRequestBodyDto = components['schemas']['CreatePrivacyRequestBodyDto'];
5290
+ export type CreateMyPrivacyRequestBodyDto = components['schemas']['CreateMyPrivacyRequestBodyDto'];
5291
+ export type CreateWorkspacePrivacyRequestBodyDto = components['schemas']['CreateWorkspacePrivacyRequestBodyDto'];
5292
+ export type CreatePrivacyRequestResultDto = components['schemas']['CreatePrivacyRequestResultDto'];
5293
+ export type MyPrivacyRequestSummaryDto = components['schemas']['MyPrivacyRequestSummaryDto'];
5294
+ export type MyPrivacyRequestListDto = components['schemas']['MyPrivacyRequestListDto'];
5295
+ export type PrivacyRequestDto = components['schemas']['PrivacyRequestDto'];
5296
+ export type PrivacyRequestEventDto = components['schemas']['PrivacyRequestEventDto'];
5297
+ export type PrivacyRequestDetailDto = components['schemas']['PrivacyRequestDetailDto'];
5298
+ export type PrivacyRequestListDto = components['schemas']['PrivacyRequestListDto'];
5299
+ export type UpdatePrivacyRequestBodyDto = components['schemas']['UpdatePrivacyRequestBodyDto'];
5300
+ export type FulfillPersonErasureBodyDto = components['schemas']['FulfillPersonErasureBodyDto'];
5301
+ export type PrivacyRequestPersonErasureResultDto = components['schemas']['PrivacyRequestPersonErasureResultDto'];
5302
+ export type PrivacyRequestExportDto = components['schemas']['PrivacyRequestExportDto'];
4815
5303
  export type WorkspaceSummaryDto = components['schemas']['WorkspaceSummaryDto'];
4816
5304
  export type WorkspacesForUserDto = components['schemas']['WorkspacesForUserDto'];
4817
5305
  export type CreateWorkspaceBodyDto = components['schemas']['CreateWorkspaceBodyDto'];
@@ -4951,8 +5439,11 @@ export type ParameterProviderSlug = components['parameters']['ProviderSlug'];
4951
5439
  export type ParameterProjectId = components['parameters']['ProjectId'];
4952
5440
  export type ParameterNotificationId = components['parameters']['NotificationId'];
4953
5441
  export type ParameterWorkspaceMemberId = components['parameters']['WorkspaceMemberId'];
5442
+ export type ParameterPrivacyRequestId = components['parameters']['PrivacyRequestId'];
4954
5443
  export type ParameterFixId = components['parameters']['FixId'];
4955
5444
  export type ParameterInsightsProductivityRangeId = components['parameters']['InsightsProductivityRangeId'];
5445
+ export type ParameterInsightsProductivityFrom = components['parameters']['InsightsProductivityFrom'];
5446
+ export type ParameterInsightsProductivityTo = components['parameters']['InsightsProductivityTo'];
4956
5447
  export type ParameterInsightsDepartmentFilter = components['parameters']['InsightsDepartmentFilter'];
4957
5448
  export type ParameterPaginationLimit = components['parameters']['PaginationLimit'];
4958
5449
  export type ParameterPaginationOffset = components['parameters']['PaginationOffset'];
@@ -5165,14 +5656,485 @@ export interface operations {
5165
5656
  };
5166
5657
  };
5167
5658
  };
5168
- getMe: {
5659
+ submitPublicPrivacyRequest: {
5169
5660
  parameters: {
5170
5661
  query?: never;
5171
5662
  header?: never;
5172
5663
  path?: never;
5173
5664
  cookie?: never;
5174
5665
  };
5175
- requestBody?: never;
5666
+ requestBody: {
5667
+ content: {
5668
+ "application/json": components["schemas"]["CreatePrivacyRequestBodyDto"];
5669
+ };
5670
+ };
5671
+ responses: {
5672
+ /** @description Request accepted and queued for privacy ops. */
5673
+ 201: {
5674
+ headers: {
5675
+ [name: string]: unknown;
5676
+ };
5677
+ content: {
5678
+ "application/json": components["schemas"]["CreatePrivacyRequestResultDto"];
5679
+ };
5680
+ };
5681
+ /** @description Missing or invalid email, unknown request type, or details too long. */
5682
+ 400: {
5683
+ headers: {
5684
+ [name: string]: unknown;
5685
+ };
5686
+ content: {
5687
+ /**
5688
+ * @example {
5689
+ * "error": "A valid email is required",
5690
+ * "code": "invalid_email"
5691
+ * }
5692
+ */
5693
+ "application/json": components["schemas"]["ErrorMessageDto"];
5694
+ };
5695
+ };
5696
+ /** @description An open request for this email and type already exists. */
5697
+ 409: {
5698
+ headers: {
5699
+ [name: string]: unknown;
5700
+ };
5701
+ content: {
5702
+ /**
5703
+ * @example {
5704
+ * "error": "An open request for this email already exists",
5705
+ * "code": "duplicate_open_request"
5706
+ * }
5707
+ */
5708
+ "application/json": components["schemas"]["ErrorMessageDto"];
5709
+ };
5710
+ };
5711
+ /** @description Too many submissions from this client; retry later. */
5712
+ 429: {
5713
+ headers: {
5714
+ [name: string]: unknown;
5715
+ };
5716
+ content: {
5717
+ /**
5718
+ * @example {
5719
+ * "error": "Too many requests",
5720
+ * "code": "too_many_requests"
5721
+ * }
5722
+ */
5723
+ "application/json": components["schemas"]["ErrorMessageDto"];
5724
+ };
5725
+ };
5726
+ };
5727
+ };
5728
+ listMyPrivacyRequests: {
5729
+ parameters: {
5730
+ query?: never;
5731
+ header?: never;
5732
+ path?: never;
5733
+ cookie?: never;
5734
+ };
5735
+ requestBody?: never;
5736
+ responses: {
5737
+ /** @description Caller's privacy requests, newest first. */
5738
+ 200: {
5739
+ headers: {
5740
+ [name: string]: unknown;
5741
+ };
5742
+ content: {
5743
+ "application/json": components["schemas"]["MyPrivacyRequestListDto"];
5744
+ };
5745
+ };
5746
+ 401: components["responses"]["Unauthorized"];
5747
+ };
5748
+ };
5749
+ submitMyPrivacyRequest: {
5750
+ parameters: {
5751
+ query?: never;
5752
+ header?: never;
5753
+ path?: never;
5754
+ cookie?: never;
5755
+ };
5756
+ requestBody: {
5757
+ content: {
5758
+ "application/json": components["schemas"]["CreateMyPrivacyRequestBodyDto"];
5759
+ };
5760
+ };
5761
+ responses: {
5762
+ /** @description Request accepted and queued. */
5763
+ 201: {
5764
+ headers: {
5765
+ [name: string]: unknown;
5766
+ };
5767
+ content: {
5768
+ "application/json": components["schemas"]["CreatePrivacyRequestResultDto"];
5769
+ };
5770
+ };
5771
+ /** @description Unknown request type, details too long, or email override attempted. */
5772
+ 400: {
5773
+ headers: {
5774
+ [name: string]: unknown;
5775
+ };
5776
+ content: {
5777
+ /**
5778
+ * @example {
5779
+ * "error": "Email cannot be overridden on an authenticated request",
5780
+ * "code": "email_override_rejected"
5781
+ * }
5782
+ */
5783
+ "application/json": components["schemas"]["ErrorMessageDto"];
5784
+ };
5785
+ };
5786
+ 401: components["responses"]["Unauthorized"];
5787
+ /** @description An open request for this subject and type already exists. */
5788
+ 409: {
5789
+ headers: {
5790
+ [name: string]: unknown;
5791
+ };
5792
+ content: {
5793
+ "application/json": components["schemas"]["ErrorMessageDto"];
5794
+ };
5795
+ };
5796
+ };
5797
+ };
5798
+ submitWorkspacePrivacyRequest: {
5799
+ parameters: {
5800
+ query?: never;
5801
+ header?: never;
5802
+ path: {
5803
+ workspaceId: components["parameters"]["WorkspaceId"];
5804
+ };
5805
+ cookie?: never;
5806
+ };
5807
+ requestBody: {
5808
+ content: {
5809
+ "application/json": components["schemas"]["CreateWorkspacePrivacyRequestBodyDto"];
5810
+ };
5811
+ };
5812
+ responses: {
5813
+ /** @description Request accepted and queued. */
5814
+ 201: {
5815
+ headers: {
5816
+ [name: string]: unknown;
5817
+ };
5818
+ content: {
5819
+ "application/json": components["schemas"]["CreatePrivacyRequestResultDto"];
5820
+ };
5821
+ };
5822
+ /** @description Invalid subject email, unknown request type, or details too long. */
5823
+ 400: {
5824
+ headers: {
5825
+ [name: string]: unknown;
5826
+ };
5827
+ content: {
5828
+ "application/json": components["schemas"]["ErrorMessageDto"];
5829
+ };
5830
+ };
5831
+ 401: components["responses"]["Unauthorized"];
5832
+ /** @description Caller is not a workspace admin. */
5833
+ 403: {
5834
+ headers: {
5835
+ [name: string]: unknown;
5836
+ };
5837
+ content: {
5838
+ /**
5839
+ * @example {
5840
+ * "error": "Forbidden",
5841
+ * "code": "workspace_admin_required"
5842
+ * }
5843
+ */
5844
+ "application/json": components["schemas"]["ErrorMessageDto"];
5845
+ };
5846
+ };
5847
+ /** @description Workspace not found. */
5848
+ 404: {
5849
+ headers: {
5850
+ [name: string]: unknown;
5851
+ };
5852
+ content: {
5853
+ "application/json": components["schemas"]["ErrorMessageDto"];
5854
+ };
5855
+ };
5856
+ };
5857
+ };
5858
+ adminListPrivacyRequests: {
5859
+ parameters: {
5860
+ query?: {
5861
+ /** @description Filter by workflow status. */
5862
+ status?: components["schemas"]["PrivacyRequestStatus"];
5863
+ /** @description Filter by request type. */
5864
+ requestType?: components["schemas"]["PrivacyRequestType"];
5865
+ /** @description When true, return only requests past their SLA due date and not yet completed. */
5866
+ overdue?: boolean;
5867
+ /** @description Maximum number of rows to return (default 100, max 200). */
5868
+ limit?: number;
5869
+ };
5870
+ header?: never;
5871
+ path?: never;
5872
+ cookie?: never;
5873
+ };
5874
+ requestBody?: never;
5875
+ responses: {
5876
+ /** @description Privacy request queue. */
5877
+ 200: {
5878
+ headers: {
5879
+ [name: string]: unknown;
5880
+ };
5881
+ content: {
5882
+ "application/json": components["schemas"]["PrivacyRequestListDto"];
5883
+ };
5884
+ };
5885
+ 401: components["responses"]["Unauthorized"];
5886
+ /** @description Caller is not a platform admin. */
5887
+ 403: {
5888
+ headers: {
5889
+ [name: string]: unknown;
5890
+ };
5891
+ content: {
5892
+ /**
5893
+ * @example {
5894
+ * "error": "Forbidden",
5895
+ * "code": "forbidden"
5896
+ * }
5897
+ */
5898
+ "application/json": components["schemas"]["ErrorMessageDto"];
5899
+ };
5900
+ };
5901
+ };
5902
+ };
5903
+ adminGetPrivacyRequest: {
5904
+ parameters: {
5905
+ query?: never;
5906
+ header?: never;
5907
+ path: {
5908
+ /** @description Privacy request id (`tai_privacy_requests.id`). */
5909
+ requestId: components["parameters"]["PrivacyRequestId"];
5910
+ };
5911
+ cookie?: never;
5912
+ };
5913
+ requestBody?: never;
5914
+ responses: {
5915
+ /** @description Privacy request detail with audit timeline. */
5916
+ 200: {
5917
+ headers: {
5918
+ [name: string]: unknown;
5919
+ };
5920
+ content: {
5921
+ "application/json": components["schemas"]["PrivacyRequestDetailDto"];
5922
+ };
5923
+ };
5924
+ 401: components["responses"]["Unauthorized"];
5925
+ /** @description Caller is not a platform admin. */
5926
+ 403: {
5927
+ headers: {
5928
+ [name: string]: unknown;
5929
+ };
5930
+ content: {
5931
+ "application/json": components["schemas"]["ErrorMessageDto"];
5932
+ };
5933
+ };
5934
+ /** @description Request not found. */
5935
+ 404: {
5936
+ headers: {
5937
+ [name: string]: unknown;
5938
+ };
5939
+ content: {
5940
+ "application/json": components["schemas"]["ErrorMessageDto"];
5941
+ };
5942
+ };
5943
+ };
5944
+ };
5945
+ adminUpdatePrivacyRequest: {
5946
+ parameters: {
5947
+ query?: never;
5948
+ header?: never;
5949
+ path: {
5950
+ /** @description Privacy request id (`tai_privacy_requests.id`). */
5951
+ requestId: components["parameters"]["PrivacyRequestId"];
5952
+ };
5953
+ cookie?: never;
5954
+ };
5955
+ requestBody: {
5956
+ content: {
5957
+ "application/json": components["schemas"]["UpdatePrivacyRequestBodyDto"];
5958
+ };
5959
+ };
5960
+ responses: {
5961
+ /** @description Updated privacy request detail. */
5962
+ 200: {
5963
+ headers: {
5964
+ [name: string]: unknown;
5965
+ };
5966
+ content: {
5967
+ "application/json": components["schemas"]["PrivacyRequestDetailDto"];
5968
+ };
5969
+ };
5970
+ /** @description Invalid field value or missing fulfillment metadata for completion. */
5971
+ 400: {
5972
+ headers: {
5973
+ [name: string]: unknown;
5974
+ };
5975
+ content: {
5976
+ /**
5977
+ * @example {
5978
+ * "error": "Completing a request requires a fulfillment action and reference",
5979
+ * "code": "fulfillment_metadata_required"
5980
+ * }
5981
+ */
5982
+ "application/json": components["schemas"]["ErrorMessageDto"];
5983
+ };
5984
+ };
5985
+ 401: components["responses"]["Unauthorized"];
5986
+ /** @description Caller is not a platform admin. */
5987
+ 403: {
5988
+ headers: {
5989
+ [name: string]: unknown;
5990
+ };
5991
+ content: {
5992
+ "application/json": components["schemas"]["ErrorMessageDto"];
5993
+ };
5994
+ };
5995
+ /** @description Request not found. */
5996
+ 404: {
5997
+ headers: {
5998
+ [name: string]: unknown;
5999
+ };
6000
+ content: {
6001
+ "application/json": components["schemas"]["ErrorMessageDto"];
6002
+ };
6003
+ };
6004
+ };
6005
+ };
6006
+ adminExportPrivacyRequest: {
6007
+ parameters: {
6008
+ query?: never;
6009
+ header?: never;
6010
+ path: {
6011
+ /** @description Privacy request id (`tai_privacy_requests.id`). */
6012
+ requestId: components["parameters"]["PrivacyRequestId"];
6013
+ };
6014
+ cookie?: never;
6015
+ };
6016
+ requestBody?: never;
6017
+ responses: {
6018
+ /** @description DSAR export bundle (also offered as a file download via Content-Disposition). */
6019
+ 200: {
6020
+ headers: {
6021
+ [name: string]: unknown;
6022
+ };
6023
+ content: {
6024
+ "application/json": components["schemas"]["PrivacyRequestExportDto"];
6025
+ };
6026
+ };
6027
+ 401: components["responses"]["Unauthorized"];
6028
+ /** @description Caller is not a platform admin, or identity has not been verified. */
6029
+ 403: {
6030
+ headers: {
6031
+ [name: string]: unknown;
6032
+ };
6033
+ content: {
6034
+ /**
6035
+ * @example {
6036
+ * "error": "Identity must be verified before export",
6037
+ * "code": "identity_not_verified"
6038
+ * }
6039
+ */
6040
+ "application/json": components["schemas"]["ErrorMessageDto"];
6041
+ };
6042
+ };
6043
+ /** @description Request not found. */
6044
+ 404: {
6045
+ headers: {
6046
+ [name: string]: unknown;
6047
+ };
6048
+ content: {
6049
+ "application/json": components["schemas"]["ErrorMessageDto"];
6050
+ };
6051
+ };
6052
+ /** @description Export exceeds the size cap; scope the request by workspace. */
6053
+ 413: {
6054
+ headers: {
6055
+ [name: string]: unknown;
6056
+ };
6057
+ content: {
6058
+ /**
6059
+ * @example {
6060
+ * "error": "Export bundle is too large; scope by workspace",
6061
+ * "code": "export_too_large"
6062
+ * }
6063
+ */
6064
+ "application/json": components["schemas"]["ErrorMessageDto"];
6065
+ };
6066
+ };
6067
+ };
6068
+ };
6069
+ adminFulfillPrivacyRequestPersonErasure: {
6070
+ parameters: {
6071
+ query?: never;
6072
+ header?: never;
6073
+ path: {
6074
+ /** @description Privacy request id (`tai_privacy_requests.id`). */
6075
+ requestId: components["parameters"]["PrivacyRequestId"];
6076
+ };
6077
+ cookie?: never;
6078
+ };
6079
+ requestBody: {
6080
+ content: {
6081
+ "application/json": components["schemas"]["FulfillPersonErasureBodyDto"];
6082
+ };
6083
+ };
6084
+ responses: {
6085
+ /** @description Erasure result. */
6086
+ 200: {
6087
+ headers: {
6088
+ [name: string]: unknown;
6089
+ };
6090
+ content: {
6091
+ "application/json": components["schemas"]["PrivacyRequestPersonErasureResultDto"];
6092
+ };
6093
+ };
6094
+ /** @description Missing workspaceId/personId or invalid options. */
6095
+ 400: {
6096
+ headers: {
6097
+ [name: string]: unknown;
6098
+ };
6099
+ content: {
6100
+ "application/json": components["schemas"]["ErrorMessageDto"];
6101
+ };
6102
+ };
6103
+ 401: components["responses"]["Unauthorized"];
6104
+ /** @description Caller is not a platform admin, or identity has not been verified. */
6105
+ 403: {
6106
+ headers: {
6107
+ [name: string]: unknown;
6108
+ };
6109
+ content: {
6110
+ /**
6111
+ * @example {
6112
+ * "error": "Identity must be verified before erasure",
6113
+ * "code": "identity_not_verified"
6114
+ * }
6115
+ */
6116
+ "application/json": components["schemas"]["ErrorMessageDto"];
6117
+ };
6118
+ };
6119
+ /** @description Request not found, or person not found in the workspace org chart. */
6120
+ 404: {
6121
+ headers: {
6122
+ [name: string]: unknown;
6123
+ };
6124
+ content: {
6125
+ "application/json": components["schemas"]["ErrorMessageDto"];
6126
+ };
6127
+ };
6128
+ };
6129
+ };
6130
+ getMe: {
6131
+ parameters: {
6132
+ query?: never;
6133
+ header?: never;
6134
+ path?: never;
6135
+ cookie?: never;
6136
+ };
6137
+ requestBody?: never;
5176
6138
  responses: {
5177
6139
  /** @description Profile */
5178
6140
  200: {
@@ -5995,8 +6957,12 @@ export interface operations {
5995
6957
  getProductivityInsightsAggregatedTeams: {
5996
6958
  parameters: {
5997
6959
  query?: {
5998
- /** @description Productivity insights time range in weeks (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` is an alias for 12 weeks. */
6960
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
5999
6961
  rangeId?: components["parameters"]["InsightsProductivityRangeId"];
6962
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
6963
+ from?: components["parameters"]["InsightsProductivityFrom"];
6964
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
6965
+ to?: components["parameters"]["InsightsProductivityTo"];
6000
6966
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
6001
6967
  department?: components["parameters"]["InsightsDepartmentFilter"];
6002
6968
  /** @description Team name filter; send `All teams` to include every team. */
@@ -6047,8 +7013,12 @@ export interface operations {
6047
7013
  getProductivityInsightsMergedPrTrends: {
6048
7014
  parameters: {
6049
7015
  query?: {
6050
- /** @description Productivity insights time range in weeks (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` is an alias for 12 weeks. */
7016
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
6051
7017
  rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7018
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7019
+ from?: components["parameters"]["InsightsProductivityFrom"];
7020
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7021
+ to?: components["parameters"]["InsightsProductivityTo"];
6052
7022
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
6053
7023
  department?: components["parameters"]["InsightsDepartmentFilter"];
6054
7024
  /** @description Team name filter; send `All teams` to include every team. */
@@ -6103,8 +7073,12 @@ export interface operations {
6103
7073
  teamId?: string;
6104
7074
  /** @description Maximum top-team rows when `teamId` is omitted (UI default 3). */
6105
7075
  limit?: number;
6106
- /** @description Productivity insights time range in weeks (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` is an alias for 12 weeks. */
7076
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
6107
7077
  rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7078
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7079
+ from?: components["parameters"]["InsightsProductivityFrom"];
7080
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7081
+ to?: components["parameters"]["InsightsProductivityTo"];
6108
7082
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
6109
7083
  department?: components["parameters"]["InsightsDepartmentFilter"];
6110
7084
  /** @description Team name filter; send `All teams` to include every team. */
@@ -6157,8 +7131,12 @@ export interface operations {
6157
7131
  getProductivityInsightsContributor: {
6158
7132
  parameters: {
6159
7133
  query?: {
6160
- /** @description Productivity insights time range in weeks (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` is an alias for 12 weeks. */
7134
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
6161
7135
  rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7136
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7137
+ from?: components["parameters"]["InsightsProductivityFrom"];
7138
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7139
+ to?: components["parameters"]["InsightsProductivityTo"];
6162
7140
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
6163
7141
  department?: components["parameters"]["InsightsDepartmentFilter"];
6164
7142
  /** @description Team name filter; send `All teams` to include every team. */
@@ -6217,8 +7195,12 @@ export interface operations {
6217
7195
  entityType?: "teams" | "contributors";
6218
7196
  /** @description Maximum number of laggard rows to return (UI default 3). */
6219
7197
  limit?: number;
6220
- /** @description Productivity insights time range in weeks (`4w`=4, `8w`=8, `12w`=12, `16w`=16). Legacy `q` is an alias for 12 weeks. */
7198
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
6221
7199
  rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7200
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7201
+ from?: components["parameters"]["InsightsProductivityFrom"];
7202
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7203
+ to?: components["parameters"]["InsightsProductivityTo"];
6222
7204
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
6223
7205
  department?: components["parameters"]["InsightsDepartmentFilter"];
6224
7206
  /** @description Team name filter; send `All teams` to include every team. */
@@ -6583,6 +7565,58 @@ export interface operations {
6583
7565
  };
6584
7566
  };
6585
7567
  };
7568
+ getAiUsageSpendProviderEngagementInsights: {
7569
+ parameters: {
7570
+ query?: {
7571
+ /** @description Measure time range (maps to weekly bucket count). */
7572
+ rangeId?: "4w" | "8w" | "q";
7573
+ /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
7574
+ department?: components["parameters"]["InsightsDepartmentFilter"];
7575
+ /** @description Team name filter; send `All teams` to include every team. */
7576
+ team?: string;
7577
+ /** @description ISO timestamp for the end of the last weekly bucket; omit for current week. */
7578
+ windowEnd?: string;
7579
+ };
7580
+ header?: never;
7581
+ path: {
7582
+ workspaceId: components["parameters"]["WorkspaceId"];
7583
+ };
7584
+ cookie?: never;
7585
+ };
7586
+ requestBody?: never;
7587
+ responses: {
7588
+ /** @description Provider engagement insight cards */
7589
+ 200: {
7590
+ headers: {
7591
+ [name: string]: unknown;
7592
+ };
7593
+ content: {
7594
+ "application/json": components["schemas"]["AiUsageSpendProviderEngagementInsightsDto"];
7595
+ };
7596
+ };
7597
+ /** @description Invalid query parameters */
7598
+ 400: {
7599
+ headers: {
7600
+ [name: string]: unknown;
7601
+ };
7602
+ content: {
7603
+ "application/json": {
7604
+ /** @example invalid_query */
7605
+ error: string;
7606
+ };
7607
+ };
7608
+ };
7609
+ 401: components["responses"]["Unauthorized"];
7610
+ 403: components["responses"]["Forbidden"];
7611
+ /** @description Workspace does not exist or malformed workspaceId */
7612
+ 404: {
7613
+ headers: {
7614
+ [name: string]: unknown;
7615
+ };
7616
+ content?: never;
7617
+ };
7618
+ };
7619
+ };
6586
7620
  getAiUsageSpendAiToolUsageSpend: {
6587
7621
  parameters: {
6588
7622
  query?: {