@thinkai/tai-api-contract 2.211.0 → 2.212.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.211.0
4
+ version: 2.212.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}/...`.
@@ -2893,8 +2893,9 @@ paths:
2893
2893
  tags: [Workspace]
2894
2894
  summary: Get enterprise SAML SSO configuration
2895
2895
  description: >
2896
- Returns per-workspace enterprise SSO binding (`ssoProviderId`, domains, join policy).
2897
- Member-level read. Does not return IdP metadata XML.
2896
+ Returns per-workspace enterprise SSO status (`pending` / `active` / …), domains,
2897
+ join policy, and optional IdP metadata URL. Member-level read. Does not return
2898
+ IdP metadata XML. `ssoProviderId` is present only after platform Apply.
2898
2899
  operationId: getWorkspaceEnterpriseSso
2899
2900
  parameters:
2900
2901
  - $ref: "#/components/parameters/WorkspaceId"
@@ -2917,13 +2918,14 @@ paths:
2917
2918
  $ref: "#/components/schemas/ErrorMessageDto"
2918
2919
  put:
2919
2920
  tags: [Workspace]
2920
- summary: Set enterprise SAML SSO configuration
2921
- description: >
2922
- Full-replace workspace enterprise SSO config. Bind a Supabase `sso_provider_id`
2923
- (from `supabase sso add` for Okta or Entra) and one or more email domains.
2924
- `joinPolicy: domain_auto_join` grants viewer membership on first `GET /me/workspaces`
2925
- after SSO login when the JWT email domain matches. Requires workspace **admin**.
2926
- Domains must be unique across enabled workspaces (`409 sso_domain_conflict`).
2921
+ summary: Submit or update a pending enterprise SSO request
2922
+ description: >
2923
+ Workspace **admin** submits Okta or Entra IdP details (`metadataUrl`, domains,
2924
+ join policy). Sets `status=pending`, `enabled=false`, and clears `ssoProviderId`.
2925
+ Platform admins register the IdP via `POST /admin/enterprise-sso/{workspaceId}/apply`.
2926
+ Domains must be unique across pending and active workspaces
2927
+ (`409 sso_domain_conflict`). Rejected when SSO is already active
2928
+ (`409 enterprise_sso_already_active`).
2927
2929
  operationId: putWorkspaceEnterpriseSso
2928
2930
  parameters:
2929
2931
  - $ref: "#/components/parameters/WorkspaceId"
@@ -2932,10 +2934,10 @@ paths:
2932
2934
  content:
2933
2935
  application/json:
2934
2936
  schema:
2935
- $ref: "#/components/schemas/WorkspaceSsoConfigDto"
2937
+ $ref: "#/components/schemas/WorkspaceSsoRequestDto"
2936
2938
  responses:
2937
2939
  "204":
2938
- description: Config persisted
2940
+ description: Pending request persisted
2939
2941
  "400":
2940
2942
  description: Invalid payload
2941
2943
  content:
@@ -2957,7 +2959,7 @@ paths:
2957
2959
  schema:
2958
2960
  $ref: "#/components/schemas/ErrorMessageDto"
2959
2961
  "409":
2960
- description: Email domain already bound to another workspace
2962
+ description: Domain conflict or SSO already active
2961
2963
  content:
2962
2964
  application/json:
2963
2965
  schema:
@@ -2968,6 +2970,111 @@ paths:
2968
2970
  error: Email domain acme.com is already bound to another workspace.
2969
2971
  code: sso_domain_conflict
2970
2972
 
2973
+ /admin/enterprise-sso/pending:
2974
+ get:
2975
+ tags: [PlatformAdmin]
2976
+ summary: List pending enterprise SSO requests
2977
+ description: Platform admin only. Returns workspaces with `status=pending`.
2978
+ operationId: listAdminEnterpriseSsoPending
2979
+ responses:
2980
+ "200":
2981
+ description: Pending queue
2982
+ content:
2983
+ application/json:
2984
+ schema:
2985
+ $ref: "#/components/schemas/AdminEnterpriseSsoPendingListDto"
2986
+ "401":
2987
+ $ref: "#/components/responses/Unauthorized"
2988
+ "403":
2989
+ $ref: "#/components/responses/Forbidden"
2990
+
2991
+ /admin/enterprise-sso/{workspaceId}/apply:
2992
+ post:
2993
+ tags: [PlatformAdmin]
2994
+ summary: Apply a pending enterprise SSO request
2995
+ description: >
2996
+ Platform admin only. Creates a SAML SSO provider on ThinkAI Auth from the
2997
+ workspace pending `metadataUrl` and domains, then sets `status=active` and
2998
+ `enabled=true`. `dedicatedScope` defaults to true when `idpType` is `entra`.
2999
+ operationId: postAdminEnterpriseSsoApply
3000
+ parameters:
3001
+ - $ref: "#/components/parameters/WorkspaceId"
3002
+ requestBody:
3003
+ required: false
3004
+ content:
3005
+ application/json:
3006
+ schema:
3007
+ $ref: "#/components/schemas/AdminEnterpriseSsoApplyRequestDto"
3008
+ responses:
3009
+ "200":
3010
+ description: Provider created and workspace activated
3011
+ content:
3012
+ application/json:
3013
+ schema:
3014
+ $ref: "#/components/schemas/AdminEnterpriseSsoApplyResponseDto"
3015
+ "400":
3016
+ description: Invalid pending payload
3017
+ content:
3018
+ application/json:
3019
+ schema:
3020
+ $ref: "#/components/schemas/ErrorMessageDto"
3021
+ "401":
3022
+ $ref: "#/components/responses/Unauthorized"
3023
+ "403":
3024
+ $ref: "#/components/responses/Forbidden"
3025
+ "404":
3026
+ description: Workspace not found
3027
+ content:
3028
+ application/json:
3029
+ schema:
3030
+ $ref: "#/components/schemas/ErrorMessageDto"
3031
+ "409":
3032
+ description: Not pending
3033
+ content:
3034
+ application/json:
3035
+ schema:
3036
+ $ref: "#/components/schemas/ErrorMessageDto"
3037
+ "502":
3038
+ description: ThinkAI Auth rejected provider create
3039
+ content:
3040
+ application/json:
3041
+ schema:
3042
+ $ref: "#/components/schemas/ErrorMessageDto"
3043
+
3044
+ /admin/enterprise-sso/{workspaceId}/reject:
3045
+ post:
3046
+ tags: [PlatformAdmin]
3047
+ summary: Reject a pending enterprise SSO request
3048
+ description: Platform admin only. Sets `status=rejected` and optional `rejectReason`.
3049
+ operationId: postAdminEnterpriseSsoReject
3050
+ parameters:
3051
+ - $ref: "#/components/parameters/WorkspaceId"
3052
+ requestBody:
3053
+ required: false
3054
+ content:
3055
+ application/json:
3056
+ schema:
3057
+ $ref: "#/components/schemas/AdminEnterpriseSsoRejectRequestDto"
3058
+ responses:
3059
+ "204":
3060
+ description: Rejected
3061
+ "401":
3062
+ $ref: "#/components/responses/Unauthorized"
3063
+ "403":
3064
+ $ref: "#/components/responses/Forbidden"
3065
+ "404":
3066
+ description: Workspace not found
3067
+ content:
3068
+ application/json:
3069
+ schema:
3070
+ $ref: "#/components/schemas/ErrorMessageDto"
3071
+ "409":
3072
+ description: Not pending
3073
+ content:
3074
+ application/json:
3075
+ schema:
3076
+ $ref: "#/components/schemas/ErrorMessageDto"
3077
+
2971
3078
  /workspaces/{workspaceId}/productivity-targets:
2972
3079
  get:
2973
3080
  tags: [Workspace]
@@ -10771,6 +10878,58 @@ paths:
10771
10878
  schema:
10772
10879
  $ref: "#/components/schemas/ErrorMessageDto"
10773
10880
 
10881
+ /workspaces/{workspaceId}/code-chat/knowledge-jobs/{jobId}/cancel:
10882
+ post:
10883
+ tags: [CodeChat]
10884
+ summary: Cancel a queued or running knowledge job
10885
+ description: >
10886
+ Any workspace member when Engineering Context Graph is on. Clears the worker lease so
10887
+ in-flight work stops at the next ownership check. Restores the index to ready when a
10888
+ usable graph already exists (`graph_json` and `node_count > 0`); otherwise marks the
10889
+ index failed with "Cancelled by user". Authz matches other CodeChat member routes
10890
+ (Code Intelligence enabled); unlike continue, no execution key is required.
10891
+ operationId: cancelCodeChatKnowledgeJob
10892
+ x-test-coverage-skip: thin HTTP over cancelKnowledgeJob store update; covered by stuck-recovery unit tests
10893
+ parameters:
10894
+ - $ref: "#/components/parameters/WorkspaceId"
10895
+ - name: jobId
10896
+ in: path
10897
+ required: true
10898
+ schema:
10899
+ type: string
10900
+ format: uuid
10901
+ description: Active knowledge job id (`tai_workspace_code_knowledge_jobs.id`).
10902
+ responses:
10903
+ "200":
10904
+ description: Job cancelled
10905
+ content:
10906
+ application/json:
10907
+ schema:
10908
+ type: object
10909
+ required: [job]
10910
+ properties:
10911
+ job:
10912
+ $ref: "#/components/schemas/CodeKnowledgeJobDto"
10913
+ "401":
10914
+ $ref: "#/components/responses/Unauthorized"
10915
+ "403":
10916
+ description: Engineering Context Graph is off
10917
+ content:
10918
+ application/json:
10919
+ schema:
10920
+ $ref: "#/components/schemas/ErrorMessageDto"
10921
+ example:
10922
+ error: Code Intelligence is disabled for this workspace
10923
+ code: code_intelligence_disabled
10924
+ "404":
10925
+ description: No active knowledge job to cancel
10926
+ content:
10927
+ application/json:
10928
+ schema:
10929
+ $ref: "#/components/schemas/ErrorMessageDto"
10930
+ example:
10931
+ error: No active knowledge job to cancel
10932
+
10774
10933
  /workspaces/{workspaceId}/code-chat/readiness:
10775
10934
  get:
10776
10935
  tags: [CodeChat]
@@ -17375,16 +17534,22 @@ components:
17375
17534
 
17376
17535
  WorkspaceSsoConfigDto:
17377
17536
  type: object
17378
- required: [enabled, ssoProviderId, domains, joinPolicy]
17537
+ required: [status, enabled, ssoProviderId, domains, joinPolicy]
17379
17538
  properties:
17539
+ status:
17540
+ type: string
17541
+ enum: [pending, active, rejected, disabled]
17542
+ description: >
17543
+ Lifecycle of the SSO binding. Sign-in (`/auth/sso-lookup`) is available only
17544
+ when `status` is `active` and `enabled` is true with a provider id.
17380
17545
  enabled:
17381
17546
  type: boolean
17382
- description: When true, enterprise SAML SSO is active for the listed domains.
17547
+ description: When true with `status=active`, enterprise SAML SSO is live for the listed domains.
17383
17548
  ssoProviderId:
17384
17549
  type: string
17385
17550
  format: uuid
17386
17551
  nullable: true
17387
- description: Supabase Auth SSO provider id from `supabase sso add` / dashboard.
17552
+ description: ThinkAI Auth SSO provider id set by platform Apply (null while pending).
17388
17553
  domains:
17389
17554
  type: array
17390
17555
  items:
@@ -17401,12 +17566,127 @@ components:
17401
17566
  type: string
17402
17567
  enum: [okta, entra, saml]
17403
17568
  nullable: true
17404
- description: Optional label for UI / ops (Okta, Microsoft Entra, or generic SAML).
17569
+ description: IdP label (Okta / Microsoft Entra; `saml` is legacy).
17570
+ metadataUrl:
17571
+ type: string
17572
+ format: uri
17573
+ nullable: true
17574
+ description: HTTPS IdP SAML metadata URL from the customer IdP admin.
17575
+ metadataRef:
17576
+ type: string
17577
+ nullable: true
17578
+ maxLength: 256
17579
+ description: Optional ops label; not the IdP metadata URL.
17580
+ rejectReason:
17581
+ type: string
17582
+ nullable: true
17583
+ maxLength: 500
17584
+ description: Present when `status` is `rejected`.
17585
+
17586
+ WorkspaceSsoRequestDto:
17587
+ type: object
17588
+ required: [idpType, metadataUrl, domains, joinPolicy]
17589
+ additionalProperties: false
17590
+ properties:
17591
+ idpType:
17592
+ type: string
17593
+ enum: [okta, entra]
17594
+ description: Which company IdP the workspace is connecting.
17595
+ metadataUrl:
17596
+ type: string
17597
+ format: uri
17598
+ description: HTTPS Identity Provider metadata URL from Okta or Entra.
17599
+ domains:
17600
+ type: array
17601
+ items:
17602
+ type: string
17603
+ minItems: 1
17604
+ maxItems: 50
17605
+ description: Work email domains that should use this IdP.
17606
+ example: [acme.com]
17607
+ joinPolicy:
17608
+ type: string
17609
+ enum: [invite_only, domain_auto_join]
17405
17610
  metadataRef:
17406
17611
  type: string
17407
17612
  nullable: true
17408
17613
  maxLength: 256
17409
- description: Ops-only label or URL reference; never raw SAML metadata XML.
17614
+ description: Optional internal ops label (not the metadata URL).
17615
+
17616
+ AdminEnterpriseSsoPendingListDto:
17617
+ type: object
17618
+ required: [items]
17619
+ properties:
17620
+ items:
17621
+ type: array
17622
+ items:
17623
+ $ref: "#/components/schemas/AdminEnterpriseSsoPendingItemDto"
17624
+
17625
+ AdminEnterpriseSsoPendingItemDto:
17626
+ type: object
17627
+ required: [workspaceId, workspaceSlug, workspaceName, submittedAt, domains, joinPolicy]
17628
+ properties:
17629
+ workspaceId:
17630
+ type: string
17631
+ format: uuid
17632
+ workspaceSlug:
17633
+ type: string
17634
+ workspaceName:
17635
+ type: string
17636
+ submittedAt:
17637
+ type: string
17638
+ format: date-time
17639
+ idpType:
17640
+ type: string
17641
+ enum: [okta, entra, saml]
17642
+ nullable: true
17643
+ domains:
17644
+ type: array
17645
+ items:
17646
+ type: string
17647
+ metadataUrl:
17648
+ type: string
17649
+ nullable: true
17650
+ joinPolicy:
17651
+ type: string
17652
+ enum: [invite_only, domain_auto_join]
17653
+ metadataRef:
17654
+ type: string
17655
+ nullable: true
17656
+
17657
+ AdminEnterpriseSsoApplyRequestDto:
17658
+ type: object
17659
+ additionalProperties: false
17660
+ properties:
17661
+ dedicatedScope:
17662
+ type: boolean
17663
+ description: >
17664
+ When true, Auth may allocate a dedicated ACS (recommended for Entra).
17665
+ Defaults to true for Entra and false for Okta when omitted.
17666
+
17667
+ AdminEnterpriseSsoApplyResponseDto:
17668
+ type: object
17669
+ required: [workspaceId, ssoProviderId, status, dedicatedScope]
17670
+ properties:
17671
+ workspaceId:
17672
+ type: string
17673
+ format: uuid
17674
+ ssoProviderId:
17675
+ type: string
17676
+ format: uuid
17677
+ status:
17678
+ type: string
17679
+ enum: [active]
17680
+ dedicatedScope:
17681
+ type: boolean
17682
+
17683
+ AdminEnterpriseSsoRejectRequestDto:
17684
+ type: object
17685
+ additionalProperties: false
17686
+ properties:
17687
+ reason:
17688
+ type: string
17689
+ maxLength: 500
17410
17690
 
17411
17691
  AuthSsoLookupDto:
17412
17692
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.211.0",
3
+ "version": "2.212.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",