@thinkai/tai-api-contract 2.251.0 → 2.252.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/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.252.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}/...`.
|
|
@@ -15260,16 +15260,23 @@ paths:
|
|
|
15260
15260
|
Returns token usage and spend aggregated from connected AI tool sources (e.g. Cursor)
|
|
15261
15261
|
over the requested range, broken down by week and provider. Covers issue #274.
|
|
15262
15262
|
Results are cached for 60 seconds.
|
|
15263
|
+
|
|
15264
|
+
|
|
15265
|
+
The window is selected like the Productivity and AI usage insights routes: daily presets
|
|
15266
|
+
(`7d`, `30d`, `90d`, `180d`), a custom `cr:YYYY-MM-DD:YYYY-MM-DD` range, explicit
|
|
15267
|
+
`from`/`to` day bounds (max 180 days), or legacy weekly ranges (`4w`, `8w`, `q`, `12w`,
|
|
15268
|
+
`16w`). Totals, active users and provider rows are scoped to the day window (or to the
|
|
15269
|
+
calendar weeks for a weekly range); spend counts every billing cycle that overlaps the
|
|
15270
|
+
window. `weeks` lists the calendar weeks overlapping the window, so the weekly strip keeps
|
|
15271
|
+
working for any range. `windowStart`/`windowEnd` are the day-window bounds for daily
|
|
15272
|
+
ranges and the first/last week bucket bounds for weekly ranges. Unsupported values return
|
|
15273
|
+
`400` (previously they silently fell back to `4w`).
|
|
15263
15274
|
operationId: getYourAiJourneyAiSpend
|
|
15264
15275
|
parameters:
|
|
15265
15276
|
- $ref: "#/components/parameters/WorkspaceId"
|
|
15266
|
-
-
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
type: string
|
|
15270
|
-
enum: [4w, 8w, q]
|
|
15271
|
-
default: 4w
|
|
15272
|
-
description: Time range — `4w` (4 weeks), `8w` (8 weeks), or `q` (quarter, 12 weeks).
|
|
15277
|
+
- $ref: "#/components/parameters/InsightsProductivityRangeId"
|
|
15278
|
+
- $ref: "#/components/parameters/InsightsProductivityFrom"
|
|
15279
|
+
- $ref: "#/components/parameters/InsightsProductivityTo"
|
|
15273
15280
|
responses:
|
|
15274
15281
|
"200":
|
|
15275
15282
|
description: AI spend aggregation
|
|
@@ -15277,6 +15284,15 @@ paths:
|
|
|
15277
15284
|
application/json:
|
|
15278
15285
|
schema:
|
|
15279
15286
|
$ref: "#/components/schemas/YourAiJourneyAiSpendDto"
|
|
15287
|
+
"400":
|
|
15288
|
+
description: Invalid `rangeId`, `from`, or `to`
|
|
15289
|
+
content:
|
|
15290
|
+
application/json:
|
|
15291
|
+
schema:
|
|
15292
|
+
type: object
|
|
15293
|
+
required: [error]
|
|
15294
|
+
properties:
|
|
15295
|
+
error: { type: string, example: invalid_query }
|
|
15280
15296
|
"401":
|
|
15281
15297
|
$ref: "#/components/responses/Unauthorized"
|
|
15282
15298
|
"403":
|
package/package.json
CHANGED
package/src/generated/openapi.ts
CHANGED
|
@@ -5949,6 +5949,8 @@ export interface paths {
|
|
|
5949
5949
|
/**
|
|
5950
5950
|
* AI tool spend and usage aggregated by week and provider
|
|
5951
5951
|
* @description Returns token usage and spend aggregated from connected AI tool sources (e.g. Cursor) over the requested range, broken down by week and provider. Covers issue #274. Results are cached for 60 seconds.
|
|
5952
|
+
*
|
|
5953
|
+
* The window is selected like the Productivity and AI usage insights routes: daily presets (`7d`, `30d`, `90d`, `180d`), a custom `cr:YYYY-MM-DD:YYYY-MM-DD` range, explicit `from`/`to` day bounds (max 180 days), or legacy weekly ranges (`4w`, `8w`, `q`, `12w`, `16w`). Totals, active users and provider rows are scoped to the day window (or to the calendar weeks for a weekly range); spend counts every billing cycle that overlaps the window. `weeks` lists the calendar weeks overlapping the window, so the weekly strip keeps working for any range. `windowStart`/`windowEnd` are the day-window bounds for daily ranges and the first/last week bucket bounds for weekly ranges. Unsupported values return `400` (previously they silently fell back to `4w`).
|
|
5952
5954
|
*/
|
|
5953
5955
|
get: operations["getYourAiJourneyAiSpend"];
|
|
5954
5956
|
put?: never;
|
|
@@ -32627,8 +32629,12 @@ export interface operations {
|
|
|
32627
32629
|
getYourAiJourneyAiSpend: {
|
|
32628
32630
|
parameters: {
|
|
32629
32631
|
query?: {
|
|
32630
|
-
/** @description
|
|
32631
|
-
rangeId?: "
|
|
32632
|
+
/** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
|
|
32633
|
+
rangeId?: components["parameters"]["InsightsProductivityRangeId"];
|
|
32634
|
+
/** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
|
|
32635
|
+
from?: components["parameters"]["InsightsProductivityFrom"];
|
|
32636
|
+
/** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
|
|
32637
|
+
to?: components["parameters"]["InsightsProductivityTo"];
|
|
32632
32638
|
};
|
|
32633
32639
|
header?: never;
|
|
32634
32640
|
path: {
|
|
@@ -32647,6 +32653,18 @@ export interface operations {
|
|
|
32647
32653
|
"application/json": components["schemas"]["YourAiJourneyAiSpendDto"];
|
|
32648
32654
|
};
|
|
32649
32655
|
};
|
|
32656
|
+
/** @description Invalid `rangeId`, `from`, or `to` */
|
|
32657
|
+
400: {
|
|
32658
|
+
headers: {
|
|
32659
|
+
[name: string]: unknown;
|
|
32660
|
+
};
|
|
32661
|
+
content: {
|
|
32662
|
+
"application/json": {
|
|
32663
|
+
/** @example invalid_query */
|
|
32664
|
+
error: string;
|
|
32665
|
+
};
|
|
32666
|
+
};
|
|
32667
|
+
};
|
|
32650
32668
|
401: components["responses"]["Unauthorized"];
|
|
32651
32669
|
403: components["responses"]["Forbidden"];
|
|
32652
32670
|
/** @description Workspace does not exist */
|