@@ -17,6 +17,12 @@ export const UnityChangeset = UnityChangesetClass;
1717export type UnityChangeset = UnityChangesetClass ;
1818export { UnityReleaseEntitlement , UnityReleaseStream } ;
1919
20+ /**
21+ * Retrieves the Unity changeset for a specific version.
22+ * @param version - The Unity version string (e.g., "2020.1.14f1").
23+ * @returns A Promise that resolves to the UnityChangeset object.
24+ * @throws Error if the version is not found.
25+ */
2026export async function getUnityChangeset (
2127 version : string ,
2228) : Promise < UnityChangeset > {
@@ -117,6 +123,15 @@ export enum FormatMode {
117123 PrettyJson = "pretty-json" ,
118124}
119125
126+ /**
127+ * Lists Unity changesets based on search, filter, group, output, and format options.
128+ * @param searchMode - The search mode to use.
129+ * @param filterOptions - The filter options to apply.
130+ * @param groupMode - The group mode to use.
131+ * @param outputMode - The output mode for the results.
132+ * @param formatMode - The format mode for the output.
133+ * @returns A Promise that resolves to a formatted string of the results.
134+ */
120135export function listChangesets (
121136 searchMode : SearchMode ,
122137 filterOptions : FilterOptions ,
@@ -160,6 +175,12 @@ export function listChangesets(
160175 } ) ;
161176}
162177
178+ /**
179+ * Searches for Unity changesets based on the specified search mode.
180+ * @param searchMode - The search mode to use.
181+ * @returns A Promise that resolves to an array of UnityChangeset objects.
182+ * @throws Error if the search mode is not supported.
183+ */
163184export async function searchChangesets (
164185 searchMode : SearchMode ,
165186) : Promise < UnityChangeset [ ] > {
@@ -182,6 +203,12 @@ export async function searchChangesets(
182203 }
183204}
184205
206+ /**
207+ * Filters an array of Unity changesets based on the provided options.
208+ * @param changesets - The array of UnityChangeset objects to filter.
209+ * @param options - The filter options.
210+ * @returns An array of filtered UnityChangeset objects.
211+ */
185212export function filterChangesets (
186213 changesets : UnityChangeset [ ] ,
187214 options : FilterOptions ,
@@ -216,6 +243,13 @@ export function filterChangesets(
216243 ) ;
217244}
218245
246+ /**
247+ * Groups an array of Unity changesets based on the specified group mode.
248+ * @param changesets - The array of UnityChangeset objects to group.
249+ * @param groupMode - The group mode to use.
250+ * @returns An array of grouped UnityChangeset objects.
251+ * @throws Error if the group mode is not supported.
252+ */
219253export function groupChangesets (
220254 changesets : UnityChangeset [ ] ,
221255 groupMode : GroupMode ,
@@ -243,6 +277,11 @@ export function groupChangesets(
243277 }
244278}
245279
280+ /**
281+ * Retrieves all Unity changesets from the database.
282+ * @returns A Promise that resolves to an array of all UnityChangeset objects from the database.
283+ * @throws Error if the database cannot be fetched or is invalid.
284+ */
246285export function getAllChangesetsFromDb ( ) : Promise < UnityChangeset [ ] > {
247286 return fetch ( UNITY_CHANGESETS_DB_URL )
248287 . then ( ( res ) => {
@@ -262,6 +301,11 @@ export function getAllChangesetsFromDb(): Promise<UnityChangeset[]> {
262301 } ) ;
263302}
264303
304+ /**
305+ * Searches for Unity changesets from the database based on the specified search mode.
306+ * @param searchMode - The search mode to use.
307+ * @returns A Promise that resolves to an array of UnityChangeset objects from the database.
308+ */
265309export function searchChangesetsFromDb (
266310 searchMode : SearchMode ,
267311) : Promise < UnityChangeset [ ] > {
0 commit comments