@nulab/bee 1.1.0 → 1.1.2
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/README.md +6 -3
- package/dist/activities-BPTHt_MD.mjs +69 -0
- package/dist/activities-CRiEq51-.mjs +72 -0
- package/dist/activities-DyOMqdsM.mjs +69 -0
- package/dist/activity-labels-CLFpxp8o.mjs +34 -0
- package/dist/add-Br-_TLRp.mjs +55 -0
- package/dist/add-CTmmy2t9.mjs +26 -0
- package/dist/add-user-BVWFcbH7.mjs +26 -0
- package/dist/api-kJR0fRPw.mjs +143 -0
- package/dist/attachments-CnL8t9tK.mjs +50 -0
- package/dist/attachments-D8IoJjYE.mjs +50 -0
- package/dist/attachments-DfgEkAY2.mjs +46 -0
- package/dist/auth-5TJGBPxi.mjs +13 -0
- package/dist/bee-command-v0qvZeth.mjs +57 -0
- package/dist/browse-vgF6nz7X.mjs +304 -0
- package/dist/category-BZ7XdVgx.mjs +11 -0
- package/dist/clone-DAWVtVbZ.mjs +43 -0
- package/dist/close-cTyZPv77.mjs +37 -0
- package/dist/comment-CkYJYFrF.mjs +115 -0
- package/dist/comment-DzRBQNv8.mjs +102 -0
- package/dist/comments-SnOZ-EUJ.mjs +47 -0
- package/dist/common-options-BuYWxYdO.mjs +45 -0
- package/dist/completion-yfcnEl7k.mjs +113 -0
- package/dist/count-BI7ld4k5.mjs +50 -0
- package/dist/count-Bw0mVlxC.mjs +40 -0
- package/dist/count-CH_LN4k6.mjs +51 -0
- package/dist/count-CHzDiMV3.mjs +25 -0
- package/dist/count-DvmYzPD_.mjs +46 -0
- package/dist/create-BHjwacOk.mjs +47 -0
- package/dist/create-BXWATibN.mjs +41 -0
- package/dist/create-BtLVFmbR.mjs +29 -0
- package/dist/create-CoF2bahH.mjs +29 -0
- package/dist/create-DhAOhro9.mjs +60 -0
- package/dist/create-DtMLv7Wq.mjs +26 -0
- package/dist/create-PtahSFdG.mjs +66 -0
- package/dist/create-Y4vo2zwX.mjs +44 -0
- package/dist/create-vwRKZ3Lm.mjs +31 -0
- package/dist/dashboard-CYYU5Yii.mjs +97 -0
- package/dist/delete-BCAPHs-g.mjs +25 -0
- package/dist/delete-BHNt5SWa.mjs +24 -0
- package/dist/delete-BlmanW0H.mjs +25 -0
- package/dist/delete-Bxk14ntp.mjs +24 -0
- package/dist/delete-C05oMZEW.mjs +24 -0
- package/dist/delete-CMwkcSiA.mjs +25 -0
- package/dist/delete-CTeH7nzL.mjs +29 -0
- package/dist/delete-D2yDBhZc.mjs +24 -0
- package/dist/delete-HMOfvtv3.mjs +25 -0
- package/dist/document-CiIzSyoS.mjs +13 -0
- package/dist/edit-BBvSbt0m.mjs +22 -0
- package/dist/edit-CN1gdpjd.mjs +37 -0
- package/dist/edit-C_KbKopB.mjs +36 -0
- package/dist/edit-D5Z45NVj.mjs +27 -0
- package/dist/edit-DKQw-XXP.mjs +27 -0
- package/dist/edit-DRxr4r-r.mjs +60 -0
- package/dist/edit-DxsP-aPX.mjs +43 -0
- package/dist/edit-Otc7XHU7.mjs +52 -0
- package/dist/format-DHAR0n3J.mjs +9 -0
- package/dist/history-DpjqxFkX.mjs +55 -0
- package/dist/index.mjs +35 -207
- package/dist/issue-BRzJy3k1.mjs +18 -0
- package/dist/issue-type-Byzh4yLx.mjs +11 -0
- package/dist/list-B3A5SDEm.mjs +35 -0
- package/dist/list-BMKaJoe_.mjs +64 -0
- package/dist/list-BOMbpS4m.mjs +46 -0
- package/dist/list-BmZ_JbLB.mjs +104 -0
- package/dist/list-BpUUxxwQ.mjs +46 -0
- package/dist/list-CgIebllW.mjs +94 -0
- package/dist/list-D0Z__0nw.mjs +42 -0
- package/dist/list-D3FkO9gb.mjs +56 -0
- package/dist/list-D7WLdHvX.mjs +42 -0
- package/dist/list-DAr3urtu.mjs +53 -0
- package/dist/list-DqpWd9aR.mjs +59 -0
- package/dist/list-VO_PbRjC.mjs +50 -0
- package/dist/list-b6ByzUFt.mjs +79 -0
- package/dist/list-jpQ28gU2.mjs +56 -0
- package/dist/list-y93EXyDj.mjs +42 -0
- package/dist/login-BnJYzdR3.mjs +228 -0
- package/dist/logout-YMnSRLLF.mjs +56 -0
- package/dist/me-CLPAe7X2.mjs +36 -0
- package/dist/milestone-Dc3alfp9.mjs +11 -0
- package/dist/notification-CsOuC8Uk.mjs +11 -0
- package/dist/output-DBvfyU1J.mjs +39 -0
- package/dist/pr-BBe07JUp.mjs +15 -0
- package/dist/project-Dilo1T5e.mjs +16 -0
- package/dist/read-BS2G4sNq.mjs +17 -0
- package/dist/read-CyCASx6U.mjs +17 -0
- package/dist/read-all-CjgMJ2to.mjs +16 -0
- package/dist/refresh-DDU2ZLnc.mjs +54 -0
- package/dist/registry-B0ZQfBD5.mjs +35 -0
- package/dist/registry-RATsKPUm.mjs +2 -0
- package/dist/remove-BSDJvkVJ.mjs +17 -0
- package/dist/remove-user-CShNCvf8.mjs +26 -0
- package/dist/reopen-BIRhcmsI.mjs +28 -0
- package/dist/repo-B2K8y0mD.mjs +10 -0
- package/dist/role-labels-CLA2wmjO.mjs +11 -0
- package/dist/space-BgZeUqoH.mjs +6 -0
- package/dist/{shared/bee.B3N0WBdU.mjs → src-BWaxjrq_.mjs} +143 -176
- package/dist/src-CP4YLIAh.mjs +1008 -0
- package/dist/src-CTD9-bSB.mjs +22760 -0
- package/dist/star-Sgb-e2CQ.mjs +11 -0
- package/dist/status-BkFMW8Jh.mjs +53 -0
- package/dist/status-CaGqMXh7.mjs +64 -0
- package/dist/status-DDFyQrRZ.mjs +11 -0
- package/dist/status-nI4Dpcoo.mjs +58 -0
- package/dist/stdin-C-vjNi9T.mjs +17 -0
- package/dist/switch-CMLfVGDN.mjs +34 -0
- package/dist/tags-DuMJZyBL.mjs +29 -0
- package/dist/team-DfQn8Tf5.mjs +6 -0
- package/dist/token-BmkUX9vc.mjs +28 -0
- package/dist/tree-CozBqPbN.mjs +46 -0
- package/dist/user-DMyFmoP3.mjs +11 -0
- package/dist/users-BSGqsGSy.mjs +51 -0
- package/dist/view-Bj99sk7O.mjs +48 -0
- package/dist/view-Bs8o0c7i.mjs +36 -0
- package/dist/view-C1ECwTMN.mjs +54 -0
- package/dist/view-COBYBfu7.mjs +38 -0
- package/dist/view-CZHT-HiE.mjs +36 -0
- package/dist/view-D1RuQJV6.mjs +76 -0
- package/dist/view-DBO75WzR.mjs +54 -0
- package/dist/view-DJHrnN8j.mjs +62 -0
- package/dist/view-DLx6qQt9.mjs +51 -0
- package/dist/watching-D22YYxOT.mjs +12 -0
- package/dist/wiki-B-DQUuIX.mjs +16 -0
- package/package.json +12 -7
- package/dist/chunks/activities.mjs +0 -77
- package/dist/chunks/activities2.mjs +0 -77
- package/dist/chunks/activities3.mjs +0 -77
- package/dist/chunks/add-user.mjs +0 -40
- package/dist/chunks/add.mjs +0 -65
- package/dist/chunks/add2.mjs +0 -41
- package/dist/chunks/api.mjs +0 -176
- package/dist/chunks/attachments.mjs +0 -49
- package/dist/chunks/attachments2.mjs +0 -49
- package/dist/chunks/attachments3.mjs +0 -50
- package/dist/chunks/browse.mjs +0 -271
- package/dist/chunks/clone.mjs +0 -62
- package/dist/chunks/close.mjs +0 -52
- package/dist/chunks/comment.mjs +0 -127
- package/dist/chunks/comment2.mjs +0 -113
- package/dist/chunks/comments.mjs +0 -59
- package/dist/chunks/completion.mjs +0 -118
- package/dist/chunks/count.mjs +0 -70
- package/dist/chunks/count2.mjs +0 -71
- package/dist/chunks/count3.mjs +0 -61
- package/dist/chunks/count4.mjs +0 -37
- package/dist/chunks/count5.mjs +0 -54
- package/dist/chunks/create.mjs +0 -62
- package/dist/chunks/create2.mjs +0 -90
- package/dist/chunks/create3.mjs +0 -66
- package/dist/chunks/create4.mjs +0 -76
- package/dist/chunks/create5.mjs +0 -58
- package/dist/chunks/create6.mjs +0 -39
- package/dist/chunks/create7.mjs +0 -47
- package/dist/chunks/create8.mjs +0 -51
- package/dist/chunks/create9.mjs +0 -51
- package/dist/chunks/dashboard.mjs +0 -86
- package/dist/chunks/delete.mjs +0 -50
- package/dist/chunks/delete2.mjs +0 -48
- package/dist/chunks/delete3.mjs +0 -48
- package/dist/chunks/delete4.mjs +0 -51
- package/dist/chunks/delete5.mjs +0 -52
- package/dist/chunks/delete6.mjs +0 -52
- package/dist/chunks/delete7.mjs +0 -64
- package/dist/chunks/delete8.mjs +0 -55
- package/dist/chunks/delete9.mjs +0 -50
- package/dist/chunks/edit.mjs +0 -58
- package/dist/chunks/edit2.mjs +0 -80
- package/dist/chunks/edit3.mjs +0 -67
- package/dist/chunks/edit4.mjs +0 -53
- package/dist/chunks/edit5.mjs +0 -45
- package/dist/chunks/edit6.mjs +0 -56
- package/dist/chunks/edit7.mjs +0 -52
- package/dist/chunks/edit8.mjs +0 -52
- package/dist/chunks/history.mjs +0 -58
- package/dist/chunks/index.mjs +0 -15
- package/dist/chunks/index10.mjs +0 -18
- package/dist/chunks/index11.mjs +0 -13
- package/dist/chunks/index12.mjs +0 -13
- package/dist/chunks/index13.mjs +0 -13
- package/dist/chunks/index14.mjs +0 -8
- package/dist/chunks/index15.mjs +0 -13
- package/dist/chunks/index16.mjs +0 -13
- package/dist/chunks/index17.mjs +0 -14
- package/dist/chunks/index2.mjs +0 -18
- package/dist/chunks/index3.mjs +0 -20
- package/dist/chunks/index4.mjs +0 -15
- package/dist/chunks/index5.mjs +0 -13
- package/dist/chunks/index6.mjs +0 -17
- package/dist/chunks/index7.mjs +0 -8
- package/dist/chunks/index8.mjs +0 -8
- package/dist/chunks/index9.mjs +0 -13
- package/dist/chunks/list.mjs +0 -54
- package/dist/chunks/list10.mjs +0 -46
- package/dist/chunks/list11.mjs +0 -51
- package/dist/chunks/list12.mjs +0 -47
- package/dist/chunks/list13.mjs +0 -47
- package/dist/chunks/list14.mjs +0 -56
- package/dist/chunks/list15.mjs +0 -48
- package/dist/chunks/list2.mjs +0 -105
- package/dist/chunks/list3.mjs +0 -87
- package/dist/chunks/list4.mjs +0 -81
- package/dist/chunks/list5.mjs +0 -79
- package/dist/chunks/list6.mjs +0 -47
- package/dist/chunks/list7.mjs +0 -50
- package/dist/chunks/list8.mjs +0 -48
- package/dist/chunks/list9.mjs +0 -55
- package/dist/chunks/login.mjs +0 -220
- package/dist/chunks/logout.mjs +0 -72
- package/dist/chunks/me.mjs +0 -50
- package/dist/chunks/read-all.mjs +0 -31
- package/dist/chunks/read.mjs +0 -31
- package/dist/chunks/read2.mjs +0 -29
- package/dist/chunks/refresh.mjs +0 -78
- package/dist/chunks/remove-user.mjs +0 -40
- package/dist/chunks/remove.mjs +0 -29
- package/dist/chunks/reopen.mjs +0 -44
- package/dist/chunks/status.mjs +0 -61
- package/dist/chunks/status2.mjs +0 -63
- package/dist/chunks/status3.mjs +0 -68
- package/dist/chunks/switch.mjs +0 -51
- package/dist/chunks/tags.mjs +0 -43
- package/dist/chunks/token.mjs +0 -38
- package/dist/chunks/tree.mjs +0 -63
- package/dist/chunks/users.mjs +0 -50
- package/dist/chunks/view.mjs +0 -60
- package/dist/chunks/view2.mjs +0 -96
- package/dist/chunks/view3.mjs +0 -70
- package/dist/chunks/view4.mjs +0 -72
- package/dist/chunks/view5.mjs +0 -63
- package/dist/chunks/view6.mjs +0 -54
- package/dist/chunks/view7.mjs +0 -50
- package/dist/chunks/view8.mjs +0 -63
- package/dist/chunks/view9.mjs +0 -50
- package/dist/shared/bee.BImw1HZl.mjs +0 -28
- package/dist/shared/bee.BTBGpv4K.mjs +0 -34
- package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
- package/dist/shared/bee.BYqxm3yG.mjs +0 -24
- package/dist/shared/bee.Btmq3TXs.mjs +0 -19
- package/dist/shared/bee.C--ZWPxf.mjs +0 -14
- package/dist/shared/bee.C4p7W8_P.mjs +0 -18
- package/dist/shared/bee.CirccSk2.mjs +0 -51
- package/dist/shared/bee.CktwmH8R.mjs +0 -25
- package/dist/shared/bee.CzKcWSES.mjs +0 -42
- package/dist/shared/bee.DFnSWb6q.mjs +0 -396
- package/dist/shared/bee.DessOtkV.mjs +0 -132
- package/dist/shared/bee.DfqnFet4.mjs +0 -49
- package/dist/shared/bee.DoTvz3uW.mjs +0 -13
- package/dist/shared/bee.G4d7izLe.mjs +0 -14
- package/dist/shared/bee.KteAW2rM.mjs +0 -73
- package/dist/shared/bee.PF8hrVKn.mjs +0 -27
- package/dist/shared/bee.a05kNWpn.mjs +0 -32
- package/dist/shared/bee.n5MYN4a6.mjs +0 -12
- package/dist/shared/bee.x-FvgDW2.mjs +0 -37660
package/dist/chunks/view9.mjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
3
|
-
import 'node:stream/consumers';
|
|
4
|
-
import 'valibot';
|
|
5
|
-
import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
|
|
6
|
-
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
7
|
-
import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
|
|
8
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
9
|
-
import 'backlog-js';
|
|
10
|
-
import 'node:http';
|
|
11
|
-
import 'open';
|
|
12
|
-
import 'node:child_process';
|
|
13
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
14
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
15
|
-
import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
|
|
16
|
-
import '../shared/bee.DFnSWb6q.mjs';
|
|
17
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
18
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
19
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
20
|
-
import 'node:module';
|
|
21
|
-
import 'commander';
|
|
22
|
-
import 'consola/utils';
|
|
23
|
-
import 'node:fs';
|
|
24
|
-
import 'node:path';
|
|
25
|
-
import 'node:os';
|
|
26
|
-
|
|
27
|
-
const view = new BeeCommand("view").summary("View a watching item").description(`Shows the associated issue, note, read status, and timestamps.`).argument("<watching>", "Watching ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
28
|
-
{ description: "View a watching item", command: "bee watching view 12345" },
|
|
29
|
-
{ description: "Output as JSON", command: "bee watching view 12345 --json" }
|
|
30
|
-
]).action(async (watching, opts) => {
|
|
31
|
-
const { client } = await getClient(opts.space);
|
|
32
|
-
const watchingData = await client.getWatchingListItem(parseArg(vInteger, watching, "watching"));
|
|
33
|
-
outputResult(watchingData, opts, (data) => {
|
|
34
|
-
consola.log("");
|
|
35
|
-
consola.log(` ${data.issue.issueKey}: ${data.issue.summary}`);
|
|
36
|
-
consola.log("");
|
|
37
|
-
printDefinitionList([
|
|
38
|
-
["ID", String(data.id)],
|
|
39
|
-
["Issue Key", data.issue.issueKey],
|
|
40
|
-
["Title", data.issue.summary],
|
|
41
|
-
["Note", data.note || void 0],
|
|
42
|
-
["Read", data.resourceAlreadyRead ? "Read" : "Unread"],
|
|
43
|
-
["Created", formatDate(data.created)],
|
|
44
|
-
["Updated", formatDate(data.updated)]
|
|
45
|
-
]);
|
|
46
|
-
consola.log("");
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export { view as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
|
|
3
|
-
const ApiKeyAuthSchema = v.object({
|
|
4
|
-
method: v.literal("api-key"),
|
|
5
|
-
apiKey: v.string()
|
|
6
|
-
});
|
|
7
|
-
const OAuthAuthSchema = v.object({
|
|
8
|
-
method: v.literal("oauth"),
|
|
9
|
-
accessToken: v.string(),
|
|
10
|
-
refreshToken: v.string(),
|
|
11
|
-
clientId: v.optional(v.string()),
|
|
12
|
-
clientSecret: v.optional(v.string())
|
|
13
|
-
});
|
|
14
|
-
const RcAuthSchema = v.variant("method", [ApiKeyAuthSchema, OAuthAuthSchema]);
|
|
15
|
-
const RcHostSchema = v.pipe(v.string(), v.toLowerCase(), v.domain());
|
|
16
|
-
const RcSpaceSchema = v.object({
|
|
17
|
-
host: RcHostSchema,
|
|
18
|
-
auth: RcAuthSchema
|
|
19
|
-
});
|
|
20
|
-
const RcSchema = v.object({
|
|
21
|
-
// Lowercased to match the normalized `host` values it is compared against.
|
|
22
|
-
// Not a full host: it may also be a shorthand that `findSpace` expands.
|
|
23
|
-
defaultSpace: v.optional(v.pipe(v.string(), v.toLowerCase())),
|
|
24
|
-
spaces: v.optional(v.array(RcSpaceSchema), []),
|
|
25
|
-
aliases: v.optional(v.record(v.string(), v.string()), {})
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export { RcHostSchema as R, RcSchema as a };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
2
|
-
const pickFields = (obj, fields) => {
|
|
3
|
-
if (!isRecord(obj)) {
|
|
4
|
-
return {};
|
|
5
|
-
}
|
|
6
|
-
const result = {};
|
|
7
|
-
for (const field of fields) {
|
|
8
|
-
if (field in obj) {
|
|
9
|
-
result[field] = obj[field];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
const filterFields = (data, fields) => {
|
|
15
|
-
if (Array.isArray(data)) {
|
|
16
|
-
return data.map((item) => pickFields(item, fields));
|
|
17
|
-
}
|
|
18
|
-
return pickFields(data, fields);
|
|
19
|
-
};
|
|
20
|
-
const outputResult = (data, args, defaultFormat) => {
|
|
21
|
-
if (args.json === void 0) {
|
|
22
|
-
defaultFormat(data);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const output = args.json ? filterFields(
|
|
26
|
-
data,
|
|
27
|
-
args.json.split(",").map((f) => f.trim())
|
|
28
|
-
) : data;
|
|
29
|
-
const json = process.stdout.isTTY ? JSON.stringify(output, null, 2) : JSON.stringify(output);
|
|
30
|
-
process.stdout.write(`${json}
|
|
31
|
-
`);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export { outputResult as o };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
import consola from 'consola';
|
|
3
|
-
|
|
4
|
-
class UserError extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = "UserError";
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const vFiniteNumber = v.pipe(v.string(), v.transform(Number), v.number(), v.finite());
|
|
12
|
-
const vInteger = v.pipe(v.string(), v.transform(Number), v.number(), v.integer());
|
|
13
|
-
const parseArg = (schema, value, label) => {
|
|
14
|
-
const result = v.safeParse(schema, value);
|
|
15
|
-
if (result.success) {
|
|
16
|
-
return result.output;
|
|
17
|
-
}
|
|
18
|
-
const reason = result.issues[0]?.message;
|
|
19
|
-
const message = reason ? `Invalid value for "${label}": "${value}" \u2014 ${reason}` : `Invalid value for "${label}": "${value}"`;
|
|
20
|
-
consola.debug("parseArg validation issues:", result.issues);
|
|
21
|
-
throw new UserError(message);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { UserError as U, vFiniteNumber as a, parseArg as p, vInteger as v };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const IssueStatusId = {
|
|
2
|
-
Open: 1,
|
|
3
|
-
Closed: 4
|
|
4
|
-
};
|
|
5
|
-
const ResolutionId = {
|
|
6
|
-
fixed: 0,
|
|
7
|
-
"wont-fix": 1,
|
|
8
|
-
invalid: 2,
|
|
9
|
-
duplicate: 3,
|
|
10
|
-
"cannot-reproduce": 4
|
|
11
|
-
};
|
|
12
|
-
const PriorityId = {
|
|
13
|
-
high: 2,
|
|
14
|
-
normal: 3,
|
|
15
|
-
low: 4
|
|
16
|
-
};
|
|
17
|
-
const PRIORITY_NAMES = Object.keys(PriorityId);
|
|
18
|
-
|
|
19
|
-
export { IssueStatusId as I, PriorityId as P, ResolutionId as R, PRIORITY_NAMES as a };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { text } from 'node:stream/consumers';
|
|
2
|
-
|
|
3
|
-
const readStdin = async () => {
|
|
4
|
-
const content = await text(process.stdin);
|
|
5
|
-
return content.trim();
|
|
6
|
-
};
|
|
7
|
-
const resolveStdinArg = async (value) => {
|
|
8
|
-
if (!value && !process.stdin.isTTY) {
|
|
9
|
-
return readStdin();
|
|
10
|
-
}
|
|
11
|
-
return value;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { resolveStdinArg as a, readStdin as r };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { s as stringWidth, w as widthPadEnd } from './bee.DFnSWb6q.mjs';
|
|
3
|
-
|
|
4
|
-
const printDefinitionList = (items, indent = 4) => {
|
|
5
|
-
const filtered = items.filter(
|
|
6
|
-
(item) => item[1] !== null && item[1] !== void 0 && item[1] !== ""
|
|
7
|
-
);
|
|
8
|
-
if (filtered.length === 0) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const maxLabel = Math.max(...filtered.map(([label]) => stringWidth(label)));
|
|
12
|
-
const pad = " ".repeat(indent);
|
|
13
|
-
for (const [label, value] of filtered) {
|
|
14
|
-
consola.log(`${pad}${widthPadEnd(label, maxLabel)} ${value}`);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { printDefinitionList as p };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const ACTIVITY_LABELS = {
|
|
2
|
-
1: "Issue Created",
|
|
3
|
-
2: "Issue Updated",
|
|
4
|
-
3: "Issue Commented",
|
|
5
|
-
4: "Issue Deleted",
|
|
6
|
-
5: "Wiki Created",
|
|
7
|
-
6: "Wiki Updated",
|
|
8
|
-
7: "Wiki Deleted",
|
|
9
|
-
8: "File Added",
|
|
10
|
-
9: "File Updated",
|
|
11
|
-
10: "File Deleted",
|
|
12
|
-
11: "SVN Committed",
|
|
13
|
-
12: "Git Pushed",
|
|
14
|
-
13: "Git Repo Created",
|
|
15
|
-
14: "Issue Multi-Updated",
|
|
16
|
-
15: "Project User Added",
|
|
17
|
-
16: "Project User Removed",
|
|
18
|
-
17: "Notification Added",
|
|
19
|
-
18: "Pull Request Added",
|
|
20
|
-
19: "Pull Request Updated",
|
|
21
|
-
20: "Pull Request Commented",
|
|
22
|
-
21: "Pull Request Deleted",
|
|
23
|
-
22: "Milestone Added",
|
|
24
|
-
23: "Milestone Updated",
|
|
25
|
-
24: "Milestone Deleted",
|
|
26
|
-
25: "Project Team Added",
|
|
27
|
-
26: "Project Team Deleted",
|
|
28
|
-
34: "Status Deleted",
|
|
29
|
-
35: "Issues Dates Updated",
|
|
30
|
-
47: "Issue Multi-Created"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const STATUS_DELETED_TYPE = 34;
|
|
34
|
-
const getActivitySummary = (activity) => {
|
|
35
|
-
const { content } = activity;
|
|
36
|
-
if (activity.type === STATUS_DELETED_TYPE && "deletedStatus" in content && content.deletedStatus.name) {
|
|
37
|
-
return content.deletedStatus.name;
|
|
38
|
-
}
|
|
39
|
-
if ("summary" in content && content.summary) {
|
|
40
|
-
return content.summary;
|
|
41
|
-
}
|
|
42
|
-
if ("link" in content && content.link.length > 0) {
|
|
43
|
-
return content.link.map((item) => item.key_id ? `#${item.key_id}` : item.title ?? "").filter(Boolean).join(", ");
|
|
44
|
-
}
|
|
45
|
-
if ("key_id" in content && content.key_id) {
|
|
46
|
-
return `#${content.key_id}`;
|
|
47
|
-
}
|
|
48
|
-
return "";
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export { ACTIVITY_LABELS as A, getActivitySummary as g };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OAuth2 } from 'backlog-js';
|
|
2
|
-
|
|
3
|
-
const exchangeAuthorizationCode = async (host, params) => {
|
|
4
|
-
const oauth2 = new OAuth2({
|
|
5
|
-
clientId: params.clientId,
|
|
6
|
-
clientSecret: params.clientSecret
|
|
7
|
-
});
|
|
8
|
-
return oauth2.getAccessToken({
|
|
9
|
-
host,
|
|
10
|
-
code: params.code,
|
|
11
|
-
redirectUri: params.redirectUri
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
const refreshAccessToken = async (host, params) => {
|
|
15
|
-
const oauth2 = new OAuth2({
|
|
16
|
-
clientId: params.clientId,
|
|
17
|
-
clientSecret: params.clientSecret
|
|
18
|
-
});
|
|
19
|
-
return oauth2.refreshAccessToken({
|
|
20
|
-
host,
|
|
21
|
-
refreshToken: params.refreshToken
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { exchangeAuthorizationCode as e, refreshAccessToken as r };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import open from 'open';
|
|
2
|
-
|
|
3
|
-
const openUrl = async (url) => {
|
|
4
|
-
await open(url);
|
|
5
|
-
};
|
|
6
|
-
const buildBacklogUrl = (host, path) => `https://${host}${path}`;
|
|
7
|
-
const issueUrl = (host, issueKey) => buildBacklogUrl(host, `/view/${issueKey}`);
|
|
8
|
-
const projectUrl = (host, projectKey) => buildBacklogUrl(host, `/projects/${projectKey}`);
|
|
9
|
-
const pullRequestUrl = (host, projectKey, repoName, prNumber) => buildBacklogUrl(host, `/git/${projectKey}/${repoName}/pullRequests/${prNumber}`);
|
|
10
|
-
const repositoryUrl = (host, projectKey, repoName) => buildBacklogUrl(host, `/git/${projectKey}/${repoName}`);
|
|
11
|
-
const wikiUrl = (host, wikiId) => buildBacklogUrl(host, `/alias/wiki/${wikiId}`);
|
|
12
|
-
const documentUrl = (host, projectKey, documentId) => buildBacklogUrl(host, `/document/${projectKey}/${documentId}`);
|
|
13
|
-
const categoryUrl = (host, categoryId, projectId) => buildBacklogUrl(
|
|
14
|
-
host,
|
|
15
|
-
`/EditComponent.action?component.id=${categoryId}&component.projectId=${projectId}`
|
|
16
|
-
);
|
|
17
|
-
const milestoneUrl = (host, milestoneId) => buildBacklogUrl(host, `/EditVersion.action?version.id=${milestoneId}`);
|
|
18
|
-
const issueTypeUrl = (host, issueTypeId, projectId) => buildBacklogUrl(
|
|
19
|
-
host,
|
|
20
|
-
`/EditIssueType.action?issueType.id=${issueTypeId}&issueType.projectId=${projectId}`
|
|
21
|
-
);
|
|
22
|
-
const statusUrl = (host, projectKey, statusId) => buildBacklogUrl(host, `/projects/${projectKey}/statuses/${statusId}`);
|
|
23
|
-
const dashboardUrl = (host) => buildBacklogUrl(host, "/dashboard");
|
|
24
|
-
const gitBlobUrl = (host, projectKey, repoName, branch, filePath, line) => {
|
|
25
|
-
const url = buildBacklogUrl(host, `/git/${projectKey}/${repoName}/blob/${branch}/${filePath}`);
|
|
26
|
-
return line ? `${url}#${line}` : url;
|
|
27
|
-
};
|
|
28
|
-
const gitTreeUrl = (host, projectKey, repoName, branch, dirPath) => {
|
|
29
|
-
const base = `/git/${projectKey}/${repoName}/tree/${branch}`;
|
|
30
|
-
return buildBacklogUrl(host, dirPath ? `${base}/${dirPath}` : base);
|
|
31
|
-
};
|
|
32
|
-
const gitCommitUrl = (host, projectKey, repoName, commitSha) => buildBacklogUrl(host, `/git/${projectKey}/${repoName}/commit/${commitSha}`);
|
|
33
|
-
const openOrPrintUrl = async (url, noBrowser, log) => {
|
|
34
|
-
if (noBrowser) {
|
|
35
|
-
log.log(url);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
await openUrl(url);
|
|
39
|
-
log.info(`Opening ${url} in your browser.`);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { gitTreeUrl as a, buildBacklogUrl as b, gitBlobUrl as c, dashboardUrl as d, openUrl as e, documentUrl as f, gitCommitUrl as g, pullRequestUrl as h, issueUrl as i, categoryUrl as j, issueTypeUrl as k, milestoneUrl as m, openOrPrintUrl as o, projectUrl as p, repositoryUrl as r, statusUrl as s, wikiUrl as w };
|