Skip to content

Commit 337e5f8

Browse files
Adjust comments in releases-api-consumer.ts
1 parent 6d1cf08 commit 337e5f8

1 file changed

Lines changed: 11 additions & 33 deletions

File tree

extensions/ql-vscode/src/codeql-cli/releases-api-consumer.ts

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { URL } from "url";
44
import { Release, ReleaseAsset } from "./release";
55
import { GithubRateLimitedError, GithubApiError } from "./github-api-error";
66

7+
/**
8+
* Communicates with the GitHub API to determine the latest compatible release and download assets.
9+
*/
710
export class ReleasesApiConsumer {
811
constructor(
912
ownerName: string,
@@ -173,52 +176,27 @@ function isRedirectStatusCode(statusCode: number): boolean {
173176

174177
/**
175178
* The json returned from github for a release.
179+
* See https://docs.github.com/en/rest/releases/releases#get-a-release for example response and response schema.
180+
*
181+
* This type must match the format of the GitHub API and is not intended to be used outside of this file except for tests. Please use the `Release` type instead.
176182
*/
177-
interface GithubRelease {
183+
export interface GithubRelease {
178184
assets: GithubReleaseAsset[];
179-
180-
/**
181-
* The creation date of the release on GitHub, in ISO 8601 format.
182-
*/
183185
created_at: string;
184-
185-
/**
186-
* The id associated with the release on GitHub.
187-
*/
188186
id: number;
189-
190-
/**
191-
* The name associated with the release on GitHub.
192-
*/
193187
name: string;
194-
195-
/**
196-
* Whether the release is a prerelease.
197-
*/
198188
prerelease: boolean;
199-
200-
/**
201-
* The tag name. This should be the version.
202-
*/
203189
tag_name: string;
204190
}
205191

206192
/**
207193
* The json returned by github for an asset in a release.
194+
* See https://docs.github.com/en/rest/releases/releases#get-a-release for example response and response schema.
195+
*
196+
* This type must match the format of the GitHub API and is not intended to be used outside of this file except for tests. Please use the `ReleaseAsset` type instead.
208197
*/
209-
interface GithubReleaseAsset {
210-
/**
211-
* The id associated with the asset on GitHub.
212-
*/
198+
export interface GithubReleaseAsset {
213199
id: number;
214-
215-
/**
216-
* The name associated with the asset on GitHub.
217-
*/
218200
name: string;
219-
220-
/**
221-
* The size of the asset in bytes.
222-
*/
223201
size: number;
224202
}

0 commit comments

Comments
 (0)