@@ -13,11 +13,15 @@ export enum UnityReleaseStream {
1313interface UnityReleasesResponse {
1414 getUnityReleases : {
1515 totalCount : number ;
16- edges : { node : { version : string ; shortRevision : string } } [ ] ;
16+ edges : { node : { version : string ; shortRevision : string ; stream : UnityReleaseStream } } [ ] ;
1717 pageInfo : { hasNextPage : boolean } ;
1818 } ;
1919}
2020
21+ interface UnityReleasesMajorVersionsResponse {
22+ getUnityReleaseMajorVersions : { version : string ; } [ ] ;
23+ }
24+
2125export async function getUnityReleases (
2226 version : string ,
2327 stream : UnityReleaseStream [ ] = [ ] ,
@@ -38,6 +42,7 @@ query GetRelease($limit: Int, $skip: Int, $version: String!, $stream: [UnityRele
3842 node {
3943 version
4044 shortRevision
45+ stream
4146 }
4247 }
4348 pageInfo {
@@ -58,7 +63,7 @@ query GetRelease($limit: Int, $skip: Int, $version: String!, $stream: [UnityRele
5863 const data : UnityReleasesResponse = await client . request ( query , variables ) ;
5964 results . push (
6065 ...data . getUnityReleases . edges . map ( ( edge ) =>
61- new UnityChangeset ( edge . node . version , edge . node . shortRevision )
66+ new UnityChangeset ( edge . node . version , edge . node . shortRevision , edge . node . stream == UnityReleaseStream . LTS )
6267 ) ,
6368 ) ;
6469 if ( data . getUnityReleases . pageInfo . hasNextPage === false ) {
@@ -70,3 +75,26 @@ query GetRelease($limit: Int, $skip: Int, $version: String!, $stream: [UnityRele
7075
7176 return results ;
7277}
78+
79+ export async function getUnityReleasesInLTS ( ) : Promise < UnityChangeset [ ] > {
80+ const client = new GraphQLClient ( UNITY_GRAPHQL_ENDPOINT ) ;
81+ const query = gql `
82+ query {
83+ getUnityReleaseMajorVersions(
84+ stream: []
85+ platform: []
86+ architecture: []
87+ entitlements: []
88+ ) {
89+ version
90+ }
91+ }
92+ ` ;
93+ const data : UnityReleasesMajorVersionsResponse = await client . request ( query ) ;
94+ const results = await Promise . all ( data . getUnityReleaseMajorVersions
95+ . map ( async ( v ) => {
96+ return await getUnityReleases ( v . version , [ UnityReleaseStream . LTS ] ) ;
97+ } ) ) ;
98+
99+ return results . flat ( ) ;
100+ }
0 commit comments