@thinkai/tai-api-contract 2.120.0 → 2.122.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.
- package/dist/generated/openapi.d.ts +121 -1
- package/dist/generated/openapi.d.ts.map +1 -1
- package/openapi/openapi.yaml +141 -1
- package/package.json +1 -1
- package/src/generated/openapi.ts +121 -1
package/openapi/openapi.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.0.3
|
|
2
2
|
info:
|
|
3
3
|
title: ThinkAI API
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.122.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}/...`.
|
|
@@ -3121,6 +3121,103 @@ paths:
|
|
|
3121
3121
|
"404":
|
|
3122
3122
|
description: Workspace does not exist or malformed workspaceId
|
|
3123
3123
|
|
|
3124
|
+
/workspaces/{workspaceId}/ingest/sdlc/rollups/rebuild:
|
|
3125
|
+
post:
|
|
3126
|
+
tags: [SdlcInsights]
|
|
3127
|
+
summary: Rebuild SDLC DORA/CI daily rollups for a day range
|
|
3128
|
+
operationId: rebuildSdlcRollups
|
|
3129
|
+
description: >
|
|
3130
|
+
Rebuilds DORA/CI daily rollups for this workspace from stored dashboard
|
|
3131
|
+
productivity history for the inclusive `from`/`to` UTC day range (max 90 days).
|
|
3132
|
+
Does not re-pull GitHub. Returns 409 when another rebuild holds the advisory lock.
|
|
3133
|
+
parameters:
|
|
3134
|
+
- $ref: "#/components/parameters/WorkspaceId"
|
|
3135
|
+
- name: from
|
|
3136
|
+
in: query
|
|
3137
|
+
required: true
|
|
3138
|
+
description: Inclusive UTC start day (`YYYY-MM-DD`).
|
|
3139
|
+
schema:
|
|
3140
|
+
type: string
|
|
3141
|
+
format: date
|
|
3142
|
+
- name: to
|
|
3143
|
+
in: query
|
|
3144
|
+
required: true
|
|
3145
|
+
description: Inclusive UTC end day (`YYYY-MM-DD`).
|
|
3146
|
+
schema:
|
|
3147
|
+
type: string
|
|
3148
|
+
format: date
|
|
3149
|
+
responses:
|
|
3150
|
+
"200":
|
|
3151
|
+
description: Rebuild completed
|
|
3152
|
+
content:
|
|
3153
|
+
application/json:
|
|
3154
|
+
schema:
|
|
3155
|
+
type: object
|
|
3156
|
+
required: [ok, rollupRows]
|
|
3157
|
+
properties:
|
|
3158
|
+
ok:
|
|
3159
|
+
type: boolean
|
|
3160
|
+
enum: [true]
|
|
3161
|
+
rollupRows:
|
|
3162
|
+
type: integer
|
|
3163
|
+
minimum: 0
|
|
3164
|
+
example:
|
|
3165
|
+
ok: true
|
|
3166
|
+
rollupRows: 42
|
|
3167
|
+
"400":
|
|
3168
|
+
description: >
|
|
3169
|
+
Invalid range. Stable `error` codes: `invalid_day_range` (missing pair,
|
|
3170
|
+
bad calendar date, or from > to) and `range_too_large` (more than 90 days).
|
|
3171
|
+
content:
|
|
3172
|
+
application/json:
|
|
3173
|
+
schema:
|
|
3174
|
+
type: object
|
|
3175
|
+
required: [ok, error]
|
|
3176
|
+
properties:
|
|
3177
|
+
ok:
|
|
3178
|
+
type: boolean
|
|
3179
|
+
enum: [false]
|
|
3180
|
+
error:
|
|
3181
|
+
type: string
|
|
3182
|
+
enum: [invalid_day_range, range_too_large]
|
|
3183
|
+
"401":
|
|
3184
|
+
$ref: "#/components/responses/Unauthorized"
|
|
3185
|
+
"403":
|
|
3186
|
+
$ref: "#/components/responses/Forbidden"
|
|
3187
|
+
"404":
|
|
3188
|
+
description: >
|
|
3189
|
+
Feature off or no dashboard metrics source. Stable `error` codes:
|
|
3190
|
+
`feature_off`, `no_source`.
|
|
3191
|
+
content:
|
|
3192
|
+
application/json:
|
|
3193
|
+
schema:
|
|
3194
|
+
type: object
|
|
3195
|
+
required: [ok, error]
|
|
3196
|
+
properties:
|
|
3197
|
+
ok:
|
|
3198
|
+
type: boolean
|
|
3199
|
+
enum: [false]
|
|
3200
|
+
error:
|
|
3201
|
+
type: string
|
|
3202
|
+
enum: [feature_off, no_source]
|
|
3203
|
+
"409":
|
|
3204
|
+
description: Rebuild already in progress
|
|
3205
|
+
content:
|
|
3206
|
+
application/json:
|
|
3207
|
+
schema:
|
|
3208
|
+
type: object
|
|
3209
|
+
required: [ok, error]
|
|
3210
|
+
properties:
|
|
3211
|
+
ok:
|
|
3212
|
+
type: boolean
|
|
3213
|
+
enum: [false]
|
|
3214
|
+
error:
|
|
3215
|
+
type: string
|
|
3216
|
+
enum: [already_in_progress]
|
|
3217
|
+
example:
|
|
3218
|
+
ok: false
|
|
3219
|
+
error: already_in_progress
|
|
3220
|
+
|
|
3124
3221
|
/workspaces/{workspaceId}/insights/sdlc/overview:
|
|
3125
3222
|
get:
|
|
3126
3223
|
tags: [SdlcInsights]
|
|
@@ -4455,6 +4552,14 @@ paths:
|
|
|
4455
4552
|
Cursor resets its spend/model/daily backfill cursors so the full `spendHistoryDays` window
|
|
4456
4553
|
re-ingests from the retention floor even when the backfill was already complete.
|
|
4457
4554
|
Omitted/false performs a normal incremental refresh.
|
|
4555
|
+
Pass `from` and `to` (UTC `YYYY-MM-DD`) together to re-ingest only that
|
|
4556
|
+
inclusive day range without resetting incremental watermarks; mutually
|
|
4557
|
+
exclusive with `full`. Day-range behavior is provider-specific: all providers
|
|
4558
|
+
re-pull generic daily usage for the window (Cursor does this via the spend-daily
|
|
4559
|
+
path instead of a duplicate top-level poll); Cursor additionally re-ingests
|
|
4560
|
+
spend/model daily for the window without resetting backfill cursors. Claude
|
|
4561
|
+
Enterprise model/product/engagement ingest paths are not day-range scoped and
|
|
4562
|
+
continue to use their normal refresh windows.
|
|
4458
4563
|
parameters:
|
|
4459
4564
|
- $ref: "#/components/parameters/WorkspaceId"
|
|
4460
4565
|
- name: provider
|
|
@@ -4473,6 +4578,27 @@ paths:
|
|
|
4473
4578
|
schema:
|
|
4474
4579
|
type: string
|
|
4475
4580
|
enum: ["true", "1"]
|
|
4581
|
+
- name: from
|
|
4582
|
+
in: query
|
|
4583
|
+
required: false
|
|
4584
|
+
description: >
|
|
4585
|
+
Inclusive UTC start day (`YYYY-MM-DD`) for a targeted re-ingest window.
|
|
4586
|
+
Must be paired with `to`. Mutually exclusive with `full`. Clamped to the
|
|
4587
|
+
configured retention floor (`spendHistoryDays`). Cursor also re-ingests
|
|
4588
|
+
spend/model daily for the window; Claude Enterprise model/product/engagement
|
|
4589
|
+
paths are not day-range scoped.
|
|
4590
|
+
schema:
|
|
4591
|
+
type: string
|
|
4592
|
+
format: date
|
|
4593
|
+
- name: to
|
|
4594
|
+
in: query
|
|
4595
|
+
required: false
|
|
4596
|
+
description: >
|
|
4597
|
+
Inclusive UTC end day (`YYYY-MM-DD`) for a targeted re-ingest window.
|
|
4598
|
+
Must be paired with `from`. Mutually exclusive with `full`.
|
|
4599
|
+
schema:
|
|
4600
|
+
type: string
|
|
4601
|
+
format: date
|
|
4476
4602
|
responses:
|
|
4477
4603
|
"200":
|
|
4478
4604
|
description: Refresh result
|
|
@@ -4485,6 +4611,20 @@ paths:
|
|
|
4485
4611
|
value: { ok: true }
|
|
4486
4612
|
invalid_token:
|
|
4487
4613
|
value: { ok: false, error: "invalid_token" }
|
|
4614
|
+
"400":
|
|
4615
|
+
description: >
|
|
4616
|
+
Invalid request — day-range validation failed. Stable `error` codes:
|
|
4617
|
+
`invalid_day_range` (missing pair, bad calendar date, or from > to) and
|
|
4618
|
+
`full_and_day_range_conflict` (`full` combined with `from`/`to`).
|
|
4619
|
+
content:
|
|
4620
|
+
application/json:
|
|
4621
|
+
schema:
|
|
4622
|
+
$ref: "#/components/schemas/AiToolRefreshResponseDto"
|
|
4623
|
+
examples:
|
|
4624
|
+
invalid_day_range:
|
|
4625
|
+
value: { ok: false, error: "invalid_day_range" }
|
|
4626
|
+
full_and_day_range_conflict:
|
|
4627
|
+
value: { ok: false, error: "full_and_day_range_conflict" }
|
|
4488
4628
|
"401":
|
|
4489
4629
|
$ref: "#/components/responses/Unauthorized"
|
|
4490
4630
|
"403":
|
package/package.json
CHANGED
package/src/generated/openapi.ts
CHANGED
|
@@ -1110,6 +1110,26 @@ export interface paths {
|
|
|
1110
1110
|
patch?: never;
|
|
1111
1111
|
trace?: never;
|
|
1112
1112
|
};
|
|
1113
|
+
"/workspaces/{workspaceId}/ingest/sdlc/rollups/rebuild": {
|
|
1114
|
+
parameters: {
|
|
1115
|
+
query?: never;
|
|
1116
|
+
header?: never;
|
|
1117
|
+
path?: never;
|
|
1118
|
+
cookie?: never;
|
|
1119
|
+
};
|
|
1120
|
+
get?: never;
|
|
1121
|
+
put?: never;
|
|
1122
|
+
/**
|
|
1123
|
+
* Rebuild SDLC DORA/CI daily rollups for a day range
|
|
1124
|
+
* @description Rebuilds DORA/CI daily rollups for this workspace from stored dashboard productivity history for the inclusive `from`/`to` UTC day range (max 90 days). Does not re-pull GitHub. Returns 409 when another rebuild holds the advisory lock.
|
|
1125
|
+
*/
|
|
1126
|
+
post: operations["rebuildSdlcRollups"];
|
|
1127
|
+
delete?: never;
|
|
1128
|
+
options?: never;
|
|
1129
|
+
head?: never;
|
|
1130
|
+
patch?: never;
|
|
1131
|
+
trace?: never;
|
|
1132
|
+
};
|
|
1113
1133
|
"/workspaces/{workspaceId}/insights/sdlc/overview": {
|
|
1114
1134
|
parameters: {
|
|
1115
1135
|
query?: never;
|
|
@@ -1630,7 +1650,7 @@ export interface paths {
|
|
|
1630
1650
|
put?: never;
|
|
1631
1651
|
/**
|
|
1632
1652
|
* Refresh AI tool integration snapshots
|
|
1633
|
-
* @description Provider-agnostic refresh. Returns 409 when an advisory-lock refresh is already in progress. On upstream auth/rate/network failures, returns `200` with `{ ok:false, error }` so the SPA can render inline error. Pass `full=true` to force a full re-sync that re-pulls the full history instead of the incremental window, used to backfill historical months. Provider-specific behavior: Claude Enterprise re-pulls six calendar months of daily usage; Claude Team widens its daily-usage window to the configured history depth (`spendHistoryDays`, default 180 days); Cursor resets its spend/model/daily backfill cursors so the full `spendHistoryDays` window re-ingests from the retention floor even when the backfill was already complete. Omitted/false performs a normal incremental refresh.
|
|
1653
|
+
* @description Provider-agnostic refresh. Returns 409 when an advisory-lock refresh is already in progress. On upstream auth/rate/network failures, returns `200` with `{ ok:false, error }` so the SPA can render inline error. Pass `full=true` to force a full re-sync that re-pulls the full history instead of the incremental window, used to backfill historical months. Provider-specific behavior: Claude Enterprise re-pulls six calendar months of daily usage; Claude Team widens its daily-usage window to the configured history depth (`spendHistoryDays`, default 180 days); Cursor resets its spend/model/daily backfill cursors so the full `spendHistoryDays` window re-ingests from the retention floor even when the backfill was already complete. Omitted/false performs a normal incremental refresh. Pass `from` and `to` (UTC `YYYY-MM-DD`) together to re-ingest only that inclusive day range without resetting incremental watermarks; mutually exclusive with `full`. Day-range behavior is provider-specific: all providers re-pull generic daily usage for the window (Cursor does this via the spend-daily path instead of a duplicate top-level poll); Cursor additionally re-ingests spend/model daily for the window without resetting backfill cursors. Claude Enterprise model/product/engagement ingest paths are not day-range scoped and continue to use their normal refresh windows.
|
|
1634
1654
|
*/
|
|
1635
1655
|
post: operations["refreshWorkspaceAiTool"];
|
|
1636
1656
|
delete?: never;
|
|
@@ -13002,6 +13022,93 @@ export interface operations {
|
|
|
13002
13022
|
};
|
|
13003
13023
|
};
|
|
13004
13024
|
};
|
|
13025
|
+
rebuildSdlcRollups: {
|
|
13026
|
+
parameters: {
|
|
13027
|
+
query: {
|
|
13028
|
+
/** @description Inclusive UTC start day (`YYYY-MM-DD`). */
|
|
13029
|
+
from: string;
|
|
13030
|
+
/** @description Inclusive UTC end day (`YYYY-MM-DD`). */
|
|
13031
|
+
to: string;
|
|
13032
|
+
};
|
|
13033
|
+
header?: never;
|
|
13034
|
+
path: {
|
|
13035
|
+
workspaceId: components["parameters"]["WorkspaceId"];
|
|
13036
|
+
};
|
|
13037
|
+
cookie?: never;
|
|
13038
|
+
};
|
|
13039
|
+
requestBody?: never;
|
|
13040
|
+
responses: {
|
|
13041
|
+
/** @description Rebuild completed */
|
|
13042
|
+
200: {
|
|
13043
|
+
headers: {
|
|
13044
|
+
[name: string]: unknown;
|
|
13045
|
+
};
|
|
13046
|
+
content: {
|
|
13047
|
+
/**
|
|
13048
|
+
* @example {
|
|
13049
|
+
* "ok": true,
|
|
13050
|
+
* "rollupRows": 42
|
|
13051
|
+
* }
|
|
13052
|
+
*/
|
|
13053
|
+
"application/json": {
|
|
13054
|
+
/** @enum {boolean} */
|
|
13055
|
+
ok: true;
|
|
13056
|
+
rollupRows: number;
|
|
13057
|
+
};
|
|
13058
|
+
};
|
|
13059
|
+
};
|
|
13060
|
+
/** @description Invalid range. Stable `error` codes: `invalid_day_range` (missing pair, bad calendar date, or from > to) and `range_too_large` (more than 90 days). */
|
|
13061
|
+
400: {
|
|
13062
|
+
headers: {
|
|
13063
|
+
[name: string]: unknown;
|
|
13064
|
+
};
|
|
13065
|
+
content: {
|
|
13066
|
+
"application/json": {
|
|
13067
|
+
/** @enum {boolean} */
|
|
13068
|
+
ok: false;
|
|
13069
|
+
/** @enum {string} */
|
|
13070
|
+
error: "invalid_day_range" | "range_too_large";
|
|
13071
|
+
};
|
|
13072
|
+
};
|
|
13073
|
+
};
|
|
13074
|
+
401: components["responses"]["Unauthorized"];
|
|
13075
|
+
403: components["responses"]["Forbidden"];
|
|
13076
|
+
/** @description Feature off or no dashboard metrics source. Stable `error` codes: `feature_off`, `no_source`. */
|
|
13077
|
+
404: {
|
|
13078
|
+
headers: {
|
|
13079
|
+
[name: string]: unknown;
|
|
13080
|
+
};
|
|
13081
|
+
content: {
|
|
13082
|
+
"application/json": {
|
|
13083
|
+
/** @enum {boolean} */
|
|
13084
|
+
ok: false;
|
|
13085
|
+
/** @enum {string} */
|
|
13086
|
+
error: "feature_off" | "no_source";
|
|
13087
|
+
};
|
|
13088
|
+
};
|
|
13089
|
+
};
|
|
13090
|
+
/** @description Rebuild already in progress */
|
|
13091
|
+
409: {
|
|
13092
|
+
headers: {
|
|
13093
|
+
[name: string]: unknown;
|
|
13094
|
+
};
|
|
13095
|
+
content: {
|
|
13096
|
+
/**
|
|
13097
|
+
* @example {
|
|
13098
|
+
* "ok": false,
|
|
13099
|
+
* "error": "already_in_progress"
|
|
13100
|
+
* }
|
|
13101
|
+
*/
|
|
13102
|
+
"application/json": {
|
|
13103
|
+
/** @enum {boolean} */
|
|
13104
|
+
ok: false;
|
|
13105
|
+
/** @enum {string} */
|
|
13106
|
+
error: "already_in_progress";
|
|
13107
|
+
};
|
|
13108
|
+
};
|
|
13109
|
+
};
|
|
13110
|
+
};
|
|
13111
|
+
};
|
|
13005
13112
|
getSdlcInsightsOverview: {
|
|
13006
13113
|
parameters: {
|
|
13007
13114
|
query?: {
|
|
@@ -14420,6 +14527,10 @@ export interface operations {
|
|
|
14420
14527
|
query?: {
|
|
14421
14528
|
/** @description Force a full history re-sync instead of the incremental window (Enterprise: 6 months; Team: `spendHistoryDays`-day daily-usage window; Cursor: spend/model/daily backfill reset over `spendHistoryDays`). Truthy only for `true` or `1`. */
|
|
14422
14529
|
full?: "true" | "1";
|
|
14530
|
+
/** @description Inclusive UTC start day (`YYYY-MM-DD`) for a targeted re-ingest window. Must be paired with `to`. Mutually exclusive with `full`. Clamped to the configured retention floor (`spendHistoryDays`). Cursor also re-ingests spend/model daily for the window; Claude Enterprise model/product/engagement paths are not day-range scoped. */
|
|
14531
|
+
from?: string;
|
|
14532
|
+
/** @description Inclusive UTC end day (`YYYY-MM-DD`) for a targeted re-ingest window. Must be paired with `from`. Mutually exclusive with `full`. */
|
|
14533
|
+
to?: string;
|
|
14423
14534
|
};
|
|
14424
14535
|
header?: never;
|
|
14425
14536
|
path: {
|
|
@@ -14439,6 +14550,15 @@ export interface operations {
|
|
|
14439
14550
|
"application/json": components["schemas"]["AiToolRefreshResponseDto"];
|
|
14440
14551
|
};
|
|
14441
14552
|
};
|
|
14553
|
+
/** @description Invalid request — day-range validation failed. Stable `error` codes: `invalid_day_range` (missing pair, bad calendar date, or from > to) and `full_and_day_range_conflict` (`full` combined with `from`/`to`). */
|
|
14554
|
+
400: {
|
|
14555
|
+
headers: {
|
|
14556
|
+
[name: string]: unknown;
|
|
14557
|
+
};
|
|
14558
|
+
content: {
|
|
14559
|
+
"application/json": components["schemas"]["AiToolRefreshResponseDto"];
|
|
14560
|
+
};
|
|
14561
|
+
};
|
|
14442
14562
|
401: components["responses"]["Unauthorized"];
|
|
14443
14563
|
403: components["responses"]["Forbidden"];
|
|
14444
14564
|
/** @description Provider source missing for this workspace */
|