@thinkai/tai-api-contract 2.251.0 → 2.253.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.251.0
4
+ version: 2.253.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}/...`.
@@ -14998,12 +14998,13 @@ paths:
14998
14998
  tags: [YourAiJourney]
14999
14999
  summary: Secondary dashboard panels bootstrap payload
15000
15000
  description: >
15001
- Returns readiness aggregate, merged PR trends (8-week default window), aggregated teams
15002
- (8-week default window), and agentic foundation dashboard in one response. Nested payloads
15003
- reuse the same builders and caches as their dedicated routes.
15001
+ Returns readiness aggregate, merged PR trends, aggregated teams, and agentic foundation
15002
+ dashboard in one response. Productivity nested payloads use the same builders and caches
15003
+ as their dedicated routes. Default productivity window is `30d` when `rangeId` is omitted.
15004
15004
  operationId: getYourAiJourneyDashboardSecondary
15005
15005
  parameters:
15006
15006
  - $ref: "#/components/parameters/WorkspaceId"
15007
+ - $ref: "#/components/parameters/InsightsProductivityRangeId"
15007
15008
  responses:
15008
15009
  "200":
15009
15010
  description: Secondary dashboard bootstrap payload
@@ -15260,16 +15261,23 @@ paths:
15260
15261
  Returns token usage and spend aggregated from connected AI tool sources (e.g. Cursor)
15261
15262
  over the requested range, broken down by week and provider. Covers issue #274.
15262
15263
  Results are cached for 60 seconds.
15264
+
15265
+
15266
+ The window is selected like the Productivity and AI usage insights routes: daily presets
15267
+ (`7d`, `30d`, `90d`, `180d`), a custom `cr:YYYY-MM-DD:YYYY-MM-DD` range, explicit
15268
+ `from`/`to` day bounds (max 180 days), or legacy weekly ranges (`4w`, `8w`, `q`, `12w`,
15269
+ `16w`). Totals, active users and provider rows are scoped to the day window (or to the
15270
+ calendar weeks for a weekly range); spend counts every billing cycle that overlaps the
15271
+ window. `weeks` lists the calendar weeks overlapping the window, so the weekly strip keeps
15272
+ working for any range. `windowStart`/`windowEnd` are the day-window bounds for daily
15273
+ ranges and the first/last week bucket bounds for weekly ranges. Unsupported values return
15274
+ `400` (previously they silently fell back to `4w`).
15263
15275
  operationId: getYourAiJourneyAiSpend
15264
15276
  parameters:
15265
15277
  - $ref: "#/components/parameters/WorkspaceId"
15266
- - name: rangeId
15267
- in: query
15268
- schema:
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).
15278
+ - $ref: "#/components/parameters/InsightsProductivityRangeId"
15279
+ - $ref: "#/components/parameters/InsightsProductivityFrom"
15280
+ - $ref: "#/components/parameters/InsightsProductivityTo"
15273
15281
  responses:
15274
15282
  "200":
15275
15283
  description: AI spend aggregation
@@ -15277,6 +15285,15 @@ paths:
15277
15285
  application/json:
15278
15286
  schema:
15279
15287
  $ref: "#/components/schemas/YourAiJourneyAiSpendDto"
15288
+ "400":
15289
+ description: Invalid `rangeId`, `from`, or `to`
15290
+ content:
15291
+ application/json:
15292
+ schema:
15293
+ type: object
15294
+ required: [error]
15295
+ properties:
15296
+ error: { type: string, example: invalid_query }
15280
15297
  "401":
15281
15298
  $ref: "#/components/responses/Unauthorized"
15282
15299
  "403":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.251.0",
3
+ "version": "2.253.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -5804,7 +5804,7 @@ export interface paths {
5804
5804
  };
5805
5805
  /**
5806
5806
  * Secondary dashboard panels bootstrap payload
5807
- * @description Returns readiness aggregate, merged PR trends (8-week default window), aggregated teams (8-week default window), and agentic foundation dashboard in one response. Nested payloads reuse the same builders and caches as their dedicated routes.
5807
+ * @description Returns readiness aggregate, merged PR trends, aggregated teams, and agentic foundation dashboard in one response. Productivity nested payloads use the same builders and caches as their dedicated routes. Default productivity window is `30d` when `rangeId` is omitted.
5808
5808
  */
5809
5809
  get: operations["getYourAiJourneyDashboardSecondary"];
5810
5810
  put?: never;
@@ -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;
@@ -32334,7 +32336,10 @@ export interface operations {
32334
32336
  };
32335
32337
  getYourAiJourneyDashboardSecondary: {
32336
32338
  parameters: {
32337
- query?: never;
32339
+ query?: {
32340
+ /** @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. */
32341
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
32342
+ };
32338
32343
  header?: never;
32339
32344
  path: {
32340
32345
  workspaceId: components["parameters"]["WorkspaceId"];
@@ -32627,8 +32632,12 @@ export interface operations {
32627
32632
  getYourAiJourneyAiSpend: {
32628
32633
  parameters: {
32629
32634
  query?: {
32630
- /** @description Time range — `4w` (4 weeks), `8w` (8 weeks), or `q` (quarter, 12 weeks). */
32631
- rangeId?: "4w" | "8w" | "q";
32635
+ /** @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. */
32636
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
32637
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
32638
+ from?: components["parameters"]["InsightsProductivityFrom"];
32639
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
32640
+ to?: components["parameters"]["InsightsProductivityTo"];
32632
32641
  };
32633
32642
  header?: never;
32634
32643
  path: {
@@ -32647,6 +32656,18 @@ export interface operations {
32647
32656
  "application/json": components["schemas"]["YourAiJourneyAiSpendDto"];
32648
32657
  };
32649
32658
  };
32659
+ /** @description Invalid `rangeId`, `from`, or `to` */
32660
+ 400: {
32661
+ headers: {
32662
+ [name: string]: unknown;
32663
+ };
32664
+ content: {
32665
+ "application/json": {
32666
+ /** @example invalid_query */
32667
+ error: string;
32668
+ };
32669
+ };
32670
+ };
32650
32671
  401: components["responses"]["Unauthorized"];
32651
32672
  403: components["responses"]["Forbidden"];
32652
32673
  /** @description Workspace does not exist */