@thinkai/tai-api-contract 2.148.0 → 2.149.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.148.0
4
+ version: 2.149.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}/...`.
@@ -9400,6 +9400,9 @@ paths:
9400
9400
  get:
9401
9401
  tags: [Preferences]
9402
9402
  summary: Get preferences for current user
9403
+ description: >
9404
+ Returns saved preferences, including `notificationChannels`. An empty or missing
9405
+ profile returns defaults (`email.status` is `digest`; every other channel cell is `off`).
9403
9406
  operationId: getMyPreferences
9404
9407
  responses:
9405
9408
  "200":
@@ -9413,13 +9416,20 @@ paths:
9413
9416
  put:
9414
9417
  tags: [Preferences]
9415
9418
  summary: Upsert preferences
9419
+ description: >
9420
+ Replaces the saved preferences object. Omitting `notificationChannels` keeps the
9421
+ stored cells, or the defaults when none are stored. A body that includes
9422
+ `notificationChannels` replaces those cells; any missing key inside it uses the
9423
+ default (`email.status` = `digest`, every other cell = `off`). Setting
9424
+ `email.status` to `off` returns 400 `notification_channel_required`. In-app
9425
+ `notifications` booleans are independent of these cells.
9416
9426
  operationId: putMyPreferences
9417
9427
  requestBody:
9418
9428
  required: true
9419
9429
  content:
9420
9430
  application/json:
9421
9431
  schema:
9422
- $ref: "#/components/schemas/PreferencesDto"
9432
+ $ref: "#/components/schemas/PutPreferencesBodyDto"
9423
9433
  responses:
9424
9434
  "200":
9425
9435
  description: Saved preferences
@@ -9428,11 +9438,15 @@ paths:
9428
9438
  schema:
9429
9439
  $ref: "#/components/schemas/PreferencesDto"
9430
9440
  "400":
9431
- description: Validation failed
9441
+ description: >
9442
+ Validation failed, or Status email was set to off
9443
+ (`code` `notification_channel_required`).
9432
9444
  content:
9433
9445
  application/json:
9434
9446
  schema:
9435
- $ref: "#/components/schemas/PreferencesValidationErrorDto"
9447
+ oneOf:
9448
+ - $ref: "#/components/schemas/PreferencesValidationErrorDto"
9449
+ - $ref: "#/components/schemas/NotificationChannelRequiredErrorDto"
9436
9450
  "401":
9437
9451
  $ref: "#/components/responses/Unauthorized"
9438
9452
 
@@ -9487,7 +9501,8 @@ paths:
9487
9501
  tags: [Me]
9488
9502
  summary: App chrome bootstrap payload
9489
9503
  description: >
9490
- Returns the authenticated user's profile, workspace list, and preferences in one response.
9504
+ Returns the authenticated user's profile, workspace list, and preferences
9505
+ (including `notificationChannels`) in one response.
9491
9506
  When `workspaceId` is provided and resolves to a workspace the caller belongs to, also
9492
9507
  returns platform banner, unread notification count (`count` and `hasUnreadCritical`), journey progress, and connectors
9493
9508
  snapshot. Invalid, unknown, or non-member `workspaceId` values do not produce 403/404 —
@@ -18753,9 +18768,156 @@ components:
18753
18768
  type: boolean
18754
18769
  description: System / platform announcements.
18755
18770
 
18771
+ NotificationEmailStatusMode:
18772
+ type: string
18773
+ description: >
18774
+ Status email delivery. `digest` (default) is the weekly mail. `immediate`
18775
+ sends as events arrive. `off` is not allowed.
18776
+ enum: [immediate, digest]
18777
+
18778
+ NotificationEmailDeliveryMode:
18779
+ type: string
18780
+ description: >
18781
+ Email delivery for comment, activity, or system. Default `off`.
18782
+ `immediate` sends as events arrive. `digest` is the weekly mail.
18783
+ enum: [off, immediate, digest]
18784
+
18785
+ NotificationChatDeliveryMode:
18786
+ type: string
18787
+ description: >
18788
+ Slack or Teams delivery for one category. Default `off` until that member
18789
+ changes the cell. `dm` is a direct message. `channel` posts to the workspace
18790
+ channel an admin saved. Connecting chat does not turn cells on.
18791
+ enum: [off, dm, channel]
18792
+
18793
+ NotificationEmailChannelsDto:
18794
+ type: object
18795
+ additionalProperties: false
18796
+ required: [status, comment, activity, system]
18797
+ properties:
18798
+ status:
18799
+ $ref: "#/components/schemas/NotificationEmailStatusMode"
18800
+ comment:
18801
+ $ref: "#/components/schemas/NotificationEmailDeliveryMode"
18802
+ activity:
18803
+ $ref: "#/components/schemas/NotificationEmailDeliveryMode"
18804
+ system:
18805
+ $ref: "#/components/schemas/NotificationEmailDeliveryMode"
18806
+
18807
+ NotificationChatChannelsDto:
18808
+ type: object
18809
+ additionalProperties: false
18810
+ required: [status, comment, activity, system]
18811
+ properties:
18812
+ status:
18813
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18814
+ comment:
18815
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18816
+ activity:
18817
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18818
+ system:
18819
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18820
+
18821
+ NotificationChannelsDto:
18822
+ type: object
18823
+ additionalProperties: false
18824
+ required: [email, slack, teams]
18825
+ description: >
18826
+ Delivery cells beside the in-app Message Center switches. Defaults:
18827
+ `email.status` is `digest`; every other cell is `off`. Inbox rows whose
18828
+ type is `integration` use the `status` cell.
18829
+ properties:
18830
+ email:
18831
+ $ref: "#/components/schemas/NotificationEmailChannelsDto"
18832
+ slack:
18833
+ $ref: "#/components/schemas/NotificationChatChannelsDto"
18834
+ teams:
18835
+ $ref: "#/components/schemas/NotificationChatChannelsDto"
18836
+
18837
+ PutNotificationEmailChannelsDto:
18838
+ type: object
18839
+ additionalProperties: false
18840
+ description: >
18841
+ Partial email cells. Omitted keys are filled with defaults on save
18842
+ (`status` = `digest`, other keys = `off`).
18843
+ properties:
18844
+ status:
18845
+ $ref: "#/components/schemas/NotificationEmailStatusMode"
18846
+ comment:
18847
+ $ref: "#/components/schemas/NotificationEmailDeliveryMode"
18848
+ activity:
18849
+ $ref: "#/components/schemas/NotificationEmailDeliveryMode"
18850
+ system:
18851
+ $ref: "#/components/schemas/NotificationEmailDeliveryMode"
18852
+
18853
+ PutNotificationChatChannelsDto:
18854
+ type: object
18855
+ additionalProperties: false
18856
+ description: Partial chat cells. Omitted keys default to `off` on save.
18857
+ properties:
18858
+ status:
18859
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18860
+ comment:
18861
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18862
+ activity:
18863
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18864
+ system:
18865
+ $ref: "#/components/schemas/NotificationChatDeliveryMode"
18866
+
18867
+ PutNotificationChannelsDto:
18868
+ type: object
18869
+ additionalProperties: false
18870
+ description: >
18871
+ Replaces stored channel cells when present on `PUT /me/preferences`.
18872
+ Omitted `email`, `slack`, or `teams` objects are filled with defaults.
18873
+ properties:
18874
+ email:
18875
+ $ref: "#/components/schemas/PutNotificationEmailChannelsDto"
18876
+ slack:
18877
+ $ref: "#/components/schemas/PutNotificationChatChannelsDto"
18878
+ teams:
18879
+ $ref: "#/components/schemas/PutNotificationChatChannelsDto"
18880
+
18756
18881
  PreferencesDto:
18757
18882
  type: object
18758
18883
  additionalProperties: false
18884
+ required:
18885
+ [
18886
+ theme,
18887
+ sidebarCollapsed,
18888
+ timezone,
18889
+ dataRefreshInterval,
18890
+ notifications,
18891
+ buddyEnabled,
18892
+ notificationChannels,
18893
+ ]
18894
+ properties:
18895
+ theme:
18896
+ $ref: "#/components/schemas/ThemePreference"
18897
+ sidebarCollapsed:
18898
+ type: boolean
18899
+ timezone:
18900
+ type: string
18901
+ description: IANA timezone name
18902
+ dataRefreshInterval:
18903
+ $ref: "#/components/schemas/DataRefreshInterval"
18904
+ notifications:
18905
+ $ref: "#/components/schemas/NotificationPreferencesDto"
18906
+ buddyEnabled:
18907
+ type: boolean
18908
+ default: false
18909
+ description: >
18910
+ When true, show the ThinkAI Buddy mascot. Default and missing stored
18911
+ values are false (opt-in only).
18912
+ notificationChannels:
18913
+ $ref: "#/components/schemas/NotificationChannelsDto"
18914
+
18915
+ PutPreferencesBodyDto:
18916
+ type: object
18917
+ additionalProperties: false
18918
+ description: >
18919
+ Body for `PUT /me/preferences`. `notificationChannels` may be omitted to keep
18920
+ stored cells.
18759
18921
  required:
18760
18922
  [theme, sidebarCollapsed, timezone, dataRefreshInterval, notifications, buddyEnabled]
18761
18923
  properties:
@@ -18776,6 +18938,20 @@ components:
18776
18938
  description: >
18777
18939
  When true, show the ThinkAI Buddy mascot. Default and missing stored
18778
18940
  values are false (opt-in only).
18941
+ notificationChannels:
18942
+ $ref: "#/components/schemas/PutNotificationChannelsDto"
18943
+
18944
+ NotificationChannelRequiredErrorDto:
18945
+ type: object
18946
+ additionalProperties: false
18947
+ required: [error, code]
18948
+ properties:
18949
+ error:
18950
+ type: string
18951
+ description: Status email cannot be turned off.
18952
+ code:
18953
+ type: string
18954
+ enum: [notification_channel_required]
18779
18955
 
18780
18956
  ValidationIssueDto:
18781
18957
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.148.0",
3
+ "version": "2.149.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3820,9 +3820,15 @@ export interface paths {
3820
3820
  path?: never;
3821
3821
  cookie?: never;
3822
3822
  };
3823
- /** Get preferences for current user */
3823
+ /**
3824
+ * Get preferences for current user
3825
+ * @description Returns saved preferences, including `notificationChannels`. An empty or missing profile returns defaults (`email.status` is `digest`; every other channel cell is `off`).
3826
+ */
3824
3827
  get: operations["getMyPreferences"];
3825
- /** Upsert preferences */
3828
+ /**
3829
+ * Upsert preferences
3830
+ * @description Replaces the saved preferences object. Omitting `notificationChannels` keeps the stored cells, or the defaults when none are stored. A body that includes `notificationChannels` replaces those cells; any missing key inside it uses the default (`email.status` = `digest`, every other cell = `off`). Setting `email.status` to `off` returns 400 `notification_channel_required`. In-app `notifications` booleans are independent of these cells.
3831
+ */
3826
3832
  put: operations["putMyPreferences"];
3827
3833
  post?: never;
3828
3834
  delete?: never;
@@ -3858,7 +3864,7 @@ export interface paths {
3858
3864
  };
3859
3865
  /**
3860
3866
  * App chrome bootstrap payload
3861
- * @description Returns the authenticated user's profile, workspace list, and preferences in one response. When `workspaceId` is provided and resolves to a workspace the caller belongs to, also returns platform banner, unread notification count (`count` and `hasUnreadCritical`), journey progress, and connectors snapshot. Invalid, unknown, or non-member `workspaceId` values do not produce 403/404 — the response is still 200 with only `me`, `workspaces`, and `preferences` (workspace-scoped fields omitted).
3867
+ * @description Returns the authenticated user's profile, workspace list, and preferences (including `notificationChannels`) in one response. When `workspaceId` is provided and resolves to a workspace the caller belongs to, also returns platform banner, unread notification count (`count` and `hasUnreadCritical`), journey progress, and connectors snapshot. Invalid, unknown, or non-member `workspaceId` values do not produce 403/404 — the response is still 200 with only `me`, `workspaces`, and `preferences` (workspace-scoped fields omitted).
3862
3868
  */
3863
3869
  get: operations["getAppShell"];
3864
3870
  put?: never;
@@ -7979,6 +7985,59 @@ export interface components {
7979
7985
  /** @description System / platform announcements. */
7980
7986
  system: boolean;
7981
7987
  };
7988
+ /**
7989
+ * @description Status email delivery. `digest` (default) is the weekly mail. `immediate` sends as events arrive. `off` is not allowed.
7990
+ * @enum {string}
7991
+ */
7992
+ NotificationEmailStatusMode: "immediate" | "digest";
7993
+ /**
7994
+ * @description Email delivery for comment, activity, or system. Default `off`. `immediate` sends as events arrive. `digest` is the weekly mail.
7995
+ * @enum {string}
7996
+ */
7997
+ NotificationEmailDeliveryMode: "off" | "immediate" | "digest";
7998
+ /**
7999
+ * @description Slack or Teams delivery for one category. Default `off` until that member changes the cell. `dm` is a direct message. `channel` posts to the workspace channel an admin saved. Connecting chat does not turn cells on.
8000
+ * @enum {string}
8001
+ */
8002
+ NotificationChatDeliveryMode: "off" | "dm" | "channel";
8003
+ NotificationEmailChannelsDto: {
8004
+ status: components["schemas"]["NotificationEmailStatusMode"];
8005
+ comment: components["schemas"]["NotificationEmailDeliveryMode"];
8006
+ activity: components["schemas"]["NotificationEmailDeliveryMode"];
8007
+ system: components["schemas"]["NotificationEmailDeliveryMode"];
8008
+ };
8009
+ NotificationChatChannelsDto: {
8010
+ status: components["schemas"]["NotificationChatDeliveryMode"];
8011
+ comment: components["schemas"]["NotificationChatDeliveryMode"];
8012
+ activity: components["schemas"]["NotificationChatDeliveryMode"];
8013
+ system: components["schemas"]["NotificationChatDeliveryMode"];
8014
+ };
8015
+ /** @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. */
8016
+ NotificationChannelsDto: {
8017
+ email: components["schemas"]["NotificationEmailChannelsDto"];
8018
+ slack: components["schemas"]["NotificationChatChannelsDto"];
8019
+ teams: components["schemas"]["NotificationChatChannelsDto"];
8020
+ };
8021
+ /** @description Partial email cells. Omitted keys are filled with defaults on save (`status` = `digest`, other keys = `off`). */
8022
+ PutNotificationEmailChannelsDto: {
8023
+ status?: components["schemas"]["NotificationEmailStatusMode"];
8024
+ comment?: components["schemas"]["NotificationEmailDeliveryMode"];
8025
+ activity?: components["schemas"]["NotificationEmailDeliveryMode"];
8026
+ system?: components["schemas"]["NotificationEmailDeliveryMode"];
8027
+ };
8028
+ /** @description Partial chat cells. Omitted keys default to `off` on save. */
8029
+ PutNotificationChatChannelsDto: {
8030
+ status?: components["schemas"]["NotificationChatDeliveryMode"];
8031
+ comment?: components["schemas"]["NotificationChatDeliveryMode"];
8032
+ activity?: components["schemas"]["NotificationChatDeliveryMode"];
8033
+ system?: components["schemas"]["NotificationChatDeliveryMode"];
8034
+ };
8035
+ /** @description Replaces stored channel cells when present on `PUT /me/preferences`. Omitted `email`, `slack`, or `teams` objects are filled with defaults. */
8036
+ PutNotificationChannelsDto: {
8037
+ email?: components["schemas"]["PutNotificationEmailChannelsDto"];
8038
+ slack?: components["schemas"]["PutNotificationChatChannelsDto"];
8039
+ teams?: components["schemas"]["PutNotificationChatChannelsDto"];
8040
+ };
7982
8041
  PreferencesDto: {
7983
8042
  theme: components["schemas"]["ThemePreference"];
7984
8043
  sidebarCollapsed: boolean;
@@ -7991,6 +8050,28 @@ export interface components {
7991
8050
  * @default false
7992
8051
  */
7993
8052
  buddyEnabled: boolean;
8053
+ notificationChannels: components["schemas"]["NotificationChannelsDto"];
8054
+ };
8055
+ /** @description Body for `PUT /me/preferences`. `notificationChannels` may be omitted to keep stored cells. */
8056
+ PutPreferencesBodyDto: {
8057
+ theme: components["schemas"]["ThemePreference"];
8058
+ sidebarCollapsed: boolean;
8059
+ /** @description IANA timezone name */
8060
+ timezone: string;
8061
+ dataRefreshInterval: components["schemas"]["DataRefreshInterval"];
8062
+ notifications: components["schemas"]["NotificationPreferencesDto"];
8063
+ /**
8064
+ * @description When true, show the ThinkAI Buddy mascot. Default and missing stored values are false (opt-in only).
8065
+ * @default false
8066
+ */
8067
+ buddyEnabled: boolean;
8068
+ notificationChannels?: components["schemas"]["PutNotificationChannelsDto"];
8069
+ };
8070
+ NotificationChannelRequiredErrorDto: {
8071
+ /** @description Status email cannot be turned off. */
8072
+ error: string;
8073
+ /** @enum {string} */
8074
+ code: "notification_channel_required";
7994
8075
  };
7995
8076
  ValidationIssueDto: {
7996
8077
  path: (string | number)[];
@@ -10720,7 +10801,18 @@ export type JourneyProgressUpdateDto = components['schemas']['JourneyProgressUpd
10720
10801
  export type ThemePreference = components['schemas']['ThemePreference'];
10721
10802
  export type DataRefreshInterval = components['schemas']['DataRefreshInterval'];
10722
10803
  export type NotificationPreferencesDto = components['schemas']['NotificationPreferencesDto'];
10804
+ export type NotificationEmailStatusMode = components['schemas']['NotificationEmailStatusMode'];
10805
+ export type NotificationEmailDeliveryMode = components['schemas']['NotificationEmailDeliveryMode'];
10806
+ export type NotificationChatDeliveryMode = components['schemas']['NotificationChatDeliveryMode'];
10807
+ export type NotificationEmailChannelsDto = components['schemas']['NotificationEmailChannelsDto'];
10808
+ export type NotificationChatChannelsDto = components['schemas']['NotificationChatChannelsDto'];
10809
+ export type NotificationChannelsDto = components['schemas']['NotificationChannelsDto'];
10810
+ export type PutNotificationEmailChannelsDto = components['schemas']['PutNotificationEmailChannelsDto'];
10811
+ export type PutNotificationChatChannelsDto = components['schemas']['PutNotificationChatChannelsDto'];
10812
+ export type PutNotificationChannelsDto = components['schemas']['PutNotificationChannelsDto'];
10723
10813
  export type PreferencesDto = components['schemas']['PreferencesDto'];
10814
+ export type PutPreferencesBodyDto = components['schemas']['PutPreferencesBodyDto'];
10815
+ export type NotificationChannelRequiredErrorDto = components['schemas']['NotificationChannelRequiredErrorDto'];
10724
10816
  export type ValidationIssueDto = components['schemas']['ValidationIssueDto'];
10725
10817
  export type PreferencesValidationErrorDto = components['schemas']['PreferencesValidationErrorDto'];
10726
10818
  export type ConsentCategoriesDto = components['schemas']['ConsentCategoriesDto'];
@@ -20837,7 +20929,7 @@ export interface operations {
20837
20929
  };
20838
20930
  requestBody: {
20839
20931
  content: {
20840
- "application/json": components["schemas"]["PreferencesDto"];
20932
+ "application/json": components["schemas"]["PutPreferencesBodyDto"];
20841
20933
  };
20842
20934
  };
20843
20935
  responses: {
@@ -20850,13 +20942,13 @@ export interface operations {
20850
20942
  "application/json": components["schemas"]["PreferencesDto"];
20851
20943
  };
20852
20944
  };
20853
- /** @description Validation failed */
20945
+ /** @description Validation failed, or Status email was set to off (`code` `notification_channel_required`). */
20854
20946
  400: {
20855
20947
  headers: {
20856
20948
  [name: string]: unknown;
20857
20949
  };
20858
20950
  content: {
20859
- "application/json": components["schemas"]["PreferencesValidationErrorDto"];
20951
+ "application/json": components["schemas"]["PreferencesValidationErrorDto"] | components["schemas"]["NotificationChannelRequiredErrorDto"];
20860
20952
  };
20861
20953
  };
20862
20954
  401: components["responses"]["Unauthorized"];