@thinkai/tai-api-contract 2.250.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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.250.0
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}/...`.
@@ -7306,6 +7306,7 @@ paths:
7306
7306
  - $ref: "#/components/parameters/GithubRepoOffset"
7307
7307
  - $ref: "#/components/parameters/GithubRepoSort"
7308
7308
  - $ref: "#/components/parameters/GithubRepoOrder"
7309
+ - $ref: "#/components/parameters/GithubRepoSearch"
7309
7310
  responses:
7310
7311
  "200":
7311
7312
  description: Installation status
@@ -7313,6 +7314,12 @@ paths:
7313
7314
  application/json:
7314
7315
  schema:
7315
7316
  $ref: "#/components/schemas/GithubInstallationStatusDto"
7317
+ "400":
7318
+ description: Invalid `repoLimit`, `repoOffset`, `repoSort`, `repoOrder`, or `search` query parameter
7319
+ content:
7320
+ application/json:
7321
+ schema:
7322
+ $ref: "#/components/schemas/ErrorMessageDto"
7316
7323
  "401":
7317
7324
  $ref: "#/components/responses/Unauthorized"
7318
7325
  "403":
@@ -15253,16 +15260,23 @@ paths:
15253
15260
  Returns token usage and spend aggregated from connected AI tool sources (e.g. Cursor)
15254
15261
  over the requested range, broken down by week and provider. Covers issue #274.
15255
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`).
15256
15274
  operationId: getYourAiJourneyAiSpend
15257
15275
  parameters:
15258
15276
  - $ref: "#/components/parameters/WorkspaceId"
15259
- - name: rangeId
15260
- in: query
15261
- schema:
15262
- type: string
15263
- enum: [4w, 8w, q]
15264
- default: 4w
15265
- 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"
15266
15280
  responses:
15267
15281
  "200":
15268
15282
  description: AI spend aggregation
@@ -15270,6 +15284,15 @@ paths:
15270
15284
  application/json:
15271
15285
  schema:
15272
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 }
15273
15296
  "401":
15274
15297
  $ref: "#/components/responses/Unauthorized"
15275
15298
  "403":
@@ -17582,6 +17605,17 @@ components:
17582
17605
  type: string
17583
17606
  enum: [asc, desc]
17584
17607
  default: asc
17608
+ GithubRepoSearch:
17609
+ name: search
17610
+ in: query
17611
+ required: false
17612
+ description: >
17613
+ Case-insensitive substring filter on repository `fullName`, `name`, or `language`,
17614
+ applied before `repoLimit`/`repoOffset` paging (for both top-level `repos` and each
17615
+ installation's `repos`). Empty or whitespace-only values are treated as unfiltered.
17616
+ schema:
17617
+ type: string
17618
+ maxLength: 256
17585
17619
 
17586
17620
  responses:
17587
17621
  Unauthorized:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.250.0",
3
+ "version": "2.252.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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;
@@ -15997,6 +15999,8 @@ export interface components {
15997
15999
  GithubRepoSort: "name" | "updatedAt";
15998
16000
  /** @description Sort direction for the nested installation repo list. */
15999
16001
  GithubRepoOrder: "asc" | "desc";
16002
+ /** @description Case-insensitive substring filter on repository `fullName`, `name`, or `language`, applied before `repoLimit`/`repoOffset` paging (for both top-level `repos` and each installation's `repos`). Empty or whitespace-only values are treated as unfiltered. */
16003
+ GithubRepoSearch: string;
16000
16004
  };
16001
16005
  requestBodies: never;
16002
16006
  headers: never;
@@ -16867,6 +16871,7 @@ export type ParameterGithubRepoLimit = components['parameters']['GithubRepoLimit
16867
16871
  export type ParameterGithubRepoOffset = components['parameters']['GithubRepoOffset'];
16868
16872
  export type ParameterGithubRepoSort = components['parameters']['GithubRepoSort'];
16869
16873
  export type ParameterGithubRepoOrder = components['parameters']['GithubRepoOrder'];
16874
+ export type ParameterGithubRepoSearch = components['parameters']['GithubRepoSearch'];
16870
16875
  export type $defs = Record<string, never>;
16871
16876
  export interface operations {
16872
16877
  adminDeleteUser: {
@@ -24133,6 +24138,8 @@ export interface operations {
24133
24138
  repoSort?: components["parameters"]["GithubRepoSort"];
24134
24139
  /** @description Sort direction for the nested installation repo list. */
24135
24140
  repoOrder?: components["parameters"]["GithubRepoOrder"];
24141
+ /** @description Case-insensitive substring filter on repository `fullName`, `name`, or `language`, applied before `repoLimit`/`repoOffset` paging (for both top-level `repos` and each installation's `repos`). Empty or whitespace-only values are treated as unfiltered. */
24142
+ search?: components["parameters"]["GithubRepoSearch"];
24136
24143
  };
24137
24144
  header?: never;
24138
24145
  path: {
@@ -24151,6 +24158,15 @@ export interface operations {
24151
24158
  "application/json": components["schemas"]["GithubInstallationStatusDto"];
24152
24159
  };
24153
24160
  };
24161
+ /** @description Invalid `repoLimit`, `repoOffset`, `repoSort`, `repoOrder`, or `search` query parameter */
24162
+ 400: {
24163
+ headers: {
24164
+ [name: string]: unknown;
24165
+ };
24166
+ content: {
24167
+ "application/json": components["schemas"]["ErrorMessageDto"];
24168
+ };
24169
+ };
24154
24170
  401: components["responses"]["Unauthorized"];
24155
24171
  403: components["responses"]["Forbidden"];
24156
24172
  /** @description Workspace does not exist or malformed workspaceId */
@@ -32613,8 +32629,12 @@ export interface operations {
32613
32629
  getYourAiJourneyAiSpend: {
32614
32630
  parameters: {
32615
32631
  query?: {
32616
- /** @description Time range — `4w` (4 weeks), `8w` (8 weeks), or `q` (quarter, 12 weeks). */
32617
- rangeId?: "4w" | "8w" | "q";
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"];
32618
32638
  };
32619
32639
  header?: never;
32620
32640
  path: {
@@ -32633,6 +32653,18 @@ export interface operations {
32633
32653
  "application/json": components["schemas"]["YourAiJourneyAiSpendDto"];
32634
32654
  };
32635
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
+ };
32636
32668
  401: components["responses"]["Unauthorized"];
32637
32669
  403: components["responses"]["Forbidden"];
32638
32670
  /** @description Workspace does not exist */