@thinkai/tai-api-contract 2.150.0 → 2.152.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.150.0
4
+ version: 2.152.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}/...`.
@@ -9236,7 +9236,7 @@ paths:
9236
9236
  description: >
9237
9237
  **Unauthenticated.** Sets that category's email cell to `off` when the category
9238
9238
  allows off. A status token leaves status email unchanged. Redirects `303` to
9239
- `{spa}/settings?tab=preferences`. An unknown or expired token is `400` HTML and
9239
+ `{spa}/workspace/preferences`. An unknown or expired token is `400` HTML and
9240
9240
  does not change preferences.
9241
9241
  operationId: postNotificationEmailUnsubscribe
9242
9242
  security: []
@@ -9252,7 +9252,7 @@ paths:
9252
9252
  description: Preference updated, or left unchanged for status email.
9253
9253
  headers:
9254
9254
  Location:
9255
- description: "`{spa}/settings?tab=preferences`"
9255
+ description: "`{spa}/workspace/preferences`"
9256
9256
  schema:
9257
9257
  type: string
9258
9258
  "400":
@@ -9326,7 +9326,7 @@ paths:
9326
9326
  bearer token. `state` was issued by `getSlackInstallUrl` to a signed-in admin
9327
9327
  and is single-use. The bot token is stored encrypted only when that user is
9328
9328
  still a workspace admin. Success redirects to
9329
- `{spa}/settings?tab=preferences&chat=slack`. Failures redirect to the same
9329
+ `{spa}/workspace/preferences?chat=slack`. Failures redirect to the same
9330
9330
  page with `slack=error`. The token is never in the redirect.
9331
9331
  parameters:
9332
9332
  - name: code
@@ -9489,6 +9489,61 @@ paths:
9489
9489
  error: Slack did not accept the channel
9490
9490
  code: slack_request_failed
9491
9491
 
9492
+ /workspaces/{workspaceId}/notification-preferences:
9493
+ get:
9494
+ tags: [Notifications]
9495
+ summary: Member notification preferences for this workspace
9496
+ description: >
9497
+ In-app Message Center switches and email, Slack, and Teams cells for the
9498
+ current member in this workspace. Missing stored values use the same defaults
9499
+ as account preferences (`email.status` is `digest`; other channel cells are `off`).
9500
+ operationId: getWorkspaceNotificationPreferences
9501
+ parameters:
9502
+ - $ref: "#/components/parameters/WorkspaceId"
9503
+ responses:
9504
+ "200":
9505
+ description: Preferences for this member in this workspace
9506
+ content:
9507
+ application/json:
9508
+ schema:
9509
+ $ref: "#/components/schemas/WorkspaceNotificationPreferencesDto"
9510
+ "401":
9511
+ $ref: "#/components/responses/Unauthorized"
9512
+ put:
9513
+ tags: [Notifications]
9514
+ summary: Save member notification preferences for this workspace
9515
+ description: >
9516
+ Replaces the in-app switches. `notificationChannels` may be omitted to keep
9517
+ stored cells. `email.status` = `off` is `400` `notification_channel_required`.
9518
+ Account `PUT /me/preferences` no longer changes the inbox or delivery.
9519
+ operationId: putWorkspaceNotificationPreferences
9520
+ parameters:
9521
+ - $ref: "#/components/parameters/WorkspaceId"
9522
+ requestBody:
9523
+ required: true
9524
+ content:
9525
+ application/json:
9526
+ schema:
9527
+ $ref: "#/components/schemas/PutWorkspaceNotificationPreferencesBodyDto"
9528
+ responses:
9529
+ "200":
9530
+ description: Saved preferences
9531
+ content:
9532
+ application/json:
9533
+ schema:
9534
+ $ref: "#/components/schemas/WorkspaceNotificationPreferencesDto"
9535
+ "400":
9536
+ description: Invalid body, or status email set to off
9537
+ content:
9538
+ application/json:
9539
+ schema:
9540
+ $ref: "#/components/schemas/ErrorMessageDto"
9541
+ example:
9542
+ error: Status email cannot be turned off
9543
+ code: notification_channel_required
9544
+ "401":
9545
+ $ref: "#/components/responses/Unauthorized"
9546
+
9492
9547
  /workspaces/{workspaceId}/notifications:
9493
9548
  get:
9494
9549
  tags: [Notifications]
@@ -9566,6 +9621,35 @@ paths:
9566
9621
  "401":
9567
9622
  $ref: "#/components/responses/Unauthorized"
9568
9623
 
9624
+ /workspaces/{workspaceId}/notifications/read:
9625
+ post:
9626
+ tags: [Notifications]
9627
+ summary: Mark selected notifications read
9628
+ description: >
9629
+ Marks only the given ids read for the current member in this workspace.
9630
+ Ids that are missing or belong to someone else are ignored. `ids` is 1 to 100
9631
+ uuids.
9632
+ operationId: postNotificationsRead
9633
+ parameters:
9634
+ - $ref: "#/components/parameters/WorkspaceId"
9635
+ requestBody:
9636
+ required: true
9637
+ content:
9638
+ application/json:
9639
+ schema:
9640
+ $ref: "#/components/schemas/NotificationReadIdsBodyDto"
9641
+ responses:
9642
+ "204":
9643
+ description: Updated
9644
+ "400":
9645
+ description: Invalid ids
9646
+ content:
9647
+ application/json:
9648
+ schema:
9649
+ $ref: "#/components/schemas/ErrorMessageDto"
9650
+ "401":
9651
+ $ref: "#/components/responses/Unauthorized"
9652
+
9569
9653
  /workspaces/{workspaceId}/notifications/{id}/read:
9570
9654
  post:
9571
9655
  tags: [Notifications]
@@ -10249,6 +10333,239 @@ paths:
10249
10333
  "403":
10250
10334
  $ref: "#/components/responses/Forbidden"
10251
10335
 
10336
+ /workspaces/{workspaceId}/integrations/teams/install-url:
10337
+ get:
10338
+ tags: [Integrations, Notifications]
10339
+ summary: Microsoft sign-in URL for Teams notification delivery
10340
+ operationId: getWorkspaceTeamsInstallUrl
10341
+ description: >
10342
+ Workspace **admin** only. Returns the Microsoft authorize URL. State carries the
10343
+ workspace and the signed-in admin. Editor or viewer is `403` `workspace_admin_required`.
10344
+ parameters:
10345
+ - $ref: "#/components/parameters/WorkspaceId"
10346
+ responses:
10347
+ "200":
10348
+ description: Authorize URL
10349
+ content:
10350
+ application/json:
10351
+ schema:
10352
+ $ref: "#/components/schemas/TeamsInstallUrlDto"
10353
+ example:
10354
+ url: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=example&state=example-state"
10355
+ "401":
10356
+ $ref: "#/components/responses/Unauthorized"
10357
+ "403":
10358
+ description: Editor or viewer
10359
+ content:
10360
+ application/json:
10361
+ schema:
10362
+ $ref: "#/components/schemas/ErrorMessageDto"
10363
+ example:
10364
+ error: Forbidden
10365
+ code: workspace_admin_required
10366
+ "404":
10367
+ description: Workspace not found
10368
+ content:
10369
+ application/json:
10370
+ schema:
10371
+ $ref: "#/components/schemas/ErrorMessageDto"
10372
+ example:
10373
+ error: Not found
10374
+ "503":
10375
+ description: Teams app credentials are not configured
10376
+ content:
10377
+ application/json:
10378
+ schema:
10379
+ $ref: "#/components/schemas/ErrorMessageDto"
10380
+ example:
10381
+ error: Teams sign-in is not configured
10382
+ code: teams_not_configured
10383
+
10384
+ /integrations/teams/callback:
10385
+ get:
10386
+ tags: [Integrations, Notifications]
10387
+ summary: Finish Teams Microsoft sign-in
10388
+ operationId: getTeamsIntegrationCallback
10389
+ description: >
10390
+ Public redirect target. The one-time state was minted by a signed-in admin and
10391
+ still requires that user to be a workspace admin. Stores the bot token encrypted
10392
+ and redirects to `{spa}/workspace/preferences?chat=teams`.
10393
+ security: []
10394
+ parameters:
10395
+ - name: code
10396
+ in: query
10397
+ schema:
10398
+ type: string
10399
+ - name: state
10400
+ in: query
10401
+ required: true
10402
+ schema:
10403
+ type: string
10404
+ - name: error
10405
+ in: query
10406
+ schema:
10407
+ type: string
10408
+ responses:
10409
+ "302":
10410
+ description: Redirect to Settings → Preferences
10411
+ headers:
10412
+ Location:
10413
+ schema:
10414
+ type: string
10415
+ example: "https://app.example.com/workspace/preferences?chat=teams"
10416
+ "503":
10417
+ description: SPA origin is not configured
10418
+ content:
10419
+ application/json:
10420
+ schema:
10421
+ $ref: "#/components/schemas/ErrorMessageDto"
10422
+
10423
+ /workspaces/{workspaceId}/integrations/teams:
10424
+ get:
10425
+ tags: [Integrations, Notifications]
10426
+ summary: Teams connection status
10427
+ operationId: getWorkspaceTeamsConnection
10428
+ description: >
10429
+ Any workspace member. `{ connected, channelName }`. Never returns the bot token.
10430
+ `channelName` is null until an admin saves a channel.
10431
+ parameters:
10432
+ - $ref: "#/components/parameters/WorkspaceId"
10433
+ responses:
10434
+ "200":
10435
+ description: Connection status
10436
+ content:
10437
+ application/json:
10438
+ schema:
10439
+ $ref: "#/components/schemas/TeamsConnectionDto"
10440
+ example:
10441
+ connected: true
10442
+ channelName: General
10443
+ "401":
10444
+ $ref: "#/components/responses/Unauthorized"
10445
+ "403":
10446
+ $ref: "#/components/responses/Forbidden"
10447
+ "404":
10448
+ description: Workspace not found
10449
+ content:
10450
+ application/json:
10451
+ schema:
10452
+ $ref: "#/components/schemas/ErrorMessageDto"
10453
+ example:
10454
+ error: Not found
10455
+ delete:
10456
+ tags: [Integrations, Notifications]
10457
+ summary: Disconnect Teams
10458
+ operationId: deleteWorkspaceTeamsConnection
10459
+ description: >
10460
+ Workspace **admin** only. Later Message Center posts do not go to Teams.
10461
+ Member chat cells stay unchanged.
10462
+ parameters:
10463
+ - $ref: "#/components/parameters/WorkspaceId"
10464
+ responses:
10465
+ "204":
10466
+ description: Disconnected
10467
+ "401":
10468
+ $ref: "#/components/responses/Unauthorized"
10469
+ "403":
10470
+ description: Editor or viewer
10471
+ content:
10472
+ application/json:
10473
+ schema:
10474
+ $ref: "#/components/schemas/ErrorMessageDto"
10475
+ example:
10476
+ error: Forbidden
10477
+ code: workspace_admin_required
10478
+ "404":
10479
+ description: Workspace not found
10480
+ content:
10481
+ application/json:
10482
+ schema:
10483
+ $ref: "#/components/schemas/ErrorMessageDto"
10484
+ example:
10485
+ error: Not found
10486
+
10487
+ /workspaces/{workspaceId}/integrations/teams/channel:
10488
+ put:
10489
+ tags: [Integrations, Notifications]
10490
+ summary: Save the Teams channel for notification posts
10491
+ operationId: putWorkspaceTeamsChannel
10492
+ description: >
10493
+ Workspace **admin** only. Body `{ channelId }`. The channel must be visible to the
10494
+ connected Microsoft account. Until a channel is saved, channel-mode delivery is
10495
+ skipped with `chat_channel_unset`.
10496
+ parameters:
10497
+ - $ref: "#/components/parameters/WorkspaceId"
10498
+ requestBody:
10499
+ required: true
10500
+ content:
10501
+ application/json:
10502
+ schema:
10503
+ $ref: "#/components/schemas/TeamsChannelBodyDto"
10504
+ example:
10505
+ channelId: "19:example@thread.tacv2"
10506
+ responses:
10507
+ "200":
10508
+ description: Channel saved
10509
+ content:
10510
+ application/json:
10511
+ schema:
10512
+ $ref: "#/components/schemas/TeamsConnectionDto"
10513
+ example:
10514
+ connected: true
10515
+ channelName: General
10516
+ "400":
10517
+ description: Missing channelId, or the channel was not found
10518
+ content:
10519
+ application/json:
10520
+ schema:
10521
+ $ref: "#/components/schemas/ErrorMessageDto"
10522
+ examples:
10523
+ invalid:
10524
+ value:
10525
+ error: channelId is required
10526
+ code: invalid_input
10527
+ missing:
10528
+ value:
10529
+ error: Teams channel was not found
10530
+ code: teams_channel_not_found
10531
+ "401":
10532
+ $ref: "#/components/responses/Unauthorized"
10533
+ "403":
10534
+ description: Editor or viewer
10535
+ content:
10536
+ application/json:
10537
+ schema:
10538
+ $ref: "#/components/schemas/ErrorMessageDto"
10539
+ example:
10540
+ error: Forbidden
10541
+ code: workspace_admin_required
10542
+ "404":
10543
+ description: Workspace not found
10544
+ content:
10545
+ application/json:
10546
+ schema:
10547
+ $ref: "#/components/schemas/ErrorMessageDto"
10548
+ example:
10549
+ error: Not found
10550
+ "409":
10551
+ description: Teams is not connected
10552
+ content:
10553
+ application/json:
10554
+ schema:
10555
+ $ref: "#/components/schemas/ErrorMessageDto"
10556
+ example:
10557
+ error: Teams is not connected
10558
+ code: teams_not_connected
10559
+ "502":
10560
+ description: Microsoft Graph rejected the channel lookup
10561
+ content:
10562
+ application/json:
10563
+ schema:
10564
+ $ref: "#/components/schemas/ErrorMessageDto"
10565
+ example:
10566
+ error: Teams channel lookup failed
10567
+ code: teams_graph_failed
10568
+
10252
10569
  /workspaces/{workspaceId}/integrations/zelt/authorize-url:
10253
10570
  post:
10254
10571
  tags: [HRIS, Integrations]
@@ -11261,6 +11578,35 @@ components:
11261
11578
  error: zenhr_sync_in_progress
11262
11579
 
11263
11580
  schemas:
11581
+ TeamsInstallUrlDto:
11582
+ type: object
11583
+ required: [url]
11584
+ properties:
11585
+ url:
11586
+ type: string
11587
+ format: uri
11588
+
11589
+ TeamsConnectionDto:
11590
+ type: object
11591
+ required: [connected, channelName]
11592
+ properties:
11593
+ connected:
11594
+ type: boolean
11595
+ description: True after an admin completes Microsoft sign-in.
11596
+ channelName:
11597
+ type: string
11598
+ nullable: true
11599
+ description: Selected channel display name. Null until an admin saves a channel.
11600
+
11601
+ TeamsChannelBodyDto:
11602
+ type: object
11603
+ required: [channelId]
11604
+ properties:
11605
+ channelId:
11606
+ type: string
11607
+ minLength: 1
11608
+ maxLength: 256
11609
+
11264
11610
  ErrorMessageDto:
11265
11611
  type: object
11266
11612
  required: [error]
@@ -19107,6 +19453,44 @@ components:
19107
19453
  system:
19108
19454
  $ref: "#/components/schemas/NotificationChatDeliveryMode"
19109
19455
 
19456
+ WorkspaceNotificationPreferencesDto:
19457
+ type: object
19458
+ additionalProperties: false
19459
+ required: [notifications, notificationChannels]
19460
+ description: >
19461
+ Message Center switches and delivery cells for one member in one workspace.
19462
+ properties:
19463
+ notifications:
19464
+ $ref: "#/components/schemas/NotificationPreferencesDto"
19465
+ notificationChannels:
19466
+ $ref: "#/components/schemas/NotificationChannelsDto"
19467
+
19468
+ PutWorkspaceNotificationPreferencesBodyDto:
19469
+ type: object
19470
+ additionalProperties: false
19471
+ required: [notifications]
19472
+ description: >
19473
+ Body for `PUT /workspaces/{workspaceId}/notification-preferences`.
19474
+ Omit `notificationChannels` to keep stored cells.
19475
+ properties:
19476
+ notifications:
19477
+ $ref: "#/components/schemas/NotificationPreferencesDto"
19478
+ notificationChannels:
19479
+ $ref: "#/components/schemas/PutNotificationChannelsDto"
19480
+
19481
+ NotificationReadIdsBodyDto:
19482
+ type: object
19483
+ additionalProperties: false
19484
+ required: [ids]
19485
+ properties:
19486
+ ids:
19487
+ type: array
19488
+ minItems: 1
19489
+ maxItems: 100
19490
+ items:
19491
+ type: string
19492
+ format: uuid
19493
+
19110
19494
  NotificationChannelsDto:
19111
19495
  type: object
19112
19496
  additionalProperties: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.150.0",
3
+ "version": "2.152.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,9 +19,9 @@
19
19
  }
20
20
  },
21
21
  "devDependencies": {
22
- "@stoplight/spectral-cli": "^6.16.3",
23
- "@types/node": "^26.6.3",
24
- "jsonpath-plus": "^11.1.0",
22
+ "@stoplight/spectral-cli": "^6.17.0",
23
+ "@types/node": "^26.6.4",
24
+ "jsonpath-plus": "^11.1.1",
25
25
  "openapi-typescript": "^7.13.0",
26
26
  "typescript": "~6.0.3"
27
27
  },