@thinkai/tai-api-contract 2.47.0 → 2.48.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.47.0
4
+ version: 2.48.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}/...`.
@@ -598,6 +598,59 @@ paths:
598
598
  error: Cannot remove the workspace owner
599
599
  code: workspace_owner
600
600
 
601
+ /workspaces/{workspaceId}/org-chart/status:
602
+ get:
603
+ tags: [Workspace]
604
+ summary: Effective org chart status (structure + identity)
605
+ operationId: getWorkspaceOrgChartStatus
606
+ parameters:
607
+ - $ref: "#/components/parameters/WorkspaceId"
608
+ responses:
609
+ "200":
610
+ description: Structure source, identity mappings, and effective chart summary
611
+ content:
612
+ application/json:
613
+ schema:
614
+ $ref: "#/components/schemas/OrgChartStatusDto"
615
+ "401":
616
+ $ref: "#/components/responses/Unauthorized"
617
+ "403":
618
+ $ref: "#/components/responses/Forbidden"
619
+
620
+ /workspaces/{workspaceId}/org-chart/structure-source:
621
+ put:
622
+ tags: [Workspace]
623
+ summary: Switch org structure base between HRIS and uploaded file
624
+ description: >
625
+ Advanced override when both HRIS and uploaded structure caches exist.
626
+ Re-materializes the effective org chart and may queue productivity re-ingest.
627
+ operationId: putWorkspaceOrgStructureSource
628
+ parameters:
629
+ - $ref: "#/components/parameters/WorkspaceId"
630
+ requestBody:
631
+ required: true
632
+ content:
633
+ application/json:
634
+ schema:
635
+ $ref: "#/components/schemas/OrgStructureSourceBodyDto"
636
+ responses:
637
+ "200":
638
+ description: Updated status after re-materialization
639
+ content:
640
+ application/json:
641
+ schema:
642
+ $ref: "#/components/schemas/OrgChartStatusDto"
643
+ "400":
644
+ description: Both structure caches are not available
645
+ content:
646
+ application/json:
647
+ schema:
648
+ $ref: "#/components/schemas/ErrorMessageDto"
649
+ "401":
650
+ $ref: "#/components/responses/Unauthorized"
651
+ "403":
652
+ $ref: "#/components/responses/Forbidden"
653
+
601
654
  /workspaces/{workspaceId}/org-chart:
602
655
  get:
603
656
  tags: [Workspace]
@@ -6030,6 +6083,11 @@ components:
6030
6083
  type: array
6031
6084
  items:
6032
6085
  type: string
6086
+ unmatchedPreview:
6087
+ type: array
6088
+ description: Parse-only preview of identity rows that would not match HRIS persons
6089
+ items:
6090
+ $ref: "#/components/schemas/OrgChartUnmatchedIdentitySampleDto"
6033
6091
 
6034
6092
  OrgChartSaveResultDto:
6035
6093
  type: object
@@ -6041,6 +6099,103 @@ components:
6041
6099
  tenantId:
6042
6100
  type: string
6043
6101
  format: uuid
6102
+ unmatchedCount:
6103
+ type: integer
6104
+ minimum: 0
6105
+ description: Identity rows that did not match HRIS persons (non-blocking)
6106
+
6107
+ OrgStructureSourceBodyDto:
6108
+ type: object
6109
+ additionalProperties: false
6110
+ required: [source]
6111
+ properties:
6112
+ source:
6113
+ type: string
6114
+ enum: [hris, upload]
6115
+
6116
+ OrgChartStructureAvailabilityDto:
6117
+ type: object
6118
+ additionalProperties: false
6119
+ required: [personCount, teamCount]
6120
+ properties:
6121
+ personCount:
6122
+ type: integer
6123
+ minimum: 0
6124
+ teamCount:
6125
+ type: integer
6126
+ minimum: 0
6127
+ provider:
6128
+ type: string
6129
+ description: HRIS provider when structure is from HRIS sync
6130
+
6131
+ OrgChartUnmatchedIdentitySampleDto:
6132
+ type: object
6133
+ additionalProperties: false
6134
+ required: [email]
6135
+ properties:
6136
+ email:
6137
+ type: string
6138
+ employeeId:
6139
+ type: string
6140
+ githubUsername:
6141
+ type: string
6142
+
6143
+ OrgChartStatusDto:
6144
+ type: object
6145
+ additionalProperties: false
6146
+ required: [structure, identity, effective]
6147
+ properties:
6148
+ structure:
6149
+ type: object
6150
+ additionalProperties: false
6151
+ required: [source, hris, uploadOverride]
6152
+ properties:
6153
+ source:
6154
+ type: string
6155
+ enum: [hris, upload]
6156
+ hris:
6157
+ allOf:
6158
+ - $ref: "#/components/schemas/OrgChartStructureAvailabilityDto"
6159
+ - type: object
6160
+ properties:
6161
+ lastSyncAt:
6162
+ type: string
6163
+ format: date-time
6164
+ nullable: true
6165
+ uploadOverride:
6166
+ allOf:
6167
+ - $ref: "#/components/schemas/OrgChartStructureAvailabilityDto"
6168
+ nullable: true
6169
+ identity:
6170
+ type: object
6171
+ additionalProperties: false
6172
+ required: [mappingCount, updatedAt, unmatchedCount, unmatchedSample]
6173
+ properties:
6174
+ mappingCount:
6175
+ type: integer
6176
+ minimum: 0
6177
+ updatedAt:
6178
+ type: string
6179
+ format: date-time
6180
+ nullable: true
6181
+ unmatchedCount:
6182
+ type: integer
6183
+ minimum: 0
6184
+ unmatchedSample:
6185
+ type: array
6186
+ items:
6187
+ $ref: "#/components/schemas/OrgChartUnmatchedIdentitySampleDto"
6188
+ effective:
6189
+ type: object
6190
+ additionalProperties: false
6191
+ required: [personCount, githubMappedCount]
6192
+ properties:
6193
+ personCount:
6194
+ type: integer
6195
+ minimum: 0
6196
+ githubMappedCount:
6197
+ type: integer
6198
+ minimum: 0
6044
6199
 
6045
6200
  TenantSourceEntryDto:
6046
6201
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.47.0",
3
+ "version": "2.48.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -195,6 +195,43 @@ export interface paths {
195
195
  patch: operations["updateTenantMemberRole"];
196
196
  trace?: never;
197
197
  };
198
+ "/workspaces/{workspaceId}/org-chart/status": {
199
+ parameters: {
200
+ query?: never;
201
+ header?: never;
202
+ path?: never;
203
+ cookie?: never;
204
+ };
205
+ /** Effective org chart status (structure + identity) */
206
+ get: operations["getWorkspaceOrgChartStatus"];
207
+ put?: never;
208
+ post?: never;
209
+ delete?: never;
210
+ options?: never;
211
+ head?: never;
212
+ patch?: never;
213
+ trace?: never;
214
+ };
215
+ "/workspaces/{workspaceId}/org-chart/structure-source": {
216
+ parameters: {
217
+ query?: never;
218
+ header?: never;
219
+ path?: never;
220
+ cookie?: never;
221
+ };
222
+ get?: never;
223
+ /**
224
+ * Switch org structure base between HRIS and uploaded file
225
+ * @description Advanced override when both HRIS and uploaded structure caches exist. Re-materializes the effective org chart and may queue productivity re-ingest.
226
+ */
227
+ put: operations["putWorkspaceOrgStructureSource"];
228
+ post?: never;
229
+ delete?: never;
230
+ options?: never;
231
+ head?: never;
232
+ patch?: never;
233
+ trace?: never;
234
+ };
198
235
  "/workspaces/{workspaceId}/org-chart": {
199
236
  parameters: {
200
237
  query?: never;
@@ -2306,11 +2343,52 @@ export interface components {
2306
2343
  OrgChartImportResultDto: {
2307
2344
  persons: components["schemas"]["OrgChartPersonDto"][];
2308
2345
  errors: string[];
2346
+ /** @description Parse-only preview of identity rows that would not match HRIS persons */
2347
+ unmatchedPreview?: components["schemas"]["OrgChartUnmatchedIdentitySampleDto"][];
2309
2348
  };
2310
2349
  OrgChartSaveResultDto: {
2311
2350
  ok: boolean;
2312
2351
  /** Format: uuid */
2313
2352
  tenantId: string;
2353
+ /** @description Identity rows that did not match HRIS persons (non-blocking) */
2354
+ unmatchedCount?: number;
2355
+ };
2356
+ OrgStructureSourceBodyDto: {
2357
+ /** @enum {string} */
2358
+ source: "hris" | "upload";
2359
+ };
2360
+ OrgChartStructureAvailabilityDto: {
2361
+ personCount: number;
2362
+ teamCount: number;
2363
+ /** @description HRIS provider when structure is from HRIS sync */
2364
+ provider?: string;
2365
+ };
2366
+ OrgChartUnmatchedIdentitySampleDto: {
2367
+ email: string;
2368
+ employeeId?: string;
2369
+ githubUsername?: string;
2370
+ };
2371
+ OrgChartStatusDto: {
2372
+ structure: {
2373
+ /** @enum {string} */
2374
+ source: "hris" | "upload";
2375
+ hris: (components["schemas"]["OrgChartStructureAvailabilityDto"] & {
2376
+ /** Format: date-time */
2377
+ lastSyncAt?: string;
2378
+ }) | null;
2379
+ uploadOverride: components["schemas"]["OrgChartStructureAvailabilityDto"] | null;
2380
+ };
2381
+ identity: {
2382
+ mappingCount: number;
2383
+ /** Format: date-time */
2384
+ updatedAt: string | null;
2385
+ unmatchedCount: number;
2386
+ unmatchedSample: components["schemas"]["OrgChartUnmatchedIdentitySampleDto"][];
2387
+ };
2388
+ effective: {
2389
+ personCount: number;
2390
+ githubMappedCount: number;
2391
+ };
2314
2392
  };
2315
2393
  TenantSourceEntryDto: {
2316
2394
  type: string;
@@ -4656,6 +4734,10 @@ export type OrgChartDto = components['schemas']['OrgChartDto'];
4656
4734
  export type OrgChartPersonDto = components['schemas']['OrgChartPersonDto'];
4657
4735
  export type OrgChartImportResultDto = components['schemas']['OrgChartImportResultDto'];
4658
4736
  export type OrgChartSaveResultDto = components['schemas']['OrgChartSaveResultDto'];
4737
+ export type OrgStructureSourceBodyDto = components['schemas']['OrgStructureSourceBodyDto'];
4738
+ export type OrgChartStructureAvailabilityDto = components['schemas']['OrgChartStructureAvailabilityDto'];
4739
+ export type OrgChartUnmatchedIdentitySampleDto = components['schemas']['OrgChartUnmatchedIdentitySampleDto'];
4740
+ export type OrgChartStatusDto = components['schemas']['OrgChartStatusDto'];
4659
4741
  export type TenantSourceEntryDto = components['schemas']['TenantSourceEntryDto'];
4660
4742
  export type CursorSourceDto = components['schemas']['CursorSourceDto'];
4661
4743
  export type CursorSourcePatchDto = components['schemas']['CursorSourcePatchDto'];
@@ -5448,6 +5530,67 @@ export interface operations {
5448
5530
  };
5449
5531
  };
5450
5532
  };
5533
+ getWorkspaceOrgChartStatus: {
5534
+ parameters: {
5535
+ query?: never;
5536
+ header?: never;
5537
+ path: {
5538
+ workspaceId: components["parameters"]["WorkspaceId"];
5539
+ };
5540
+ cookie?: never;
5541
+ };
5542
+ requestBody?: never;
5543
+ responses: {
5544
+ /** @description Structure source, identity mappings, and effective chart summary */
5545
+ 200: {
5546
+ headers: {
5547
+ [name: string]: unknown;
5548
+ };
5549
+ content: {
5550
+ "application/json": components["schemas"]["OrgChartStatusDto"];
5551
+ };
5552
+ };
5553
+ 401: components["responses"]["Unauthorized"];
5554
+ 403: components["responses"]["Forbidden"];
5555
+ };
5556
+ };
5557
+ putWorkspaceOrgStructureSource: {
5558
+ parameters: {
5559
+ query?: never;
5560
+ header?: never;
5561
+ path: {
5562
+ workspaceId: components["parameters"]["WorkspaceId"];
5563
+ };
5564
+ cookie?: never;
5565
+ };
5566
+ requestBody: {
5567
+ content: {
5568
+ "application/json": components["schemas"]["OrgStructureSourceBodyDto"];
5569
+ };
5570
+ };
5571
+ responses: {
5572
+ /** @description Updated status after re-materialization */
5573
+ 200: {
5574
+ headers: {
5575
+ [name: string]: unknown;
5576
+ };
5577
+ content: {
5578
+ "application/json": components["schemas"]["OrgChartStatusDto"];
5579
+ };
5580
+ };
5581
+ /** @description Both structure caches are not available */
5582
+ 400: {
5583
+ headers: {
5584
+ [name: string]: unknown;
5585
+ };
5586
+ content: {
5587
+ "application/json": components["schemas"]["ErrorMessageDto"];
5588
+ };
5589
+ };
5590
+ 401: components["responses"]["Unauthorized"];
5591
+ 403: components["responses"]["Forbidden"];
5592
+ };
5593
+ };
5451
5594
  getTenantOrgChart: {
5452
5595
  parameters: {
5453
5596
  query?: never;