@thinkai/tai-api-contract 2.194.0 → 2.195.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.194.0
4
+ version: 2.195.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}/...`.
@@ -1757,6 +1757,59 @@ paths:
1757
1757
  schema:
1758
1758
  $ref: "#/components/schemas/PlatformBannerViewDto"
1759
1759
 
1760
+ /admin/jobs-session:
1761
+ post:
1762
+ tags: [PlatformAdmin]
1763
+ summary: Mint HttpOnly cookie for /admin/jobs dashboard access
1764
+ operationId: adminCreateJobsSession
1765
+ description: >
1766
+ Platform admins only. Copies the caller's Bearer JWT into an HttpOnly
1767
+ `tai_admin_jobs` cookie (`Path=/admin/`, `SameSite=Lax`, `Secure` when HTTPS/prod,
1768
+ `Max-Age` 1 hour) so browser navigations and admin-SPA iframes can authenticate to
1769
+ `/admin/jobs*` without an `Authorization` header on every request.
1770
+
1771
+ Requires a Bearer JWT from an email on `PLATFORM_ADMIN_EMAILS`. The cookie is only
1772
+ accepted as a Bearer substitute on `/admin/jobs*` paths by the API auth preHandler.
1773
+ The mounted `@pg-boss/dashboard` HTML surface is not part of this contract.
1774
+ responses:
1775
+ "204":
1776
+ description: "Session cookie set (Set-Cookie with tai_admin_jobs)."
1777
+ headers:
1778
+ Set-Cookie:
1779
+ schema:
1780
+ type: string
1781
+ description: >
1782
+ HttpOnly jobs session cookie with the caller's JWT value,
1783
+ Path=/admin/, SameSite=Lax, Max-Age=3600, Secure when applicable.
1784
+ "401":
1785
+ description: Missing or non-Bearer Authorization (no JWT to put in the cookie).
1786
+ content:
1787
+ application/json:
1788
+ schema:
1789
+ $ref: "#/components/schemas/ErrorMessageDto"
1790
+ example:
1791
+ error: Unauthorized
1792
+ code: unauthorized
1793
+ "403":
1794
+ description: Caller is not a platform admin.
1795
+ content:
1796
+ application/json:
1797
+ schema:
1798
+ $ref: "#/components/schemas/ErrorMessageDto"
1799
+ example:
1800
+ error: Forbidden
1801
+ code: forbidden
1802
+ "503":
1803
+ description: >
1804
+ Jobs dashboard unavailable (`JOBS_PG_BOSS_ENABLED=false` or readiness DB URL missing).
1805
+ content:
1806
+ application/json:
1807
+ schema:
1808
+ $ref: "#/components/schemas/ErrorMessageDto"
1809
+ example:
1810
+ error: Jobs dashboard unavailable
1811
+ code: jobs_dashboard_unavailable
1812
+
1760
1813
  /admin/platform/banner:
1761
1814
  get:
1762
1815
  tags: [PlatformAdmin]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.194.0",
3
+ "version": "2.195.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -465,6 +465,27 @@ export interface paths {
465
465
  patch?: never;
466
466
  trace?: never;
467
467
  };
468
+ "/admin/jobs-session": {
469
+ parameters: {
470
+ query?: never;
471
+ header?: never;
472
+ path?: never;
473
+ cookie?: never;
474
+ };
475
+ get?: never;
476
+ put?: never;
477
+ /**
478
+ * Mint HttpOnly cookie for /admin/jobs dashboard access
479
+ * @description Platform admins only. Copies the caller's Bearer JWT into an HttpOnly `tai_admin_jobs` cookie (`Path=/admin/`, `SameSite=Lax`, `Secure` when HTTPS/prod, `Max-Age` 1 hour) so browser navigations and admin-SPA iframes can authenticate to `/admin/jobs*` without an `Authorization` header on every request.
480
+ * Requires a Bearer JWT from an email on `PLATFORM_ADMIN_EMAILS`. The cookie is only accepted as a Bearer substitute on `/admin/jobs*` paths by the API auth preHandler. The mounted `@pg-boss/dashboard` HTML surface is not part of this contract.
481
+ */
482
+ post: operations["adminCreateJobsSession"];
483
+ delete?: never;
484
+ options?: never;
485
+ head?: never;
486
+ patch?: never;
487
+ trace?: never;
488
+ };
468
489
  "/admin/platform/banner": {
469
490
  parameters: {
470
491
  query?: never;
@@ -15389,6 +15410,71 @@ export interface operations {
15389
15410
  };
15390
15411
  };
15391
15412
  };
15413
+ adminCreateJobsSession: {
15414
+ parameters: {
15415
+ query?: never;
15416
+ header?: never;
15417
+ path?: never;
15418
+ cookie?: never;
15419
+ };
15420
+ requestBody?: never;
15421
+ responses: {
15422
+ /** @description Session cookie set (Set-Cookie with tai_admin_jobs). */
15423
+ 204: {
15424
+ headers: {
15425
+ /** @description HttpOnly jobs session cookie with the caller's JWT value, Path=/admin/, SameSite=Lax, Max-Age=3600, Secure when applicable. */
15426
+ "Set-Cookie"?: string;
15427
+ [name: string]: unknown;
15428
+ };
15429
+ content?: never;
15430
+ };
15431
+ /** @description Missing or non-Bearer Authorization (no JWT to put in the cookie). */
15432
+ 401: {
15433
+ headers: {
15434
+ [name: string]: unknown;
15435
+ };
15436
+ content: {
15437
+ /**
15438
+ * @example {
15439
+ * "error": "Unauthorized",
15440
+ * "code": "unauthorized"
15441
+ * }
15442
+ */
15443
+ "application/json": components["schemas"]["ErrorMessageDto"];
15444
+ };
15445
+ };
15446
+ /** @description Caller is not a platform admin. */
15447
+ 403: {
15448
+ headers: {
15449
+ [name: string]: unknown;
15450
+ };
15451
+ content: {
15452
+ /**
15453
+ * @example {
15454
+ * "error": "Forbidden",
15455
+ * "code": "forbidden"
15456
+ * }
15457
+ */
15458
+ "application/json": components["schemas"]["ErrorMessageDto"];
15459
+ };
15460
+ };
15461
+ /** @description Jobs dashboard unavailable (`JOBS_PG_BOSS_ENABLED=false` or readiness DB URL missing). */
15462
+ 503: {
15463
+ headers: {
15464
+ [name: string]: unknown;
15465
+ };
15466
+ content: {
15467
+ /**
15468
+ * @example {
15469
+ * "error": "Jobs dashboard unavailable",
15470
+ * "code": "jobs_dashboard_unavailable"
15471
+ * }
15472
+ */
15473
+ "application/json": components["schemas"]["ErrorMessageDto"];
15474
+ };
15475
+ };
15476
+ };
15477
+ };
15392
15478
  adminGetPlatformBanner: {
15393
15479
  parameters: {
15394
15480
  query?: never;