@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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.149.0
4
+ version: 2.150.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}/...`.
@@ -9200,6 +9200,295 @@ paths:
9200
9200
  "409":
9201
9201
  description: Corpus not ready
9202
9202
 
9203
+ /notifications/email/unsubscribe:
9204
+ get:
9205
+ tags: [Notifications]
9206
+ summary: Confirm a Message Center email unsubscribe (public)
9207
+ description: >
9208
+ **Unauthenticated.** Mail scanners prefetch GET, so this page does not change
9209
+ preferences. Status email cannot be turned off; the page says so. Other categories
9210
+ show a button that POSTs the same token. An unknown or expired token is `400` HTML.
9211
+ operationId: getNotificationEmailUnsubscribe
9212
+ security: []
9213
+ parameters:
9214
+ - name: token
9215
+ in: query
9216
+ required: true
9217
+ description: Opaque unsubscribe token from the email. Only its SHA-256 hash is stored.
9218
+ schema:
9219
+ type: string
9220
+ responses:
9221
+ "200":
9222
+ description: Confirm page. Preferences are unchanged.
9223
+ content:
9224
+ text/html:
9225
+ schema:
9226
+ type: string
9227
+ "400":
9228
+ description: Unknown or expired token
9229
+ content:
9230
+ text/html:
9231
+ schema:
9232
+ type: string
9233
+ post:
9234
+ tags: [Notifications]
9235
+ summary: Apply a Message Center email unsubscribe (public)
9236
+ description: >
9237
+ **Unauthenticated.** Sets that category's email cell to `off` when the category
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
9240
+ does not change preferences.
9241
+ operationId: postNotificationEmailUnsubscribe
9242
+ security: []
9243
+ parameters:
9244
+ - name: token
9245
+ in: query
9246
+ required: true
9247
+ description: Opaque unsubscribe token from the email. Only its SHA-256 hash is stored.
9248
+ schema:
9249
+ type: string
9250
+ responses:
9251
+ "303":
9252
+ description: Preference updated, or left unchanged for status email.
9253
+ headers:
9254
+ Location:
9255
+ description: "`{spa}/settings?tab=preferences`"
9256
+ schema:
9257
+ type: string
9258
+ "400":
9259
+ description: Unknown or expired token
9260
+ content:
9261
+ text/html:
9262
+ schema:
9263
+ type: string
9264
+ "200":
9265
+ description: Preference updated when no SPA origin is configured.
9266
+ content:
9267
+ text/html:
9268
+ schema:
9269
+ type: string
9270
+
9271
+ /workspaces/{workspaceId}/integrations/slack/install-url:
9272
+ get:
9273
+ tags: [Integrations]
9274
+ summary: Slack install URL for Message Center
9275
+ operationId: getSlackInstallUrl
9276
+ description: >
9277
+ Workspace admin only. Returns the Slack OAuth authorize URL. State is stored
9278
+ server-side and names this workspace and the signed-in admin. Editor or viewer
9279
+ is `403` with `code` `workspace_admin_required`. Missing Slack app settings are
9280
+ `503` with `code` `slack_not_configured`.
9281
+ security:
9282
+ - bearerAuth: []
9283
+ parameters:
9284
+ - $ref: "#/components/parameters/WorkspaceId"
9285
+ responses:
9286
+ "200":
9287
+ description: Slack authorize URL
9288
+ content:
9289
+ application/json:
9290
+ schema:
9291
+ $ref: "#/components/schemas/SlackInstallUrlDto"
9292
+ "401":
9293
+ $ref: "#/components/responses/Unauthorized"
9294
+ "403":
9295
+ description: Caller is not a workspace admin
9296
+ content:
9297
+ application/json:
9298
+ schema:
9299
+ $ref: "#/components/schemas/ErrorMessageDto"
9300
+ example:
9301
+ error: Forbidden
9302
+ code: workspace_admin_required
9303
+ "404":
9304
+ description: Workspace does not exist or malformed workspaceId
9305
+ content:
9306
+ application/json:
9307
+ schema:
9308
+ $ref: "#/components/schemas/ErrorMessageDto"
9309
+ "503":
9310
+ description: Slack app client id, secret, API origin, or SPA origin is unset
9311
+ content:
9312
+ application/json:
9313
+ schema:
9314
+ $ref: "#/components/schemas/ErrorMessageDto"
9315
+ example:
9316
+ error: Slack is not configured
9317
+ code: slack_not_configured
9318
+
9319
+ /integrations/slack/callback:
9320
+ get:
9321
+ tags: [Integrations]
9322
+ summary: Slack OAuth callback
9323
+ operationId: getSlackOauthCallback
9324
+ description: >
9325
+ Browser return from Slack. The provider redirect does not include the API
9326
+ bearer token. `state` was issued by `getSlackInstallUrl` to a signed-in admin
9327
+ and is single-use. The bot token is stored encrypted only when that user is
9328
+ still a workspace admin. Success redirects to
9329
+ `{spa}/settings?tab=preferences&chat=slack`. Failures redirect to the same
9330
+ page with `slack=error`. The token is never in the redirect.
9331
+ parameters:
9332
+ - name: code
9333
+ in: query
9334
+ schema:
9335
+ type: string
9336
+ - name: state
9337
+ in: query
9338
+ required: true
9339
+ schema:
9340
+ type: string
9341
+ - name: error
9342
+ in: query
9343
+ schema:
9344
+ type: string
9345
+ responses:
9346
+ "302":
9347
+ description: Redirect to Settings → Preferences
9348
+ headers:
9349
+ Location:
9350
+ schema:
9351
+ type: string
9352
+ "503":
9353
+ description: Slack app settings are unset and no SPA origin is available
9354
+ content:
9355
+ application/json:
9356
+ schema:
9357
+ $ref: "#/components/schemas/ErrorMessageDto"
9358
+
9359
+ /workspaces/{workspaceId}/integrations/slack:
9360
+ get:
9361
+ tags: [Integrations]
9362
+ summary: Slack connection status
9363
+ operationId: getSlackIntegration
9364
+ description: >
9365
+ Any workspace member. `{ connected, channelName }`. `channelName` is null
9366
+ until an admin saves a channel. The bot token is never returned.
9367
+ security:
9368
+ - bearerAuth: []
9369
+ parameters:
9370
+ - $ref: "#/components/parameters/WorkspaceId"
9371
+ responses:
9372
+ "200":
9373
+ description: Slack connection status
9374
+ content:
9375
+ application/json:
9376
+ schema:
9377
+ $ref: "#/components/schemas/SlackIntegrationStatusDto"
9378
+ "401":
9379
+ $ref: "#/components/responses/Unauthorized"
9380
+ "403":
9381
+ $ref: "#/components/responses/Forbidden"
9382
+ "404":
9383
+ description: Workspace does not exist or malformed workspaceId
9384
+ content:
9385
+ application/json:
9386
+ schema:
9387
+ $ref: "#/components/schemas/ErrorMessageDto"
9388
+ delete:
9389
+ tags: [Integrations]
9390
+ summary: Disconnect Slack
9391
+ operationId: deleteSlackIntegration
9392
+ description: >
9393
+ Workspace admin only. Removes the bot token and saved channel. Later
9394
+ Message Center delivery does not post to Slack.
9395
+ security:
9396
+ - bearerAuth: []
9397
+ parameters:
9398
+ - $ref: "#/components/parameters/WorkspaceId"
9399
+ responses:
9400
+ "204":
9401
+ description: Slack disconnected
9402
+ "401":
9403
+ $ref: "#/components/responses/Unauthorized"
9404
+ "403":
9405
+ description: Caller is not a workspace admin
9406
+ content:
9407
+ application/json:
9408
+ schema:
9409
+ $ref: "#/components/schemas/ErrorMessageDto"
9410
+ example:
9411
+ error: Forbidden
9412
+ code: workspace_admin_required
9413
+ "404":
9414
+ description: Workspace does not exist or malformed workspaceId
9415
+ content:
9416
+ application/json:
9417
+ schema:
9418
+ $ref: "#/components/schemas/ErrorMessageDto"
9419
+
9420
+ /workspaces/{workspaceId}/integrations/slack/channel:
9421
+ put:
9422
+ tags: [Integrations]
9423
+ summary: Save the Slack channel for Message Center
9424
+ operationId: putSlackChannel
9425
+ description: >
9426
+ Workspace admin only. Body `{ channelId }`. Slack must already be connected.
9427
+ The response is the same status object as `getSlackIntegration`, with the
9428
+ channel name Slack returned. Unknown or malformed `channelId` is `400`
9429
+ `invalid_slack_channel`. Not connected is `409` `slack_not_connected`.
9430
+ security:
9431
+ - bearerAuth: []
9432
+ parameters:
9433
+ - $ref: "#/components/parameters/WorkspaceId"
9434
+ requestBody:
9435
+ required: true
9436
+ content:
9437
+ application/json:
9438
+ schema:
9439
+ $ref: "#/components/schemas/SlackChannelBodyDto"
9440
+ responses:
9441
+ "200":
9442
+ description: Channel saved
9443
+ content:
9444
+ application/json:
9445
+ schema:
9446
+ $ref: "#/components/schemas/SlackIntegrationStatusDto"
9447
+ "400":
9448
+ description: channelId is missing, malformed, or unknown to Slack
9449
+ content:
9450
+ application/json:
9451
+ schema:
9452
+ $ref: "#/components/schemas/ErrorMessageDto"
9453
+ example:
9454
+ error: Slack channel was not found
9455
+ code: invalid_slack_channel
9456
+ "401":
9457
+ $ref: "#/components/responses/Unauthorized"
9458
+ "403":
9459
+ description: Caller is not a workspace admin
9460
+ content:
9461
+ application/json:
9462
+ schema:
9463
+ $ref: "#/components/schemas/ErrorMessageDto"
9464
+ example:
9465
+ error: Forbidden
9466
+ code: workspace_admin_required
9467
+ "404":
9468
+ description: Workspace does not exist or malformed workspaceId
9469
+ content:
9470
+ application/json:
9471
+ schema:
9472
+ $ref: "#/components/schemas/ErrorMessageDto"
9473
+ "409":
9474
+ description: Slack is not connected
9475
+ content:
9476
+ application/json:
9477
+ schema:
9478
+ $ref: "#/components/schemas/ErrorMessageDto"
9479
+ example:
9480
+ error: Slack is not connected
9481
+ code: slack_not_connected
9482
+ "502":
9483
+ description: Slack rejected the lookup
9484
+ content:
9485
+ application/json:
9486
+ schema:
9487
+ $ref: "#/components/schemas/ErrorMessageDto"
9488
+ example:
9489
+ error: Slack did not accept the channel
9490
+ code: slack_request_failed
9491
+
9203
9492
  /workspaces/{workspaceId}/notifications:
9204
9493
  get:
9205
9494
  tags: [Notifications]
@@ -18834,6 +19123,37 @@ components:
18834
19123
  teams:
18835
19124
  $ref: "#/components/schemas/NotificationChatChannelsDto"
18836
19125
 
19126
+ SlackInstallUrlDto:
19127
+ type: object
19128
+ additionalProperties: false
19129
+ required: [url]
19130
+ properties:
19131
+ url:
19132
+ type: string
19133
+ description: Slack OAuth authorize URL. The bot token is not included.
19134
+
19135
+ SlackIntegrationStatusDto:
19136
+ type: object
19137
+ additionalProperties: false
19138
+ required: [connected, channelName]
19139
+ properties:
19140
+ connected:
19141
+ type: boolean
19142
+ channelName:
19143
+ type: string
19144
+ nullable: true
19145
+ description: Saved channel name. Null until an admin saves a channel, and when disconnected.
19146
+
19147
+ SlackChannelBodyDto:
19148
+ type: object
19149
+ additionalProperties: false
19150
+ required: [channelId]
19151
+ properties:
19152
+ channelId:
19153
+ type: string
19154
+ minLength: 1
19155
+ maxLength: 32
19156
+
18837
19157
  PutNotificationEmailChannelsDto:
18838
19158
  type: object
18839
19159
  additionalProperties: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.149.0",
3
+ "version": "2.150.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",