feedbackbasket-cli 0.3.4 → 0.3.6
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.
|
@@ -4,11 +4,14 @@ import { AuthManager } from '../auth/manager.js';
|
|
|
4
4
|
import { loadConfig } from '../config/config.js';
|
|
5
5
|
import { errAuth } from '../output/errors.js';
|
|
6
6
|
import { brand, divider } from '../output/theme.js';
|
|
7
|
-
|
|
7
|
+
import { resolveProject } from '../resolve.js';
|
|
8
|
+
async function resolveProjectId(client, optProject, all) {
|
|
8
9
|
if (all)
|
|
9
10
|
return undefined;
|
|
10
|
-
if (optProject)
|
|
11
|
-
|
|
11
|
+
if (optProject) {
|
|
12
|
+
const project = await resolveProject(client, optProject);
|
|
13
|
+
return project.id;
|
|
14
|
+
}
|
|
12
15
|
const config = loadConfig();
|
|
13
16
|
return config.defaultProject;
|
|
14
17
|
}
|
|
@@ -30,7 +33,7 @@ export function createBugsCommand(getWriter) {
|
|
|
30
33
|
const writer = getWriter();
|
|
31
34
|
const client = requireClient();
|
|
32
35
|
const result = await client.getBugReports({
|
|
33
|
-
projectId: resolveProjectId(opts.project, opts.all),
|
|
36
|
+
projectId: await resolveProjectId(client, opts.project, opts.all),
|
|
34
37
|
status: opts.status,
|
|
35
38
|
severity: opts.severity,
|
|
36
39
|
search: opts.search,
|
|
@@ -66,7 +69,7 @@ export function createBugsCommand(getWriter) {
|
|
|
66
69
|
.action(async (opts) => {
|
|
67
70
|
const writer = getWriter();
|
|
68
71
|
const client = requireClient();
|
|
69
|
-
const stats = await client.getBugStats({ projectId: resolveProjectId(opts.project, opts.all) });
|
|
72
|
+
const stats = await client.getBugStats({ projectId: await resolveProjectId(client, opts.project, opts.all) });
|
|
70
73
|
if (!writer.isMachineOutput()) {
|
|
71
74
|
renderBugStats(stats);
|
|
72
75
|
}
|
|
@@ -4,11 +4,14 @@ import { AuthManager } from '../auth/manager.js';
|
|
|
4
4
|
import { loadConfig } from '../config/config.js';
|
|
5
5
|
import { errAuth } from '../output/errors.js';
|
|
6
6
|
import { brand } from '../output/theme.js';
|
|
7
|
-
|
|
7
|
+
import { resolveProject } from '../resolve.js';
|
|
8
|
+
async function resolveProjectId(client, optProject, all) {
|
|
8
9
|
if (all)
|
|
9
10
|
return undefined;
|
|
10
|
-
if (optProject)
|
|
11
|
-
|
|
11
|
+
if (optProject) {
|
|
12
|
+
const project = await resolveProject(client, optProject);
|
|
13
|
+
return project.id;
|
|
14
|
+
}
|
|
12
15
|
const config = loadConfig();
|
|
13
16
|
return config.defaultProject;
|
|
14
17
|
}
|
|
@@ -43,7 +46,7 @@ export function createFeedbackCommand(getWriter) {
|
|
|
43
46
|
const writer = getWriter();
|
|
44
47
|
const client = requireClient();
|
|
45
48
|
const result = await client.getFeedback({
|
|
46
|
-
projectId: resolveProjectId(opts.project, opts.all),
|
|
49
|
+
projectId: await resolveProjectId(client, opts.project, opts.all),
|
|
47
50
|
category: opts.category,
|
|
48
51
|
status: opts.status,
|
|
49
52
|
sentiment: opts.sentiment,
|
|
@@ -101,7 +104,7 @@ export function createFeedbackCommand(getWriter) {
|
|
|
101
104
|
const writer = getWriter();
|
|
102
105
|
const client = requireClient();
|
|
103
106
|
const result = await client.searchFeedback(query, {
|
|
104
|
-
projectId: resolveProjectId(opts.project),
|
|
107
|
+
projectId: await resolveProjectId(client, opts.project),
|
|
105
108
|
category: opts.category,
|
|
106
109
|
limit: parseInt(opts.limit, 10),
|
|
107
110
|
});
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.3.
|
|
2
|
-
export declare const USER_AGENT = "FeedbackBasket-CLI/0.3.
|
|
1
|
+
export declare const VERSION = "0.3.6";
|
|
2
|
+
export declare const USER_AGENT = "FeedbackBasket-CLI/0.3.6";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.3.
|
|
1
|
+
export const VERSION = '0.3.6';
|
|
2
2
|
export const USER_AGENT = `FeedbackBasket-CLI/${VERSION}`;
|