bitbucketdc-cli 0.0.3 → 0.0.4

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.
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function download(parent: Command): void;
3
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../src/commands/repo/attachment/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,QA0BvC"}
@@ -0,0 +1,28 @@
1
+ import { getClient } from '../../../utils/client.js';
2
+ import { output, handleError } from '../../../utils/output.js';
3
+ export function download(parent) {
4
+ parent
5
+ .command('download')
6
+ .description('Download a repository attachment to disk')
7
+ .requiredOption('--project <key>', 'Project key')
8
+ .requiredOption('--repo <slug>', 'Repository slug')
9
+ .requiredOption('--id <attachmentId>', 'Attachment ID')
10
+ .requiredOption('--output <path>', 'Destination file path')
11
+ .addHelpText('after', '\nExamples:\n bitbucketdc repo attachment download --project PROJ --repo my-repo --id abc123 --output ./file.png')
12
+ .action(async (opts) => {
13
+ try {
14
+ const client = getClient();
15
+ await client.repositories.downloadAttachment({
16
+ projectKey: opts.project,
17
+ repositorySlug: opts.repo,
18
+ attachmentId: opts.id,
19
+ destinationPath: opts.output,
20
+ });
21
+ output({ downloaded: true, path: opts.output, attachmentId: opts.id });
22
+ }
23
+ catch (err) {
24
+ handleError(err);
25
+ }
26
+ });
27
+ }
28
+ //# sourceMappingURL=download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.js","sourceRoot":"","sources":["../../../../src/commands/repo/attachment/download.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,0CAA0C,CAAC;SACvD,cAAc,CAAC,iBAAiB,EAAE,aAAa,CAAC;SAChD,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,qBAAqB,EAAE,eAAe,CAAC;SACtD,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAC1D,WAAW,CACV,OAAO,EACP,mHAAmH,CACpH;SACA,MAAM,CAAC,KAAK,EAAE,IAAmE,EAAE,EAAE;QACpF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC;gBAC3C,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,YAAY,EAAE,IAAI,CAAC,EAAE;gBACrB,eAAe,EAAE,IAAI,CAAC,MAAM;aAC7B,CAAC,CAAC;YACH,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACzE,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 registerAttachmentCommands(parent: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/repo/attachment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,QAczD"}
@@ -0,0 +1,15 @@
1
+ import { download } from './download.js';
2
+ import { metadata } from './metadata.js';
3
+ export function registerAttachmentCommands(parent) {
4
+ const attachment = parent
5
+ .command('attachment')
6
+ .description('Attachment operations')
7
+ .addHelpText('after', `
8
+ Examples:
9
+ $ bitbucketdc repo attachment download --project PROJ --repo my-repo --id abc123 --output ./file.png
10
+ $ bitbucketdc repo attachment metadata --project PROJ --repo my-repo --id abc123
11
+ `);
12
+ download(attachment);
13
+ metadata(attachment);
14
+ }
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/repo/attachment/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,0BAA0B,CAAC,MAAe;IACxD,MAAM,UAAU,GAAG,MAAM;SACtB,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,uBAAuB,CAAC;SACpC,WAAW,CACV,OAAO,EACP;;;;CAIL,CACI,CAAC;IACJ,QAAQ,CAAC,UAAU,CAAC,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,CAAC;AACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function metadata(parent: Command): void;
3
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/commands/repo/attachment/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,QAwBvC"}
@@ -0,0 +1,26 @@
1
+ import { getClient } from '../../../utils/client.js';
2
+ import { output, handleError } from '../../../utils/output.js';
3
+ export function metadata(parent) {
4
+ parent
5
+ .command('metadata')
6
+ .description('Get metadata for a repository attachment')
7
+ .requiredOption('--project <key>', 'Project key')
8
+ .requiredOption('--repo <slug>', 'Repository slug')
9
+ .requiredOption('--id <attachmentId>', 'Attachment ID')
10
+ .addHelpText('after', '\nExamples:\n bitbucketdc repo attachment metadata --project PROJ --repo my-repo --id abc123')
11
+ .action(async (opts) => {
12
+ try {
13
+ const client = getClient();
14
+ const result = await client.repositories.getAttachmentMetadata({
15
+ projectKey: opts.project,
16
+ repositorySlug: opts.repo,
17
+ attachmentId: opts.id,
18
+ });
19
+ output(result);
20
+ }
21
+ catch (err) {
22
+ handleError(err);
23
+ }
24
+ });
25
+ }
26
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../src/commands/repo/attachment/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,0CAA0C,CAAC;SACvD,cAAc,CAAC,iBAAiB,EAAE,aAAa,CAAC;SAChD,cAAc,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAClD,cAAc,CAAC,qBAAqB,EAAE,eAAe,CAAC;SACtD,WAAW,CACV,OAAO,EACP,+FAA+F,CAChG;SACA,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,qBAAqB,CAAC;gBAC7D,UAAU,EAAE,IAAI,CAAC,OAAO;gBACxB,cAAc,EAAE,IAAI,CAAC,IAAI;gBACzB,YAAY,EAAE,IAAI,CAAC,EAAE;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"}
@@ -1 +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,QAYpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/repo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAcpD"}
@@ -1,3 +1,4 @@
1
+ import { registerAttachmentCommands } from './attachment/index.js';
1
2
  import { list } from './list.js';
2
3
  export function registerRepoCommands(program) {
3
4
  const repo = program
@@ -6,7 +7,9 @@ export function registerRepoCommands(program) {
6
7
  .addHelpText('after', `
7
8
  Examples:
8
9
  $ bitbucketdc repo list PROJ
10
+ $ bitbucketdc repo attachment download --project PROJ --repo my-repo --id abc123 --output ./file.png
9
11
  `);
10
12
  list(repo);
13
+ registerAttachmentCommands(repo);
11
14
  }
12
15
  //# sourceMappingURL=index.js.map
@@ -1 +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;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,uBAAuB,CAAC;SACpC,WAAW,CACV,OAAO,EACP;;;CAGL,CACI,CAAC;IACJ,IAAI,CAAC,IAAI,CAAC,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/repo/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,uBAAuB,CAAC;SACpC,WAAW,CACV,OAAO,EACP;;;;CAIL,CACI,CAAC;IACJ,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,0BAA0B,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitbucketdc-cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
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.3"
16
+ "bitbucket-data-center-client": "1.4.4"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "24.10.4",