@thinkai/tai-api-contract 2.94.0 → 2.96.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.94.0
4
+ version: 2.96.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}/...`.
@@ -1550,6 +1550,7 @@ paths:
1550
1550
  - $ref: "#/components/schemas/GrafanaSourceDto"
1551
1551
  - $ref: "#/components/schemas/SonarQubeSourceDto"
1552
1552
  - $ref: "#/components/schemas/PagerDutySourceDto"
1553
+ - $ref: "#/components/schemas/JiraSourceDto"
1553
1554
  - $ref: "#/components/schemas/TenantSourceEntryDto"
1554
1555
  examples:
1555
1556
  cursorAndJira:
@@ -1645,6 +1646,8 @@ paths:
1645
1646
  required; optional `branch`) calls `GET {baseUrl}/api/measures/component` with a Bearer
1646
1647
  token. Other types report `{ success: false, error: "unsupported_type" }`. Documented
1647
1648
  `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
1649
+ `jira` (`baseUrl`, `email`, `apiToken` or legacy `api_key`) calls
1650
+ `GET {baseUrl}/rest/api/3/myself` with Basic auth.
1648
1651
 
1649
1652
  **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the
1650
1653
  declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable
@@ -1668,6 +1671,7 @@ paths:
1668
1671
  - $ref: "#/components/schemas/GrafanaSourceDto"
1669
1672
  - $ref: "#/components/schemas/SonarQubeSourceDto"
1670
1673
  - $ref: "#/components/schemas/PagerDutySourceDto"
1674
+ - $ref: "#/components/schemas/JiraSourceDto"
1671
1675
  - $ref: "#/components/schemas/TenantSourceEntryDto"
1672
1676
  examples:
1673
1677
  cursorValid:
@@ -1733,6 +1737,80 @@ paths:
1733
1737
  "404":
1734
1738
  description: Workspace does not exist or malformed workspaceId
1735
1739
 
1740
+ /workspaces/{workspaceId}/integrations/sonarqube/repo-mappings:
1741
+ get:
1742
+ tags: [Workspace]
1743
+ summary: List SonarQube repo to project key mappings
1744
+ operationId: listSonarQubeRepoMappings
1745
+ parameters:
1746
+ - $ref: "#/components/parameters/WorkspaceId"
1747
+ responses:
1748
+ "200":
1749
+ description: Mappings for repos in this workspace
1750
+ content:
1751
+ application/json:
1752
+ schema:
1753
+ $ref: "#/components/schemas/SonarQubeRepoMappingsListDto"
1754
+ "401":
1755
+ $ref: "#/components/responses/Unauthorized"
1756
+ "403":
1757
+ $ref: "#/components/responses/Forbidden"
1758
+ put:
1759
+ tags: [Workspace]
1760
+ summary: Replace SonarQube repo mappings (full list)
1761
+ description: >
1762
+ Replaces all SonarQube repo→projectKey rows for the workspace. Validate rows in the UI
1763
+ before save; optional `POST .../validate` probes keys with the workspace token.
1764
+ operationId: putSonarQubeRepoMappings
1765
+ parameters:
1766
+ - $ref: "#/components/parameters/WorkspaceId"
1767
+ requestBody:
1768
+ required: true
1769
+ content:
1770
+ application/json:
1771
+ schema:
1772
+ $ref: "#/components/schemas/SonarQubeRepoMappingsPutDto"
1773
+ responses:
1774
+ "200":
1775
+ description: Mappings saved
1776
+ content:
1777
+ application/json:
1778
+ schema:
1779
+ $ref: "#/components/schemas/SonarQubeRepoMappingsListDto"
1780
+ "400":
1781
+ description: Unknown repo slug or invalid body
1782
+ "401":
1783
+ $ref: "#/components/responses/Unauthorized"
1784
+ "403":
1785
+ $ref: "#/components/responses/Forbidden"
1786
+
1787
+ /workspaces/{workspaceId}/integrations/sonarqube/repo-mappings/validate:
1788
+ post:
1789
+ tags: [Workspace]
1790
+ summary: Validate SonarQube mapping rows against the workspace token
1791
+ operationId: validateSonarQubeRepoMappings
1792
+ parameters:
1793
+ - $ref: "#/components/parameters/WorkspaceId"
1794
+ requestBody:
1795
+ required: true
1796
+ content:
1797
+ application/json:
1798
+ schema:
1799
+ $ref: "#/components/schemas/SonarQubeRepoMappingsPutDto"
1800
+ responses:
1801
+ "200":
1802
+ description: Per-row probe results
1803
+ content:
1804
+ application/json:
1805
+ schema:
1806
+ $ref: "#/components/schemas/SonarQubeRepoMappingsValidateResponseDto"
1807
+ "401":
1808
+ $ref: "#/components/responses/Unauthorized"
1809
+ "403":
1810
+ $ref: "#/components/responses/Forbidden"
1811
+ "503":
1812
+ description: SonarQube source not configured
1813
+
1736
1814
  /workspaces/{workspaceId}/sources/{type}:
1737
1815
  delete:
1738
1816
  tags: [Workspace]
@@ -5501,14 +5579,17 @@ paths:
5501
5579
  (issues plus optional remediation from `criteriaDetails`).
5502
5580
 
5503
5581
  The Markdown is grouped **by readiness dimension** (catalog order). Each dimension section
5504
- lists matching issues sorted by severity. Issue sections include severity in the heading
5505
- and do not emit per-issue `Fix status` / `Fix tier` lines. Default filter is outstanding
5506
- issues (`open` + `pr-pending`). Optional query params narrow the set. When `includeCriteria`
5507
- is true (default), each issue includes a Remediation section from the matching criterion when
5508
- available. Timestamps use the optional `timeZone` query (IANA; default `UTC`).
5582
+ lists matching issues sorted by severity. Issue sections include severity in the heading,
5583
+ export format version, issue/rubric metadata, agent workflow, and agent instructions from
5584
+ the rubric when available. Default filter is outstanding issues (`open` + `pr-pending`).
5585
+ Optional query params narrow the set. When `includeCriteria` is true (default), each issue
5586
+ also includes criterion summary/status in metadata and remediation from `criteriaDetails`
5587
+ when it differs from agent instructions. Agent workflow and rubric agent instructions are
5588
+ emitted regardless of `includeCriteria`. Timestamps use the optional `timeZone` query
5589
+ (IANA; default `UTC`).
5509
5590
 
5510
5591
  The response sets `Content-Disposition: attachment` with filename
5511
- `readiness-issues-{providerSlug}-{date}.md`.
5592
+ `readiness-remediations-{providerSlug}-{date}.md`.
5512
5593
  operationId: exportReadinessRepoIssuesMarkdown
5513
5594
  parameters:
5514
5595
  - $ref: "#/components/parameters/WorkspaceId"
@@ -5536,7 +5617,11 @@ paths:
5536
5617
  - name: includeCriteria
5537
5618
  in: query
5538
5619
  required: false
5539
- description: Include remediation from criteriaDetails (default true).
5620
+ description: >
5621
+ When true (default), include criterion summary/status in issue metadata and remediation
5622
+ from `criteriaDetails` (plus inline scan remediation paragraphs). Agent workflow and
5623
+ rubric agent instructions are always included. When false, omit criterion-derived metadata
5624
+ and criterion remediation only.
5540
5625
  schema:
5541
5626
  type: boolean
5542
5627
  default: true
@@ -9940,9 +10025,10 @@ components:
9940
10025
  SonarQubeSourceDto:
9941
10026
  type: object
9942
10027
  description: >
9943
- SonarQube source for workspace sources PUT and connection test. Every field is
10028
+ SonarQube source for workspace sources PUT and connection test. Credentials only —
10029
+ per-repository Sonar project keys are configured via repo mappings. Every field is
9944
10030
  re-submitted on each save; `token` is never round-tripped from `GET` workspace config.
9945
- required: [type, baseUrl, token, projectKey]
10031
+ required: [type, baseUrl, token]
9946
10032
  additionalProperties: false
9947
10033
  properties:
9948
10034
  type:
@@ -9952,7 +10038,7 @@ components:
9952
10038
  type: string
9953
10039
  minLength: 1
9954
10040
  maxLength: 2048
9955
- description: SonarQube server URL, e.g. https://sonarqube.example.com.
10041
+ description: SonarQube server URL, e.g. https://sonarcloud.io or https://sonarqube.example.com.
9956
10042
  token:
9957
10043
  type: string
9958
10044
  minLength: 1
@@ -9960,22 +10046,22 @@ components:
9960
10046
  description: >
9961
10047
  User or project analysis token (write-only on PUT). Literal tokens are
9962
10048
  encrypted at rest. Operator-managed secrets may use an `env:VAR` reference
9963
- (resolved at runtime / batch poll), matching other non-AI-tool sources.
9964
- projectKey:
10049
+ (resolved at runtime), matching other non-AI-tool sources.
10050
+ organization:
9965
10051
  type: string
9966
10052
  minLength: 1
9967
- maxLength: 400
9968
- description: SonarQube project key (component key).
10053
+ maxLength: 255
10054
+ description: SonarCloud organization key (required for project search on SonarCloud).
9969
10055
  branch:
9970
10056
  type: string
9971
10057
  minLength: 1
9972
10058
  maxLength: 255
9973
- description: Optional branch name for branch-scoped measures.
10059
+ description: Optional workspace default branch fallback for per-repo Sonar probes.
9974
10060
 
9975
10061
  SonarQubeSourceConfigDto:
9976
10062
  type: object
9977
10063
  description: Redacted SonarQube source returned by GET workspace config.
9978
- required: [type, hasToken, baseUrl, projectKey]
10064
+ required: [type, hasToken, baseUrl]
9979
10065
  additionalProperties: false
9980
10066
  properties:
9981
10067
  type:
@@ -9985,10 +10071,88 @@ components:
9985
10071
  type: boolean
9986
10072
  baseUrl:
9987
10073
  type: string
10074
+ organization:
10075
+ type: string
10076
+ branch:
10077
+ type: string
10078
+
10079
+ SonarQubeRepoMappingDto:
10080
+ type: object
10081
+ required: [providerSlug, projectKey]
10082
+ additionalProperties: false
10083
+ properties:
10084
+ providerSlug:
10085
+ type: string
10086
+ minLength: 1
10087
+ description: Repository slug (`owner/repo`) in the workspace catalog.
9988
10088
  projectKey:
9989
10089
  type: string
10090
+ minLength: 1
10091
+ maxLength: 400
9990
10092
  branch:
9991
10093
  type: string
10094
+ minLength: 1
10095
+ maxLength: 255
10096
+ description: Optional branch override for Sonar API calls for this repo.
10097
+
10098
+ SonarQubeRepoMappingRowDto:
10099
+ allOf:
10100
+ - $ref: "#/components/schemas/SonarQubeRepoMappingDto"
10101
+ - type: object
10102
+ required: [repoId, updatedAt]
10103
+ properties:
10104
+ repoId:
10105
+ type: string
10106
+ format: uuid
10107
+ updatedAt:
10108
+ type: string
10109
+ format: date-time
10110
+
10111
+ SonarQubeRepoMappingsPutDto:
10112
+ type: object
10113
+ required: [mappings]
10114
+ additionalProperties: false
10115
+ properties:
10116
+ mappings:
10117
+ type: array
10118
+ items:
10119
+ $ref: "#/components/schemas/SonarQubeRepoMappingDto"
10120
+
10121
+ SonarQubeRepoMappingsListDto:
10122
+ type: object
10123
+ required: [mappings]
10124
+ additionalProperties: false
10125
+ properties:
10126
+ mappings:
10127
+ type: array
10128
+ items:
10129
+ $ref: "#/components/schemas/SonarQubeRepoMappingRowDto"
10130
+
10131
+ SonarQubeRepoMappingValidateRowDto:
10132
+ type: object
10133
+ required: [providerSlug, projectKey, ok]
10134
+ additionalProperties: false
10135
+ properties:
10136
+ providerSlug:
10137
+ type: string
10138
+ projectKey:
10139
+ type: string
10140
+ branch:
10141
+ type: string
10142
+ ok:
10143
+ type: boolean
10144
+ error:
10145
+ type: string
10146
+
10147
+ SonarQubeRepoMappingsValidateResponseDto:
10148
+ type: object
10149
+ required: [results]
10150
+ additionalProperties: false
10151
+ properties:
10152
+ results:
10153
+ type: array
10154
+ items:
10155
+ $ref: "#/components/schemas/SonarQubeRepoMappingValidateRowDto"
9992
10156
 
9993
10157
  PagerDutySourceDto:
9994
10158
  type: object
@@ -10041,6 +10205,73 @@ components:
10041
10205
  type: string
10042
10206
  description: PagerDuty user email when known from the last successful verify.
10043
10207
 
10208
+ JiraSourceDto:
10209
+ type: object
10210
+ description: >
10211
+ Jira Cloud source for `PUT /workspaces/{workspaceId}/sources` and
10212
+ `POST /workspaces/{workspaceId}/sources/test`. Uses Atlassian Cloud email + API token
10213
+ (Basic auth). Provide `apiToken` (preferred) or legacy write-only `api_key`; the server
10214
+ normalizes `api_key` to `apiToken` on write.
10215
+ required: [type, baseUrl, email]
10216
+ additionalProperties: false
10217
+ properties:
10218
+ type:
10219
+ type: string
10220
+ enum: [jira]
10221
+ baseUrl:
10222
+ type: string
10223
+ minLength: 1
10224
+ description: Jira Cloud site URL (e.g. `https://your-domain.atlassian.net`).
10225
+ email:
10226
+ type: string
10227
+ minLength: 1
10228
+ description: Atlassian account email used with the API token.
10229
+ apiToken:
10230
+ type: string
10231
+ minLength: 1
10232
+ maxLength: 512
10233
+ description: Atlassian API token (write-only on PUT; preferred).
10234
+ api_key:
10235
+ type: string
10236
+ minLength: 1
10237
+ maxLength: 512
10238
+ description: >
10239
+ Deprecated write-only alias for `apiToken`. Accepted for backward compatibility;
10240
+ normalized to `apiToken` and never returned on GET `/config`.
10241
+ userName:
10242
+ type: string
10243
+ description: Optional display name from a successful connection test (echo-after-test).
10244
+ accountId:
10245
+ type: string
10246
+ description: Optional Atlassian account id from a successful connection test.
10247
+
10248
+ JiraSourceConfigDto:
10249
+ type: object
10250
+ description: >
10251
+ Redacted Jira source returned by `GET /workspaces/{workspaceId}/config`.
10252
+ Raw API token is never returned.
10253
+ required: [type, hasToken, baseUrl, email]
10254
+ additionalProperties: false
10255
+ properties:
10256
+ type:
10257
+ type: string
10258
+ enum: [jira]
10259
+ hasToken:
10260
+ type: boolean
10261
+ description: Whether an API token is stored for this workspace.
10262
+ baseUrl:
10263
+ type: string
10264
+ description: Configured Jira Cloud site URL.
10265
+ email:
10266
+ type: string
10267
+ description: Atlassian account email associated with the stored token.
10268
+ userName:
10269
+ type: string
10270
+ description: Display name when known from the last successful verify.
10271
+ accountId:
10272
+ type: string
10273
+ description: Atlassian account id when known from the last successful verify.
10274
+
10044
10275
  AgentExecutionProviderDto:
10045
10276
  type: string
10046
10277
  description: >
@@ -10092,6 +10323,7 @@ components:
10092
10323
  - $ref: "#/components/schemas/GrafanaSourceConfigDto"
10093
10324
  - $ref: "#/components/schemas/SonarQubeSourceConfigDto"
10094
10325
  - $ref: "#/components/schemas/PagerDutySourceConfigDto"
10326
+ - $ref: "#/components/schemas/JiraSourceConfigDto"
10095
10327
  - $ref: "#/components/schemas/TenantSourceEntryDto"
10096
10328
  orgChart:
10097
10329
  nullable: true
@@ -10169,13 +10401,13 @@ components:
10169
10401
  description: Error detail when `executionKeyValid` is false.
10170
10402
  userName:
10171
10403
  type: string
10172
- description: Present for New Relic or Grafana verify success — authenticated user name.
10404
+ description: Present for New Relic, Grafana, PagerDuty, or Jira verify success — authenticated user name.
10173
10405
  accountName:
10174
10406
  type: string
10175
10407
  description: Present for New Relic verify success — resolved account display name.
10176
10408
  accountId:
10177
10409
  type: string
10178
- description: Present for New Relic verify success — resolved account ID.
10410
+ description: Present for New Relic or Jira verify success — resolved account ID.
10179
10411
  orgName:
10180
10412
  type: string
10181
10413
  description: Present for Grafana verify success — resolved organization name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.94.0",
3
+ "version": "2.96.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",