@thinkai/tai-api-contract 2.149.0 → 2.150.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.
@@ -3700,6 +3700,114 @@ export interface paths {
3700
3700
  patch?: never;
3701
3701
  trace?: never;
3702
3702
  };
3703
+ "/notifications/email/unsubscribe": {
3704
+ parameters: {
3705
+ query?: never;
3706
+ header?: never;
3707
+ path?: never;
3708
+ cookie?: never;
3709
+ };
3710
+ /**
3711
+ * Confirm a Message Center email unsubscribe (public)
3712
+ * @description **Unauthenticated.** Mail scanners prefetch GET, so this page does not change preferences. Status email cannot be turned off; the page says so. Other categories show a button that POSTs the same token. An unknown or expired token is `400` HTML.
3713
+ */
3714
+ get: operations["getNotificationEmailUnsubscribe"];
3715
+ put?: never;
3716
+ /**
3717
+ * Apply a Message Center email unsubscribe (public)
3718
+ * @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
+ */
3720
+ post: operations["postNotificationEmailUnsubscribe"];
3721
+ delete?: never;
3722
+ options?: never;
3723
+ head?: never;
3724
+ patch?: never;
3725
+ trace?: never;
3726
+ };
3727
+ "/workspaces/{workspaceId}/integrations/slack/install-url": {
3728
+ parameters: {
3729
+ query?: never;
3730
+ header?: never;
3731
+ path?: never;
3732
+ cookie?: never;
3733
+ };
3734
+ /**
3735
+ * Slack install URL for Message Center
3736
+ * @description Workspace admin only. Returns the Slack OAuth authorize URL. State is stored server-side and names this workspace and the signed-in admin. Editor or viewer is `403` with `code` `workspace_admin_required`. Missing Slack app settings are `503` with `code` `slack_not_configured`.
3737
+ */
3738
+ get: operations["getSlackInstallUrl"];
3739
+ put?: never;
3740
+ post?: never;
3741
+ delete?: never;
3742
+ options?: never;
3743
+ head?: never;
3744
+ patch?: never;
3745
+ trace?: never;
3746
+ };
3747
+ "/integrations/slack/callback": {
3748
+ parameters: {
3749
+ query?: never;
3750
+ header?: never;
3751
+ path?: never;
3752
+ cookie?: never;
3753
+ };
3754
+ /**
3755
+ * Slack OAuth callback
3756
+ * @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
+ */
3758
+ get: operations["getSlackOauthCallback"];
3759
+ put?: never;
3760
+ post?: never;
3761
+ delete?: never;
3762
+ options?: never;
3763
+ head?: never;
3764
+ patch?: never;
3765
+ trace?: never;
3766
+ };
3767
+ "/workspaces/{workspaceId}/integrations/slack": {
3768
+ parameters: {
3769
+ query?: never;
3770
+ header?: never;
3771
+ path?: never;
3772
+ cookie?: never;
3773
+ };
3774
+ /**
3775
+ * Slack connection status
3776
+ * @description Any workspace member. `{ connected, channelName }`. `channelName` is null until an admin saves a channel. The bot token is never returned.
3777
+ */
3778
+ get: operations["getSlackIntegration"];
3779
+ put?: never;
3780
+ post?: never;
3781
+ /**
3782
+ * Disconnect Slack
3783
+ * @description Workspace admin only. Removes the bot token and saved channel. Later Message Center delivery does not post to Slack.
3784
+ */
3785
+ delete: operations["deleteSlackIntegration"];
3786
+ options?: never;
3787
+ head?: never;
3788
+ patch?: never;
3789
+ trace?: never;
3790
+ };
3791
+ "/workspaces/{workspaceId}/integrations/slack/channel": {
3792
+ parameters: {
3793
+ query?: never;
3794
+ header?: never;
3795
+ path?: never;
3796
+ cookie?: never;
3797
+ };
3798
+ get?: never;
3799
+ /**
3800
+ * Save the Slack channel for Message Center
3801
+ * @description Workspace admin only. Body `{ channelId }`. Slack must already be connected. The response is the same status object as `getSlackIntegration`, with the channel name Slack returned. Unknown or malformed `channelId` is `400` `invalid_slack_channel`. Not connected is `409` `slack_not_connected`.
3802
+ */
3803
+ put: operations["putSlackChannel"];
3804
+ post?: never;
3805
+ delete?: never;
3806
+ options?: never;
3807
+ head?: never;
3808
+ patch?: never;
3809
+ trace?: never;
3810
+ };
3703
3811
  "/workspaces/{workspaceId}/notifications": {
3704
3812
  parameters: {
3705
3813
  query?: never;
@@ -8017,6 +8125,18 @@ export interface components {
8017
8125
  slack: components["schemas"]["NotificationChatChannelsDto"];
8018
8126
  teams: components["schemas"]["NotificationChatChannelsDto"];
8019
8127
  };
8128
+ SlackInstallUrlDto: {
8129
+ /** @description Slack OAuth authorize URL. The bot token is not included. */
8130
+ url: string;
8131
+ };
8132
+ SlackIntegrationStatusDto: {
8133
+ connected: boolean;
8134
+ /** @description Saved channel name. Null until an admin saves a channel, and when disconnected. */
8135
+ channelName: string | null;
8136
+ };
8137
+ SlackChannelBodyDto: {
8138
+ channelId: string;
8139
+ };
8020
8140
  /** @description Partial email cells. Omitted keys are filled with defaults on save (`status` = `digest`, other keys = `off`). */
8021
8141
  PutNotificationEmailChannelsDto: {
8022
8142
  status?: components["schemas"]["NotificationEmailStatusMode"];
@@ -10806,6 +10926,9 @@ export type NotificationChatDeliveryMode = components['schemas']['NotificationCh
10806
10926
  export type NotificationEmailChannelsDto = components['schemas']['NotificationEmailChannelsDto'];
10807
10927
  export type NotificationChatChannelsDto = components['schemas']['NotificationChatChannelsDto'];
10808
10928
  export type NotificationChannelsDto = components['schemas']['NotificationChannelsDto'];
10929
+ export type SlackInstallUrlDto = components['schemas']['SlackInstallUrlDto'];
10930
+ export type SlackIntegrationStatusDto = components['schemas']['SlackIntegrationStatusDto'];
10931
+ export type SlackChannelBodyDto = components['schemas']['SlackChannelBodyDto'];
10809
10932
  export type PutNotificationEmailChannelsDto = components['schemas']['PutNotificationEmailChannelsDto'];
10810
10933
  export type PutNotificationChatChannelsDto = components['schemas']['PutNotificationChatChannelsDto'];
10811
10934
  export type PutNotificationChannelsDto = components['schemas']['PutNotificationChannelsDto'];
@@ -20678,6 +20801,347 @@ export interface operations {
20678
20801
  };
20679
20802
  };
20680
20803
  };
20804
+ getNotificationEmailUnsubscribe: {
20805
+ parameters: {
20806
+ query: {
20807
+ /** @description Opaque unsubscribe token from the email. Only its SHA-256 hash is stored. */
20808
+ token: string;
20809
+ };
20810
+ header?: never;
20811
+ path?: never;
20812
+ cookie?: never;
20813
+ };
20814
+ requestBody?: never;
20815
+ responses: {
20816
+ /** @description Confirm page. Preferences are unchanged. */
20817
+ 200: {
20818
+ headers: {
20819
+ [name: string]: unknown;
20820
+ };
20821
+ content: {
20822
+ "text/html": string;
20823
+ };
20824
+ };
20825
+ /** @description Unknown or expired token */
20826
+ 400: {
20827
+ headers: {
20828
+ [name: string]: unknown;
20829
+ };
20830
+ content: {
20831
+ "text/html": string;
20832
+ };
20833
+ };
20834
+ };
20835
+ };
20836
+ postNotificationEmailUnsubscribe: {
20837
+ parameters: {
20838
+ query: {
20839
+ /** @description Opaque unsubscribe token from the email. Only its SHA-256 hash is stored. */
20840
+ token: string;
20841
+ };
20842
+ header?: never;
20843
+ path?: never;
20844
+ cookie?: never;
20845
+ };
20846
+ requestBody?: never;
20847
+ responses: {
20848
+ /** @description Preference updated when no SPA origin is configured. */
20849
+ 200: {
20850
+ headers: {
20851
+ [name: string]: unknown;
20852
+ };
20853
+ content: {
20854
+ "text/html": string;
20855
+ };
20856
+ };
20857
+ /** @description Preference updated, or left unchanged for status email. */
20858
+ 303: {
20859
+ headers: {
20860
+ /** @description `{spa}/settings?tab=preferences` */
20861
+ Location?: string;
20862
+ [name: string]: unknown;
20863
+ };
20864
+ content?: never;
20865
+ };
20866
+ /** @description Unknown or expired token */
20867
+ 400: {
20868
+ headers: {
20869
+ [name: string]: unknown;
20870
+ };
20871
+ content: {
20872
+ "text/html": string;
20873
+ };
20874
+ };
20875
+ };
20876
+ };
20877
+ getSlackInstallUrl: {
20878
+ parameters: {
20879
+ query?: never;
20880
+ header?: never;
20881
+ path: {
20882
+ workspaceId: components["parameters"]["WorkspaceId"];
20883
+ };
20884
+ cookie?: never;
20885
+ };
20886
+ requestBody?: never;
20887
+ responses: {
20888
+ /** @description Slack authorize URL */
20889
+ 200: {
20890
+ headers: {
20891
+ [name: string]: unknown;
20892
+ };
20893
+ content: {
20894
+ "application/json": components["schemas"]["SlackInstallUrlDto"];
20895
+ };
20896
+ };
20897
+ 401: components["responses"]["Unauthorized"];
20898
+ /** @description Caller is not a workspace admin */
20899
+ 403: {
20900
+ headers: {
20901
+ [name: string]: unknown;
20902
+ };
20903
+ content: {
20904
+ /**
20905
+ * @example {
20906
+ * "error": "Forbidden",
20907
+ * "code": "workspace_admin_required"
20908
+ * }
20909
+ */
20910
+ "application/json": components["schemas"]["ErrorMessageDto"];
20911
+ };
20912
+ };
20913
+ /** @description Workspace does not exist or malformed workspaceId */
20914
+ 404: {
20915
+ headers: {
20916
+ [name: string]: unknown;
20917
+ };
20918
+ content: {
20919
+ "application/json": components["schemas"]["ErrorMessageDto"];
20920
+ };
20921
+ };
20922
+ /** @description Slack app client id, secret, API origin, or SPA origin is unset */
20923
+ 503: {
20924
+ headers: {
20925
+ [name: string]: unknown;
20926
+ };
20927
+ content: {
20928
+ /**
20929
+ * @example {
20930
+ * "error": "Slack is not configured",
20931
+ * "code": "slack_not_configured"
20932
+ * }
20933
+ */
20934
+ "application/json": components["schemas"]["ErrorMessageDto"];
20935
+ };
20936
+ };
20937
+ };
20938
+ };
20939
+ getSlackOauthCallback: {
20940
+ parameters: {
20941
+ query: {
20942
+ code?: string;
20943
+ state: string;
20944
+ error?: string;
20945
+ };
20946
+ header?: never;
20947
+ path?: never;
20948
+ cookie?: never;
20949
+ };
20950
+ requestBody?: never;
20951
+ responses: {
20952
+ /** @description Redirect to Settings → Preferences */
20953
+ 302: {
20954
+ headers: {
20955
+ Location?: string;
20956
+ [name: string]: unknown;
20957
+ };
20958
+ content?: never;
20959
+ };
20960
+ /** @description Slack app settings are unset and no SPA origin is available */
20961
+ 503: {
20962
+ headers: {
20963
+ [name: string]: unknown;
20964
+ };
20965
+ content: {
20966
+ "application/json": components["schemas"]["ErrorMessageDto"];
20967
+ };
20968
+ };
20969
+ };
20970
+ };
20971
+ getSlackIntegration: {
20972
+ parameters: {
20973
+ query?: never;
20974
+ header?: never;
20975
+ path: {
20976
+ workspaceId: components["parameters"]["WorkspaceId"];
20977
+ };
20978
+ cookie?: never;
20979
+ };
20980
+ requestBody?: never;
20981
+ responses: {
20982
+ /** @description Slack connection status */
20983
+ 200: {
20984
+ headers: {
20985
+ [name: string]: unknown;
20986
+ };
20987
+ content: {
20988
+ "application/json": components["schemas"]["SlackIntegrationStatusDto"];
20989
+ };
20990
+ };
20991
+ 401: components["responses"]["Unauthorized"];
20992
+ 403: components["responses"]["Forbidden"];
20993
+ /** @description Workspace does not exist or malformed workspaceId */
20994
+ 404: {
20995
+ headers: {
20996
+ [name: string]: unknown;
20997
+ };
20998
+ content: {
20999
+ "application/json": components["schemas"]["ErrorMessageDto"];
21000
+ };
21001
+ };
21002
+ };
21003
+ };
21004
+ deleteSlackIntegration: {
21005
+ parameters: {
21006
+ query?: never;
21007
+ header?: never;
21008
+ path: {
21009
+ workspaceId: components["parameters"]["WorkspaceId"];
21010
+ };
21011
+ cookie?: never;
21012
+ };
21013
+ requestBody?: never;
21014
+ responses: {
21015
+ /** @description Slack disconnected */
21016
+ 204: {
21017
+ headers: {
21018
+ [name: string]: unknown;
21019
+ };
21020
+ content?: never;
21021
+ };
21022
+ 401: components["responses"]["Unauthorized"];
21023
+ /** @description Caller is not a workspace admin */
21024
+ 403: {
21025
+ headers: {
21026
+ [name: string]: unknown;
21027
+ };
21028
+ content: {
21029
+ /**
21030
+ * @example {
21031
+ * "error": "Forbidden",
21032
+ * "code": "workspace_admin_required"
21033
+ * }
21034
+ */
21035
+ "application/json": components["schemas"]["ErrorMessageDto"];
21036
+ };
21037
+ };
21038
+ /** @description Workspace does not exist or malformed workspaceId */
21039
+ 404: {
21040
+ headers: {
21041
+ [name: string]: unknown;
21042
+ };
21043
+ content: {
21044
+ "application/json": components["schemas"]["ErrorMessageDto"];
21045
+ };
21046
+ };
21047
+ };
21048
+ };
21049
+ putSlackChannel: {
21050
+ parameters: {
21051
+ query?: never;
21052
+ header?: never;
21053
+ path: {
21054
+ workspaceId: components["parameters"]["WorkspaceId"];
21055
+ };
21056
+ cookie?: never;
21057
+ };
21058
+ requestBody: {
21059
+ content: {
21060
+ "application/json": components["schemas"]["SlackChannelBodyDto"];
21061
+ };
21062
+ };
21063
+ responses: {
21064
+ /** @description Channel saved */
21065
+ 200: {
21066
+ headers: {
21067
+ [name: string]: unknown;
21068
+ };
21069
+ content: {
21070
+ "application/json": components["schemas"]["SlackIntegrationStatusDto"];
21071
+ };
21072
+ };
21073
+ /** @description channelId is missing, malformed, or unknown to Slack */
21074
+ 400: {
21075
+ headers: {
21076
+ [name: string]: unknown;
21077
+ };
21078
+ content: {
21079
+ /**
21080
+ * @example {
21081
+ * "error": "Slack channel was not found",
21082
+ * "code": "invalid_slack_channel"
21083
+ * }
21084
+ */
21085
+ "application/json": components["schemas"]["ErrorMessageDto"];
21086
+ };
21087
+ };
21088
+ 401: components["responses"]["Unauthorized"];
21089
+ /** @description Caller is not a workspace admin */
21090
+ 403: {
21091
+ headers: {
21092
+ [name: string]: unknown;
21093
+ };
21094
+ content: {
21095
+ /**
21096
+ * @example {
21097
+ * "error": "Forbidden",
21098
+ * "code": "workspace_admin_required"
21099
+ * }
21100
+ */
21101
+ "application/json": components["schemas"]["ErrorMessageDto"];
21102
+ };
21103
+ };
21104
+ /** @description Workspace does not exist or malformed workspaceId */
21105
+ 404: {
21106
+ headers: {
21107
+ [name: string]: unknown;
21108
+ };
21109
+ content: {
21110
+ "application/json": components["schemas"]["ErrorMessageDto"];
21111
+ };
21112
+ };
21113
+ /** @description Slack is not connected */
21114
+ 409: {
21115
+ headers: {
21116
+ [name: string]: unknown;
21117
+ };
21118
+ content: {
21119
+ /**
21120
+ * @example {
21121
+ * "error": "Slack is not connected",
21122
+ * "code": "slack_not_connected"
21123
+ * }
21124
+ */
21125
+ "application/json": components["schemas"]["ErrorMessageDto"];
21126
+ };
21127
+ };
21128
+ /** @description Slack rejected the lookup */
21129
+ 502: {
21130
+ headers: {
21131
+ [name: string]: unknown;
21132
+ };
21133
+ content: {
21134
+ /**
21135
+ * @example {
21136
+ * "error": "Slack did not accept the channel",
21137
+ * "code": "slack_request_failed"
21138
+ * }
21139
+ */
21140
+ "application/json": components["schemas"]["ErrorMessageDto"];
21141
+ };
21142
+ };
21143
+ };
21144
+ };
20681
21145
  listNotifications: {
20682
21146
  parameters: {
20683
21147
  query?: {