bitbucketdc-cli 0.0.3 → 0.0.5
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/repo/attachment/download.d.ts +3 -0
- package/dist/commands/repo/attachment/download.d.ts.map +1 -0
- package/dist/commands/repo/attachment/download.js +28 -0
- package/dist/commands/repo/attachment/download.js.map +1 -0
- package/dist/commands/repo/attachment/index.d.ts +3 -0
- package/dist/commands/repo/attachment/index.d.ts.map +1 -0
- package/dist/commands/repo/attachment/index.js +12 -0
- package/dist/commands/repo/attachment/index.js.map +1 -0
- package/dist/commands/repo/index.d.ts.map +1 -1
- package/dist/commands/repo/index.js +3 -0
- package/dist/commands/repo/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -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 @@
|
|
|
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;AAGpC,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,QAYzD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { download } from './download.js';
|
|
2
|
+
export function registerAttachmentCommands(parent) {
|
|
3
|
+
const attachment = parent
|
|
4
|
+
.command('attachment')
|
|
5
|
+
.description('Attachment operations')
|
|
6
|
+
.addHelpText('after', `
|
|
7
|
+
Examples:
|
|
8
|
+
$ bitbucketdc repo attachment download --project PROJ --repo my-repo --id 706 --output ./image.png
|
|
9
|
+
`);
|
|
10
|
+
download(attachment);
|
|
11
|
+
}
|
|
12
|
+
//# 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;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;;;CAGL,CACI,CAAC;IACJ,QAAQ,CAAC,UAAU,CAAC,CAAC;AACvB,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;
|
|
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
|
|
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
|
+
"version": "0.0.5",
|
|
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.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "24.10.4",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"tsx": "^4.19.2",
|
|
22
22
|
"typescript": "^5.7.2",
|
|
23
23
|
"vitest": "^4.0.16",
|
|
24
|
-
"config-
|
|
25
|
-
"config-
|
|
24
|
+
"config-typescript": "0.0.0",
|
|
25
|
+
"config-eslint": "0.0.0"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=22.0.0"
|