@microsoft/vscode-azext-github 2.0.0 → 3.0.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.
- package/dist/cjs/src/createOctokitClient.js +2 -2
- package/dist/cjs/src/extensionVariables.js +1 -26
- package/dist/cjs/src/index.js +3 -1
- package/dist/cjs/src/tree/ActionItem.js +1 -0
- package/dist/cjs/src/tree/JobItem.js +1 -1
- package/dist/cjs/src/utils/actionUtils.js +0 -1
- package/dist/cjs/src/utils/gitHubUrlParse.js +1 -0
- package/dist/cjs/src/wizard/GitHubBranchListStep.js +1 -0
- package/dist/cjs/src/wizard/GitHubRepositoryListStep.js +2 -0
- package/dist/esm/src/createOctokitClient.d.ts +1 -1
- package/dist/esm/src/createOctokitClient.js +1 -1
- package/dist/esm/src/extensionVariables.d.ts +2 -9
- package/dist/esm/src/extensionVariables.js +1 -25
- package/dist/esm/src/index.d.ts +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/tree/ActionItem.js +1 -0
- package/dist/esm/src/tree/JobItem.js +1 -1
- package/dist/esm/src/utils/actionUtils.js +0 -1
- package/dist/esm/src/utils/gitHubUrlParse.js +1 -0
- package/dist/esm/src/wizard/GitHubBranchListStep.js +1 -0
- package/dist/esm/src/wizard/GitHubRepositoryListStep.js +2 -0
- package/package.json +12 -21
- package/dist/cjs/src/GitHubContext.d.ts +0 -9
- package/dist/cjs/src/constants.d.ts +0 -4
- package/dist/cjs/src/createOctokitClient.d.ts +0 -9
- package/dist/cjs/src/extensionVariables.d.ts +0 -13
- package/dist/cjs/src/index.d.ts +0 -15
- package/dist/cjs/src/tree/ActionItem.d.ts +0 -19
- package/dist/cjs/src/tree/ActionsItemBase.d.ts +0 -59
- package/dist/cjs/src/tree/JobItem.d.ts +0 -16
- package/dist/cjs/src/tree/StepItem.d.ts +0 -15
- package/dist/cjs/src/utils/actionUtils.d.ts +0 -35
- package/dist/cjs/src/utils/getGitHubAccessToken.d.ts +0 -1
- package/dist/cjs/src/utils/gitHubUrlParse.d.ts +0 -23
- package/dist/cjs/src/wizard/GitHubBranchListStep.d.ts +0 -13
- package/dist/cjs/src/wizard/GitHubOrgListStep.d.ts +0 -11
- package/dist/cjs/src/wizard/GitHubRepositoryListStep.d.ts +0 -13
- package/dist/cjs/src/wrappers/getActions.d.ts +0 -9
- package/dist/cjs/src/wrappers/getAuthenticatedUser.d.ts +0 -7
- package/dist/cjs/src/wrappers/getBranches.d.ts +0 -11
- package/dist/cjs/src/wrappers/getJobs.d.ts +0 -10
- package/dist/cjs/src/wrappers/getOrgs.d.ts +0 -7
- package/dist/cjs/src/wrappers/getRepositories.d.ts +0 -16
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.createOctokitClient = createOctokitClient;
|
|
8
8
|
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils");
|
|
9
|
-
const rest_1 = require("@octokit/rest");
|
|
10
9
|
const getGitHubAccessToken_1 = require("./utils/getGitHubAccessToken");
|
|
11
10
|
/**
|
|
12
11
|
* Can be used to initialize a new Octokit client.
|
|
@@ -15,8 +14,9 @@ const getGitHubAccessToken_1 = require("./utils/getGitHubAccessToken");
|
|
|
15
14
|
* unless implementing a custom behavior.
|
|
16
15
|
*/
|
|
17
16
|
async function createOctokitClient(context) {
|
|
17
|
+
const { Octokit } = await import('@octokit/rest');
|
|
18
18
|
context.gitHubAccessToken ||= await (0, getGitHubAccessToken_1.getGitHubAccessToken)();
|
|
19
|
-
return new
|
|
19
|
+
return new Octokit({
|
|
20
20
|
userAgent: (0, vscode_azext_utils_1.appendExtensionUserAgent)(),
|
|
21
21
|
auth: context.gitHubAccessToken
|
|
22
22
|
});
|
|
@@ -4,38 +4,13 @@
|
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ext = void 0;
|
|
8
7
|
exports.registerGitHubExtensionVariables = registerGitHubExtensionVariables;
|
|
9
8
|
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils");
|
|
10
|
-
const vscode_1 = require("vscode");
|
|
11
|
-
class UninitializedExtensionVariables {
|
|
12
|
-
_error = new Error(vscode_1.l10n.t('"registerGitHubExtensionVariables" must be called before using the vscode-azext-github package.'));
|
|
13
|
-
get context() {
|
|
14
|
-
throw this._error;
|
|
15
|
-
}
|
|
16
|
-
get outputChannel() {
|
|
17
|
-
throw this._error;
|
|
18
|
-
}
|
|
19
|
-
get ui() {
|
|
20
|
-
throw this._error;
|
|
21
|
-
}
|
|
22
|
-
get prefix() {
|
|
23
|
-
throw this._error;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Container for common extension variables used throughout the github package. They must be initialized with `registerGitHubExtensionVariables`
|
|
28
|
-
*/
|
|
29
|
-
exports.ext = new UninitializedExtensionVariables();
|
|
30
9
|
/**
|
|
31
10
|
* Call this to register common variables used throughout the github package.
|
|
11
|
+
* @deprecated This method is no longer necessary and will be removed in a future release. You can safely remove any calls to this method.
|
|
32
12
|
*/
|
|
33
13
|
function registerGitHubExtensionVariables(extVars) {
|
|
34
|
-
if (exports.ext === extVars) {
|
|
35
|
-
// already registered
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
exports.ext = extVars;
|
|
39
14
|
(0, vscode_azext_utils_1.registerUIExtensionVariables)(extVars);
|
|
40
15
|
}
|
|
41
16
|
//# sourceMappingURL=extensionVariables.js.map
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -18,7 +18,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
21
|
+
exports.registerGitHubExtensionVariables = void 0;
|
|
22
|
+
var extensionVariables_1 = require("./extensionVariables");
|
|
23
|
+
Object.defineProperty(exports, "registerGitHubExtensionVariables", { enumerable: true, get: function () { return extensionVariables_1.registerGitHubExtensionVariables; } });
|
|
22
24
|
__exportStar(require("./GitHubContext"), exports);
|
|
23
25
|
__exportStar(require("./createOctokitClient"), exports);
|
|
24
26
|
__exportStar(require("./utils/getGitHubAccessToken"), exports);
|
|
@@ -62,6 +62,7 @@ class ActionItem {
|
|
|
62
62
|
const getJobsParams = {
|
|
63
63
|
owner: (0, vscode_azext_utils_1.nonNullValue)(ownerOrOrganization),
|
|
64
64
|
repo: (0, vscode_azext_utils_1.nonNullValue)(repositoryName),
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
65
66
|
run_id: this.actionWorkflowRuns.id
|
|
66
67
|
};
|
|
67
68
|
return await (0, getJobs_1.getJobs)(context, getJobsParams);
|
|
@@ -41,7 +41,7 @@ class JobItem {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
async getChildren() {
|
|
44
|
-
return this.job.steps?.map((step) => new StepItem_1.StepItem(this.id, this.extensionPrefixContextValue, step)) ?? [];
|
|
44
|
+
return Promise.resolve(this.job.steps?.map((step) => new StepItem_1.StepItem(this.id, this.extensionPrefixContextValue, step)) ?? []);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.JobItem = JobItem;
|
|
@@ -12,7 +12,6 @@ exports.getJobBasedDescription = getJobBasedDescription;
|
|
|
12
12
|
exports.getActionBasedIconPath = getActionBasedIconPath;
|
|
13
13
|
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils");
|
|
14
14
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
15
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
16
15
|
const relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
|
|
17
16
|
const vscode_1 = require("vscode");
|
|
18
17
|
dayjs_1.default.extend(relativeTime_1.default);
|
|
@@ -11,6 +11,7 @@ exports.gitHubUrlParse = gitHubUrlParse;
|
|
|
11
11
|
* @example 'https://github.com/microsoft/foo-bar'
|
|
12
12
|
*/
|
|
13
13
|
function gitHubUrlParse(url) {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
|
|
14
15
|
const match = url.match(/github\.com\/(?<ownerOrOrganization>[^/]+)\/(?<repositoryName>[^/]+)/i);
|
|
15
16
|
return {
|
|
16
17
|
urlReference: url,
|
|
@@ -35,6 +35,7 @@ class GitHubBranchListStep extends vscode_azext_utils_1.AzureWizardPromptStep {
|
|
|
35
35
|
const branchParams = {
|
|
36
36
|
owner: (0, vscode_azext_utils_1.nonNullProp)(context, 'gitHubRepositoryOwner'),
|
|
37
37
|
repo: (0, vscode_azext_utils_1.nonNullProp)(context, 'gitHubRepository'),
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
38
39
|
per_page: perPage,
|
|
39
40
|
page
|
|
40
41
|
};
|
|
@@ -41,6 +41,7 @@ class GitHubRepositoryListStep extends vscode_azext_utils_1.AzureWizardPromptSte
|
|
|
41
41
|
const userRepoParams = {
|
|
42
42
|
affiliation: 'owner',
|
|
43
43
|
visibility: 'all',
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
44
45
|
per_page: perPage,
|
|
45
46
|
page
|
|
46
47
|
};
|
|
@@ -48,6 +49,7 @@ class GitHubRepositoryListStep extends vscode_azext_utils_1.AzureWizardPromptSte
|
|
|
48
49
|
// Doesn't matter if context.gitHubOrg is undefined; that just means we will end up calling 'getRepositoriesByUser' instead
|
|
49
50
|
org: context.gitHubOrg ?? '',
|
|
50
51
|
type: 'all',
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
51
53
|
per_page: perPage,
|
|
52
54
|
page
|
|
53
55
|
};
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { appendExtensionUserAgent } from "@microsoft/vscode-azext-utils";
|
|
6
|
-
import { Octokit } from "@octokit/rest";
|
|
7
6
|
import { getGitHubAccessToken } from "./utils/getGitHubAccessToken";
|
|
8
7
|
/**
|
|
9
8
|
* Can be used to initialize a new Octokit client.
|
|
@@ -12,6 +11,7 @@ import { getGitHubAccessToken } from "./utils/getGitHubAccessToken";
|
|
|
12
11
|
* unless implementing a custom behavior.
|
|
13
12
|
*/
|
|
14
13
|
export async function createOctokitClient(context) {
|
|
14
|
+
const { Octokit } = await import('@octokit/rest');
|
|
15
15
|
context.gitHubAccessToken ||= await getGitHubAccessToken();
|
|
16
16
|
return new Octokit({
|
|
17
17
|
userAgent: appendExtensionUserAgent(),
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { UIExtensionVariables } from '@microsoft/vscode-azext-utils';
|
|
2
|
-
interface IAzureUtilsExtensionVariables extends UIExtensionVariables {
|
|
3
|
-
prefix: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Container for common extension variables used throughout the github package. They must be initialized with `registerGitHubExtensionVariables`
|
|
7
|
-
*/
|
|
8
|
-
export declare let ext: IAzureUtilsExtensionVariables;
|
|
9
2
|
/**
|
|
10
3
|
* Call this to register common variables used throughout the github package.
|
|
4
|
+
* @deprecated This method is no longer necessary and will be removed in a future release. You can safely remove any calls to this method.
|
|
11
5
|
*/
|
|
12
|
-
export declare function registerGitHubExtensionVariables(extVars:
|
|
13
|
-
export {};
|
|
6
|
+
export declare function registerGitHubExtensionVariables(extVars: UIExtensionVariables): void;
|
|
@@ -3,35 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { registerUIExtensionVariables } from '@microsoft/vscode-azext-utils';
|
|
6
|
-
import { l10n } from "vscode";
|
|
7
|
-
class UninitializedExtensionVariables {
|
|
8
|
-
_error = new Error(l10n.t('"registerGitHubExtensionVariables" must be called before using the vscode-azext-github package.'));
|
|
9
|
-
get context() {
|
|
10
|
-
throw this._error;
|
|
11
|
-
}
|
|
12
|
-
get outputChannel() {
|
|
13
|
-
throw this._error;
|
|
14
|
-
}
|
|
15
|
-
get ui() {
|
|
16
|
-
throw this._error;
|
|
17
|
-
}
|
|
18
|
-
get prefix() {
|
|
19
|
-
throw this._error;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Container for common extension variables used throughout the github package. They must be initialized with `registerGitHubExtensionVariables`
|
|
24
|
-
*/
|
|
25
|
-
export let ext = new UninitializedExtensionVariables();
|
|
26
6
|
/**
|
|
27
7
|
* Call this to register common variables used throughout the github package.
|
|
8
|
+
* @deprecated This method is no longer necessary and will be removed in a future release. You can safely remove any calls to this method.
|
|
28
9
|
*/
|
|
29
10
|
export function registerGitHubExtensionVariables(extVars) {
|
|
30
|
-
if (ext === extVars) {
|
|
31
|
-
// already registered
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
ext = extVars;
|
|
35
11
|
registerUIExtensionVariables(extVars);
|
|
36
12
|
}
|
|
37
13
|
//# sourceMappingURL=extensionVariables.js.map
|
package/dist/esm/src/index.d.ts
CHANGED
package/dist/esm/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
export
|
|
5
|
+
export { registerGitHubExtensionVariables } from './extensionVariables';
|
|
6
6
|
export * from './GitHubContext';
|
|
7
7
|
export * from './createOctokitClient';
|
|
8
8
|
export * from './utils/getGitHubAccessToken';
|
|
@@ -59,6 +59,7 @@ export class ActionItem {
|
|
|
59
59
|
const getJobsParams = {
|
|
60
60
|
owner: nonNullValue(ownerOrOrganization),
|
|
61
61
|
repo: nonNullValue(repositoryName),
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
62
63
|
run_id: this.actionWorkflowRuns.id
|
|
63
64
|
};
|
|
64
65
|
return await getJobs(context, getJobsParams);
|
|
@@ -38,7 +38,7 @@ export class JobItem {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
async getChildren() {
|
|
41
|
-
return this.job.steps?.map((step) => new StepItem(this.id, this.extensionPrefixContextValue, step)) ?? [];
|
|
41
|
+
return Promise.resolve(this.job.steps?.map((step) => new StepItem(this.id, this.extensionPrefixContextValue, step)) ?? []);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=JobItem.js.map
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { nonNullProp } from "@microsoft/vscode-azext-utils";
|
|
6
6
|
import dayjs from "dayjs";
|
|
7
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
8
7
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
9
8
|
import { ThemeColor, ThemeIcon, l10n } from "vscode";
|
|
10
9
|
dayjs.extend(relativeTime);
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @example 'https://github.com/microsoft/foo-bar'
|
|
9
9
|
*/
|
|
10
10
|
export function gitHubUrlParse(url) {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
|
|
11
12
|
const match = url.match(/github\.com\/(?<ownerOrOrganization>[^/]+)\/(?<repositoryName>[^/]+)/i);
|
|
12
13
|
return {
|
|
13
14
|
urlReference: url,
|
|
@@ -32,6 +32,7 @@ export class GitHubBranchListStep extends AzureWizardPromptStep {
|
|
|
32
32
|
const branchParams = {
|
|
33
33
|
owner: nonNullProp(context, 'gitHubRepositoryOwner'),
|
|
34
34
|
repo: nonNullProp(context, 'gitHubRepository'),
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
35
36
|
per_page: perPage,
|
|
36
37
|
page
|
|
37
38
|
};
|
|
@@ -38,6 +38,7 @@ export class GitHubRepositoryListStep extends AzureWizardPromptStep {
|
|
|
38
38
|
const userRepoParams = {
|
|
39
39
|
affiliation: 'owner',
|
|
40
40
|
visibility: 'all',
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
41
42
|
per_page: perPage,
|
|
42
43
|
page
|
|
43
44
|
};
|
|
@@ -45,6 +46,7 @@ export class GitHubRepositoryListStep extends AzureWizardPromptStep {
|
|
|
45
46
|
// Doesn't matter if context.gitHubOrg is undefined; that just means we will end up calling 'getRepositoriesByUser' instead
|
|
46
47
|
org: context.gitHubOrg ?? '',
|
|
47
48
|
type: 'all',
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
48
50
|
per_page: perPage,
|
|
49
51
|
page
|
|
50
52
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/vscode-azext-github",
|
|
3
3
|
"author": "Microsoft Corporation",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Common GitHub tools for VS Code",
|
|
6
6
|
"tags": [
|
|
7
7
|
"azure",
|
|
@@ -26,35 +26,26 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "npm run build:esm && npm run build:cjs",
|
|
28
28
|
"build:esm": "tsc -p ./",
|
|
29
|
-
"build:cjs": "tsc -p ./ --outDir ./dist/cjs --module nodenext --moduleResolution nodenext",
|
|
30
|
-
"lint": "eslint --
|
|
31
|
-
"lint-fix": "eslint --ext .ts . --fix",
|
|
29
|
+
"build:cjs": "tsc -p ./ --outDir ./dist/cjs --module nodenext --moduleResolution nodenext --declaration false",
|
|
30
|
+
"lint": "eslint --max-warnings 0",
|
|
32
31
|
"package": "npm pack",
|
|
33
|
-
"test": "
|
|
32
|
+
"test": "exit 0",
|
|
34
33
|
"l10n": "npx @vscode/l10n-dev export --outDir ./l10n ./src"
|
|
35
34
|
},
|
|
36
35
|
"engines": {
|
|
37
36
|
"vscode": "^1.105.0"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@microsoft/
|
|
41
|
-
"@microsoft/vscode-azureresources-api": "^3.
|
|
42
|
-
"@types/glob": "^8.1.0",
|
|
43
|
-
"@types/mocha": "^7.0.2",
|
|
39
|
+
"@microsoft/vscode-azext-eng": "^1.1.0-alpha.1",
|
|
40
|
+
"@microsoft/vscode-azureresources-api": "^3.1.0",
|
|
44
41
|
"@types/node": "22.x",
|
|
45
|
-
"@types/vscode": "1.
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
|
47
|
-
"@vscode/test-electron": "^2.3.8",
|
|
48
|
-
"eslint": "^8.34.0",
|
|
49
|
-
"eslint-plugin-import": "^2.22.1",
|
|
50
|
-
"glob": "^7.1.6",
|
|
51
|
-
"mocha": "^10.8.2",
|
|
52
|
-
"mocha-junit-reporter": "^2.0.2",
|
|
53
|
-
"mocha-multi-reporters": "^1.1.7",
|
|
54
|
-
"typescript": "^5.9.3"
|
|
42
|
+
"@types/vscode": "1.105.0"
|
|
55
43
|
},
|
|
56
44
|
"dependencies": {
|
|
57
|
-
"@microsoft/vscode-azext-utils": "^
|
|
58
|
-
"@octokit/rest": "^
|
|
45
|
+
"@microsoft/vscode-azext-utils": "^5.0.0",
|
|
46
|
+
"@octokit/rest": "^22.0.1"
|
|
47
|
+
},
|
|
48
|
+
"overrides": {
|
|
49
|
+
"serialize-javascript": "^7.0.5"
|
|
59
50
|
}
|
|
60
51
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IActionContext } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
export interface GitHubContext extends IActionContext {
|
|
3
|
-
gitHubAccessToken?: string;
|
|
4
|
-
gitHubOrg?: string;
|
|
5
|
-
gitHubRepository?: string;
|
|
6
|
-
gitHubRepositoryOwner?: string;
|
|
7
|
-
gitHubRepositoryUrl?: string;
|
|
8
|
-
gitHubBranch?: string;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Octokit } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "./GitHubContext";
|
|
3
|
-
/**
|
|
4
|
-
* Can be used to initialize a new Octokit client.
|
|
5
|
-
*
|
|
6
|
-
* Note: Typically does not need to be called directly by client extensions
|
|
7
|
-
* unless implementing a custom behavior.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createOctokitClient(context: GitHubContext): Promise<Octokit>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { UIExtensionVariables } from '@microsoft/vscode-azext-utils';
|
|
2
|
-
interface IAzureUtilsExtensionVariables extends UIExtensionVariables {
|
|
3
|
-
prefix: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Container for common extension variables used throughout the github package. They must be initialized with `registerGitHubExtensionVariables`
|
|
7
|
-
*/
|
|
8
|
-
export declare let ext: IAzureUtilsExtensionVariables;
|
|
9
|
-
/**
|
|
10
|
-
* Call this to register common variables used throughout the github package.
|
|
11
|
-
*/
|
|
12
|
-
export declare function registerGitHubExtensionVariables(extVars: IAzureUtilsExtensionVariables): void;
|
|
13
|
-
export {};
|
package/dist/cjs/src/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './extensionVariables';
|
|
2
|
-
export * from './GitHubContext';
|
|
3
|
-
export * from './createOctokitClient';
|
|
4
|
-
export * from './utils/getGitHubAccessToken';
|
|
5
|
-
export * from './utils/gitHubUrlParse';
|
|
6
|
-
export * from './tree/ActionsItemBase';
|
|
7
|
-
export * from './wizard/GitHubBranchListStep';
|
|
8
|
-
export * from './wizard/GitHubOrgListStep';
|
|
9
|
-
export * from './wizard/GitHubRepositoryListStep';
|
|
10
|
-
export * from './wrappers/getActions';
|
|
11
|
-
export * from './wrappers/getAuthenticatedUser';
|
|
12
|
-
export * from './wrappers/getBranches';
|
|
13
|
-
export * from './wrappers/getJobs';
|
|
14
|
-
export * from './wrappers/getOrgs';
|
|
15
|
-
export * from './wrappers/getRepositories';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TreeElementBase } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import type { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
|
|
3
|
-
import { TreeItem } from "vscode";
|
|
4
|
-
import { ActionWorkflowRuns } from "../wrappers/getActions";
|
|
5
|
-
export declare class ActionItem implements TreeElementBase {
|
|
6
|
-
private readonly parentResourceId;
|
|
7
|
-
private readonly extensionPrefixContextValue;
|
|
8
|
-
private readonly actionWorkflowRuns;
|
|
9
|
-
static readonly contextValueSuffix: string;
|
|
10
|
-
static readonly completedContextValue: string;
|
|
11
|
-
static readonly inProgressContextValue: string;
|
|
12
|
-
constructor(parentResourceId: string, extensionPrefixContextValue: string, actionWorkflowRuns: ActionWorkflowRuns);
|
|
13
|
-
get id(): string;
|
|
14
|
-
get label(): string;
|
|
15
|
-
get viewProperties(): ViewPropertiesModel;
|
|
16
|
-
private get contextValue();
|
|
17
|
-
getTreeItem(): TreeItem;
|
|
18
|
-
getChildren(): Promise<TreeElementBase[]>;
|
|
19
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { TreeElementBase } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import { TreeItem } from "vscode";
|
|
3
|
-
export interface GitHubSourceControl {
|
|
4
|
-
repoUrl: string;
|
|
5
|
-
repoBranch?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ConnectToGitHubCommand {
|
|
8
|
-
/**
|
|
9
|
-
* The command id to call for initiating the setup of source control for the client extension.
|
|
10
|
-
* The client extension should provide its own connect implementation to call.
|
|
11
|
-
*
|
|
12
|
-
* @example 'containerApps.connectToGitHub'
|
|
13
|
-
*/
|
|
14
|
-
commandId: string;
|
|
15
|
-
/**
|
|
16
|
-
* The list of corresponding args to provide when the command is called
|
|
17
|
-
*/
|
|
18
|
-
commandArgs: unknown[] | undefined;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Base tree node for setting up and tracking GitHub Actions in the tree view.
|
|
22
|
-
* Branching children will be automatically setup and included to track actions, jobs, and steps.
|
|
23
|
-
*/
|
|
24
|
-
export declare abstract class ActionsItemBase implements TreeElementBase {
|
|
25
|
-
private readonly parentId;
|
|
26
|
-
private readonly contextValueExtensionPrefix;
|
|
27
|
-
static readonly contextValueSuffix: string;
|
|
28
|
-
static readonly connectedContextValue: string;
|
|
29
|
-
static readonly unconnectedContextValue: string;
|
|
30
|
-
static readonly idSuffix: string;
|
|
31
|
-
/**
|
|
32
|
-
* @param parentId A unique identifier corresponding to the id of the parent tree node
|
|
33
|
-
* @param contextValueExtensionPrefix The extension prefix used in constructing context values for the 'ActionsItem'
|
|
34
|
-
* and its children. Passing 'containerApps' becomes `containerApps${ActionsItemBase.contextValueSuffix}`.
|
|
35
|
-
*/
|
|
36
|
-
constructor(parentId: string, contextValueExtensionPrefix: string);
|
|
37
|
-
/**
|
|
38
|
-
* Constructed using the format: `${this.parentId}/${ActionsTreeItemBase.idSuffix}`
|
|
39
|
-
*/
|
|
40
|
-
get id(): string;
|
|
41
|
-
readonly label: string;
|
|
42
|
-
private getContextValue;
|
|
43
|
-
getTreeItem(): Promise<TreeItem>;
|
|
44
|
-
getChildren(): Promise<TreeElementBase[]>;
|
|
45
|
-
/**
|
|
46
|
-
* An optional method that the client extension may provide to initiate connection to a GitHub repository.
|
|
47
|
-
*
|
|
48
|
-
* The 'ActionsTreeItem' will display a generic tree item when no connection is detected (e.g. 'Connect to a GitHub Repository...').
|
|
49
|
-
* This tree item becomes an entrypoint for initiating a source control connection.
|
|
50
|
-
*
|
|
51
|
-
* When no method is supplied, clicking on the generic tree item does nothing.
|
|
52
|
-
*/
|
|
53
|
-
getConnectToGitHubCommand?(): Promise<ConnectToGitHubCommand>;
|
|
54
|
-
/**
|
|
55
|
-
* A required method for obtaining the connected GitHub repository's data.
|
|
56
|
-
* If no repository is connected, return undefined.
|
|
57
|
-
*/
|
|
58
|
-
abstract getSourceControl(): Promise<GitHubSourceControl | undefined>;
|
|
59
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TreeElementBase } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import type { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
|
|
3
|
-
import { TreeItem } from "vscode";
|
|
4
|
-
import { Job } from "../wrappers/getJobs";
|
|
5
|
-
export declare class JobItem implements TreeElementBase {
|
|
6
|
-
private readonly parentResourceId;
|
|
7
|
-
private readonly extensionPrefixContextValue;
|
|
8
|
-
private readonly job;
|
|
9
|
-
static contextValueSuffix: string;
|
|
10
|
-
constructor(parentResourceId: string, extensionPrefixContextValue: string, job: Job);
|
|
11
|
-
get id(): string;
|
|
12
|
-
get label(): string;
|
|
13
|
-
get viewProperties(): ViewPropertiesModel;
|
|
14
|
-
getTreeItem(): TreeItem;
|
|
15
|
-
getChildren(): Promise<TreeElementBase[]>;
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { TreeElementBase } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import type { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
|
|
3
|
-
import { TreeItem } from "vscode";
|
|
4
|
-
import { JobStep } from "../wrappers/getJobs";
|
|
5
|
-
export declare class StepItem implements TreeElementBase {
|
|
6
|
-
private readonly parentResourceId;
|
|
7
|
-
private readonly extensionPrefixContextValue;
|
|
8
|
-
private readonly step;
|
|
9
|
-
static contextValueSuffix: string;
|
|
10
|
-
constructor(parentResourceId: string, extensionPrefixContextValue: string, step: JobStep);
|
|
11
|
-
get id(): string;
|
|
12
|
-
get label(): string;
|
|
13
|
-
get viewProperties(): ViewPropertiesModel;
|
|
14
|
-
getTreeItem(): TreeItem;
|
|
15
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ThemeIcon } from "vscode";
|
|
2
|
-
import { ActionWorkflowRuns } from "../wrappers/getActions";
|
|
3
|
-
import { Job, JobStep } from "../wrappers/getJobs";
|
|
4
|
-
/**
|
|
5
|
-
* GitHub 'Check Run' - final conclusion of the check
|
|
6
|
-
* https://developer.github.com/v3/checks/runs/#parameters
|
|
7
|
-
*/
|
|
8
|
-
export declare enum Conclusion {
|
|
9
|
-
Success = "success",
|
|
10
|
-
Failure = "failure",
|
|
11
|
-
Skipped = "skipped",
|
|
12
|
-
Cancelled = "cancelled"
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* GitHub 'Check Run' - current status of the check
|
|
16
|
-
*/
|
|
17
|
-
export declare enum Status {
|
|
18
|
-
Queued = "queued",
|
|
19
|
-
InProgress = "in_progress",
|
|
20
|
-
Completed = "completed"
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get a tree item description based on its Job-related status.
|
|
24
|
-
*
|
|
25
|
-
* Note: Typically does not need to be called directly by client extensions
|
|
26
|
-
* unless implementing a custom experience.
|
|
27
|
-
*/
|
|
28
|
-
export declare function getJobBasedDescription(data: Job | JobStep): string;
|
|
29
|
-
/**
|
|
30
|
-
* Select an icon based on its Action-related status.
|
|
31
|
-
*
|
|
32
|
-
* Note: Typically does not need to be called directly by client extensions
|
|
33
|
-
* unless implementing a custom experience.
|
|
34
|
-
*/
|
|
35
|
-
export declare function getActionBasedIconPath(data: ActionWorkflowRuns | Job | JobStep): ThemeIcon;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getGitHubAccessToken(): Promise<string>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface ParsedGitHubUrl {
|
|
2
|
-
/**
|
|
3
|
-
* The original URL for reference
|
|
4
|
-
* @example 'https://github.com/microsoft/foo-bar'
|
|
5
|
-
*/
|
|
6
|
-
urlReference?: string;
|
|
7
|
-
/**
|
|
8
|
-
* The owner or organization, parsed from the full GitHub URL
|
|
9
|
-
* @example 'microsoft'
|
|
10
|
-
*/
|
|
11
|
-
ownerOrOrganization?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The repository (base), parsed from the full GitHub URL
|
|
14
|
-
* @example 'foo-bar'
|
|
15
|
-
*/
|
|
16
|
-
repositoryName?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A minimal utility function for parsing a full GitHub URL into its constituent parts
|
|
20
|
-
* @params url A complete GitHub repository URL
|
|
21
|
-
* @example 'https://github.com/microsoft/foo-bar'
|
|
22
|
-
*/
|
|
23
|
-
export declare function gitHubUrlParse(url: string): ParsedGitHubUrl;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
/**
|
|
4
|
-
* Used to prompt the user for the GitHub repository branch
|
|
5
|
-
* @prerequisites gitHubRepository, gitHubRepositoryOwner
|
|
6
|
-
* @populates gitHubBranch
|
|
7
|
-
*/
|
|
8
|
-
export declare class GitHubBranchListStep extends AzureWizardPromptStep<GitHubContext> {
|
|
9
|
-
private picks;
|
|
10
|
-
prompt(context: GitHubContext): Promise<void>;
|
|
11
|
-
shouldPrompt(context: GitHubContext): boolean;
|
|
12
|
-
private getPicks;
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
/**
|
|
4
|
-
* Used to prompt the user for the repository's GitHub organization
|
|
5
|
-
* @populates gitHubOrg
|
|
6
|
-
*/
|
|
7
|
-
export declare class GitHubOrgListStep extends AzureWizardPromptStep<GitHubContext> {
|
|
8
|
-
prompt(context: GitHubContext): Promise<void>;
|
|
9
|
-
shouldPrompt(context: GitHubContext): boolean;
|
|
10
|
-
private getPicks;
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
/**
|
|
4
|
-
* Used to prompt the user for the GitHub repository
|
|
5
|
-
* @prerequisites gitHubOrg
|
|
6
|
-
* @populates gitHubRepository, gitHubRepositoryOwner, gitHubRepositoryUrl
|
|
7
|
-
*/
|
|
8
|
-
export declare class GitHubRepositoryListStep extends AzureWizardPromptStep<GitHubContext> {
|
|
9
|
-
private picks;
|
|
10
|
-
prompt(context: GitHubContext): Promise<void>;
|
|
11
|
-
shouldPrompt(context: GitHubContext): boolean;
|
|
12
|
-
private getPicks;
|
|
13
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
export type ActionsListWorkflowRuns = RestEndpointMethodTypes["actions"]["listWorkflowRunsForRepo"]["response"]["data"];
|
|
4
|
-
export type ActionWorkflowRuns = ActionsListWorkflowRuns["workflow_runs"][number];
|
|
5
|
-
export type GetActionsListWorkflowRunsParams = RestEndpointMethodTypes["actions"]["listWorkflowRunsForRepo"]["parameters"];
|
|
6
|
-
/**
|
|
7
|
-
* A wrapper for Octokit's: `client.actions.listWorkflowRunsForRepo`
|
|
8
|
-
*/
|
|
9
|
-
export declare function getActions(context: GitHubContext, params?: GetActionsListWorkflowRunsParams): Promise<ActionsListWorkflowRuns>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
export type AuthenticatedUser = RestEndpointMethodTypes["users"]["getAuthenticated"]["response"]["data"];
|
|
4
|
-
/**
|
|
5
|
-
* A wrapper for Octokit's: `client.users.getAuthenticated`
|
|
6
|
-
*/
|
|
7
|
-
export declare function getAuthenticatedUser(context: GitHubContext): Promise<AuthenticatedUser>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
export type Branches = RestEndpointMethodTypes["repos"]["listBranches"]["response"]["data"];
|
|
4
|
-
export type GetBranchesParams = RestEndpointMethodTypes["repos"]["listBranches"]["parameters"] & {
|
|
5
|
-
owner: string;
|
|
6
|
-
repo: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* A wrapper for Octokit's: `client.repos.listBranches`
|
|
10
|
-
*/
|
|
11
|
-
export declare function getBranches(context: GitHubContext, reqParams: GetBranchesParams): Promise<Branches>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
export type Jobs = RestEndpointMethodTypes["actions"]["listJobsForWorkflowRun"]["response"]["data"];
|
|
4
|
-
export type Job = Jobs["jobs"][number];
|
|
5
|
-
export type JobStep = NonNullable<Job["steps"]>[number];
|
|
6
|
-
export type GetJobsParams = RestEndpointMethodTypes["actions"]["listJobsForWorkflowRun"]["parameters"];
|
|
7
|
-
/**
|
|
8
|
-
* A wrapper for Octokit's: `client.actions.listJobsForWorkflowRun`
|
|
9
|
-
*/
|
|
10
|
-
export declare function getJobs(context: GitHubContext, params: GetJobsParams): Promise<Jobs>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
export type Orgs = RestEndpointMethodTypes["orgs"]["listForAuthenticatedUser"]["response"]["data"];
|
|
4
|
-
/**
|
|
5
|
-
* A wrapper for Octokit's: `client.orgs.listForAuthenticatedUser`
|
|
6
|
-
*/
|
|
7
|
-
export declare function getOrgs(context: GitHubContext): Promise<Orgs>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
-
import type { GitHubContext } from "../GitHubContext";
|
|
3
|
-
export type UserRepos = RestEndpointMethodTypes["repos"]["listForAuthenticatedUser"]["response"]["data"];
|
|
4
|
-
export type GetUserReposReqParams = RestEndpointMethodTypes["repos"]["listForAuthenticatedUser"]["parameters"];
|
|
5
|
-
/**
|
|
6
|
-
* A wrapper for Octokit's: `client.repos.listForAuthenticatedUser`
|
|
7
|
-
*/
|
|
8
|
-
export declare function getRepositoriesByUser(context: GitHubContext, reqParams?: GetUserReposReqParams): Promise<UserRepos>;
|
|
9
|
-
export type OrgRepos = RestEndpointMethodTypes["repos"]["listForOrg"]["response"]["data"];
|
|
10
|
-
export type GetOrgReposReqParams = RestEndpointMethodTypes["repos"]["listForOrg"]["parameters"] & {
|
|
11
|
-
org: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* A wrapper for Octokit's: `client.repos.listForOrg`
|
|
15
|
-
*/
|
|
16
|
-
export declare function getRepositoriesByOrg(context: GitHubContext, reqParams: GetOrgReposReqParams): Promise<OrgRepos>;
|