@thinkai/tai-api-contract 2.151.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.151.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]
@@ -10305,7 +10389,7 @@ paths:
10305
10389
  description: >
10306
10390
  Public redirect target. The one-time state was minted by a signed-in admin and
10307
10391
  still requires that user to be a workspace admin. Stores the bot token encrypted
10308
- and redirects to `{spa}/settings?tab=preferences&chat=teams`.
10392
+ and redirects to `{spa}/workspace/preferences?chat=teams`.
10309
10393
  security: []
10310
10394
  parameters:
10311
10395
  - name: code
@@ -10328,7 +10412,7 @@ paths:
10328
10412
  Location:
10329
10413
  schema:
10330
10414
  type: string
10331
- example: "https://app.example.com/settings?tab=preferences&chat=teams"
10415
+ example: "https://app.example.com/workspace/preferences?chat=teams"
10332
10416
  "503":
10333
10417
  description: SPA origin is not configured
10334
10418
  content:
@@ -19369,6 +19453,44 @@ components:
19369
19453
  system:
19370
19454
  $ref: "#/components/schemas/NotificationChatDeliveryMode"
19371
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
+
19372
19494
  NotificationChannelsDto:
19373
19495
  type: object
19374
19496
  additionalProperties: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.151.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
  },
@@ -3716,7 +3716,7 @@ export interface paths {
3716
3716
  put?: never;
3717
3717
  /**
3718
3718
  * Apply a Message Center email unsubscribe (public)
3719
- * @description **Unauthenticated.** Sets that category's email cell to `off` when the category allows off. A status token leaves status email unchanged. Redirects `303` to `{spa}/settings?tab=preferences`. An unknown or expired token is `400` HTML and does not change preferences.
3719
+ * @description **Unauthenticated.** Sets that category's email cell to `off` when the category allows off. A status token leaves status email unchanged. Redirects `303` to `{spa}/workspace/preferences`. An unknown or expired token is `400` HTML and does not change preferences.
3720
3720
  */
3721
3721
  post: operations["postNotificationEmailUnsubscribe"];
3722
3722
  delete?: never;
@@ -3754,7 +3754,7 @@ export interface paths {
3754
3754
  };
3755
3755
  /**
3756
3756
  * Slack OAuth callback
3757
- * @description Browser return from Slack. The provider redirect does not include the API bearer token. `state` was issued by `getSlackInstallUrl` to a signed-in admin and is single-use. The bot token is stored encrypted only when that user is still a workspace admin. Success redirects to `{spa}/settings?tab=preferences&chat=slack`. Failures redirect to the same page with `slack=error`. The token is never in the redirect.
3757
+ * @description Browser return from Slack. The provider redirect does not include the API bearer token. `state` was issued by `getSlackInstallUrl` to a signed-in admin and is single-use. The bot token is stored encrypted only when that user is still a workspace admin. Success redirects to `{spa}/workspace/preferences?chat=slack`. Failures redirect to the same page with `slack=error`. The token is never in the redirect.
3758
3758
  */
3759
3759
  get: operations["getSlackOauthCallback"];
3760
3760
  put?: never;
@@ -3809,6 +3809,30 @@ export interface paths {
3809
3809
  patch?: never;
3810
3810
  trace?: never;
3811
3811
  };
3812
+ "/workspaces/{workspaceId}/notification-preferences": {
3813
+ parameters: {
3814
+ query?: never;
3815
+ header?: never;
3816
+ path?: never;
3817
+ cookie?: never;
3818
+ };
3819
+ /**
3820
+ * Member notification preferences for this workspace
3821
+ * @description In-app Message Center switches and email, Slack, and Teams cells for the current member in this workspace. Missing stored values use the same defaults as account preferences (`email.status` is `digest`; other channel cells are `off`).
3822
+ */
3823
+ get: operations["getWorkspaceNotificationPreferences"];
3824
+ /**
3825
+ * Save member notification preferences for this workspace
3826
+ * @description Replaces the in-app switches. `notificationChannels` may be omitted to keep stored cells. `email.status` = `off` is `400` `notification_channel_required`. Account `PUT /me/preferences` no longer changes the inbox or delivery.
3827
+ */
3828
+ put: operations["putWorkspaceNotificationPreferences"];
3829
+ post?: never;
3830
+ delete?: never;
3831
+ options?: never;
3832
+ head?: never;
3833
+ patch?: never;
3834
+ trace?: never;
3835
+ };
3812
3836
  "/workspaces/{workspaceId}/notifications": {
3813
3837
  parameters: {
3814
3838
  query?: never;
@@ -3849,6 +3873,26 @@ export interface paths {
3849
3873
  patch?: never;
3850
3874
  trace?: never;
3851
3875
  };
3876
+ "/workspaces/{workspaceId}/notifications/read": {
3877
+ parameters: {
3878
+ query?: never;
3879
+ header?: never;
3880
+ path?: never;
3881
+ cookie?: never;
3882
+ };
3883
+ get?: never;
3884
+ put?: never;
3885
+ /**
3886
+ * Mark selected notifications read
3887
+ * @description Marks only the given ids read for the current member in this workspace. Ids that are missing or belong to someone else are ignored. `ids` is 1 to 100 uuids.
3888
+ */
3889
+ post: operations["postNotificationsRead"];
3890
+ delete?: never;
3891
+ options?: never;
3892
+ head?: never;
3893
+ patch?: never;
3894
+ trace?: never;
3895
+ };
3852
3896
  "/workspaces/{workspaceId}/notifications/{id}/read": {
3853
3897
  parameters: {
3854
3898
  query?: never;
@@ -4236,7 +4280,7 @@ export interface paths {
4236
4280
  };
4237
4281
  /**
4238
4282
  * Finish Teams Microsoft sign-in
4239
- * @description Public redirect target. The one-time state was minted by a signed-in admin and still requires that user to be a workspace admin. Stores the bot token encrypted and redirects to `{spa}/settings?tab=preferences&chat=teams`.
4283
+ * @description Public redirect target. The one-time state was minted by a signed-in admin and still requires that user to be a workspace admin. Stores the bot token encrypted and redirects to `{spa}/workspace/preferences?chat=teams`.
4240
4284
  */
4241
4285
  get: operations["getTeamsIntegrationCallback"];
4242
4286
  put?: never;
@@ -8217,6 +8261,19 @@ export interface components {
8217
8261
  activity: components["schemas"]["NotificationChatDeliveryMode"];
8218
8262
  system: components["schemas"]["NotificationChatDeliveryMode"];
8219
8263
  };
8264
+ /** @description Message Center switches and delivery cells for one member in one workspace. */
8265
+ WorkspaceNotificationPreferencesDto: {
8266
+ notifications: components["schemas"]["NotificationPreferencesDto"];
8267
+ notificationChannels: components["schemas"]["NotificationChannelsDto"];
8268
+ };
8269
+ /** @description Body for `PUT /workspaces/{workspaceId}/notification-preferences`. Omit `notificationChannels` to keep stored cells. */
8270
+ PutWorkspaceNotificationPreferencesBodyDto: {
8271
+ notifications: components["schemas"]["NotificationPreferencesDto"];
8272
+ notificationChannels?: components["schemas"]["PutNotificationChannelsDto"];
8273
+ };
8274
+ NotificationReadIdsBodyDto: {
8275
+ ids: string[];
8276
+ };
8220
8277
  /** @description Delivery cells beside the in-app Message Center switches. Defaults: `email.status` is `digest`; every other cell is `off`. Inbox rows whose type is `integration` use the `status` cell. */
8221
8278
  NotificationChannelsDto: {
8222
8279
  email: components["schemas"]["NotificationEmailChannelsDto"];
@@ -11026,6 +11083,9 @@ export type NotificationEmailDeliveryMode = components['schemas']['NotificationE
11026
11083
  export type NotificationChatDeliveryMode = components['schemas']['NotificationChatDeliveryMode'];
11027
11084
  export type NotificationEmailChannelsDto = components['schemas']['NotificationEmailChannelsDto'];
11028
11085
  export type NotificationChatChannelsDto = components['schemas']['NotificationChatChannelsDto'];
11086
+ export type WorkspaceNotificationPreferencesDto = components['schemas']['WorkspaceNotificationPreferencesDto'];
11087
+ export type PutWorkspaceNotificationPreferencesBodyDto = components['schemas']['PutWorkspaceNotificationPreferencesBodyDto'];
11088
+ export type NotificationReadIdsBodyDto = components['schemas']['NotificationReadIdsBodyDto'];
11029
11089
  export type NotificationChannelsDto = components['schemas']['NotificationChannelsDto'];
11030
11090
  export type SlackInstallUrlDto = components['schemas']['SlackInstallUrlDto'];
11031
11091
  export type SlackIntegrationStatusDto = components['schemas']['SlackIntegrationStatusDto'];
@@ -20958,7 +21018,7 @@ export interface operations {
20958
21018
  /** @description Preference updated, or left unchanged for status email. */
20959
21019
  303: {
20960
21020
  headers: {
20961
- /** @description `{spa}/settings?tab=preferences` */
21021
+ /** @description `{spa}/workspace/preferences` */
20962
21022
  Location?: string;
20963
21023
  [name: string]: unknown;
20964
21024
  };
@@ -21243,6 +21303,71 @@ export interface operations {
21243
21303
  };
21244
21304
  };
21245
21305
  };
21306
+ getWorkspaceNotificationPreferences: {
21307
+ parameters: {
21308
+ query?: never;
21309
+ header?: never;
21310
+ path: {
21311
+ workspaceId: components["parameters"]["WorkspaceId"];
21312
+ };
21313
+ cookie?: never;
21314
+ };
21315
+ requestBody?: never;
21316
+ responses: {
21317
+ /** @description Preferences for this member in this workspace */
21318
+ 200: {
21319
+ headers: {
21320
+ [name: string]: unknown;
21321
+ };
21322
+ content: {
21323
+ "application/json": components["schemas"]["WorkspaceNotificationPreferencesDto"];
21324
+ };
21325
+ };
21326
+ 401: components["responses"]["Unauthorized"];
21327
+ };
21328
+ };
21329
+ putWorkspaceNotificationPreferences: {
21330
+ parameters: {
21331
+ query?: never;
21332
+ header?: never;
21333
+ path: {
21334
+ workspaceId: components["parameters"]["WorkspaceId"];
21335
+ };
21336
+ cookie?: never;
21337
+ };
21338
+ requestBody: {
21339
+ content: {
21340
+ "application/json": components["schemas"]["PutWorkspaceNotificationPreferencesBodyDto"];
21341
+ };
21342
+ };
21343
+ responses: {
21344
+ /** @description Saved preferences */
21345
+ 200: {
21346
+ headers: {
21347
+ [name: string]: unknown;
21348
+ };
21349
+ content: {
21350
+ "application/json": components["schemas"]["WorkspaceNotificationPreferencesDto"];
21351
+ };
21352
+ };
21353
+ /** @description Invalid body, or status email set to off */
21354
+ 400: {
21355
+ headers: {
21356
+ [name: string]: unknown;
21357
+ };
21358
+ content: {
21359
+ /**
21360
+ * @example {
21361
+ * "error": "Status email cannot be turned off",
21362
+ * "code": "notification_channel_required"
21363
+ * }
21364
+ */
21365
+ "application/json": components["schemas"]["ErrorMessageDto"];
21366
+ };
21367
+ };
21368
+ 401: components["responses"]["Unauthorized"];
21369
+ };
21370
+ };
21246
21371
  listNotifications: {
21247
21372
  parameters: {
21248
21373
  query?: {
@@ -21305,6 +21430,40 @@ export interface operations {
21305
21430
  401: components["responses"]["Unauthorized"];
21306
21431
  };
21307
21432
  };
21433
+ postNotificationsRead: {
21434
+ parameters: {
21435
+ query?: never;
21436
+ header?: never;
21437
+ path: {
21438
+ workspaceId: components["parameters"]["WorkspaceId"];
21439
+ };
21440
+ cookie?: never;
21441
+ };
21442
+ requestBody: {
21443
+ content: {
21444
+ "application/json": components["schemas"]["NotificationReadIdsBodyDto"];
21445
+ };
21446
+ };
21447
+ responses: {
21448
+ /** @description Updated */
21449
+ 204: {
21450
+ headers: {
21451
+ [name: string]: unknown;
21452
+ };
21453
+ content?: never;
21454
+ };
21455
+ /** @description Invalid ids */
21456
+ 400: {
21457
+ headers: {
21458
+ [name: string]: unknown;
21459
+ };
21460
+ content: {
21461
+ "application/json": components["schemas"]["ErrorMessageDto"];
21462
+ };
21463
+ };
21464
+ 401: components["responses"]["Unauthorized"];
21465
+ };
21466
+ };
21308
21467
  postNotificationRead: {
21309
21468
  parameters: {
21310
21469
  query?: never;