@thinkai/tai-api-contract 2.242.0 → 2.243.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.242.0
4
+ version: 2.243.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}/...`.
@@ -1847,6 +1847,213 @@ paths:
1847
1847
  schema:
1848
1848
  $ref: "#/components/schemas/PlatformBannerViewDto"
1849
1849
 
1850
+ /admin/design-adoption:
1851
+ get:
1852
+ tags: [PlatformAdmin]
1853
+ summary: Design adoption totals, reasons, and people
1854
+ operationId: adminGetDesignAdoption
1855
+ description: >
1856
+ Platform admins only. Who is on the new design, who went back to classic, and who
1857
+ never chose. `totals.onNew`, `totals.backOnClassic`, `totals.neverChose`, and
1858
+ `totals.choseClassic` sum to `totals.totalPeople`. `reasons` counts one reason per
1859
+ person currently back on classic (tried the new design, saved choice is now `v1`),
1860
+ using the latest switch to classic. `reason: null` is no reason given.
1861
+ `people` is one row per active account (email, workspace, current design, since,
1862
+ switch count, last reason). Notes are not included. `workspaceId` and `design`
1863
+ filter the people list only; totals and reasons stay global.
1864
+ Requires a Bearer JWT from an email on `PLATFORM_ADMIN_EMAILS`.
1865
+ parameters:
1866
+ - name: workspaceId
1867
+ in: query
1868
+ required: false
1869
+ schema:
1870
+ type: string
1871
+ format: uuid
1872
+ description: Keep people who are active members of this workspace.
1873
+ - name: design
1874
+ in: query
1875
+ required: false
1876
+ schema:
1877
+ type: string
1878
+ enum: [v1, v2, none]
1879
+ description: >
1880
+ Current saved design. `v2` is the new design, `v1` is classic (including
1881
+ people who never tried the new design), `none` is no saved choice.
1882
+ - name: limit
1883
+ in: query
1884
+ required: false
1885
+ schema:
1886
+ type: integer
1887
+ minimum: 1
1888
+ maximum: 200
1889
+ default: 50
1890
+ description: Page size (default 50, max 200).
1891
+ - name: offset
1892
+ in: query
1893
+ required: false
1894
+ schema:
1895
+ type: integer
1896
+ minimum: 0
1897
+ default: 0
1898
+ description: Number of matching people to skip.
1899
+ responses:
1900
+ "200":
1901
+ description: Adoption totals, switch-back reasons, and one page of people.
1902
+ content:
1903
+ application/json:
1904
+ schema:
1905
+ $ref: "#/components/schemas/DesignAdoptionDto"
1906
+ "400":
1907
+ description: Invalid workspaceId, design, limit, or offset.
1908
+ content:
1909
+ application/json:
1910
+ schema:
1911
+ $ref: "#/components/schemas/ErrorMessageDto"
1912
+ example:
1913
+ error: design must be v1, v2, or none
1914
+ code: invalid_query
1915
+ "401":
1916
+ $ref: "#/components/responses/Unauthorized"
1917
+ "403":
1918
+ description: Caller is not a platform admin.
1919
+ content:
1920
+ application/json:
1921
+ schema:
1922
+ $ref: "#/components/schemas/ErrorMessageDto"
1923
+ example:
1924
+ error: Forbidden
1925
+ code: forbidden
1926
+ "503":
1927
+ description: Design adoption store is unavailable.
1928
+ content:
1929
+ application/json:
1930
+ schema:
1931
+ $ref: "#/components/schemas/ErrorMessageDto"
1932
+ example:
1933
+ error: Design adoption is unavailable
1934
+ code: design_adoption_unavailable
1935
+
1936
+ /admin/design-adoption.csv:
1937
+ get:
1938
+ tags: [PlatformAdmin]
1939
+ summary: Design adoption people list as CSV
1940
+ operationId: adminExportDesignAdoptionCsv
1941
+ description: >
1942
+ Platform admins only. The people list from `GET /admin/design-adoption` as an
1943
+ RFC 4180 CSV file. Accepts the same `workspaceId` and `design` filters.
1944
+ `limit` and `offset` are ignored. Columns are
1945
+ `email,workspace,design,since,switches,lastReason`. Notes are not included.
1946
+ At most 50000 matching rows. `Content-Disposition` is `attachment`.
1947
+ Requires a Bearer JWT from an email on `PLATFORM_ADMIN_EMAILS`.
1948
+ parameters:
1949
+ - name: workspaceId
1950
+ in: query
1951
+ required: false
1952
+ schema:
1953
+ type: string
1954
+ format: uuid
1955
+ - name: design
1956
+ in: query
1957
+ required: false
1958
+ schema:
1959
+ type: string
1960
+ enum: [v1, v2, none]
1961
+ responses:
1962
+ "200":
1963
+ description: CSV file of matching people.
1964
+ content:
1965
+ text/csv:
1966
+ schema:
1967
+ type: string
1968
+ example: |
1969
+ email,workspace,design,since,switches,lastReason
1970
+ ada@example.com,All New,v2,2026-11-03T00:00:00.000Z,1,
1971
+ "400":
1972
+ description: Invalid workspaceId or design.
1973
+ content:
1974
+ application/json:
1975
+ schema:
1976
+ $ref: "#/components/schemas/ErrorMessageDto"
1977
+ example:
1978
+ error: workspaceId must be a uuid
1979
+ code: invalid_query
1980
+ "401":
1981
+ $ref: "#/components/responses/Unauthorized"
1982
+ "403":
1983
+ description: Caller is not a platform admin.
1984
+ content:
1985
+ application/json:
1986
+ schema:
1987
+ $ref: "#/components/schemas/ErrorMessageDto"
1988
+ example:
1989
+ error: Forbidden
1990
+ code: forbidden
1991
+ "503":
1992
+ description: Design adoption store is unavailable.
1993
+ content:
1994
+ application/json:
1995
+ schema:
1996
+ $ref: "#/components/schemas/ErrorMessageDto"
1997
+
1998
+ /admin/design-adoption/people/{userId}:
1999
+ get:
2000
+ tags: [PlatformAdmin]
2001
+ summary: One person's design switches, including notes
2002
+ operationId: adminGetDesignAdoptionPerson
2003
+ description: >
2004
+ Platform admins only. The same summary fields as a people-list row, plus that
2005
+ person's switch events. `note` is present only here (optional, at most 500
2006
+ characters). Requires a Bearer JWT from an email on `PLATFORM_ADMIN_EMAILS`.
2007
+ parameters:
2008
+ - name: userId
2009
+ in: path
2010
+ required: true
2011
+ schema:
2012
+ type: string
2013
+ format: uuid
2014
+ responses:
2015
+ "200":
2016
+ description: One person and their switch events.
2017
+ content:
2018
+ application/json:
2019
+ schema:
2020
+ $ref: "#/components/schemas/DesignAdoptionPersonDetailDto"
2021
+ "400":
2022
+ description: userId is not a uuid.
2023
+ content:
2024
+ application/json:
2025
+ schema:
2026
+ $ref: "#/components/schemas/ErrorMessageDto"
2027
+ example:
2028
+ error: Invalid user ID format
2029
+ code: invalid_user_id
2030
+ "401":
2031
+ $ref: "#/components/responses/Unauthorized"
2032
+ "403":
2033
+ description: Caller is not a platform admin.
2034
+ content:
2035
+ application/json:
2036
+ schema:
2037
+ $ref: "#/components/schemas/ErrorMessageDto"
2038
+ example:
2039
+ error: Forbidden
2040
+ code: forbidden
2041
+ "404":
2042
+ description: No active user with that id.
2043
+ content:
2044
+ application/json:
2045
+ schema:
2046
+ $ref: "#/components/schemas/ErrorMessageDto"
2047
+ example:
2048
+ error: User not found
2049
+ code: user_not_found
2050
+ "503":
2051
+ description: Design adoption store is unavailable.
2052
+ content:
2053
+ application/json:
2054
+ schema:
2055
+ $ref: "#/components/schemas/ErrorMessageDto"
2056
+
1850
2057
  /admin/jobs-session:
1851
2058
  post:
1852
2059
  tags: [PlatformAdmin]
@@ -28457,6 +28664,189 @@ components:
28457
28664
  maxLength: 200
28458
28665
  description: App path the person was on. Query strings are not stored.
28459
28666
 
28667
+ DesignAdoptionTotalsDto:
28668
+ type: object
28669
+ additionalProperties: false
28670
+ required:
28671
+ [
28672
+ onNew,
28673
+ backOnClassic,
28674
+ neverChose,
28675
+ choseClassic,
28676
+ totalPeople,
28677
+ workspacesFullyOnNew,
28678
+ totalWorkspaces,
28679
+ ]
28680
+ description: >
28681
+ People counts partition active accounts:
28682
+ `onNew + backOnClassic + neverChose + choseClassic = totalPeople`.
28683
+ Workspace counts ignore the people-list filters.
28684
+ properties:
28685
+ onNew:
28686
+ type: integer
28687
+ minimum: 0
28688
+ description: Saved design is the new design (`v2`).
28689
+ backOnClassic:
28690
+ type: integer
28691
+ minimum: 0
28692
+ description: Tried the new design and the saved design is now classic (`v1`).
28693
+ neverChose:
28694
+ type: integer
28695
+ minimum: 0
28696
+ description: No saved design choice.
28697
+ choseClassic:
28698
+ type: integer
28699
+ minimum: 0
28700
+ description: Saved classic (`v1`) without ever switching to the new design.
28701
+ totalPeople:
28702
+ type: integer
28703
+ minimum: 0
28704
+ description: Active accounts.
28705
+ workspacesFullyOnNew:
28706
+ type: integer
28707
+ minimum: 0
28708
+ description: >
28709
+ Active workspaces with at least one active member, where every active member
28710
+ is on the new design.
28711
+ totalWorkspaces:
28712
+ type: integer
28713
+ minimum: 0
28714
+ description: Active workspaces, including those with no members.
28715
+
28716
+ DesignAdoptionReasonCountDto:
28717
+ type: object
28718
+ additionalProperties: false
28719
+ required: [reason, count]
28720
+ properties:
28721
+ reason:
28722
+ allOf:
28723
+ - $ref: "#/components/schemas/DesignSwitchReason"
28724
+ nullable: true
28725
+ description: "`null` means no reason was given on the latest switch back to classic."
28726
+ count:
28727
+ type: integer
28728
+ minimum: 0
28729
+
28730
+ DesignAdoptionPersonDto:
28731
+ type: object
28732
+ additionalProperties: false
28733
+ required: [userId, email, workspaceId, workspaceName, design, since, switchCount, lastReason]
28734
+ description: >
28735
+ One active account. Notes are not included. `workspaceId` is the earliest active
28736
+ membership, or the filtered workspace when `workspaceId` is set on the query.
28737
+ properties:
28738
+ userId:
28739
+ type: string
28740
+ format: uuid
28741
+ email:
28742
+ type: string
28743
+ workspaceId:
28744
+ type: string
28745
+ format: uuid
28746
+ nullable: true
28747
+ workspaceName:
28748
+ type: string
28749
+ nullable: true
28750
+ design:
28751
+ allOf:
28752
+ - $ref: "#/components/schemas/DesignVersion"
28753
+ nullable: true
28754
+ description: "`null` means the person has not chosen a design."
28755
+ since:
28756
+ type: string
28757
+ format: date-time
28758
+ nullable: true
28759
+ description: When the saved design last changed. `null` when none is saved.
28760
+ switchCount:
28761
+ type: integer
28762
+ minimum: 0
28763
+ lastReason:
28764
+ allOf:
28765
+ - $ref: "#/components/schemas/DesignSwitchReason"
28766
+ nullable: true
28767
+ description: Reason on the latest switch event. `null` when there is none.
28768
+
28769
+ DesignAdoptionPeoplePageDto:
28770
+ type: object
28771
+ additionalProperties: false
28772
+ required: [items, total, limit, offset]
28773
+ properties:
28774
+ items:
28775
+ type: array
28776
+ items:
28777
+ $ref: "#/components/schemas/DesignAdoptionPersonDto"
28778
+ total:
28779
+ type: integer
28780
+ minimum: 0
28781
+ description: Matching people before paging.
28782
+ limit:
28783
+ type: integer
28784
+ minimum: 1
28785
+ offset:
28786
+ type: integer
28787
+ minimum: 0
28788
+
28789
+ DesignAdoptionDto:
28790
+ type: object
28791
+ additionalProperties: false
28792
+ required: [totals, reasons, people]
28793
+ properties:
28794
+ totals:
28795
+ $ref: "#/components/schemas/DesignAdoptionTotalsDto"
28796
+ reasons:
28797
+ type: array
28798
+ description: >
28799
+ One row per switch reason, in a stable order, then `reason: null` for no
28800
+ reason given. Counts sum to `totals.backOnClassic`.
28801
+ items:
28802
+ $ref: "#/components/schemas/DesignAdoptionReasonCountDto"
28803
+ people:
28804
+ $ref: "#/components/schemas/DesignAdoptionPeoplePageDto"
28805
+
28806
+ DesignAdoptionSwitchEventDto:
28807
+ type: object
28808
+ additionalProperties: false
28809
+ required: [id, createdAt, fromVersion, toVersion, reason, note, route]
28810
+ properties:
28811
+ id:
28812
+ type: string
28813
+ format: uuid
28814
+ createdAt:
28815
+ type: string
28816
+ format: date-time
28817
+ fromVersion:
28818
+ allOf:
28819
+ - $ref: "#/components/schemas/DesignVersion"
28820
+ nullable: true
28821
+ toVersion:
28822
+ $ref: "#/components/schemas/DesignVersion"
28823
+ reason:
28824
+ allOf:
28825
+ - $ref: "#/components/schemas/DesignSwitchReason"
28826
+ nullable: true
28827
+ note:
28828
+ type: string
28829
+ nullable: true
28830
+ maxLength: 500
28831
+ description: Optional note. Present only on this per-person read.
28832
+ route:
28833
+ type: string
28834
+ nullable: true
28835
+ maxLength: 200
28836
+
28837
+ DesignAdoptionPersonDetailDto:
28838
+ allOf:
28839
+ - $ref: "#/components/schemas/DesignAdoptionPersonDto"
28840
+ - type: object
28841
+ additionalProperties: false
28842
+ required: [events]
28843
+ properties:
28844
+ events:
28845
+ type: array
28846
+ description: Newest switch first. Includes notes.
28847
+ items:
28848
+ $ref: "#/components/schemas/DesignAdoptionSwitchEventDto"
28849
+
28460
28850
  PutPreferencesBodyDto:
28461
28851
  type: object
28462
28852
  additionalProperties: false
@@ -136,6 +136,21 @@
136
136
  "method": "GET",
137
137
  "path": "/platform/banner"
138
138
  },
139
+ "adminGetDesignAdoption": {
140
+ "status": "implemented",
141
+ "method": "GET",
142
+ "path": "/admin/design-adoption"
143
+ },
144
+ "adminExportDesignAdoptionCsv": {
145
+ "status": "implemented",
146
+ "method": "GET",
147
+ "path": "/admin/design-adoption.csv"
148
+ },
149
+ "adminGetDesignAdoptionPerson": {
150
+ "status": "implemented",
151
+ "method": "GET",
152
+ "path": "/admin/design-adoption/people/{userId}"
153
+ },
139
154
  "adminCreateJobsSession": {
140
155
  "status": "implemented",
141
156
  "method": "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.242.0",
3
+ "version": "2.243.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",