@thinkai/tai-api-contract 2.68.0-pr.945.8ba31b6f → 2.69.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.68.0
4
+ version: 2.69.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}/...`.
@@ -1282,7 +1282,8 @@ paths:
1282
1282
  ignored at runtime; verification and future refresh use the fixed Cursor Admin API host.
1283
1283
  Other types pass through with only a
1284
1284
  non-empty `type` requirement so existing
1285
- jira / sonarqube / bitbucket callers are not regressed.
1285
+ jira / bitbucket callers are not regressed. `sonarqube` entries get strict validation
1286
+ (`baseUrl`, `token`, `projectKey` required; optional `branch`).
1286
1287
  **`type: github` is rejected** with HTTP 400 and `code: github_sources_deprecated`; use the
1287
1288
  GitHub App integration (`POST /workspaces/{workspaceId}/integrations/github/install-url` and callback) instead.
1288
1289
 
@@ -1325,6 +1326,7 @@ paths:
1325
1326
  - $ref: "#/components/schemas/NewRelicSourceDto"
1326
1327
  - $ref: "#/components/schemas/PrometheusSourceDto"
1327
1328
  - $ref: "#/components/schemas/GrafanaSourceDto"
1329
+ - $ref: "#/components/schemas/SonarQubeSourceDto"
1328
1330
  - $ref: "#/components/schemas/TenantSourceEntryDto"
1329
1331
  examples:
1330
1332
  cursorAndJira:
@@ -1416,9 +1418,10 @@ paths:
1416
1418
  for service accounts) and return `executionKeyValid` / `executionKeyError` without calling
1417
1419
  the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`.
1418
1420
  `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an
1419
- organization Admin API key `sk-ant-admin...`). Other types report
1420
- `{ success: false, error: "unsupported_type" }`. Documented `error`
1421
- codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
1421
+ organization Admin API key `sk-ant-admin...`). `sonarqube` (`baseUrl`, `token`, `projectKey`
1422
+ required; optional `branch`) calls `GET {baseUrl}/api/measures/component` with a Bearer
1423
+ token. Other types report `{ success: false, error: "unsupported_type" }`. Documented
1424
+ `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
1422
1425
 
1423
1426
  **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the
1424
1427
  declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable
@@ -1439,6 +1442,7 @@ paths:
1439
1442
  - $ref: "#/components/schemas/NewRelicSourceDto"
1440
1443
  - $ref: "#/components/schemas/PrometheusSourceDto"
1441
1444
  - $ref: "#/components/schemas/GrafanaSourceDto"
1445
+ - $ref: "#/components/schemas/SonarQubeSourceDto"
1442
1446
  - $ref: "#/components/schemas/TenantSourceEntryDto"
1443
1447
  examples:
1444
1448
  cursorValid:
@@ -1456,6 +1460,13 @@ paths:
1456
1460
  value:
1457
1461
  type: claude
1458
1462
  token: sk-ant-admin-example-key
1463
+ sonarqubeValid:
1464
+ summary: SonarQube source for connection test
1465
+ value:
1466
+ type: sonarqube
1467
+ baseUrl: https://sonarqube.example.com
1468
+ token: sonarqube_api_token_example
1469
+ projectKey: my-project
1459
1470
  githubShape:
1460
1471
  summary: GitHub-shaped body (non-AI-tool types return unsupported_type unless extended)
1461
1472
  value:
@@ -8683,6 +8694,59 @@ components:
8683
8694
  orgName:
8684
8695
  type: string
8685
8696
 
8697
+ SonarQubeSourceDto:
8698
+ type: object
8699
+ description: >
8700
+ SonarQube source for workspace sources PUT and connection test. Every field is
8701
+ re-submitted on each save; `token` is never round-tripped from `GET` workspace config.
8702
+ required: [type, baseUrl, token, projectKey]
8703
+ additionalProperties: false
8704
+ properties:
8705
+ type:
8706
+ type: string
8707
+ enum: [sonarqube]
8708
+ baseUrl:
8709
+ type: string
8710
+ minLength: 1
8711
+ maxLength: 2048
8712
+ description: SonarQube server URL, e.g. https://sonarqube.example.com.
8713
+ token:
8714
+ type: string
8715
+ minLength: 1
8716
+ maxLength: 512
8717
+ description: >
8718
+ User or project analysis token (write-only on PUT). Literal tokens are
8719
+ encrypted at rest. Operator-managed secrets may use an `env:VAR` reference
8720
+ (resolved at runtime / batch poll), matching other non-AI-tool sources.
8721
+ projectKey:
8722
+ type: string
8723
+ minLength: 1
8724
+ maxLength: 400
8725
+ description: SonarQube project key (component key).
8726
+ branch:
8727
+ type: string
8728
+ minLength: 1
8729
+ maxLength: 255
8730
+ description: Optional branch name for branch-scoped measures.
8731
+
8732
+ SonarQubeSourceConfigDto:
8733
+ type: object
8734
+ description: Redacted SonarQube source returned by GET workspace config.
8735
+ required: [type, hasToken, baseUrl, projectKey]
8736
+ additionalProperties: false
8737
+ properties:
8738
+ type:
8739
+ type: string
8740
+ enum: [sonarqube]
8741
+ hasToken:
8742
+ type: boolean
8743
+ baseUrl:
8744
+ type: string
8745
+ projectKey:
8746
+ type: string
8747
+ branch:
8748
+ type: string
8749
+
8686
8750
  AgentExecutionProviderDto:
8687
8751
  type: string
8688
8752
  description: >
@@ -8709,6 +8773,7 @@ components:
8709
8773
  - $ref: "#/components/schemas/NewRelicSourceConfigDto"
8710
8774
  - $ref: "#/components/schemas/PrometheusSourceConfigDto"
8711
8775
  - $ref: "#/components/schemas/GrafanaSourceConfigDto"
8776
+ - $ref: "#/components/schemas/SonarQubeSourceConfigDto"
8712
8777
  - $ref: "#/components/schemas/TenantSourceEntryDto"
8713
8778
  orgChart:
8714
8779
  nullable: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.68.0-pr.945.8ba31b6f",
3
+ "version": "2.69.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -491,7 +491,7 @@ export interface paths {
491
491
  get?: never;
492
492
  /**
493
493
  * Replace workspace data sources
494
- * @description Replace the workspace's `sources` array. Cursor entries are validated strictly (`token` 1-256 chars, no whitespace, no `env:` prefix; optional deprecated `baseUrl` is accepted for backwards compatibility and ignored at runtime; verification and future refresh use the fixed Cursor Admin API host. Other types pass through with only a non-empty `type` requirement so existing jira / sonarqube / bitbucket callers are not regressed. **`type: github` is rejected** with HTTP 400 and `code: github_sources_deprecated`; use the GitHub App integration (`POST /workspaces/{workspaceId}/integrations/github/install-url` and callback) instead.
494
+ * @description Replace the workspace's `sources` array. Cursor entries are validated strictly (`token` 1-256 chars, no whitespace, no `env:` prefix; optional deprecated `baseUrl` is accepted for backwards compatibility and ignored at runtime; verification and future refresh use the fixed Cursor Admin API host. Other types pass through with only a non-empty `type` requirement so existing jira / bitbucket callers are not regressed. `sonarqube` entries get strict validation (`baseUrl`, `token`, `projectKey` required; optional `branch`). **`type: github` is rejected** with HTTP 400 and `code: github_sources_deprecated`; use the GitHub App integration (`POST /workspaces/{workspaceId}/integrations/github/install-url` and callback) instead.
495
495
  * Every secret-keyed top-level string field (`token`, `password`, `api_key`, `secret`, `private_key`, `client_secret`) is encrypted at rest with AES-256-GCM under `SOURCES_TOKEN_ENC_KEY` before persistence; `env:`-prefixed values pass through unchanged. `GET /workspaces/{workspaceId}/config` continues to redact every secret-keyed field to `***` regardless of whether the stored value is encrypted, plaintext, or `env:` ref.
496
496
  * Requires editor or admin workspace role.
497
497
  * **Typical outcomes:** Valid typed sources → `200` with `{ ok: true, workspaceId }`. Missing required fields for a given `type` → `400` with `error` text. Unknown `type` strings (non-AI-tool, non-github) currently pass through to storage (lenient compatibility). Registered AI tools (`cursor`, `claude`) get strict field validation (no whitespace, no `env:` prefix on tokens). For `cursor`, each PUT entry may include `token` (admin key), `executionToken` (execution key), or both; at least one key field is required per entry. Cursor-specific `400` codes: `cursor_execution_token_is_admin_key` (admin key in `executionToken`), `invalid_cursor_execution_token` (execution key failed Cloud Agents verification).
@@ -516,7 +516,7 @@ export interface paths {
516
516
  /**
517
517
  * Test one source connection (does not persist)
518
518
  * @description Verify a source's credentials without persisting them. Always returns 200 — upstream auth, rate-limit, and network failures surface as `{ success: false, error }` so the SPA can render an inline error.
519
- * Registered AI tools are verified end-to-end: `cursor` (Admin API key in `token` and/or execution key in `executionToken`; at least one must be present). Execution-only tests validate the key against the Cloud Agents API (`GET /v1/me`, with `GET /v1/models` fallback for service accounts) and return `executionKeyValid` / `executionKeyError` without calling the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`. `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an organization Admin API key `sk-ant-admin...`). Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
519
+ * Registered AI tools are verified end-to-end: `cursor` (Admin API key in `token` and/or execution key in `executionToken`; at least one must be present). Execution-only tests validate the key against the Cloud Agents API (`GET /v1/me`, with `GET /v1/models` fallback for service accounts) and return `executionKeyValid` / `executionKeyError` without calling the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`. `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an organization Admin API key `sk-ant-admin...`). `sonarqube` (`baseUrl`, `token`, `projectKey` required; optional `branch`) calls `GET {baseUrl}/api/measures/component` with a Bearer token. Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
520
520
  * **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable service → `200` with `{ success: false, error: "..." }`.
521
521
  */
522
522
  post: operations["postTenantSourceTest"];
@@ -3415,6 +3415,28 @@ export interface components {
3415
3415
  orgId?: string;
3416
3416
  orgName?: string;
3417
3417
  };
3418
+ /** @description SonarQube source for workspace sources PUT and connection test. Every field is re-submitted on each save; `token` is never round-tripped from `GET` workspace config. */
3419
+ SonarQubeSourceDto: {
3420
+ /** @enum {string} */
3421
+ type: "sonarqube";
3422
+ /** @description SonarQube server URL, e.g. https://sonarqube.example.com. */
3423
+ baseUrl: string;
3424
+ /** @description User or project analysis token (write-only on PUT). Literal tokens are encrypted at rest. Operator-managed secrets may use an `env:VAR` reference (resolved at runtime / batch poll), matching other non-AI-tool sources. */
3425
+ token: string;
3426
+ /** @description SonarQube project key (component key). */
3427
+ projectKey: string;
3428
+ /** @description Optional branch name for branch-scoped measures. */
3429
+ branch?: string;
3430
+ };
3431
+ /** @description Redacted SonarQube source returned by GET workspace config. */
3432
+ SonarQubeSourceConfigDto: {
3433
+ /** @enum {string} */
3434
+ type: "sonarqube";
3435
+ hasToken: boolean;
3436
+ baseUrl: string;
3437
+ projectKey: string;
3438
+ branch?: string;
3439
+ };
3418
3440
  /**
3419
3441
  * @description The agent execution account used for Agentic Foundation runs (readiness scanner + fix queue). Exactly one is active per workspace.
3420
3442
  * - `thinkai_platform_cursor`: ThinkAI platform Cursor key (Cursor Agent CLI) — opt-in, never default.
@@ -3424,7 +3446,7 @@ export interface components {
3424
3446
  */
3425
3447
  AgentExecutionProviderDto: "thinkai_platform_cursor" | "cursor_user_api_key" | "claude_api_key";
3426
3448
  WorkspaceConfigDto: {
3427
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
3449
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
3428
3450
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
3429
3451
  /** @enum {string|null} */
3430
3452
  region?: "us" | "eu" | "me" | null;
@@ -6839,6 +6861,8 @@ export type PrometheusSourceDto = components['schemas']['PrometheusSourceDto'];
6839
6861
  export type PrometheusSourceConfigDto = components['schemas']['PrometheusSourceConfigDto'];
6840
6862
  export type GrafanaSourceDto = components['schemas']['GrafanaSourceDto'];
6841
6863
  export type GrafanaSourceConfigDto = components['schemas']['GrafanaSourceConfigDto'];
6864
+ export type SonarQubeSourceDto = components['schemas']['SonarQubeSourceDto'];
6865
+ export type SonarQubeSourceConfigDto = components['schemas']['SonarQubeSourceConfigDto'];
6842
6866
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
6843
6867
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
6844
6868
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
@@ -8554,7 +8578,7 @@ export interface operations {
8554
8578
  requestBody: {
8555
8579
  content: {
8556
8580
  "application/json": {
8557
- sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
8581
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
8558
8582
  };
8559
8583
  };
8560
8584
  };
@@ -8608,7 +8632,7 @@ export interface operations {
8608
8632
  };
8609
8633
  requestBody: {
8610
8634
  content: {
8611
- "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
8635
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
8612
8636
  };
8613
8637
  };
8614
8638
  responses: {