@nulab/bee 1.1.1 → 1.2.0
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/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-DhA8avDD.mjs +134 -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-yX2VOQSl.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-vTiqLew9.mjs +14 -0
- package/dist/edit-BBvSbt0m.mjs +22 -0
- package/dist/edit-BfCZ2Abi.mjs +50 -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/file-DwPTUKOI.mjs +17 -0
- package/dist/format-DHAR0n3J.mjs +9 -0
- package/dist/history-DpjqxFkX.mjs +55 -0
- package/dist/index.mjs +33 -37918
- 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-D8DfbunX.mjs +2 -0
- package/dist/registry-PlBmfTR4.mjs +35 -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.CHtg3F43.mjs → src-BWaxjrq_.mjs} +143 -175
- 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 +14 -11
- package/dist/chunks/activities.mjs +0 -75
- package/dist/chunks/activities2.mjs +0 -75
- package/dist/chunks/activities3.mjs +0 -75
- package/dist/chunks/add-user.mjs +0 -38
- package/dist/chunks/add.mjs +0 -63
- package/dist/chunks/add2.mjs +0 -39
- package/dist/chunks/api.mjs +0 -174
- package/dist/chunks/attachments.mjs +0 -47
- package/dist/chunks/attachments2.mjs +0 -47
- package/dist/chunks/attachments3.mjs +0 -48
- package/dist/chunks/browse.mjs +0 -269
- package/dist/chunks/clone.mjs +0 -60
- package/dist/chunks/close.mjs +0 -50
- package/dist/chunks/comment.mjs +0 -125
- package/dist/chunks/comment2.mjs +0 -111
- package/dist/chunks/comments.mjs +0 -57
- package/dist/chunks/completion.mjs +0 -113
- package/dist/chunks/count.mjs +0 -68
- package/dist/chunks/count2.mjs +0 -69
- package/dist/chunks/count3.mjs +0 -59
- package/dist/chunks/count4.mjs +0 -35
- package/dist/chunks/count5.mjs +0 -52
- package/dist/chunks/create.mjs +0 -60
- package/dist/chunks/create2.mjs +0 -88
- package/dist/chunks/create3.mjs +0 -64
- package/dist/chunks/create4.mjs +0 -74
- package/dist/chunks/create5.mjs +0 -56
- package/dist/chunks/create6.mjs +0 -37
- package/dist/chunks/create7.mjs +0 -45
- package/dist/chunks/create8.mjs +0 -49
- package/dist/chunks/create9.mjs +0 -49
- package/dist/chunks/dashboard.mjs +0 -84
- package/dist/chunks/delete.mjs +0 -48
- package/dist/chunks/delete2.mjs +0 -46
- package/dist/chunks/delete3.mjs +0 -46
- package/dist/chunks/delete4.mjs +0 -49
- package/dist/chunks/delete5.mjs +0 -50
- package/dist/chunks/delete6.mjs +0 -50
- package/dist/chunks/delete7.mjs +0 -62
- package/dist/chunks/delete8.mjs +0 -53
- package/dist/chunks/delete9.mjs +0 -48
- package/dist/chunks/edit.mjs +0 -56
- package/dist/chunks/edit2.mjs +0 -78
- package/dist/chunks/edit3.mjs +0 -65
- package/dist/chunks/edit4.mjs +0 -51
- package/dist/chunks/edit5.mjs +0 -43
- package/dist/chunks/edit6.mjs +0 -54
- package/dist/chunks/edit7.mjs +0 -50
- package/dist/chunks/edit8.mjs +0 -50
- package/dist/chunks/history.mjs +0 -56
- 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 -52
- package/dist/chunks/list10.mjs +0 -44
- package/dist/chunks/list11.mjs +0 -49
- package/dist/chunks/list12.mjs +0 -45
- package/dist/chunks/list13.mjs +0 -45
- package/dist/chunks/list14.mjs +0 -54
- package/dist/chunks/list15.mjs +0 -46
- package/dist/chunks/list2.mjs +0 -103
- package/dist/chunks/list3.mjs +0 -85
- package/dist/chunks/list4.mjs +0 -79
- package/dist/chunks/list5.mjs +0 -77
- package/dist/chunks/list6.mjs +0 -45
- package/dist/chunks/list7.mjs +0 -48
- package/dist/chunks/list8.mjs +0 -46
- package/dist/chunks/list9.mjs +0 -53
- package/dist/chunks/login.mjs +0 -218
- package/dist/chunks/logout.mjs +0 -76
- package/dist/chunks/me.mjs +0 -48
- package/dist/chunks/read-all.mjs +0 -29
- package/dist/chunks/read.mjs +0 -29
- package/dist/chunks/read2.mjs +0 -27
- package/dist/chunks/refresh.mjs +0 -76
- package/dist/chunks/remove-user.mjs +0 -38
- package/dist/chunks/remove.mjs +0 -27
- package/dist/chunks/reopen.mjs +0 -42
- package/dist/chunks/status.mjs +0 -64
- package/dist/chunks/status2.mjs +0 -61
- package/dist/chunks/status3.mjs +0 -66
- package/dist/chunks/switch.mjs +0 -55
- package/dist/chunks/tags.mjs +0 -41
- package/dist/chunks/token.mjs +0 -42
- package/dist/chunks/tree.mjs +0 -61
- package/dist/chunks/users.mjs +0 -48
- package/dist/chunks/view.mjs +0 -58
- package/dist/chunks/view2.mjs +0 -95
- package/dist/chunks/view3.mjs +0 -68
- package/dist/chunks/view4.mjs +0 -70
- package/dist/chunks/view5.mjs +0 -61
- package/dist/chunks/view6.mjs +0 -52
- package/dist/chunks/view7.mjs +0 -48
- package/dist/chunks/view8.mjs +0 -61
- package/dist/chunks/view9.mjs +0 -48
- package/dist/shared/bee.084B_7FC.mjs +0 -27
- package/dist/shared/bee.BTBGpv4K.mjs +0 -34
- package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
- 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.CAARNIp6.mjs +0 -49
- 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.DoTvz3uW.mjs +0 -13
- package/dist/shared/bee.KteAW2rM.mjs +0 -73
- package/dist/shared/bee.RsR9yniy.mjs +0 -131
- package/dist/shared/bee.a05kNWpn.mjs +0 -32
- package/dist/shared/bee.n5MYN4a6.mjs +0 -12
- package/dist/shared/bee.q93n012-.mjs +0 -14
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { U as UserError, a as vFiniteNumber } from '../index.mjs';
|
|
3
|
-
import 'node:stream/consumers';
|
|
4
|
-
import * as v from 'valibot';
|
|
5
|
-
import { Backlog } from 'backlog-js';
|
|
6
|
-
import { r as refreshAccessToken } from './bee.CktwmH8R.mjs';
|
|
7
|
-
import { l as loadConfig } from './bee.CHtg3F43.mjs';
|
|
8
|
-
import { f as findSpace, u as updateSpaceAuth } from './bee.CAARNIp6.mjs';
|
|
9
|
-
|
|
10
|
-
const formatResetTime = (epochSeconds) => {
|
|
11
|
-
const date = new Date(epochSeconds * 1e3);
|
|
12
|
-
return date.toString();
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const getClient = async (host) => {
|
|
16
|
-
const config = loadConfig();
|
|
17
|
-
const envApiKey = process.env.BACKLOG_API_KEY;
|
|
18
|
-
const envSpace = process.env.BACKLOG_SPACE;
|
|
19
|
-
const resolvedHost = host ?? envSpace ?? config.defaultSpace;
|
|
20
|
-
if (!resolvedHost) {
|
|
21
|
-
throw new UserError("No space configured. Run `bee auth login` to authenticate.");
|
|
22
|
-
}
|
|
23
|
-
const resolved = findSpace(config.spaces, resolvedHost);
|
|
24
|
-
if (!resolved) {
|
|
25
|
-
if (envApiKey) {
|
|
26
|
-
const client = new Backlog({ host: resolvedHost, apiKey: envApiKey });
|
|
27
|
-
return { client, host: resolvedHost };
|
|
28
|
-
}
|
|
29
|
-
throw new UserError(
|
|
30
|
-
`Space "${resolvedHost}" not found. Run \`bee auth login\` to authenticate.`
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
if (resolved.auth.method === "api-key") {
|
|
34
|
-
const client = new Backlog({
|
|
35
|
-
host: resolved.host,
|
|
36
|
-
apiKey: resolved.auth.apiKey
|
|
37
|
-
});
|
|
38
|
-
return { client, host: resolved.host };
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
client: createOAuthClient(resolved.host, resolved.auth),
|
|
42
|
-
host: resolved.host
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const createOAuthClient = (host, oauthAuth) => {
|
|
46
|
-
let currentClient = new Backlog({ host, accessToken: oauthAuth.accessToken });
|
|
47
|
-
let refreshPromise = null;
|
|
48
|
-
const refreshTokenIfNeeded = async () => {
|
|
49
|
-
if (refreshPromise) {
|
|
50
|
-
const result2 = await refreshPromise;
|
|
51
|
-
if (!result2) {
|
|
52
|
-
throw new UserError(
|
|
53
|
-
"OAuth session has expired. Run `bee auth login -m oauth` to re-authenticate."
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const { clientId, clientSecret, refreshToken } = oauthAuth;
|
|
59
|
-
if (!clientId || !clientSecret || !refreshToken) {
|
|
60
|
-
throw new UserError(
|
|
61
|
-
"OAuth credentials are incomplete. Run `bee auth login -m oauth` to re-authenticate."
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
refreshPromise = (async () => {
|
|
65
|
-
try {
|
|
66
|
-
consola.start("Access token expired. Refreshing...");
|
|
67
|
-
const tokenResponse = await refreshAccessToken(host, {
|
|
68
|
-
clientId,
|
|
69
|
-
clientSecret,
|
|
70
|
-
refreshToken
|
|
71
|
-
});
|
|
72
|
-
currentClient = new Backlog({
|
|
73
|
-
host,
|
|
74
|
-
accessToken: tokenResponse.access_token
|
|
75
|
-
});
|
|
76
|
-
updateSpaceAuth(host, {
|
|
77
|
-
method: "oauth",
|
|
78
|
-
accessToken: tokenResponse.access_token,
|
|
79
|
-
refreshToken: tokenResponse.refresh_token,
|
|
80
|
-
clientId,
|
|
81
|
-
clientSecret
|
|
82
|
-
});
|
|
83
|
-
consola.success("Token refreshed successfully.");
|
|
84
|
-
return true;
|
|
85
|
-
} catch {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
})();
|
|
89
|
-
const result = await refreshPromise;
|
|
90
|
-
refreshPromise = null;
|
|
91
|
-
if (!result) {
|
|
92
|
-
throw new UserError(
|
|
93
|
-
"OAuth session has expired. Run `bee auth login -m oauth` to re-authenticate."
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const proxy = new Proxy(currentClient, {
|
|
98
|
-
get(_target, prop, receiver) {
|
|
99
|
-
const value = Reflect.get(currentClient, prop, receiver);
|
|
100
|
-
if (typeof value !== "function") {
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
return async (...args) => {
|
|
104
|
-
try {
|
|
105
|
-
return await value.apply(currentClient, args);
|
|
106
|
-
} catch (error) {
|
|
107
|
-
handleRateLimitError(error);
|
|
108
|
-
if (isBacklogAuthError(error)) {
|
|
109
|
-
await refreshTokenIfNeeded();
|
|
110
|
-
const retryValue = Reflect.get(currentClient, prop, receiver);
|
|
111
|
-
return await retryValue.apply(currentClient, args);
|
|
112
|
-
}
|
|
113
|
-
throw error;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
return proxy;
|
|
119
|
-
};
|
|
120
|
-
const isBacklogAuthError = (error) => error instanceof Error && error._name === "BacklogAuthError" && error._status === 401;
|
|
121
|
-
const isBacklogRateLimitError = (error) => error instanceof Error && error._name === "BacklogApiError" && error._status === 429;
|
|
122
|
-
const handleRateLimitError = (error) => {
|
|
123
|
-
if (isBacklogRateLimitError(error)) {
|
|
124
|
-
const resetEpoch = error._response.headers.get("X-RateLimit-Reset");
|
|
125
|
-
const resetTime = resetEpoch ? v.safeParse(vFiniteNumber, resetEpoch) : void 0;
|
|
126
|
-
const resetMessage = resetTime?.success ? `Rate limit resets at ${formatResetTime(resetTime.output)}.` : "Please wait and try again later.";
|
|
127
|
-
throw new UserError(`API rate limit exceeded. ${resetMessage}`);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export { getClient as g };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { s as stringWidth, w as widthPadEnd, a as widthTruncate } from './bee.DFnSWb6q.mjs';
|
|
3
|
-
|
|
4
|
-
const printTable = (rows) => {
|
|
5
|
-
if (rows.length === 0) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const columnCount = rows[0].length;
|
|
9
|
-
const widths = [];
|
|
10
|
-
for (let col = 0; col < columnCount; col++) {
|
|
11
|
-
let max = stringWidth(rows[0][col].header);
|
|
12
|
-
for (const row of rows) {
|
|
13
|
-
const w = stringWidth(row[col].value);
|
|
14
|
-
if (w > max) {
|
|
15
|
-
max = w;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
widths.push(max);
|
|
19
|
-
}
|
|
20
|
-
const header = widths.map((w, i) => widthPadEnd(rows[0][i].header, w)).join(" ");
|
|
21
|
-
consola.log(header);
|
|
22
|
-
for (const row of rows) {
|
|
23
|
-
const line = widths.map((w, i) => {
|
|
24
|
-
const isLast = i === widths.length - 1;
|
|
25
|
-
const val = widthTruncate(row[i].value, w);
|
|
26
|
-
return isLast ? val : widthPadEnd(val, w);
|
|
27
|
-
}).join(" ");
|
|
28
|
-
consola.log(line);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { printTable as p };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const formatDate = (dateStr) => dateStr.slice(0, 10);
|
|
2
|
-
const formatSize = (bytes) => {
|
|
3
|
-
if (bytes < 1024) {
|
|
4
|
-
return `${bytes} B`;
|
|
5
|
-
}
|
|
6
|
-
if (bytes < 1024 * 1024) {
|
|
7
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
8
|
-
}
|
|
9
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { formatSize as a, formatDate as f };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import 'consola';
|
|
2
|
-
import 'node:stream/consumers';
|
|
3
|
-
import 'valibot';
|
|
4
|
-
import { p as parseArg, v as vInteger } from '../index.mjs';
|
|
5
|
-
|
|
6
|
-
const resolveUserId = async (client, value) => {
|
|
7
|
-
if (value === "@me") {
|
|
8
|
-
const me = await client.getMyself();
|
|
9
|
-
return me.id;
|
|
10
|
-
}
|
|
11
|
-
return parseArg(vInteger, value, "user");
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { resolveUserId as r };
|