bitbucketdc-cli 0.0.8 → 0.0.9
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/pr/can-merge.d.ts +3 -0
- package/dist/commands/pr/can-merge.d.ts.map +1 -0
- package/dist/commands/pr/can-merge.js +26 -0
- package/dist/commands/pr/can-merge.js.map +1 -0
- package/dist/commands/pr/decline.d.ts +3 -0
- package/dist/commands/pr/decline.d.ts.map +1 -0
- package/dist/commands/pr/decline.js +26 -0
- package/dist/commands/pr/decline.js.map +1 -0
- package/dist/commands/pr/delete.d.ts +3 -0
- package/dist/commands/pr/delete.d.ts.map +1 -0
- package/dist/commands/pr/delete.js +26 -0
- package/dist/commands/pr/delete.js.map +1 -0
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +15 -0
- package/dist/commands/pr/index.js.map +1 -1
- package/dist/commands/pr/merge.d.ts +3 -0
- package/dist/commands/pr/merge.d.ts.map +1 -0
- package/dist/commands/pr/merge.js +33 -0
- package/dist/commands/pr/merge.js.map +1 -0
- package/dist/commands/pr/update.d.ts +3 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +37 -0
- package/dist/commands/pr/update.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can-merge.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/can-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,QAqBvC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function canMerge(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('can-merge')
|
|
6
|
+
.description('Check if a pull request can be merged')
|
|
7
|
+
.requiredOption('--project <key>', 'Bitbucket project key')
|
|
8
|
+
.requiredOption('--repo <slug>', 'Repository slug')
|
|
9
|
+
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
|
+
.addHelpText('after', '\nExamples:\n bitbucketdc pr can-merge --project PROJ --repo my-repo --id 42')
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
try {
|
|
13
|
+
const client = getClient();
|
|
14
|
+
const result = await client.pullRequests.canMerge({
|
|
15
|
+
projectKey: opts.project,
|
|
16
|
+
repositorySlug: opts.repo,
|
|
17
|
+
pullRequestId: opts.id,
|
|
18
|
+
});
|
|
19
|
+
output(result);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
handleError(err);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=can-merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can-merge.js","sourceRoot":"","sources":["../../../src/commands/pr/can-merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,uCAAuC,CAAC;SACpD,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,+EAA+E,CAAC;SACrG,MAAM,CAAC,KAAK,EAAE,IAAmD,EAAE,EAAE;QACpE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;gBAChD,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,IAAI,CAAC,EAAE;aACvB,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +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,QAqBtC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function decline(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('decline')
|
|
6
|
+
.description('Decline a pull request')
|
|
7
|
+
.requiredOption('--project <key>', 'Bitbucket project key')
|
|
8
|
+
.requiredOption('--repo <slug>', 'Repository slug')
|
|
9
|
+
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
|
+
.addHelpText('after', '\nExamples:\n bitbucketdc pr decline --project PROJ --repo my-repo --id 42')
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
try {
|
|
13
|
+
const client = getClient();
|
|
14
|
+
const result = await client.pullRequests.decline({
|
|
15
|
+
projectKey: opts.project,
|
|
16
|
+
repositorySlug: opts.repo,
|
|
17
|
+
pullRequestId: opts.id,
|
|
18
|
+
});
|
|
19
|
+
output(result);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
handleError(err);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=decline.js.map
|
|
@@ -0,0 +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,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,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,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC;gBAC/C,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,IAAI,CAAC,EAAE;aACvB,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +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,QAqBvC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function deletePr(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('delete')
|
|
6
|
+
.description('Delete a pull request')
|
|
7
|
+
.requiredOption('--project <key>', 'Bitbucket project key')
|
|
8
|
+
.requiredOption('--repo <slug>', 'Repository slug')
|
|
9
|
+
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
|
+
.addHelpText('after', '\nExamples:\n bitbucketdc pr delete --project PROJ --repo my-repo --id 42')
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
try {
|
|
13
|
+
const client = getClient();
|
|
14
|
+
await client.pullRequests.deletePullRequest({
|
|
15
|
+
projectKey: opts.project,
|
|
16
|
+
repositorySlug: opts.repo,
|
|
17
|
+
pullRequestId: opts.id,
|
|
18
|
+
});
|
|
19
|
+
output({ deleted: true, pullRequestId: opts.id });
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
handleError(err);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +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,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,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,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC;gBAC1C,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,IAAI,CAAC,EAAE;aACvB,CAAC,CAAC;YACH,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,QA0ClD"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { activities } from './activities.js';
|
|
2
|
+
import { canMerge } from './can-merge.js';
|
|
2
3
|
import { changes } from './changes.js';
|
|
3
4
|
import { comment } from './comment.js';
|
|
4
5
|
import { create } from './create.js';
|
|
6
|
+
import { decline } from './decline.js';
|
|
5
7
|
import { deleteComment } from './delete-comment.js';
|
|
8
|
+
import { deletePr } from './delete.js';
|
|
6
9
|
import { diff } from './diff.js';
|
|
7
10
|
import { editComment } from './edit-comment.js';
|
|
8
11
|
import { fileComment } from './file-comment.js';
|
|
@@ -10,9 +13,11 @@ import { fileDiff } from './file-diff.js';
|
|
|
10
13
|
import { get } from './get.js';
|
|
11
14
|
import { inbox } from './inbox.js';
|
|
12
15
|
import { lineComment } from './line-comment.js';
|
|
16
|
+
import { merge } from './merge.js';
|
|
13
17
|
import { reactionAdd } from './reaction-add.js';
|
|
14
18
|
import { reactionRemove } from './reaction-remove.js';
|
|
15
19
|
import { review } from './review.js';
|
|
20
|
+
import { update } from './update.js';
|
|
16
21
|
export function registerPrCommands(program) {
|
|
17
22
|
const pr = program
|
|
18
23
|
.command('pr')
|
|
@@ -26,6 +31,11 @@ Examples:
|
|
|
26
31
|
$ bitbucketdc pr create --project PROJ --repo my-repo --from feature-x --to main --title "Add feature"
|
|
27
32
|
$ bitbucketdc pr comment --project PROJ --repo my-repo --id 42 --text "Looks good!"
|
|
28
33
|
$ bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status APPROVED
|
|
34
|
+
$ bitbucketdc pr update --project PROJ --repo my-repo --id 42 --title "New title"
|
|
35
|
+
$ bitbucketdc pr can-merge --project PROJ --repo my-repo --id 42
|
|
36
|
+
$ bitbucketdc pr merge --project PROJ --repo my-repo --id 42
|
|
37
|
+
$ bitbucketdc pr decline --project PROJ --repo my-repo --id 42
|
|
38
|
+
$ bitbucketdc pr delete --project PROJ --repo my-repo --id 42
|
|
29
39
|
`);
|
|
30
40
|
inbox(pr);
|
|
31
41
|
get(pr);
|
|
@@ -42,5 +52,10 @@ Examples:
|
|
|
42
52
|
reactionAdd(pr);
|
|
43
53
|
reactionRemove(pr);
|
|
44
54
|
review(pr);
|
|
55
|
+
update(pr);
|
|
56
|
+
canMerge(pr);
|
|
57
|
+
merge(pr);
|
|
58
|
+
decline(pr);
|
|
59
|
+
deletePr(pr);
|
|
45
60
|
}
|
|
46
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/pr/index.ts"],"names":[],"mappings":"AACA,OAAO,E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AAC;IAChB,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,cAAc,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,QA+BpC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function merge(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('merge')
|
|
6
|
+
.description('Merge a pull request')
|
|
7
|
+
.requiredOption('--project <key>', 'Bitbucket project key')
|
|
8
|
+
.requiredOption('--repo <slug>', 'Repository slug')
|
|
9
|
+
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
|
+
.option('--strategy <id>', 'Merge strategy (e.g., squash, no-ff, ff, ff-only, rebase-no-ff, rebase-ff-only)')
|
|
11
|
+
.option('--message <text>', 'Custom merge commit message')
|
|
12
|
+
.addHelpText('after', `\nExamples:
|
|
13
|
+
bitbucketdc pr merge --project PROJ --repo my-repo --id 42
|
|
14
|
+
bitbucketdc pr merge --project PROJ --repo my-repo --id 42 --strategy squash
|
|
15
|
+
bitbucketdc pr merge --project PROJ --repo my-repo --id 42 --message "Merge feature X"`)
|
|
16
|
+
.action(async (opts) => {
|
|
17
|
+
try {
|
|
18
|
+
const client = getClient();
|
|
19
|
+
const result = await client.pullRequests.merge({
|
|
20
|
+
projectKey: opts.project,
|
|
21
|
+
repositorySlug: opts.repo,
|
|
22
|
+
pullRequestId: opts.id,
|
|
23
|
+
strategyId: opts.strategy,
|
|
24
|
+
message: opts.message,
|
|
25
|
+
});
|
|
26
|
+
output(result);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
handleError(err);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/commands/pr/merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,KAAK,CAAC,MAAe;IACnC,MAAM;SACH,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,sBAAsB,CAAC;SACnC,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,MAAM,CAAC,iBAAiB,EAAE,iFAAiF,CAAC;SAC5G,MAAM,CAAC,kBAAkB,EAAE,6BAA6B,CAAC;SACzD,WAAW,CACV,OAAO,EACP;;;yFAGmF,CACpF;SACA,MAAM,CAAC,KAAK,EAAE,IAAwF,EAAE,EAAE;QACzG,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;gBAC7C,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,IAAI,CAAC,EAAE;gBACtB,UAAU,EAAE,IAAI,CAAC,QAAQ;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,QAsCrC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function update(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('update')
|
|
6
|
+
.description('Update a pull request title and/or description')
|
|
7
|
+
.requiredOption('--project <key>', 'Bitbucket project key')
|
|
8
|
+
.requiredOption('--repo <slug>', 'Repository slug')
|
|
9
|
+
.requiredOption('--id <n>', 'Pull request ID', parseInt)
|
|
10
|
+
.option('--title <title>', 'New pull request title')
|
|
11
|
+
.option('--description <text>', 'New pull request description')
|
|
12
|
+
.addHelpText('after', `\nExamples:
|
|
13
|
+
bitbucketdc pr update --project PROJ --repo my-repo --id 42 --title "New title"
|
|
14
|
+
bitbucketdc pr update --project PROJ --repo my-repo --id 42 --description "Updated description"
|
|
15
|
+
bitbucketdc pr update --project PROJ --repo my-repo --id 42 --title "New" --description "Both"`)
|
|
16
|
+
.action(async (opts) => {
|
|
17
|
+
try {
|
|
18
|
+
if (!opts.title && !opts.description) {
|
|
19
|
+
process.stderr.write(`${JSON.stringify({ error: 'At least one of --title or --description is required' })}\n`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
const client = getClient();
|
|
23
|
+
const result = await client.pullRequests.update({
|
|
24
|
+
projectKey: opts.project,
|
|
25
|
+
repositorySlug: opts.repo,
|
|
26
|
+
pullRequestId: opts.id,
|
|
27
|
+
title: opts.title,
|
|
28
|
+
description: opts.description,
|
|
29
|
+
});
|
|
30
|
+
output(result);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
handleError(err);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/pr/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,gDAAgD,CAAC;SAC7D,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,MAAM,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;SACnD,MAAM,CAAC,sBAAsB,EAAE,8BAA8B,CAAC;SAC9D,WAAW,CACV,OAAO,EACP;;;iGAG2F,CAC5F;SACA,MAAM,CAAC,KAAK,EAAE,IAAyF,EAAE,EAAE;QAC1G,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,sDAAsD,EAAE,CAAC,IAAI,CACzF,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAED,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;gBAC9C,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,IAAI,CAAC,EAAE;gBACtB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitbucketdc-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"commander": "^13.1.0",
|
|
15
15
|
"dotenv": "17.2.3",
|
|
16
|
-
"bitbucket-data-center-client": "1.4.
|
|
16
|
+
"bitbucket-data-center-client": "1.4.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "24.10.4",
|