bitbucketdc-cli 1.0.1 → 1.0.3
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/commands/commit/changes.d.ts +3 -0
- package/dist/commands/commit/changes.d.ts.map +1 -0
- package/dist/commands/commit/changes.js +25 -0
- package/dist/commands/commit/changes.js.map +1 -0
- package/dist/commands/commit/diff.d.ts +3 -0
- package/dist/commands/commit/diff.d.ts.map +1 -0
- package/dist/commands/commit/diff.js +38 -0
- package/dist/commands/commit/diff.js.map +1 -0
- package/dist/commands/commit/index.d.ts +3 -0
- package/dist/commands/commit/index.d.ts.map +1 -0
- package/dist/commands/commit/index.js +16 -0
- package/dist/commands/commit/index.js.map +1 -0
- package/dist/commands/compare/changes.d.ts +3 -0
- package/dist/commands/compare/changes.d.ts.map +1 -0
- package/dist/commands/compare/changes.js +27 -0
- package/dist/commands/compare/changes.js.map +1 -0
- package/dist/commands/compare/diff.d.ts +3 -0
- package/dist/commands/compare/diff.d.ts.map +1 -0
- package/dist/commands/compare/diff.js +32 -0
- package/dist/commands/compare/diff.js.map +1 -0
- package/dist/commands/compare/index.d.ts +3 -0
- package/dist/commands/compare/index.d.ts.map +1 -0
- package/dist/commands/compare/index.js +16 -0
- package/dist/commands/compare/index.js.map +1 -0
- package/dist/commands/file/index.d.ts +3 -0
- package/dist/commands/file/index.d.ts.map +1 -0
- package/dist/commands/file/index.js +16 -0
- package/dist/commands/file/index.js.map +1 -0
- package/dist/commands/file/list.d.ts +3 -0
- package/dist/commands/file/list.d.ts.map +1 -0
- package/dist/commands/file/list.js +26 -0
- package/dist/commands/file/list.js.map +1 -0
- package/dist/commands/file/show.d.ts +3 -0
- package/dist/commands/file/show.d.ts.map +1 -0
- package/dist/commands/file/show.js +24 -0
- package/dist/commands/file/show.js.map +1 -0
- package/dist/commands/pr/activities.d.ts.map +1 -1
- package/dist/commands/pr/activities.js +16 -21
- package/dist/commands/pr/activities.js.map +1 -1
- package/dist/commands/pr/can-merge.d.ts.map +1 -1
- package/dist/commands/pr/can-merge.js +8 -13
- package/dist/commands/pr/can-merge.js.map +1 -1
- package/dist/commands/pr/changes.d.ts.map +1 -1
- package/dist/commands/pr/changes.js +9 -14
- package/dist/commands/pr/changes.js.map +1 -1
- package/dist/commands/pr/comment.d.ts.map +1 -1
- package/dist/commands/pr/comment.js +10 -15
- package/dist/commands/pr/comment.js.map +1 -1
- package/dist/commands/pr/create.d.ts.map +1 -1
- package/dist/commands/pr/create.js +25 -30
- package/dist/commands/pr/create.js.map +1 -1
- package/dist/commands/pr/decline.d.ts.map +1 -1
- package/dist/commands/pr/decline.js +8 -13
- package/dist/commands/pr/decline.js.map +1 -1
- package/dist/commands/pr/delete-comment.d.ts.map +1 -1
- package/dist/commands/pr/delete-comment.js +17 -22
- package/dist/commands/pr/delete-comment.js.map +1 -1
- package/dist/commands/pr/delete.d.ts.map +1 -1
- package/dist/commands/pr/delete.js +8 -13
- package/dist/commands/pr/delete.js.map +1 -1
- package/dist/commands/pr/diff.d.ts.map +1 -1
- package/dist/commands/pr/diff.js +17 -22
- package/dist/commands/pr/diff.js.map +1 -1
- package/dist/commands/pr/edit-comment.d.ts.map +1 -1
- package/dist/commands/pr/edit-comment.js +18 -23
- package/dist/commands/pr/edit-comment.js.map +1 -1
- package/dist/commands/pr/file-comment.d.ts.map +1 -1
- package/dist/commands/pr/file-comment.js +10 -15
- package/dist/commands/pr/file-comment.js.map +1 -1
- package/dist/commands/pr/file-diff.d.ts.map +1 -1
- package/dist/commands/pr/file-diff.js +10 -15
- package/dist/commands/pr/file-diff.js.map +1 -1
- package/dist/commands/pr/get.d.ts.map +1 -1
- package/dist/commands/pr/get.js +8 -13
- package/dist/commands/pr/get.js.map +1 -1
- package/dist/commands/pr/inbox.d.ts.map +1 -1
- package/dist/commands/pr/inbox.js +7 -12
- package/dist/commands/pr/inbox.js.map +1 -1
- package/dist/commands/pr/line-comment.d.ts.map +1 -1
- package/dist/commands/pr/line-comment.js +13 -18
- package/dist/commands/pr/line-comment.js.map +1 -1
- package/dist/commands/pr/merge.d.ts.map +1 -1
- package/dist/commands/pr/merge.js +10 -15
- package/dist/commands/pr/merge.js.map +1 -1
- package/dist/commands/pr/reaction-add.d.ts.map +1 -1
- package/dist/commands/pr/reaction-add.js +10 -15
- package/dist/commands/pr/reaction-add.js.map +1 -1
- package/dist/commands/pr/reaction-remove.d.ts.map +1 -1
- package/dist/commands/pr/reaction-remove.js +10 -15
- package/dist/commands/pr/reaction-remove.js.map +1 -1
- package/dist/commands/pr/review.d.ts.map +1 -1
- package/dist/commands/pr/review.js +9 -14
- package/dist/commands/pr/review.js.map +1 -1
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +13 -18
- package/dist/commands/pr/update.js.map +1 -1
- package/dist/commands/project/list.d.ts.map +1 -1
- package/dist/commands/project/list.js +9 -14
- package/dist/commands/project/list.js.map +1 -1
- package/dist/commands/repo/attachment/download.d.ts.map +1 -1
- package/dist/commands/repo/attachment/download.js +9 -14
- package/dist/commands/repo/attachment/download.js.map +1 -1
- package/dist/commands/repo/attachment/upload.d.ts.map +1 -1
- package/dist/commands/repo/attachment/upload.js +26 -31
- package/dist/commands/repo/attachment/upload.js.map +1 -1
- package/dist/commands/repo/list.d.ts.map +1 -1
- package/dist/commands/repo/list.js +4 -9
- package/dist/commands/repo/list.js.map +1 -1
- package/dist/commands/user/list.d.ts.map +1 -1
- package/dist/commands/user/list.js +4 -9
- package/dist/commands/user/list.js.map +1 -1
- package/dist/commands/user/profile.d.ts.map +1 -1
- package/dist/commands/user/profile.js +4 -9
- package/dist/commands/user/profile.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/client.js +1 -1
- package/dist/utils/client.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function create(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('create')
|
|
@@ -17,39 +17,34 @@ export function create(parent) {
|
|
|
17
17
|
bitbucketdc pr create --project PROJ --repo my-repo --from fix/bug --to develop --title "Fix bug" --reviewers jsmith,jdoe
|
|
18
18
|
bitbucketdc pr create --project PROJ --repo my-repo --from wip --to main --title "WIP" --draft`)
|
|
19
19
|
.action(async (opts) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const repo = await client.repositories.get({
|
|
26
|
-
projectKey: opts.project,
|
|
27
|
-
repositorySlug: opts.repo,
|
|
28
|
-
});
|
|
29
|
-
const defaultReviewers = await client.pullRequests.getRequiredReviewers({
|
|
30
|
-
projectKey: opts.project,
|
|
31
|
-
repositorySlug: opts.repo,
|
|
32
|
-
repositoryId: repo.id,
|
|
33
|
-
sourceBranch: opts.from,
|
|
34
|
-
targetBranch: opts.to,
|
|
35
|
-
});
|
|
36
|
-
reviewers = defaultReviewers.map((r) => r.name);
|
|
37
|
-
}
|
|
38
|
-
const result = await client.pullRequests.create({
|
|
20
|
+
const client = getClient();
|
|
21
|
+
let reviewers = opts.reviewers?.split(',').map((r) => r.trim());
|
|
22
|
+
// Auto-fetch default reviewers if none provided
|
|
23
|
+
if (!reviewers || reviewers.length === 0) {
|
|
24
|
+
const repo = await client.repositories.get({
|
|
39
25
|
projectKey: opts.project,
|
|
40
26
|
repositorySlug: opts.repo,
|
|
41
|
-
fromBranch: opts.from,
|
|
42
|
-
toBranch: opts.to,
|
|
43
|
-
title: opts.title,
|
|
44
|
-
description: opts.description,
|
|
45
|
-
reviewers,
|
|
46
|
-
draft: opts.draft,
|
|
47
27
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
28
|
+
const defaultReviewers = await client.pullRequests.getRequiredReviewers({
|
|
29
|
+
projectKey: opts.project,
|
|
30
|
+
repositorySlug: opts.repo,
|
|
31
|
+
repositoryId: repo.id,
|
|
32
|
+
sourceBranch: opts.from,
|
|
33
|
+
targetBranch: opts.to,
|
|
34
|
+
});
|
|
35
|
+
reviewers = defaultReviewers.map((r) => r.name);
|
|
52
36
|
}
|
|
37
|
+
const result = await client.pullRequests.create({
|
|
38
|
+
projectKey: opts.project,
|
|
39
|
+
repositorySlug: opts.repo,
|
|
40
|
+
fromBranch: opts.from,
|
|
41
|
+
toBranch: opts.to,
|
|
42
|
+
title: opts.title,
|
|
43
|
+
description: opts.description,
|
|
44
|
+
reviewers,
|
|
45
|
+
draft: opts.draft,
|
|
46
|
+
});
|
|
47
|
+
output(result);
|
|
53
48
|
});
|
|
54
49
|
}
|
|
55
50
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/pr/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/pr/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,2BAA2B,CAAC;SACxC,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,iBAAiB,EAAE,sCAAsC,CAAC;SACzE,cAAc,CAAC,eAAe,EAAE,iCAAiC,CAAC;SAClE,cAAc,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;SACtD,MAAM,CAAC,sBAAsB,EAAE,sCAAsC,CAAC;SACtE,MAAM,CAAC,yBAAyB,EAAE,oCAAoC,CAAC;SACvE,MAAM,CAAC,SAAS,EAAE,8BAA8B,CAAC;SACjD,WAAW,CACV,OAAO,EACP;;;iGAG2F,CAC5F;SACA,MAAM,CACL,KAAK,EAAE,IASN,EAAE,EAAE;QACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAEhE,gDAAgD;QAChD,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC;gBACzC,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;aAC1B,CAAC,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,oBAAoB,CAAC;gBACtE,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,YAAY,EAAE,IAAI,CAAC,EAAE;gBACrB,YAAY,EAAE,IAAI,CAAC,IAAI;gBACvB,YAAY,EAAE,IAAI,CAAC,EAAE;aACtB,CAAC,CAAC;YACH,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;YAC9C,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,UAAU,EAAE,IAAI,CAAC,IAAI;YACrB,QAAQ,EAAE,IAAI,CAAC,EAAE;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS;YACT,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decline.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/decline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"decline.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/decline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,QAiBtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function decline(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('decline')
|
|
@@ -9,18 +9,13 @@ export function decline(parent) {
|
|
|
9
9
|
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
10
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr decline --project PROJ --repo my-repo --id 42')
|
|
11
11
|
.action(async (opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
output(result);
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
handleError(err);
|
|
23
|
-
}
|
|
12
|
+
const client = getClient();
|
|
13
|
+
const result = await client.pullRequests.decline({
|
|
14
|
+
projectKey: opts.project,
|
|
15
|
+
repositorySlug: opts.repo,
|
|
16
|
+
pullRequestId: opts.id,
|
|
17
|
+
});
|
|
18
|
+
output(result);
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
21
|
//# sourceMappingURL=decline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decline.js","sourceRoot":"","sources":["../../../src/commands/pr/decline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"decline.js","sourceRoot":"","sources":["../../../src/commands/pr/decline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,wBAAwB,CAAC;SACrC,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,WAAW,CAAC,OAAO,EAAE,6EAA6E,CAAC;SACnG,MAAM,CAAC,KAAK,EAAE,IAAmD,EAAE,EAAE;QACpE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC;YAC/C,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,IAAI,CAAC,EAAE;SACvB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/delete-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"delete-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/delete-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,QAgC5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function deleteComment(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('delete-comment')
|
|
@@ -10,27 +10,22 @@ export function deleteComment(parent) {
|
|
|
10
10
|
.requiredOption('--comment-id <n>', 'Comment ID to delete', parseInt)
|
|
11
11
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr delete-comment --project PROJ --repo my-repo --id 42 --comment-id 123')
|
|
12
12
|
.action(async (opts) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
output({ deleted: true, commentId: opts.commentId });
|
|
30
|
-
}
|
|
31
|
-
catch (err) {
|
|
32
|
-
handleError(err);
|
|
33
|
-
}
|
|
13
|
+
const client = getClient();
|
|
14
|
+
// Fetch current version for optimistic locking — agents shouldn't need to track this
|
|
15
|
+
const comment = await client.pullRequests.getComment({
|
|
16
|
+
projectKey: opts.project,
|
|
17
|
+
repositorySlug: opts.repo,
|
|
18
|
+
pullRequestId: opts.id,
|
|
19
|
+
commentId: opts.commentId,
|
|
20
|
+
});
|
|
21
|
+
await client.pullRequests.deleteComment({
|
|
22
|
+
projectKey: opts.project,
|
|
23
|
+
repositorySlug: opts.repo,
|
|
24
|
+
pullRequestId: opts.id,
|
|
25
|
+
commentId: opts.commentId,
|
|
26
|
+
version: comment.version,
|
|
27
|
+
});
|
|
28
|
+
output({ deleted: true, commentId: opts.commentId });
|
|
34
29
|
});
|
|
35
30
|
}
|
|
36
31
|
//# sourceMappingURL=delete-comment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-comment.js","sourceRoot":"","sources":["../../../src/commands/pr/delete-comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"delete-comment.js","sourceRoot":"","sources":["../../../src/commands/pr/delete-comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,MAAe;IAC3C,MAAM;SACH,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,+BAA+B,CAAC;SAC5C,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,cAAc,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,QAAQ,CAAC;SACpE,WAAW,CACV,OAAO,EACP,qGAAqG,CACtG;SACA,MAAM,CAAC,KAAK,EAAE,IAAsE,EAAE,EAAE;QACvF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,qFAAqF;QACrF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;YACnD,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,IAAI,CAAC,EAAE;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC;YACtC,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,IAAI,CAAC,EAAE;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,QAiBvC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function deletePr(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('delete')
|
|
@@ -9,18 +9,13 @@ export function deletePr(parent) {
|
|
|
9
9
|
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
10
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr delete --project PROJ --repo my-repo --id 42')
|
|
11
11
|
.action(async (opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
output({ deleted: true, pullRequestId: opts.id });
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
handleError(err);
|
|
23
|
-
}
|
|
12
|
+
const client = getClient();
|
|
13
|
+
await client.pullRequests.deletePullRequest({
|
|
14
|
+
projectKey: opts.project,
|
|
15
|
+
repositorySlug: opts.repo,
|
|
16
|
+
pullRequestId: opts.id,
|
|
17
|
+
});
|
|
18
|
+
output({ deleted: true, pullRequestId: opts.id });
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
21
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/pr/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/pr/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,uBAAuB,CAAC;SACpC,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,WAAW,CAAC,OAAO,EAAE,4EAA4E,CAAC;SAClG,MAAM,CAAC,KAAK,EAAE,IAAmD,EAAE,EAAE;QACpE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC;YAC1C,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,IAAI,CAAC,EAAE;SACvB,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,QAoDnC"}
|
package/dist/commands/pr/diff.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
2
|
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output
|
|
3
|
+
import { output } from '../../utils/output.js';
|
|
4
4
|
export function diff(parent) {
|
|
5
5
|
parent
|
|
6
6
|
.command('diff')
|
|
@@ -20,28 +20,23 @@ export function diff(parent) {
|
|
|
20
20
|
bitbucketdc pr diff --project PROJ --repo my-repo --id 42 --format json
|
|
21
21
|
bitbucketdc pr diff --project PROJ --repo my-repo --id 42 --context 5 --whitespace ignore-all`)
|
|
22
22
|
.action(async (opts) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
process.stdout.write(result);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
output(result);
|
|
41
|
-
}
|
|
23
|
+
const client = getClient();
|
|
24
|
+
const result = await client.pullRequests.getDiff({
|
|
25
|
+
projectKey: opts.project,
|
|
26
|
+
repositorySlug: opts.repo,
|
|
27
|
+
pullRequestId: parseInt(opts.id),
|
|
28
|
+
path: opts.path,
|
|
29
|
+
sinceId: opts.since,
|
|
30
|
+
untilId: opts.until,
|
|
31
|
+
contextLines: opts.context,
|
|
32
|
+
whitespace: opts.whitespace,
|
|
33
|
+
format: opts.format || 'text',
|
|
34
|
+
});
|
|
35
|
+
if (typeof result === 'string') {
|
|
36
|
+
process.stdout.write(result);
|
|
42
37
|
}
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
else {
|
|
39
|
+
output(result);
|
|
45
40
|
}
|
|
46
41
|
});
|
|
47
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/commands/pr/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/commands/pr/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,6BAA6B,CAAC;SAC1C,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,MAAM,CAAC,eAAe,EAAE,mCAAmC,CAAC;SAC5D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;SAC7C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;SAC7C,MAAM,CAAC,eAAe,EAAE,sDAAsD,EAAE,QAAQ,CAAC;SACzF,SAAS,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,qCAAqC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;SACnH,SAAS,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,iCAAiC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;SACpG,WAAW,CACV,OAAO,EACP;;;;gGAI0F,CAC3F;SACA,MAAM,CACL,KAAK,EAAE,IAUN,EAAE,EAAE;QACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC;YAC/C,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,KAAK;YACnB,OAAO,EAAE,IAAI,CAAC,KAAK;YACnB,YAAY,EAAE,IAAI,CAAC,OAAO;YAC1B,UAAU,EAAE,IAAI,CAAC,UAA+C;YAChE,MAAM,EAAG,IAAI,CAAC,MAA0B,IAAI,MAAM;SACnD,CAAC,CAAC;QACH,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/edit-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"edit-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/edit-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,QAkC1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function editComment(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('edit-comment')
|
|
@@ -11,28 +11,23 @@ export function editComment(parent) {
|
|
|
11
11
|
.requiredOption('--text <content>', 'New comment text')
|
|
12
12
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr edit-comment --project PROJ --repo my-repo --id 42 --comment-id 123 --text "Updated text"')
|
|
13
13
|
.action(async (opts) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
output(result);
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
handleError(err);
|
|
35
|
-
}
|
|
14
|
+
const client = getClient();
|
|
15
|
+
// Fetch current version for optimistic locking — agents shouldn't need to track this
|
|
16
|
+
const comment = await client.pullRequests.getComment({
|
|
17
|
+
projectKey: opts.project,
|
|
18
|
+
repositorySlug: opts.repo,
|
|
19
|
+
pullRequestId: opts.id,
|
|
20
|
+
commentId: opts.commentId,
|
|
21
|
+
});
|
|
22
|
+
const result = await client.pullRequests.editComment({
|
|
23
|
+
projectKey: opts.project,
|
|
24
|
+
repositorySlug: opts.repo,
|
|
25
|
+
pullRequestId: opts.id,
|
|
26
|
+
commentId: opts.commentId,
|
|
27
|
+
text: opts.text,
|
|
28
|
+
version: comment.version,
|
|
29
|
+
});
|
|
30
|
+
output(result);
|
|
36
31
|
});
|
|
37
32
|
}
|
|
38
33
|
//# sourceMappingURL=edit-comment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-comment.js","sourceRoot":"","sources":["../../../src/commands/pr/edit-comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"edit-comment.js","sourceRoot":"","sources":["../../../src/commands/pr/edit-comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,cAAc,CAAC,kBAAkB,EAAE,oBAAoB,EAAE,QAAQ,CAAC;SAClE,cAAc,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;SACtD,WAAW,CACV,OAAO,EACP,yHAAyH,CAC1H;SACA,MAAM,CAAC,KAAK,EAAE,IAAoF,EAAE,EAAE;QACrG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,qFAAqF;QACrF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;YACnD,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,IAAI,CAAC,EAAE;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC;YACnD,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,IAAI,CAAC,EAAE;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/file-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"file-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/file-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,QAwB1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function fileComment(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('file-comment')
|
|
@@ -11,20 +11,15 @@ export function fileComment(parent) {
|
|
|
11
11
|
.requiredOption('--path <path>', 'File path to attach comment to (e.g., src/main.ts)')
|
|
12
12
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr file-comment --project PROJ --repo my-repo --id 42 --text "This file needs refactoring" --path src/main.ts')
|
|
13
13
|
.action(async (opts) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
output(result);
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
handleError(err);
|
|
27
|
-
}
|
|
14
|
+
const client = getClient();
|
|
15
|
+
const result = await client.pullRequests.addComment({
|
|
16
|
+
projectKey: opts.project,
|
|
17
|
+
repositorySlug: opts.repo,
|
|
18
|
+
pullRequestId: parseInt(opts.id),
|
|
19
|
+
text: opts.text,
|
|
20
|
+
path: opts.path,
|
|
21
|
+
});
|
|
22
|
+
output(result);
|
|
28
23
|
});
|
|
29
24
|
}
|
|
30
25
|
//# sourceMappingURL=file-comment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-comment.js","sourceRoot":"","sources":["../../../src/commands/pr/file-comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"file-comment.js","sourceRoot":"","sources":["../../../src/commands/pr/file-comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,4CAA4C,CAAC;SACzD,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,cAAc,CAAC,eAAe,EAAE,cAAc,CAAC;SAC/C,cAAc,CAAC,eAAe,EAAE,oDAAoD,CAAC;SACrF,WAAW,CACV,OAAO,EACP,0IAA0I,CAC3I;SACA,MAAM,CAAC,KAAK,EAAE,IAA+E,EAAE,EAAE;QAChG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;YAClD,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-diff.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/file-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"file-diff.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/file-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,QAwBvC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function fileDiff(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('file-diff')
|
|
@@ -11,20 +11,15 @@ export function fileDiff(parent) {
|
|
|
11
11
|
.option('--context <n>', 'Number of context lines around changes (default: 10)', parseInt)
|
|
12
12
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr file-diff --project PROJ --repo my-repo --id 42 --path src/main.ts\n bitbucketdc pr file-diff --project PROJ --repo my-repo --id 42 --path src/main.ts --context 5')
|
|
13
13
|
.action(async (opts) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
output(result);
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
handleError(err);
|
|
27
|
-
}
|
|
14
|
+
const client = getClient();
|
|
15
|
+
const result = await client.pullRequests.getFileDiff({
|
|
16
|
+
projectKey: opts.project,
|
|
17
|
+
repositorySlug: opts.repo,
|
|
18
|
+
pullRequestId: parseInt(opts.id),
|
|
19
|
+
path: opts.path,
|
|
20
|
+
contextLines: opts.context,
|
|
21
|
+
});
|
|
22
|
+
output(result);
|
|
28
23
|
});
|
|
29
24
|
}
|
|
30
25
|
//# sourceMappingURL=file-diff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-diff.js","sourceRoot":"","sources":["../../../src/commands/pr/file-diff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"file-diff.js","sourceRoot":"","sources":["../../../src/commands/pr/file-diff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,sDAAsD,CAAC;SACnE,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,cAAc,CAAC,eAAe,EAAE,+BAA+B,CAAC;SAChE,MAAM,CAAC,eAAe,EAAE,sDAAsD,EAAE,QAAQ,CAAC;SACzF,WAAW,CACV,OAAO,EACP,mMAAmM,CACpM;SACA,MAAM,CAAC,KAAK,EAAE,IAAmF,EAAE,EAAE;QACpG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC;YACnD,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,YAAY,EAAE,IAAI,CAAC,OAAO;SAC3B,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,QAiBlC"}
|
package/dist/commands/pr/get.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function get(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('get')
|
|
@@ -9,18 +9,13 @@ export function get(parent) {
|
|
|
9
9
|
.requiredOption('--id <n>', 'Pull request ID')
|
|
10
10
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr get --project PROJ --repo my-repo --id 42')
|
|
11
11
|
.action(async (opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
output(result);
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
handleError(err);
|
|
23
|
-
}
|
|
12
|
+
const client = getClient();
|
|
13
|
+
const result = await client.pullRequests.get({
|
|
14
|
+
projectKey: opts.project,
|
|
15
|
+
repositorySlug: opts.repo,
|
|
16
|
+
pullRequestId: parseInt(opts.id),
|
|
17
|
+
});
|
|
18
|
+
output(result);
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
21
|
//# sourceMappingURL=get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/pr/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/pr/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,0BAA0B,CAAC;SACvC,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,WAAW,CAAC,OAAO,EAAE,yEAAyE,CAAC;SAC/F,MAAM,CAAC,KAAK,EAAE,IAAmD,EAAE,EAAE;QACpE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC;YAC3C,UAAU,EAAE,IAAI,CAAC,OAAO;YACxB,cAAc,EAAE,IAAI,CAAC,IAAI;YACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;SACjC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,QAkBpC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function inbox(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('inbox')
|
|
@@ -8,17 +8,12 @@ export function inbox(parent) {
|
|
|
8
8
|
.option('--limit <n>', 'Maximum number of pull requests to return (default: 25)', parseInt)
|
|
9
9
|
.addHelpText('after', '\nExamples:\n bitbucketdc pr inbox\n bitbucketdc pr inbox --limit 10\n bitbucketdc pr inbox --start 25 --limit 25')
|
|
10
10
|
.action(async (opts) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
output(result);
|
|
18
|
-
}
|
|
19
|
-
catch (err) {
|
|
20
|
-
handleError(err);
|
|
21
|
-
}
|
|
11
|
+
const client = getClient();
|
|
12
|
+
const result = await client.pullRequests.getInbox({
|
|
13
|
+
start: opts.start,
|
|
14
|
+
limit: opts.limit,
|
|
15
|
+
});
|
|
16
|
+
output(result);
|
|
22
17
|
});
|
|
23
18
|
}
|
|
24
19
|
//# sourceMappingURL=inbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../../src/commands/pr/inbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../../src/commands/pr/inbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,KAAK,CAAC,MAAe;IACnC,MAAM;SACH,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,aAAa,EAAE,4CAA4C,EAAE,QAAQ,CAAC;SAC7E,MAAM,CAAC,aAAa,EAAE,yDAAyD,EAAE,QAAQ,CAAC;SAC1F,WAAW,CACV,OAAO,EACP,sHAAsH,CACvH;SACA,MAAM,CAAC,KAAK,EAAE,IAAwC,EAAE,EAAE;QACzD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;YAChD,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/line-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"line-comment.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/line-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,QAiD1C"}
|