@pilatos/bitbucket-cli 1.5.0 → 1.6.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/README.md +9 -7
- package/dist/index.js +372 -4
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -79,15 +79,16 @@ bb pr list
|
|
|
79
79
|
|
|
80
80
|
## Features
|
|
81
81
|
|
|
82
|
-
| Category
|
|
83
|
-
|
|
84
|
-
| **Authentication**
|
|
85
|
-
| **Repositories**
|
|
86
|
-
| **Pull Requests**
|
|
87
|
-
| **Configuration**
|
|
88
|
-
| **Shell Completion** | `install`, `uninstall`
|
|
82
|
+
| Category | Commands |
|
|
83
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
84
|
+
| **Authentication** | `login`, `logout`, `status`, `token` |
|
|
85
|
+
| **Repositories** | `clone`, `create`, `list`, `view`, `delete` |
|
|
86
|
+
| **Pull Requests** | `create`, `list`, `view`, `activity`, `checks`, `edit`, `merge`, `approve`, `decline`, `ready`, `checkout`, `diff`, `comment`, `comments`, `reviewers` |
|
|
87
|
+
| **Configuration** | `get`, `set`, `list` |
|
|
88
|
+
| **Shell Completion** | `install`, `uninstall` |
|
|
89
89
|
|
|
90
90
|
**Global Options:**
|
|
91
|
+
|
|
91
92
|
- `--json` — Output results as JSON for scripting
|
|
92
93
|
- `-w, --workspace` — Specify workspace
|
|
93
94
|
- `-r, --repo` — Specify repository
|
|
@@ -139,6 +140,7 @@ bb pr list
|
|
|
139
140
|
# Review and merge
|
|
140
141
|
bb pr view 42
|
|
141
142
|
bb pr activity 42
|
|
143
|
+
bb pr checks 42
|
|
142
144
|
bb pr approve 42
|
|
143
145
|
bb pr merge 42
|
|
144
146
|
|
package/dist/index.js
CHANGED
|
@@ -44165,6 +44165,7 @@ var ServiceTokens = {
|
|
|
44165
44165
|
PullrequestsApi: "PullrequestsApi",
|
|
44166
44166
|
RepositoriesApi: "RepositoriesApi",
|
|
44167
44167
|
UsersApi: "UsersApi",
|
|
44168
|
+
CommitStatusesApi: "CommitStatusesApi",
|
|
44168
44169
|
LoginCommand: "LoginCommand",
|
|
44169
44170
|
LogoutCommand: "LogoutCommand",
|
|
44170
44171
|
StatusCommand: "StatusCommand",
|
|
@@ -44185,6 +44186,7 @@ var ServiceTokens = {
|
|
|
44185
44186
|
CheckoutPRCommand: "CheckoutPRCommand",
|
|
44186
44187
|
DiffPRCommand: "DiffPRCommand",
|
|
44187
44188
|
ActivityPRCommand: "ActivityPRCommand",
|
|
44189
|
+
ChecksPRCommand: "ChecksPRCommand",
|
|
44188
44190
|
CommentPRCommand: "CommentPRCommand",
|
|
44189
44191
|
ListCommentsPRCommand: "ListCommentsPRCommand",
|
|
44190
44192
|
EditCommentPRCommand: "EditCommentPRCommand",
|
|
@@ -48746,6 +48748,208 @@ var createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH2, configu
|
|
|
48746
48748
|
};
|
|
48747
48749
|
|
|
48748
48750
|
// src/generated/api.ts
|
|
48751
|
+
var CommitStatusesApiAxiosParamCreator = function(configuration) {
|
|
48752
|
+
return {
|
|
48753
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet: async (commit, key, repoSlug, workspace, options = {}) => {
|
|
48754
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet", "commit", commit);
|
|
48755
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet", "key", key);
|
|
48756
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet", "repoSlug", repoSlug);
|
|
48757
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet", "workspace", workspace);
|
|
48758
|
+
const localVarPath = `/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}`.replace(`{${"commit"}}`, encodeURIComponent(String(commit))).replace(`{${"key"}}`, encodeURIComponent(String(key))).replace(`{${"repo_slug"}}`, encodeURIComponent(String(repoSlug))).replace(`{${"workspace"}}`, encodeURIComponent(String(workspace)));
|
|
48759
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
48760
|
+
let baseOptions;
|
|
48761
|
+
if (configuration) {
|
|
48762
|
+
baseOptions = configuration.baseOptions;
|
|
48763
|
+
}
|
|
48764
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
48765
|
+
const localVarHeaderParameter = {};
|
|
48766
|
+
const localVarQueryParameter = {};
|
|
48767
|
+
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
48768
|
+
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["repository"], configuration);
|
|
48769
|
+
setBasicAuthToObject(localVarRequestOptions, configuration);
|
|
48770
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
48771
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
48772
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
48773
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
48774
|
+
return {
|
|
48775
|
+
url: toPathString(localVarUrlObj),
|
|
48776
|
+
options: localVarRequestOptions
|
|
48777
|
+
};
|
|
48778
|
+
},
|
|
48779
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut: async (commit, key, repoSlug, workspace, body, options = {}) => {
|
|
48780
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut", "commit", commit);
|
|
48781
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut", "key", key);
|
|
48782
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut", "repoSlug", repoSlug);
|
|
48783
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut", "workspace", workspace);
|
|
48784
|
+
const localVarPath = `/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}`.replace(`{${"commit"}}`, encodeURIComponent(String(commit))).replace(`{${"key"}}`, encodeURIComponent(String(key))).replace(`{${"repo_slug"}}`, encodeURIComponent(String(repoSlug))).replace(`{${"workspace"}}`, encodeURIComponent(String(workspace)));
|
|
48785
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
48786
|
+
let baseOptions;
|
|
48787
|
+
if (configuration) {
|
|
48788
|
+
baseOptions = configuration.baseOptions;
|
|
48789
|
+
}
|
|
48790
|
+
const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
|
|
48791
|
+
const localVarHeaderParameter = {};
|
|
48792
|
+
const localVarQueryParameter = {};
|
|
48793
|
+
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
48794
|
+
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["repository"], configuration);
|
|
48795
|
+
setBasicAuthToObject(localVarRequestOptions, configuration);
|
|
48796
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
48797
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
48798
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
48799
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
48800
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
48801
|
+
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
|
|
48802
|
+
return {
|
|
48803
|
+
url: toPathString(localVarUrlObj),
|
|
48804
|
+
options: localVarRequestOptions
|
|
48805
|
+
};
|
|
48806
|
+
},
|
|
48807
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost: async (commit, repoSlug, workspace, body, options = {}) => {
|
|
48808
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost", "commit", commit);
|
|
48809
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost", "repoSlug", repoSlug);
|
|
48810
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost", "workspace", workspace);
|
|
48811
|
+
const localVarPath = `/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build`.replace(`{${"commit"}}`, encodeURIComponent(String(commit))).replace(`{${"repo_slug"}}`, encodeURIComponent(String(repoSlug))).replace(`{${"workspace"}}`, encodeURIComponent(String(workspace)));
|
|
48812
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
48813
|
+
let baseOptions;
|
|
48814
|
+
if (configuration) {
|
|
48815
|
+
baseOptions = configuration.baseOptions;
|
|
48816
|
+
}
|
|
48817
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
48818
|
+
const localVarHeaderParameter = {};
|
|
48819
|
+
const localVarQueryParameter = {};
|
|
48820
|
+
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
48821
|
+
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["repository"], configuration);
|
|
48822
|
+
setBasicAuthToObject(localVarRequestOptions, configuration);
|
|
48823
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
48824
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
48825
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
48826
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
48827
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
48828
|
+
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
|
|
48829
|
+
return {
|
|
48830
|
+
url: toPathString(localVarUrlObj),
|
|
48831
|
+
options: localVarRequestOptions
|
|
48832
|
+
};
|
|
48833
|
+
},
|
|
48834
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesGet: async (commit, repoSlug, workspace, refname, q, sort, options = {}) => {
|
|
48835
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesGet", "commit", commit);
|
|
48836
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesGet", "repoSlug", repoSlug);
|
|
48837
|
+
assertParamExists("repositoriesWorkspaceRepoSlugCommitCommitStatusesGet", "workspace", workspace);
|
|
48838
|
+
const localVarPath = `/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses`.replace(`{${"commit"}}`, encodeURIComponent(String(commit))).replace(`{${"repo_slug"}}`, encodeURIComponent(String(repoSlug))).replace(`{${"workspace"}}`, encodeURIComponent(String(workspace)));
|
|
48839
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
48840
|
+
let baseOptions;
|
|
48841
|
+
if (configuration) {
|
|
48842
|
+
baseOptions = configuration.baseOptions;
|
|
48843
|
+
}
|
|
48844
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
48845
|
+
const localVarHeaderParameter = {};
|
|
48846
|
+
const localVarQueryParameter = {};
|
|
48847
|
+
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
48848
|
+
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["repository"], configuration);
|
|
48849
|
+
setBasicAuthToObject(localVarRequestOptions, configuration);
|
|
48850
|
+
if (refname !== undefined) {
|
|
48851
|
+
localVarQueryParameter["refname"] = refname;
|
|
48852
|
+
}
|
|
48853
|
+
if (q !== undefined) {
|
|
48854
|
+
localVarQueryParameter["q"] = q;
|
|
48855
|
+
}
|
|
48856
|
+
if (sort !== undefined) {
|
|
48857
|
+
localVarQueryParameter["sort"] = sort;
|
|
48858
|
+
}
|
|
48859
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
48860
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
48861
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
48862
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
48863
|
+
return {
|
|
48864
|
+
url: toPathString(localVarUrlObj),
|
|
48865
|
+
options: localVarRequestOptions
|
|
48866
|
+
};
|
|
48867
|
+
},
|
|
48868
|
+
repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet: async (pullRequestId, repoSlug, workspace, q, sort, options = {}) => {
|
|
48869
|
+
assertParamExists("repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet", "pullRequestId", pullRequestId);
|
|
48870
|
+
assertParamExists("repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet", "repoSlug", repoSlug);
|
|
48871
|
+
assertParamExists("repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet", "workspace", workspace);
|
|
48872
|
+
const localVarPath = `/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses`.replace(`{${"pull_request_id"}}`, encodeURIComponent(String(pullRequestId))).replace(`{${"repo_slug"}}`, encodeURIComponent(String(repoSlug))).replace(`{${"workspace"}}`, encodeURIComponent(String(workspace)));
|
|
48873
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
48874
|
+
let baseOptions;
|
|
48875
|
+
if (configuration) {
|
|
48876
|
+
baseOptions = configuration.baseOptions;
|
|
48877
|
+
}
|
|
48878
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
48879
|
+
const localVarHeaderParameter = {};
|
|
48880
|
+
const localVarQueryParameter = {};
|
|
48881
|
+
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
48882
|
+
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["pullrequest"], configuration);
|
|
48883
|
+
setBasicAuthToObject(localVarRequestOptions, configuration);
|
|
48884
|
+
if (q !== undefined) {
|
|
48885
|
+
localVarQueryParameter["q"] = q;
|
|
48886
|
+
}
|
|
48887
|
+
if (sort !== undefined) {
|
|
48888
|
+
localVarQueryParameter["sort"] = sort;
|
|
48889
|
+
}
|
|
48890
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
48891
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
48892
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
48893
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
48894
|
+
return {
|
|
48895
|
+
url: toPathString(localVarUrlObj),
|
|
48896
|
+
options: localVarRequestOptions
|
|
48897
|
+
};
|
|
48898
|
+
}
|
|
48899
|
+
};
|
|
48900
|
+
};
|
|
48901
|
+
var CommitStatusesApiFp = function(configuration) {
|
|
48902
|
+
const localVarAxiosParamCreator = CommitStatusesApiAxiosParamCreator(configuration);
|
|
48903
|
+
return {
|
|
48904
|
+
async repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet(commit, key, repoSlug, workspace, options) {
|
|
48905
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet(commit, key, repoSlug, workspace, options);
|
|
48906
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
48907
|
+
const localVarOperationServerBasePath = operationServerMap["CommitStatusesApi.repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet"]?.[localVarOperationServerIndex]?.url;
|
|
48908
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
48909
|
+
},
|
|
48910
|
+
async repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut(commit, key, repoSlug, workspace, body, options) {
|
|
48911
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut(commit, key, repoSlug, workspace, body, options);
|
|
48912
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
48913
|
+
const localVarOperationServerBasePath = operationServerMap["CommitStatusesApi.repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut"]?.[localVarOperationServerIndex]?.url;
|
|
48914
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
48915
|
+
},
|
|
48916
|
+
async repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost(commit, repoSlug, workspace, body, options) {
|
|
48917
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost(commit, repoSlug, workspace, body, options);
|
|
48918
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
48919
|
+
const localVarOperationServerBasePath = operationServerMap["CommitStatusesApi.repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost"]?.[localVarOperationServerIndex]?.url;
|
|
48920
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
48921
|
+
},
|
|
48922
|
+
async repositoriesWorkspaceRepoSlugCommitCommitStatusesGet(commit, repoSlug, workspace, refname, q, sort, options) {
|
|
48923
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.repositoriesWorkspaceRepoSlugCommitCommitStatusesGet(commit, repoSlug, workspace, refname, q, sort, options);
|
|
48924
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
48925
|
+
const localVarOperationServerBasePath = operationServerMap["CommitStatusesApi.repositoriesWorkspaceRepoSlugCommitCommitStatusesGet"]?.[localVarOperationServerIndex]?.url;
|
|
48926
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
48927
|
+
},
|
|
48928
|
+
async repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(pullRequestId, repoSlug, workspace, q, sort, options) {
|
|
48929
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(pullRequestId, repoSlug, workspace, q, sort, options);
|
|
48930
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
48931
|
+
const localVarOperationServerBasePath = operationServerMap["CommitStatusesApi.repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet"]?.[localVarOperationServerIndex]?.url;
|
|
48932
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
48933
|
+
}
|
|
48934
|
+
};
|
|
48935
|
+
};
|
|
48936
|
+
class CommitStatusesApi extends BaseAPI {
|
|
48937
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet(requestParameters, options) {
|
|
48938
|
+
return CommitStatusesApiFp(this.configuration).repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyGet(requestParameters.commit, requestParameters.key, requestParameters.repoSlug, requestParameters.workspace, options).then((request) => request(this.axios, this.basePath));
|
|
48939
|
+
}
|
|
48940
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut(requestParameters, options) {
|
|
48941
|
+
return CommitStatusesApiFp(this.configuration).repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildKeyPut(requestParameters.commit, requestParameters.key, requestParameters.repoSlug, requestParameters.workspace, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
48942
|
+
}
|
|
48943
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost(requestParameters, options) {
|
|
48944
|
+
return CommitStatusesApiFp(this.configuration).repositoriesWorkspaceRepoSlugCommitCommitStatusesBuildPost(requestParameters.commit, requestParameters.repoSlug, requestParameters.workspace, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
48945
|
+
}
|
|
48946
|
+
repositoriesWorkspaceRepoSlugCommitCommitStatusesGet(requestParameters, options) {
|
|
48947
|
+
return CommitStatusesApiFp(this.configuration).repositoriesWorkspaceRepoSlugCommitCommitStatusesGet(requestParameters.commit, requestParameters.repoSlug, requestParameters.workspace, requestParameters.refname, requestParameters.q, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
48948
|
+
}
|
|
48949
|
+
repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(requestParameters, options) {
|
|
48950
|
+
return CommitStatusesApiFp(this.configuration).repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(requestParameters.pullRequestId, requestParameters.repoSlug, requestParameters.workspace, requestParameters.q, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
48951
|
+
}
|
|
48952
|
+
}
|
|
48749
48953
|
var PullrequestsApiAxiosParamCreator = function(configuration) {
|
|
48750
48954
|
return {
|
|
48751
48955
|
getPullrequestsForCommit: async (workspace, repoSlug, commit, page, pagelen, options = {}) => {
|
|
@@ -52784,7 +52988,10 @@ class ListReviewersPRCommand extends BaseCommand {
|
|
|
52784
52988
|
} else if (reviewers.length === 0) {
|
|
52785
52989
|
this.output.info("No reviewers assigned to this pull request");
|
|
52786
52990
|
} else {
|
|
52787
|
-
this.output.table(["Display Name", "Account ID"], reviewers.map((r) => [
|
|
52991
|
+
this.output.table(["Display Name", "Account ID"], reviewers.map((r) => [
|
|
52992
|
+
r.display_name ?? "Unknown",
|
|
52993
|
+
r.account_id ?? ""
|
|
52994
|
+
]));
|
|
52788
52995
|
}
|
|
52789
52996
|
} catch (error) {
|
|
52790
52997
|
this.handleError(error, context);
|
|
@@ -52793,9 +53000,150 @@ class ListReviewersPRCommand extends BaseCommand {
|
|
|
52793
53000
|
}
|
|
52794
53001
|
}
|
|
52795
53002
|
|
|
53003
|
+
// src/commands/pr/checks.command.ts
|
|
53004
|
+
class ChecksPRCommand extends BaseCommand {
|
|
53005
|
+
commitStatusesApi;
|
|
53006
|
+
contextService;
|
|
53007
|
+
name = "checks";
|
|
53008
|
+
description = "Show CI/CD checks and build status for a pull request";
|
|
53009
|
+
constructor(commitStatusesApi, contextService, output) {
|
|
53010
|
+
super(output);
|
|
53011
|
+
this.commitStatusesApi = commitStatusesApi;
|
|
53012
|
+
this.contextService = contextService;
|
|
53013
|
+
}
|
|
53014
|
+
async execute(options, context) {
|
|
53015
|
+
const repoContext = await this.contextService.requireRepoContext({
|
|
53016
|
+
...context.globalOptions,
|
|
53017
|
+
...options
|
|
53018
|
+
});
|
|
53019
|
+
const prId = parseInt(options.id, 10);
|
|
53020
|
+
try {
|
|
53021
|
+
const response = await this.commitStatusesApi.repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet({
|
|
53022
|
+
workspace: repoContext.workspace,
|
|
53023
|
+
repoSlug: repoContext.repoSlug,
|
|
53024
|
+
pullRequestId: prId
|
|
53025
|
+
});
|
|
53026
|
+
const data = response.data;
|
|
53027
|
+
const statuses = data?.values ? Array.from(data.values) : [];
|
|
53028
|
+
const useJson = options.json || context.globalOptions.json;
|
|
53029
|
+
if (useJson) {
|
|
53030
|
+
this.output.json({
|
|
53031
|
+
pullRequestId: prId,
|
|
53032
|
+
workspace: repoContext.workspace,
|
|
53033
|
+
repoSlug: repoContext.repoSlug,
|
|
53034
|
+
statuses: statuses.map((status) => this.formatStatusForJson(status))
|
|
53035
|
+
});
|
|
53036
|
+
return;
|
|
53037
|
+
}
|
|
53038
|
+
if (statuses.length === 0) {
|
|
53039
|
+
this.output.info("No CI/CD checks found for this pull request");
|
|
53040
|
+
return;
|
|
53041
|
+
}
|
|
53042
|
+
this.renderHeader(prId, statuses.length);
|
|
53043
|
+
this.renderStatuses(statuses);
|
|
53044
|
+
} catch (error) {
|
|
53045
|
+
this.handleError(error, context);
|
|
53046
|
+
throw error;
|
|
53047
|
+
}
|
|
53048
|
+
}
|
|
53049
|
+
formatStatusForJson(status) {
|
|
53050
|
+
return {
|
|
53051
|
+
key: status.key,
|
|
53052
|
+
name: status.name,
|
|
53053
|
+
state: status.state,
|
|
53054
|
+
description: status.description,
|
|
53055
|
+
url: status.url,
|
|
53056
|
+
refname: status.refname,
|
|
53057
|
+
createdOn: status.created_on,
|
|
53058
|
+
updatedOn: status.updated_on,
|
|
53059
|
+
uuid: status.uuid
|
|
53060
|
+
};
|
|
53061
|
+
}
|
|
53062
|
+
renderHeader(prId, count) {
|
|
53063
|
+
this.output.text("");
|
|
53064
|
+
this.output.text(`${source_default.bold(`Pull Request #${prId}`)} - ${count} check${count === 1 ? "" : "s"}`);
|
|
53065
|
+
this.output.text(source_default.gray("-".repeat(60)));
|
|
53066
|
+
}
|
|
53067
|
+
renderStatuses(statuses) {
|
|
53068
|
+
const rows = statuses.map((status) => {
|
|
53069
|
+
const stateIcon = this.getStateIcon(status.state);
|
|
53070
|
+
const stateLabel = this.getStateLabel(status.state);
|
|
53071
|
+
const name = status.name ?? status.key ?? "Unknown";
|
|
53072
|
+
const description = status.description ?? "-";
|
|
53073
|
+
return [
|
|
53074
|
+
`${stateIcon} ${stateLabel}`,
|
|
53075
|
+
source_default.bold(name),
|
|
53076
|
+
this.truncate(description, 40),
|
|
53077
|
+
status.updated_on ? this.output.formatDate(status.updated_on) : "-"
|
|
53078
|
+
];
|
|
53079
|
+
});
|
|
53080
|
+
this.output.table(["STATUS", "NAME", "DESCRIPTION", "UPDATED"], rows);
|
|
53081
|
+
const summary = this.getSummary(statuses);
|
|
53082
|
+
this.output.text("");
|
|
53083
|
+
this.output.text(`${source_default.green("OK")} ${summary.successful} successful, ${source_default.red("FAIL")} ${summary.failed} failed, ${source_default.yellow("RUN")} ${summary.pending} pending`);
|
|
53084
|
+
this.output.text("");
|
|
53085
|
+
}
|
|
53086
|
+
getStateIcon(state) {
|
|
53087
|
+
switch (state?.toUpperCase()) {
|
|
53088
|
+
case "SUCCESSFUL":
|
|
53089
|
+
return source_default.green("OK");
|
|
53090
|
+
case "FAILED":
|
|
53091
|
+
return source_default.red("FAIL");
|
|
53092
|
+
case "INPROGRESS":
|
|
53093
|
+
return source_default.yellow("RUN");
|
|
53094
|
+
case "STOPPED":
|
|
53095
|
+
return source_default.gray("STOP");
|
|
53096
|
+
default:
|
|
53097
|
+
return source_default.gray("?");
|
|
53098
|
+
}
|
|
53099
|
+
}
|
|
53100
|
+
getStateLabel(state) {
|
|
53101
|
+
switch (state?.toUpperCase()) {
|
|
53102
|
+
case "SUCCESSFUL":
|
|
53103
|
+
return "passed";
|
|
53104
|
+
case "FAILED":
|
|
53105
|
+
return "failed";
|
|
53106
|
+
case "INPROGRESS":
|
|
53107
|
+
return "running";
|
|
53108
|
+
case "STOPPED":
|
|
53109
|
+
return "stopped";
|
|
53110
|
+
default:
|
|
53111
|
+
return state?.toLowerCase() ?? "unknown";
|
|
53112
|
+
}
|
|
53113
|
+
}
|
|
53114
|
+
getSummary(statuses) {
|
|
53115
|
+
return statuses.reduce((acc, status) => {
|
|
53116
|
+
const state = status.state?.toUpperCase();
|
|
53117
|
+
if (state === "SUCCESSFUL") {
|
|
53118
|
+
acc.successful++;
|
|
53119
|
+
} else if (state === "FAILED") {
|
|
53120
|
+
acc.failed++;
|
|
53121
|
+
} else if (state === "INPROGRESS") {
|
|
53122
|
+
acc.pending++;
|
|
53123
|
+
}
|
|
53124
|
+
return acc;
|
|
53125
|
+
}, { successful: 0, failed: 0, pending: 0 });
|
|
53126
|
+
}
|
|
53127
|
+
truncate(text, maxLength) {
|
|
53128
|
+
if (text.length <= maxLength) {
|
|
53129
|
+
return text;
|
|
53130
|
+
}
|
|
53131
|
+
return text.substring(0, maxLength - 3) + "...";
|
|
53132
|
+
}
|
|
53133
|
+
}
|
|
53134
|
+
|
|
52796
53135
|
// src/types/config.ts
|
|
52797
|
-
var SETTABLE_CONFIG_KEYS = [
|
|
52798
|
-
|
|
53136
|
+
var SETTABLE_CONFIG_KEYS = [
|
|
53137
|
+
"defaultWorkspace",
|
|
53138
|
+
"skipVersionCheck",
|
|
53139
|
+
"versionCheckInterval"
|
|
53140
|
+
];
|
|
53141
|
+
var READABLE_CONFIG_KEYS = [
|
|
53142
|
+
"username",
|
|
53143
|
+
"defaultWorkspace",
|
|
53144
|
+
"skipVersionCheck",
|
|
53145
|
+
"versionCheckInterval"
|
|
53146
|
+
];
|
|
52799
53147
|
function isSettableConfigKey(key) {
|
|
52800
53148
|
return SETTABLE_CONFIG_KEYS.includes(key);
|
|
52801
53149
|
}
|
|
@@ -52953,6 +53301,11 @@ function bootstrap() {
|
|
|
52953
53301
|
const axiosInstance = createApiClient(configService);
|
|
52954
53302
|
return new UsersApi(undefined, undefined, axiosInstance);
|
|
52955
53303
|
});
|
|
53304
|
+
container.register(ServiceTokens.CommitStatusesApi, () => {
|
|
53305
|
+
const configService = container.resolve(ServiceTokens.ConfigService);
|
|
53306
|
+
const axiosInstance = createApiClient(configService);
|
|
53307
|
+
return new CommitStatusesApi(undefined, undefined, axiosInstance);
|
|
53308
|
+
});
|
|
52956
53309
|
container.register(ServiceTokens.ContextService, () => {
|
|
52957
53310
|
const gitService = container.resolve(ServiceTokens.GitService);
|
|
52958
53311
|
const configService = container.resolve(ServiceTokens.ConfigService);
|
|
@@ -53124,6 +53477,12 @@ function bootstrap() {
|
|
|
53124
53477
|
const output = container.resolve(ServiceTokens.OutputService);
|
|
53125
53478
|
return new ListReviewersPRCommand(pullrequestsApi, contextService, output);
|
|
53126
53479
|
});
|
|
53480
|
+
container.register(ServiceTokens.ChecksPRCommand, () => {
|
|
53481
|
+
const commitStatusesApi = container.resolve(ServiceTokens.CommitStatusesApi);
|
|
53482
|
+
const contextService = container.resolve(ServiceTokens.ContextService);
|
|
53483
|
+
const output = container.resolve(ServiceTokens.OutputService);
|
|
53484
|
+
return new ChecksPRCommand(commitStatusesApi, contextService, output);
|
|
53485
|
+
});
|
|
53127
53486
|
container.register(ServiceTokens.GetConfigCommand, () => {
|
|
53128
53487
|
const configService = container.resolve(ServiceTokens.ConfigService);
|
|
53129
53488
|
const output = container.resolve(ServiceTokens.OutputService);
|
|
@@ -53178,7 +53537,7 @@ if (process.argv.includes("--get-yargs-completions") || process.env.COMP_LINE) {
|
|
|
53178
53537
|
} else if (env2.prev === "repo") {
|
|
53179
53538
|
completions.push("clone", "create", "list", "view", "delete");
|
|
53180
53539
|
} else if (env2.prev === "pr") {
|
|
53181
|
-
completions.push("create", "list", "view", "activity", "edit", "merge", "approve", "decline", "ready", "checkout", "diff", "comments", "reviewers");
|
|
53540
|
+
completions.push("create", "list", "view", "activity", "checks", "edit", "merge", "approve", "decline", "ready", "checkout", "diff", "comments", "reviewers");
|
|
53182
53541
|
} else if (env2.prev === "reviewers") {
|
|
53183
53542
|
completions.push("list", "add", "remove");
|
|
53184
53543
|
} else if (env2.prev === "config") {
|
|
@@ -53342,6 +53701,15 @@ prCmd.command("activity <id>").description("Show pull request activity log").opt
|
|
|
53342
53701
|
process.exit(1);
|
|
53343
53702
|
}
|
|
53344
53703
|
});
|
|
53704
|
+
prCmd.command("checks <id>").description("Show CI/CD checks and build status for a pull request").option("--json", "Output as JSON").action(async (id, options) => {
|
|
53705
|
+
try {
|
|
53706
|
+
const cmd = container.resolve(ServiceTokens.ChecksPRCommand);
|
|
53707
|
+
const context = createContext(cli);
|
|
53708
|
+
await cmd.execute(withGlobalOptions({ id, ...options }, context), context);
|
|
53709
|
+
} catch {
|
|
53710
|
+
process.exit(1);
|
|
53711
|
+
}
|
|
53712
|
+
});
|
|
53345
53713
|
prCmd.command("edit [id]").description("Edit a pull request").option("-t, --title <title>", "New pull request title").option("-b, --body <body>", "New pull request description").option("-F, --body-file <file>", "Read description from file").action(async (id, options) => {
|
|
53346
53714
|
try {
|
|
53347
53715
|
const cmd = container.resolve(ServiceTokens.EditPRCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilatos/bitbucket-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "A command-line interface for Bitbucket Cloud",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"build": "bun build src/index.ts --outdir dist --target bun",
|
|
31
31
|
"test": "bun test",
|
|
32
32
|
"lint": "tsc --noEmit",
|
|
33
|
+
"format": "prettier --write .",
|
|
34
|
+
"format:check": "prettier --check .",
|
|
33
35
|
"generate:api": "openapi-generator-cli generate",
|
|
34
36
|
"docs:dev": "cd docs && bun run dev",
|
|
35
37
|
"docs:build": "cd docs && bun run build",
|
|
@@ -38,6 +40,9 @@
|
|
|
38
40
|
"release": "bun run build && changeset publish",
|
|
39
41
|
"prepublishOnly": "bun run build"
|
|
40
42
|
},
|
|
43
|
+
"simple-git-hooks": {
|
|
44
|
+
"pre-commit": "bun run format:check"
|
|
45
|
+
},
|
|
41
46
|
"dependencies": {
|
|
42
47
|
"axios": "^1.6.0",
|
|
43
48
|
"chalk": "^5.6.2",
|
|
@@ -51,7 +56,9 @@
|
|
|
51
56
|
"@types/bun": "latest",
|
|
52
57
|
"@types/node": "^25.1.0",
|
|
53
58
|
"favicons": "^7.2.0",
|
|
59
|
+
"prettier": "^3.8.1",
|
|
54
60
|
"sharp": "^0.34.5",
|
|
61
|
+
"simple-git-hooks": "^2.13.1",
|
|
55
62
|
"typescript": "^5.9.3"
|
|
56
63
|
}
|
|
57
64
|
}
|