@we-scrum/cli 1.0.9 → 6.8.1
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/cli.js +47 -43
- package/package.json +10 -10
- package/src/cli.ts +2 -0
- package/src/commands/index.ts +1 -0
- package/src/commands/iteration.ts +26 -0
- package/src/helpers/firebase-helper.ts +1 -1
- package/src/helpers/we-scrum.helper.ts +25 -0
- package/tsconfig.json +11 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@we-scrum/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.8.1",
|
|
4
4
|
"description": "Cli tool for we-scrum application",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inquirer/prompts": "^8.
|
|
30
|
-
"commander": "^
|
|
31
|
-
"firebase": "^12.
|
|
32
|
-
"google-auth-library": "^
|
|
29
|
+
"@inquirer/prompts": "^8.6.0",
|
|
30
|
+
"commander": "^15.0.0",
|
|
31
|
+
"firebase": "^12.18.0",
|
|
32
|
+
"google-auth-library": "^11.0.2",
|
|
33
33
|
"handlebars": "^4.7.9",
|
|
34
|
-
"open": "^11.0.
|
|
34
|
+
"open": "^11.0.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^
|
|
37
|
+
"@types/node": "^24.13.3",
|
|
38
38
|
"tsup": "^8.5.1",
|
|
39
|
-
"typescript": "^
|
|
40
|
-
"@my-devkit/core": "1.0.0",
|
|
39
|
+
"typescript": "^6.0.3",
|
|
41
40
|
"@my-devkit/cli": "2.1.0",
|
|
41
|
+
"@my-devkit/core": "1.0.0",
|
|
42
|
+
"@we-scrum/enums": "1.0.0",
|
|
42
43
|
"@we-scrum/commands": "1.0.0",
|
|
43
44
|
"@we-scrum/models": "1.0.0",
|
|
44
|
-
"@we-scrum/enums": "1.0.0",
|
|
45
45
|
"@we-scrum/utils": "1.0.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
package/src/cli.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { version } from '../package.json';
|
|
5
5
|
import {
|
|
6
6
|
registerAuthCommands,
|
|
7
|
+
registerIterationCommands,
|
|
7
8
|
registerPolicyCommands,
|
|
8
9
|
registerProjectCommands,
|
|
9
10
|
registerStoryCommands,
|
|
@@ -21,5 +22,6 @@ registerProjectCommands(program);
|
|
|
21
22
|
registerStoryCommands(program);
|
|
22
23
|
registerTaskCommands(program);
|
|
23
24
|
registerPolicyCommands(program);
|
|
25
|
+
registerIterationCommands(program);
|
|
24
26
|
|
|
25
27
|
program.parse(process.argv);
|
package/src/commands/index.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { WeScrumHelper } from '@helpers';
|
|
2
|
+
import { runProjectCommand } from '@utils';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
export function registerIterationCommands(program: Command): void {
|
|
6
|
+
program
|
|
7
|
+
.command('update-iteration')
|
|
8
|
+
.description('Update an iteration')
|
|
9
|
+
.requiredOption('-n, --name <name>', 'Iteration name')
|
|
10
|
+
.option('-ca, --capacity <capacity>', 'Iteration capacity')
|
|
11
|
+
.option('-co, --comment <comment>', 'Iteration comment')
|
|
12
|
+
.option('-sd, --startDate <startDate>', 'Iteration start date (ISO 8601)')
|
|
13
|
+
.option('-ed, --endDate <endDate>', 'Iteration end date (ISO 8601)')
|
|
14
|
+
.action(
|
|
15
|
+
runProjectCommand<{ name: string; capacity?: string; comment?: string; startDate?: string; endDate?: string }>(
|
|
16
|
+
async (options) => {
|
|
17
|
+
await WeScrumHelper.updateIteration(options.name, {
|
|
18
|
+
capacity: options.capacity !== undefined ? Number(options.capacity) : undefined,
|
|
19
|
+
comment: options.comment,
|
|
20
|
+
startDate: options.startDate !== undefined ? new Date(options.startDate) : undefined,
|
|
21
|
+
endDate: options.endDate !== undefined ? new Date(options.endDate) : undefined,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
),
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -10,10 +10,12 @@ import {
|
|
|
10
10
|
TakeRelationChangeCommand,
|
|
11
11
|
TakeRouteChangeCommand,
|
|
12
12
|
TakeTaskCommand,
|
|
13
|
+
UpdateIterationCommand,
|
|
13
14
|
} from '@we-scrum/commands';
|
|
14
15
|
import { ContentType, ProgressStatus } from '@we-scrum/enums';
|
|
15
16
|
import {
|
|
16
17
|
DevelopmentPolicyModel,
|
|
18
|
+
ProjectIterationModel,
|
|
17
19
|
ProjectStoryModel,
|
|
18
20
|
ProjectStorySectionModel,
|
|
19
21
|
ProjectStorySectionModelEnumerationChange,
|
|
@@ -163,6 +165,29 @@ export class WeScrumHelper {
|
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
167
|
|
|
168
|
+
public static async updateIteration(
|
|
169
|
+
name: string,
|
|
170
|
+
options: { capacity?: number; comment?: string; startDate?: Date; endDate?: Date },
|
|
171
|
+
): Promise<void> {
|
|
172
|
+
const iteration = await FirebaseHelper.findDocument<ProjectIterationModel>(`/projects/${this.projectId}/iterations`, [
|
|
173
|
+
['name', '==', name],
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
assert(!!iteration, `Iteration "${name}" not found in the active project.`);
|
|
177
|
+
|
|
178
|
+
await this.post(
|
|
179
|
+
'project-management/update-iteration',
|
|
180
|
+
TypeHelper.transform(UpdateIterationCommand, {
|
|
181
|
+
iterationId: iteration.iterationId,
|
|
182
|
+
name: iteration.name,
|
|
183
|
+
startDate: options.startDate ?? iteration.startDate,
|
|
184
|
+
endDate: options.endDate ?? iteration.endDate,
|
|
185
|
+
capacity: options.capacity ?? iteration.capacity,
|
|
186
|
+
comment: options.comment ?? iteration.comment,
|
|
187
|
+
}),
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
166
191
|
public static async getChangeDevelopmentPolicy(change: DevelopmentPolicyHelper.Change) {
|
|
167
192
|
const developmentPolicies = await this.getDevelopmentPolicies();
|
|
168
193
|
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"strict": false,
|
|
4
|
+
"strictNullChecks": false,
|
|
5
|
+
"noImplicitThis": true,
|
|
6
|
+
"alwaysStrict": true,
|
|
7
|
+
"strictBindCallApply": true,
|
|
8
|
+
"strictFunctionTypes": true,
|
|
9
|
+
"noImplicitAny": true,
|
|
3
10
|
"module": "commonjs",
|
|
4
11
|
"moduleResolution": "bundler",
|
|
5
|
-
"target": "
|
|
12
|
+
"target": "es2023",
|
|
13
|
+
"lib": ["ES2023"],
|
|
6
14
|
"outDir": "./dist",
|
|
7
|
-
"baseUrl": "src",
|
|
8
15
|
"sourceMap": true,
|
|
9
16
|
"declaration": false,
|
|
10
17
|
"emitDecoratorMetadata": true,
|
|
@@ -13,8 +20,8 @@
|
|
|
13
20
|
"skipLibCheck": true,
|
|
14
21
|
"resolveJsonModule": true,
|
|
15
22
|
"paths": {
|
|
16
|
-
"@helpers": ["helpers"],
|
|
17
|
-
"@utils": ["utils"]
|
|
23
|
+
"@helpers": ["./src/helpers"],
|
|
24
|
+
"@utils": ["./src/utils"]
|
|
18
25
|
},
|
|
19
26
|
"forceConsistentCasingInFileNames": true
|
|
20
27
|
}
|