bitbucketdc-cli 0.0.1

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.
Files changed (105) hide show
  1. package/dist/commands/pr/activities.d.ts +3 -0
  2. package/dist/commands/pr/activities.d.ts.map +1 -0
  3. package/dist/commands/pr/activities.js +42 -0
  4. package/dist/commands/pr/activities.js.map +1 -0
  5. package/dist/commands/pr/changes.d.ts +3 -0
  6. package/dist/commands/pr/changes.d.ts.map +1 -0
  7. package/dist/commands/pr/changes.js +28 -0
  8. package/dist/commands/pr/changes.js.map +1 -0
  9. package/dist/commands/pr/comment.d.ts +3 -0
  10. package/dist/commands/pr/comment.d.ts.map +1 -0
  11. package/dist/commands/pr/comment.js +32 -0
  12. package/dist/commands/pr/comment.js.map +1 -0
  13. package/dist/commands/pr/create.d.ts +3 -0
  14. package/dist/commands/pr/create.d.ts.map +1 -0
  15. package/dist/commands/pr/create.js +55 -0
  16. package/dist/commands/pr/create.js.map +1 -0
  17. package/dist/commands/pr/delete-comment.d.ts +3 -0
  18. package/dist/commands/pr/delete-comment.d.ts.map +1 -0
  19. package/dist/commands/pr/delete-comment.js +30 -0
  20. package/dist/commands/pr/delete-comment.js.map +1 -0
  21. package/dist/commands/pr/diff.d.ts +3 -0
  22. package/dist/commands/pr/diff.d.ts.map +1 -0
  23. package/dist/commands/pr/diff.js +48 -0
  24. package/dist/commands/pr/diff.js.map +1 -0
  25. package/dist/commands/pr/file-comment.d.ts +3 -0
  26. package/dist/commands/pr/file-comment.d.ts.map +1 -0
  27. package/dist/commands/pr/file-comment.js +30 -0
  28. package/dist/commands/pr/file-comment.js.map +1 -0
  29. package/dist/commands/pr/file-diff.d.ts +3 -0
  30. package/dist/commands/pr/file-diff.d.ts.map +1 -0
  31. package/dist/commands/pr/file-diff.js +30 -0
  32. package/dist/commands/pr/file-diff.js.map +1 -0
  33. package/dist/commands/pr/get.d.ts +3 -0
  34. package/dist/commands/pr/get.d.ts.map +1 -0
  35. package/dist/commands/pr/get.js +26 -0
  36. package/dist/commands/pr/get.js.map +1 -0
  37. package/dist/commands/pr/inbox.d.ts +3 -0
  38. package/dist/commands/pr/inbox.d.ts.map +1 -0
  39. package/dist/commands/pr/inbox.js +24 -0
  40. package/dist/commands/pr/inbox.js.map +1 -0
  41. package/dist/commands/pr/index.d.ts +3 -0
  42. package/dist/commands/pr/index.d.ts.map +1 -0
  43. package/dist/commands/pr/index.js +42 -0
  44. package/dist/commands/pr/index.js.map +1 -0
  45. package/dist/commands/pr/line-comment.d.ts +3 -0
  46. package/dist/commands/pr/line-comment.d.ts.map +1 -0
  47. package/dist/commands/pr/line-comment.js +43 -0
  48. package/dist/commands/pr/line-comment.js.map +1 -0
  49. package/dist/commands/pr/reaction-add.d.ts +3 -0
  50. package/dist/commands/pr/reaction-add.d.ts.map +1 -0
  51. package/dist/commands/pr/reaction-add.js +35 -0
  52. package/dist/commands/pr/reaction-add.js.map +1 -0
  53. package/dist/commands/pr/reaction-remove.d.ts +3 -0
  54. package/dist/commands/pr/reaction-remove.d.ts.map +1 -0
  55. package/dist/commands/pr/reaction-remove.js +34 -0
  56. package/dist/commands/pr/reaction-remove.js.map +1 -0
  57. package/dist/commands/pr/review.d.ts +3 -0
  58. package/dist/commands/pr/review.d.ts.map +1 -0
  59. package/dist/commands/pr/review.js +34 -0
  60. package/dist/commands/pr/review.js.map +1 -0
  61. package/dist/commands/project/index.d.ts +3 -0
  62. package/dist/commands/project/index.d.ts.map +1 -0
  63. package/dist/commands/project/index.js +11 -0
  64. package/dist/commands/project/index.js.map +1 -0
  65. package/dist/commands/project/list.d.ts +3 -0
  66. package/dist/commands/project/list.d.ts.map +1 -0
  67. package/dist/commands/project/list.js +32 -0
  68. package/dist/commands/project/list.js.map +1 -0
  69. package/dist/commands/repo/index.d.ts +3 -0
  70. package/dist/commands/repo/index.d.ts.map +1 -0
  71. package/dist/commands/repo/index.js +10 -0
  72. package/dist/commands/repo/index.js.map +1 -0
  73. package/dist/commands/repo/list.d.ts +3 -0
  74. package/dist/commands/repo/list.d.ts.map +1 -0
  75. package/dist/commands/repo/list.js +19 -0
  76. package/dist/commands/repo/list.js.map +1 -0
  77. package/dist/commands/user/index.d.ts +3 -0
  78. package/dist/commands/user/index.d.ts.map +1 -0
  79. package/dist/commands/user/index.js +13 -0
  80. package/dist/commands/user/index.js.map +1 -0
  81. package/dist/commands/user/list.d.ts +3 -0
  82. package/dist/commands/user/list.d.ts.map +1 -0
  83. package/dist/commands/user/list.js +20 -0
  84. package/dist/commands/user/list.js.map +1 -0
  85. package/dist/commands/user/profile.d.ts +3 -0
  86. package/dist/commands/user/profile.d.ts.map +1 -0
  87. package/dist/commands/user/profile.js +19 -0
  88. package/dist/commands/user/profile.js.map +1 -0
  89. package/dist/index.d.ts +3 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +42 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/utils/client.d.ts +3 -0
  94. package/dist/utils/client.d.ts.map +1 -0
  95. package/dist/utils/client.js +11 -0
  96. package/dist/utils/client.js.map +1 -0
  97. package/dist/utils/output.d.ts +3 -0
  98. package/dist/utils/output.d.ts.map +1 -0
  99. package/dist/utils/output.js +10 -0
  100. package/dist/utils/output.js.map +1 -0
  101. package/dist/utils/strip-response.d.ts +6 -0
  102. package/dist/utils/strip-response.d.ts.map +1 -0
  103. package/dist/utils/strip-response.js +30 -0
  104. package/dist/utils/strip-response.js.map +1 -0
  105. package/package.json +38 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction-add.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/reaction-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,QA0C1C"}
@@ -0,0 +1,35 @@
1
+ import { Option } from 'commander';
2
+ import { getClient } from '../../utils/client.js';
3
+ import { output, handleError } from '../../utils/output.js';
4
+ export function reactionAdd(parent) {
5
+ parent
6
+ .command('reaction-add')
7
+ .description('Add an emoticon reaction to a PR comment')
8
+ .requiredOption('--project <key>', 'Bitbucket project key')
9
+ .requiredOption('--repo <slug>', 'Repository slug')
10
+ .requiredOption('--id <n>', 'Pull request ID')
11
+ .requiredOption('--comment-id <n>', 'Comment ID')
12
+ .addOption(new Option('--emoticon <name>', 'Emoticon to react with')
13
+ .choices(['thumbsup', 'thumbsdown', 'heart', 'thinking_face', 'laughing'])
14
+ .makeOptionMandatory())
15
+ .addHelpText('after', `\nExamples:
16
+ bitbucketdc pr reaction-add --project PROJ --repo my-repo --id 42 --comment-id 123 --emoticon thumbsup
17
+ bitbucketdc pr reaction-add --project PROJ --repo my-repo --id 42 --comment-id 123 --emoticon heart`)
18
+ .action(async (opts) => {
19
+ try {
20
+ const client = getClient();
21
+ const result = await client.pullRequests.addReaction({
22
+ projectKey: opts.project,
23
+ repositorySlug: opts.repo,
24
+ pullRequestId: parseInt(opts.id),
25
+ commentId: parseInt(opts.commentId),
26
+ emoticon: opts.emoticon,
27
+ });
28
+ output(result);
29
+ }
30
+ catch (err) {
31
+ handleError(err);
32
+ }
33
+ });
34
+ }
35
+ //# sourceMappingURL=reaction-add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction-add.js","sourceRoot":"","sources":["../../../src/commands/pr/reaction-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,0CAA0C,CAAC;SACvD,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,cAAc,CAAC,kBAAkB,EAAE,YAAY,CAAC;SAChD,SAAS,CACR,IAAI,MAAM,CAAC,mBAAmB,EAAE,wBAAwB,CAAC;SACtD,OAAO,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;SACzE,mBAAmB,EAAE,CACzB;SACA,WAAW,CACV,OAAO,EACP;;sGAEgG,CACjG;SACA,MAAM,CACL,KAAK,EAAE,IAMN,EAAE,EAAE;QACH,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC;gBACnD,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;gBACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,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,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function reactionRemove(parent: Command): void;
3
+ //# sourceMappingURL=reaction-remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction-remove.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/reaction-remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,QAyC7C"}
@@ -0,0 +1,34 @@
1
+ import { Option } from 'commander';
2
+ import { getClient } from '../../utils/client.js';
3
+ import { output, handleError } from '../../utils/output.js';
4
+ export function reactionRemove(parent) {
5
+ parent
6
+ .command('reaction-remove')
7
+ .description('Remove an emoticon reaction from a PR comment')
8
+ .requiredOption('--project <key>', 'Bitbucket project key')
9
+ .requiredOption('--repo <slug>', 'Repository slug')
10
+ .requiredOption('--id <n>', 'Pull request ID')
11
+ .requiredOption('--comment-id <n>', 'Comment ID')
12
+ .addOption(new Option('--emoticon <name>', 'Emoticon to remove')
13
+ .choices(['thumbsup', 'thumbsdown', 'heart', 'thinking_face', 'laughing'])
14
+ .makeOptionMandatory())
15
+ .addHelpText('after', `\nExamples:
16
+ bitbucketdc pr reaction-remove --project PROJ --repo my-repo --id 42 --comment-id 123 --emoticon thumbsup`)
17
+ .action(async (opts) => {
18
+ try {
19
+ const client = getClient();
20
+ await client.pullRequests.removeReaction({
21
+ projectKey: opts.project,
22
+ repositorySlug: opts.repo,
23
+ pullRequestId: parseInt(opts.id),
24
+ commentId: parseInt(opts.commentId),
25
+ emoticon: opts.emoticon,
26
+ });
27
+ output({ removed: true, emoticon: opts.emoticon });
28
+ }
29
+ catch (err) {
30
+ handleError(err);
31
+ }
32
+ });
33
+ }
34
+ //# sourceMappingURL=reaction-remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction-remove.js","sourceRoot":"","sources":["../../../src/commands/pr/reaction-remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,MAAM;SACH,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,+CAA+C,CAAC;SAC5D,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,cAAc,CAAC,kBAAkB,EAAE,YAAY,CAAC;SAChD,SAAS,CACR,IAAI,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;SAClD,OAAO,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;SACzE,mBAAmB,EAAE,CACzB;SACA,WAAW,CACV,OAAO,EACP;4GACsG,CACvG;SACA,MAAM,CACL,KAAK,EAAE,IAMN,EAAE,EAAE;QACH,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC;gBACvC,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;gBACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC,CAAC;YACH,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function review(parent: Command): void;
3
+ //# sourceMappingURL=review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,QAmCrC"}
@@ -0,0 +1,34 @@
1
+ import { Option } from 'commander';
2
+ import { getClient } from '../../utils/client.js';
3
+ import { output, handleError } from '../../utils/output.js';
4
+ export function review(parent) {
5
+ parent
6
+ .command('review')
7
+ .description('Update review status for a pull request')
8
+ .requiredOption('--project <key>', 'Bitbucket project key')
9
+ .requiredOption('--repo <slug>', 'Repository slug')
10
+ .requiredOption('--id <n>', 'Pull request ID')
11
+ .addOption(new Option('--status <status>', 'Review status')
12
+ .choices(['APPROVED', 'NEEDS_WORK', 'UNAPPROVED'])
13
+ .makeOptionMandatory())
14
+ .addHelpText('after', `\nExamples:
15
+ bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status APPROVED
16
+ bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status NEEDS_WORK
17
+ bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status UNAPPROVED`)
18
+ .action(async (opts) => {
19
+ try {
20
+ const client = getClient();
21
+ const result = await client.pullRequests.updateReviewStatus({
22
+ projectKey: opts.project,
23
+ repositorySlug: opts.repo,
24
+ pullRequestId: parseInt(opts.id),
25
+ status: opts.status,
26
+ });
27
+ output(result);
28
+ }
29
+ catch (err) {
30
+ handleError(err);
31
+ }
32
+ });
33
+ }
34
+ //# sourceMappingURL=review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.js","sourceRoot":"","sources":["../../../src/commands/pr/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,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,yCAAyC,CAAC;SACtD,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC;SAC7C,SAAS,CACR,IAAI,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC;SAC7C,OAAO,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;SACjD,mBAAmB,EAAE,CACzB;SACA,WAAW,CACV,OAAO,EACP;;;kFAG4E,CAC7E;SACA,MAAM,CACL,KAAK,EAAE,IAAmE,EAAE,EAAE;QAC5E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC;gBAC1D,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,MAAM,EAAE,IAAI,CAAC,MAAkD;aAChE,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,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerProjectCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAQvD"}
@@ -0,0 +1,11 @@
1
+ import { list } from './list.js';
2
+ export function registerProjectCommands(program) {
3
+ const project = program.command('project').description('Project operations')
4
+ .addHelpText('after', `
5
+ Examples:
6
+ $ bitbucketdc project list
7
+ $ bitbucketdc project list --name "My Project" --limit 10
8
+ `);
9
+ list(project);
10
+ }
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/project/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC;SACzE,WAAW,CAAC,OAAO,EAAE;;;;CAIzB,CAAC,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function list(parent: Command): void;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/project/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,QA0BnC"}
@@ -0,0 +1,32 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output, handleError } from '../../utils/output.js';
3
+ export function list(parent) {
4
+ parent
5
+ .command('list')
6
+ .description('List projects')
7
+ .option('--name <name>', 'Filter projects by name (partial match)')
8
+ .option('--permission <permission>', 'Filter by permission (e.g., PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN)')
9
+ .option('--start <start>', 'Starting index for pagination', parseInt)
10
+ .option('--limit <limit>', 'Maximum number of projects to return', parseInt)
11
+ .addHelpText('after', '\nExamples:\n bitbucketdc project list\n bitbucketdc project list --name "My Project"\n bitbucketdc project list --permission PROJECT_READ --limit 10')
12
+ .action(async (opts) => {
13
+ try {
14
+ const client = getClient();
15
+ const params = {};
16
+ if (opts.name)
17
+ params.name = opts.name;
18
+ if (opts.permission)
19
+ params.permission = opts.permission;
20
+ if (opts.start !== undefined)
21
+ params.start = opts.start;
22
+ if (opts.limit !== undefined)
23
+ params.limit = opts.limit;
24
+ const result = await client.projects.list(Object.keys(params).length > 0 ? params : undefined);
25
+ output(result);
26
+ }
27
+ catch (err) {
28
+ handleError(err);
29
+ }
30
+ });
31
+ }
32
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/project/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,eAAe,CAAC;SAC5B,MAAM,CAAC,eAAe,EAAE,yCAAyC,CAAC;SAClE,MAAM,CAAC,2BAA2B,EAAE,yEAAyE,CAAC;SAC9G,MAAM,CAAC,iBAAiB,EAAE,+BAA+B,EAAE,QAAQ,CAAC;SACpE,MAAM,CAAC,iBAAiB,EAAE,sCAAsC,EAAE,QAAQ,CAAC;SAC3E,WAAW,CACV,OAAO,EACP,0JAA0J,CAC3J;SACA,MAAM,CAAC,KAAK,EAAE,IAA4E,EAAE,EAAE;QAC7F,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,IAAI,IAAI,CAAC,IAAI;gBAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACvC,IAAI,IAAI,CAAC,UAAU;gBAAE,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;YACzD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACxD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACxD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACtG,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,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerRepoCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/repo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAOpD"}
@@ -0,0 +1,10 @@
1
+ import { list } from './list.js';
2
+ export function registerRepoCommands(program) {
3
+ const repo = program.command('repo').description('Repository operations')
4
+ .addHelpText('after', `
5
+ Examples:
6
+ $ bitbucketdc repo list PROJ
7
+ `);
8
+ list(repo);
9
+ }
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/repo/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC;SACtE,WAAW,CAAC,OAAO,EAAE;;;CAGzB,CAAC,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function list(parent: Command): void;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/repo/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,QAiBnC"}
@@ -0,0 +1,19 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output, handleError } from '../../utils/output.js';
3
+ export function list(parent) {
4
+ parent
5
+ .command('list <projectKey>')
6
+ .description('List repositories in a project')
7
+ .addHelpText('after', '\nExamples:\n bitbucketdc repo list PROJ\n bitbucketdc repo list AI')
8
+ .action(async (projectKey) => {
9
+ try {
10
+ const client = getClient();
11
+ const result = await client.repositories.list({ projectKey });
12
+ output(result);
13
+ }
14
+ catch (err) {
15
+ handleError(err);
16
+ }
17
+ });
18
+ }
19
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/repo/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,gCAAgC,CAAC;SAC7C,WAAW,CACV,OAAO,EACP,uEAAuE,CACxE;SACA,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,EAAE;QACnC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;YAC9D,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,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerUserCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QASpD"}
@@ -0,0 +1,13 @@
1
+ import { profile } from './profile.js';
2
+ import { list } from './list.js';
3
+ export function registerUserCommands(program) {
4
+ const user = program.command('user').description('User operations')
5
+ .addHelpText('after', `
6
+ Examples:
7
+ $ bitbucketdc user profile jsmith
8
+ $ bitbucketdc user list --filter john
9
+ `);
10
+ profile(user);
11
+ list(user);
12
+ }
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/user/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC;SAChE,WAAW,CAAC,OAAO,EAAE;;;;CAIzB,CAAC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,IAAI,CAAC,IAAI,CAAC,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function list(parent: Command): void;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/user/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,QAkBnC"}
@@ -0,0 +1,20 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output, handleError } from '../../utils/output.js';
3
+ export function list(parent) {
4
+ parent
5
+ .command('list')
6
+ .description('List all users')
7
+ .option('--filter <filter>', 'Filter users by username, name or email (partial match)')
8
+ .addHelpText('after', '\nExamples:\n bitbucketdc user list\n bitbucketdc user list --filter john')
9
+ .action(async (opts) => {
10
+ try {
11
+ const client = getClient();
12
+ const result = await client.users.getAll(opts.filter ? { filter: opts.filter } : undefined);
13
+ output(result);
14
+ }
15
+ catch (err) {
16
+ handleError(err);
17
+ }
18
+ });
19
+ }
20
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/user/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,gBAAgB,CAAC;SAC7B,MAAM,CAAC,mBAAmB,EAAE,yDAAyD,CAAC;SACtF,WAAW,CACV,OAAO,EACP,6EAA6E,CAC9E;SACA,MAAM,CAAC,KAAK,EAAE,IAAyB,EAAE,EAAE;QAC1C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC5F,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,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function profile(parent: Command): void;
3
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/commands/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,QAiBtC"}
@@ -0,0 +1,19 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output, handleError } from '../../utils/output.js';
3
+ export function profile(parent) {
4
+ parent
5
+ .command('profile <username>')
6
+ .description('Get a user profile by username')
7
+ .addHelpText('after', '\nExamples:\n bitbucketdc user profile jsmith\n bitbucketdc user profile admin')
8
+ .action(async (username) => {
9
+ try {
10
+ const client = getClient();
11
+ const result = await client.users.getProfile({ username });
12
+ output(result);
13
+ }
14
+ catch (err) {
15
+ handleError(err);
16
+ }
17
+ });
18
+ }
19
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../src/commands/user/profile.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,oBAAoB,CAAC;SAC7B,WAAW,CAAC,gCAAgC,CAAC;SAC7C,WAAW,CACV,OAAO,EACP,kFAAkF,CACnF;SACA,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;QACjC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC3D,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,3 @@
1
+ #!/usr/bin/env node
2
+ import 'dotenv/config';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ import 'dotenv/config';
3
+ import { Command } from 'commander';
4
+ import { styleText } from 'node:util';
5
+ import { registerUserCommands } from './commands/user/index.js';
6
+ import { registerProjectCommands } from './commands/project/index.js';
7
+ import { registerRepoCommands } from './commands/repo/index.js';
8
+ import { registerPrCommands } from './commands/pr/index.js';
9
+ const DIM = '\x1b[2m';
10
+ const RESET = '\x1b[0m';
11
+ const program = new Command();
12
+ program
13
+ .name('bitbucketdc')
14
+ .description('Bitbucket Data Center CLI')
15
+ .version('1.0.0')
16
+ .configureHelp({
17
+ styleTitle: (str) => styleText('bold', str),
18
+ styleUsage: (str) => styleText('dim', str),
19
+ styleCommandDescription: (str) => styleText('dim', str),
20
+ styleOptionDescription: (str) => styleText('dim', str),
21
+ styleSubcommandDescription: (str) => styleText('dim', str),
22
+ })
23
+ .addHelpText('beforeAll', `\n${styleText('bold', 'bitbucketdc')} ${DIM}— Bitbucket Data Center CLI${RESET}\n`)
24
+ .addHelpText('after', `
25
+ ${styleText('bold', 'Environment:')}
26
+ BITBUCKET_URL Bitbucket Server base URL ${DIM}(e.g., https://bitbucket.example.com)${RESET}
27
+ BITBUCKET_TOKEN Personal Access Token ${DIM}(generate in Bitbucket > Profile > Personal Access Tokens)${RESET}
28
+
29
+ ${styleText('bold', 'Examples:')}
30
+ ${DIM}$${RESET} bitbucketdc user profile jsmith
31
+ ${DIM}$${RESET} bitbucketdc user list --filter john
32
+ ${DIM}$${RESET} bitbucketdc project list --name "My Project"
33
+ ${DIM}$${RESET} bitbucketdc repo list PROJ
34
+ ${DIM}$${RESET} bitbucketdc pr inbox
35
+ ${DIM}$${RESET} bitbucketdc pr get --project PROJ --repo my-repo --pr 42
36
+ `);
37
+ registerUserCommands(program);
38
+ registerProjectCommands(program);
39
+ registerRepoCommands(program);
40
+ registerPrCommands(program);
41
+ program.parse();
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC,2BAA2B,CAAC;KACxC,OAAO,CAAC,OAAO,CAAC;KAChB,aAAa,CAAC;IACb,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3C,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IAC1C,uBAAuB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACvD,sBAAsB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACtD,0BAA0B,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;CAC3D,CAAC;KACD,WAAW,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,GAAG,8BAA8B,KAAK,IAAI,CAAC;KAC7G,WAAW,CAAC,OAAO,EAAE;EACtB,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;iDACc,GAAG,wCAAwC,KAAK;6CACpD,GAAG,6DAA6D,KAAK;;EAEhH,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC5B,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;CACf,CAAC,CAAC;AAEH,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACjC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE5B,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { BitbucketClient } from 'bitbucket-data-center-client';
2
+ export declare function getClient(): BitbucketClient;
3
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/utils/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,wBAAgB,SAAS,IAAI,eAAe,CAY3C"}
@@ -0,0 +1,11 @@
1
+ import { BitbucketClient } from 'bitbucket-data-center-client';
2
+ export function getClient() {
3
+ const baseUrl = process.env.BITBUCKET_URL;
4
+ const token = process.env.BITBUCKET_TOKEN;
5
+ if (!baseUrl || !token) {
6
+ process.stderr.write(JSON.stringify({ error: 'Missing required environment variables: BITBUCKET_URL and BITBUCKET_TOKEN' }) + '\n');
7
+ process.exit(1);
8
+ }
9
+ return new BitbucketClient({ baseUrl, token });
10
+ }
11
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/utils/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,UAAU,SAAS;IACvB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAE1C,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,2EAA2E,EAAE,CAAC,GAAG,IAAI,CAC9G,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function output(data: unknown): void;
2
+ export declare function handleError(err: unknown): void;
3
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE1C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAI9C"}
@@ -0,0 +1,10 @@
1
+ import { stripResponse } from './strip-response.js';
2
+ export function output(data) {
3
+ process.stdout.write(JSON.stringify(stripResponse(data), null, 2) + '\n');
4
+ }
5
+ export function handleError(err) {
6
+ const message = err instanceof Error ? err.message : String(err);
7
+ process.stderr.write(JSON.stringify({ error: message }) + '\n');
8
+ process.exit(1);
9
+ }
10
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,MAAM,CAAC,IAAa;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Recursively strip verbose fields from API responses to reduce token usage.
3
+ * Removes: self URLs, avatar URL dicts, links/_links, _expandable, expand metadata.
4
+ */
5
+ export declare function stripResponse(obj: unknown): unknown;
6
+ //# sourceMappingURL=strip-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strip-response.d.ts","sourceRoot":"","sources":["../../src/utils/strip-response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA+BnD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Recursively strip verbose fields from API responses to reduce token usage.
3
+ * Removes: self URLs, avatar URL dicts, links/_links, _expandable, expand metadata.
4
+ */
5
+ export function stripResponse(obj) {
6
+ if (Array.isArray(obj)) {
7
+ return obj.map(stripResponse);
8
+ }
9
+ if (obj === null || typeof obj !== 'object') {
10
+ return obj;
11
+ }
12
+ const record = obj;
13
+ const result = {};
14
+ for (const [key, value] of Object.entries(record)) {
15
+ // Skip noisy fields
16
+ if (key === 'self' ||
17
+ key === 'links' ||
18
+ key === '_links' ||
19
+ key === '_expandable' ||
20
+ key === 'expand' ||
21
+ key === 'avatarUrls' ||
22
+ key === 'avatarId' ||
23
+ key === 'iconUrl') {
24
+ continue;
25
+ }
26
+ result[key] = stripResponse(value);
27
+ }
28
+ return result;
29
+ }
30
+ //# sourceMappingURL=strip-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strip-response.js","sourceRoot":"","sources":["../../src/utils/strip-response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,MAAM,GAAG,GAA8B,CAAC;IAC9C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,oBAAoB;QACpB,IACE,GAAG,KAAK,MAAM;YACd,GAAG,KAAK,OAAO;YACf,GAAG,KAAK,QAAQ;YAChB,GAAG,KAAK,aAAa;YACrB,GAAG,KAAK,QAAQ;YAChB,GAAG,KAAK,YAAY;YACpB,GAAG,KAAK,UAAU;YAClB,GAAG,KAAK,SAAS,EACjB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "bitbucketdc-cli",
3
+ "version": "0.0.1",
4
+ "publish": true,
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "bitbucketdc": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "dependencies": {
14
+ "commander": "^13.1.0",
15
+ "dotenv": "17.2.3",
16
+ "bitbucket-data-center-client": "1.4.2"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "24.10.4",
20
+ "eslint": "^9.39.0",
21
+ "tsx": "^4.19.2",
22
+ "typescript": "^5.7.2",
23
+ "vitest": "^4.0.16",
24
+ "config-eslint": "0.0.0",
25
+ "config-typescript": "0.0.0"
26
+ },
27
+ "engines": {
28
+ "node": ">=22.0.0"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "dev": "tsx src/index.ts",
33
+ "lint": "eslint src",
34
+ "lint:fix": "eslint src --fix",
35
+ "test": "vitest run",
36
+ "test:integration": "vitest run tests/integration"
37
+ }
38
+ }