@thinkai/tai-api-contract 2.46.0 → 2.48.0-pr.865.c7804f40

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.
@@ -81,7 +81,13 @@ export interface paths {
81
81
  /** Update current user profile */
82
82
  put: operations["updateMe"];
83
83
  post?: never;
84
- delete?: never;
84
+ /**
85
+ * Delete current user account and all owned data
86
+ * @description Self-service account deletion. Hard-deletes the authenticated user in a single atomic transaction with the same semantics as admin `deleteUserAndData` (#428): 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.
87
+ * **Irreversible.** Owned workspaces in the #440 soft-delete grace period are also hard-deleted immediately; there is no restore window after account delete.
88
+ * **Authorization:** Bearer JWT required. Body must include the caller's email exactly (case-insensitive) as a type-to-confirm guard.
89
+ */
90
+ delete: operations["deleteMe"];
85
91
  options?: never;
86
92
  head?: never;
87
93
  patch?: never;
@@ -188,6 +194,43 @@ export interface paths {
188
194
  patch: operations["updateTenantMemberRole"];
189
195
  trace?: never;
190
196
  };
197
+ "/workspaces/{workspaceId}/org-chart/status": {
198
+ parameters: {
199
+ query?: never;
200
+ header?: never;
201
+ path?: never;
202
+ cookie?: never;
203
+ };
204
+ /** Effective org chart status (structure + identity) */
205
+ get: operations["getWorkspaceOrgChartStatus"];
206
+ put?: never;
207
+ post?: never;
208
+ delete?: never;
209
+ options?: never;
210
+ head?: never;
211
+ patch?: never;
212
+ trace?: never;
213
+ };
214
+ "/workspaces/{workspaceId}/org-chart/structure-source": {
215
+ parameters: {
216
+ query?: never;
217
+ header?: never;
218
+ path?: never;
219
+ cookie?: never;
220
+ };
221
+ get?: never;
222
+ /**
223
+ * Switch org structure base between HRIS and uploaded file
224
+ * @description Advanced override when both HRIS and uploaded structure caches exist. Re-materializes the effective org chart and may queue productivity re-ingest.
225
+ */
226
+ put: operations["putWorkspaceOrgStructureSource"];
227
+ post?: never;
228
+ delete?: never;
229
+ options?: never;
230
+ head?: never;
231
+ patch?: never;
232
+ trace?: never;
233
+ };
191
234
  "/workspaces/{workspaceId}/org-chart": {
192
235
  parameters: {
193
236
  query?: never;
@@ -2299,11 +2342,52 @@ export interface components {
2299
2342
  OrgChartImportResultDto: {
2300
2343
  persons: components["schemas"]["OrgChartPersonDto"][];
2301
2344
  errors: string[];
2345
+ /** @description Parse-only preview of identity rows that would not match HRIS persons */
2346
+ unmatchedPreview?: components["schemas"]["OrgChartUnmatchedIdentitySampleDto"][];
2302
2347
  };
2303
2348
  OrgChartSaveResultDto: {
2304
2349
  ok: boolean;
2305
2350
  /** Format: uuid */
2306
2351
  tenantId: string;
2352
+ /** @description Identity rows that did not match HRIS persons (non-blocking) */
2353
+ unmatchedCount?: number;
2354
+ };
2355
+ OrgStructureSourceBodyDto: {
2356
+ /** @enum {string} */
2357
+ source: "hris" | "upload";
2358
+ };
2359
+ OrgChartStructureAvailabilityDto: {
2360
+ personCount: number;
2361
+ teamCount: number;
2362
+ /** @description HRIS provider when structure is from HRIS sync */
2363
+ provider?: string;
2364
+ };
2365
+ OrgChartUnmatchedIdentitySampleDto: {
2366
+ email: string;
2367
+ employeeId?: string;
2368
+ githubUsername?: string;
2369
+ };
2370
+ OrgChartStatusDto: {
2371
+ structure: {
2372
+ /** @enum {string} */
2373
+ source: "hris" | "upload";
2374
+ hris: (components["schemas"]["OrgChartStructureAvailabilityDto"] & {
2375
+ /** Format: date-time */
2376
+ lastSyncAt?: string;
2377
+ }) | null;
2378
+ uploadOverride: components["schemas"]["OrgChartStructureAvailabilityDto"] | null;
2379
+ };
2380
+ identity: {
2381
+ mappingCount: number;
2382
+ /** Format: date-time */
2383
+ updatedAt: string | null;
2384
+ unmatchedCount: number;
2385
+ unmatchedSample: components["schemas"]["OrgChartUnmatchedIdentitySampleDto"][];
2386
+ };
2387
+ effective: {
2388
+ personCount: number;
2389
+ githubMappedCount: number;
2390
+ };
2307
2391
  };
2308
2392
  TenantSourceEntryDto: {
2309
2393
  type: string;
@@ -3103,6 +3187,13 @@ export interface components {
3103
3187
  email?: string;
3104
3188
  defaultWorkspaceId?: string | null;
3105
3189
  };
3190
+ DeleteMeBodyDto: {
3191
+ /**
3192
+ * Format: email
3193
+ * @description Must match the authenticated user's email (case-insensitive). Acts as a type-to-confirm guard against accidental deletion.
3194
+ */
3195
+ email: string;
3196
+ };
3106
3197
  WorkspaceSummaryDto: {
3107
3198
  id: string;
3108
3199
  slug: string;
@@ -4642,6 +4733,10 @@ export type OrgChartDto = components['schemas']['OrgChartDto'];
4642
4733
  export type OrgChartPersonDto = components['schemas']['OrgChartPersonDto'];
4643
4734
  export type OrgChartImportResultDto = components['schemas']['OrgChartImportResultDto'];
4644
4735
  export type OrgChartSaveResultDto = components['schemas']['OrgChartSaveResultDto'];
4736
+ export type OrgStructureSourceBodyDto = components['schemas']['OrgStructureSourceBodyDto'];
4737
+ export type OrgChartStructureAvailabilityDto = components['schemas']['OrgChartStructureAvailabilityDto'];
4738
+ export type OrgChartUnmatchedIdentitySampleDto = components['schemas']['OrgChartUnmatchedIdentitySampleDto'];
4739
+ export type OrgChartStatusDto = components['schemas']['OrgChartStatusDto'];
4645
4740
  export type TenantSourceEntryDto = components['schemas']['TenantSourceEntryDto'];
4646
4741
  export type CursorSourceDto = components['schemas']['CursorSourceDto'];
4647
4742
  export type CursorSourcePatchDto = components['schemas']['CursorSourcePatchDto'];
@@ -4715,6 +4810,7 @@ export type AiToolMemberHeatmapDayDto = components['schemas']['AiToolMemberHeatm
4715
4810
  export type AiToolMemberDetailDto = components['schemas']['AiToolMemberDetailDto'];
4716
4811
  export type MeProfileDto = components['schemas']['MeProfileDto'];
4717
4812
  export type UpdateMeBodyDto = components['schemas']['UpdateMeBodyDto'];
4813
+ export type DeleteMeBodyDto = components['schemas']['DeleteMeBodyDto'];
4718
4814
  export type WorkspaceSummaryDto = components['schemas']['WorkspaceSummaryDto'];
4719
4815
  export type WorkspacesForUserDto = components['schemas']['WorkspacesForUserDto'];
4720
4816
  export type CreateWorkspaceBodyDto = components['schemas']['CreateWorkspaceBodyDto'];
@@ -5112,6 +5208,62 @@ export interface operations {
5112
5208
  401: components["responses"]["Unauthorized"];
5113
5209
  };
5114
5210
  };
5211
+ deleteMe: {
5212
+ parameters: {
5213
+ query?: never;
5214
+ header?: never;
5215
+ path?: never;
5216
+ cookie?: never;
5217
+ };
5218
+ requestBody: {
5219
+ content: {
5220
+ "application/json": components["schemas"]["DeleteMeBodyDto"];
5221
+ };
5222
+ };
5223
+ responses: {
5224
+ /** @description Account and all owned data deleted. */
5225
+ 204: {
5226
+ headers: {
5227
+ [name: string]: unknown;
5228
+ };
5229
+ content?: never;
5230
+ };
5231
+ /** @description Missing or mismatched confirmation email. */
5232
+ 400: {
5233
+ headers: {
5234
+ [name: string]: unknown;
5235
+ };
5236
+ content: {
5237
+ /**
5238
+ * @example {
5239
+ * "error": "Confirmation email does not match account email",
5240
+ * "code": "email_mismatch"
5241
+ * }
5242
+ */
5243
+ "application/json": components["schemas"]["ErrorMessageDto"];
5244
+ };
5245
+ };
5246
+ 401: components["responses"]["Unauthorized"];
5247
+ /** @description Identity conflict resolving the current user. */
5248
+ 409: {
5249
+ headers: {
5250
+ [name: string]: unknown;
5251
+ };
5252
+ content: {
5253
+ "application/json": components["schemas"]["ErrorMessageDto"];
5254
+ };
5255
+ };
5256
+ /** @description Account deletion not supported by the configured store. */
5257
+ 503: {
5258
+ headers: {
5259
+ [name: string]: unknown;
5260
+ };
5261
+ content: {
5262
+ "application/json": components["schemas"]["ErrorMessageDto"];
5263
+ };
5264
+ };
5265
+ };
5266
+ };
5115
5267
  listMyWorkspaces: {
5116
5268
  parameters: {
5117
5269
  query?: never;
@@ -5377,6 +5529,67 @@ export interface operations {
5377
5529
  };
5378
5530
  };
5379
5531
  };
5532
+ getWorkspaceOrgChartStatus: {
5533
+ parameters: {
5534
+ query?: never;
5535
+ header?: never;
5536
+ path: {
5537
+ workspaceId: components["parameters"]["WorkspaceId"];
5538
+ };
5539
+ cookie?: never;
5540
+ };
5541
+ requestBody?: never;
5542
+ responses: {
5543
+ /** @description Structure source, identity mappings, and effective chart summary */
5544
+ 200: {
5545
+ headers: {
5546
+ [name: string]: unknown;
5547
+ };
5548
+ content: {
5549
+ "application/json": components["schemas"]["OrgChartStatusDto"];
5550
+ };
5551
+ };
5552
+ 401: components["responses"]["Unauthorized"];
5553
+ 403: components["responses"]["Forbidden"];
5554
+ };
5555
+ };
5556
+ putWorkspaceOrgStructureSource: {
5557
+ parameters: {
5558
+ query?: never;
5559
+ header?: never;
5560
+ path: {
5561
+ workspaceId: components["parameters"]["WorkspaceId"];
5562
+ };
5563
+ cookie?: never;
5564
+ };
5565
+ requestBody: {
5566
+ content: {
5567
+ "application/json": components["schemas"]["OrgStructureSourceBodyDto"];
5568
+ };
5569
+ };
5570
+ responses: {
5571
+ /** @description Updated status after re-materialization */
5572
+ 200: {
5573
+ headers: {
5574
+ [name: string]: unknown;
5575
+ };
5576
+ content: {
5577
+ "application/json": components["schemas"]["OrgChartStatusDto"];
5578
+ };
5579
+ };
5580
+ /** @description Both structure caches are not available */
5581
+ 400: {
5582
+ headers: {
5583
+ [name: string]: unknown;
5584
+ };
5585
+ content: {
5586
+ "application/json": components["schemas"]["ErrorMessageDto"];
5587
+ };
5588
+ };
5589
+ 401: components["responses"]["Unauthorized"];
5590
+ 403: components["responses"]["Forbidden"];
5591
+ };
5592
+ };
5380
5593
  getTenantOrgChart: {
5381
5594
  parameters: {
5382
5595
  query?: never;