github-issue-tower-defence-management 1.1.0 → 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/.github/workflows/commit-lint.yml +0 -2
- package/.github/workflows/empty-format-test-job.yml +28 -0
- package/.github/workflows/test.yml +1 -0
- package/CHANGELOG.md +20 -41
- package/bin/adapter/entry-points/cli/index.js +0 -0
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +127 -16
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/repositories/BaseGitHubRepository.js +3 -2
- package/bin/adapter/repositories/BaseGitHubRepository.js.map +1 -1
- package/bin/adapter/repositories/GraphqlProjectRepository.js +16 -0
- package/bin/adapter/repositories/GraphqlProjectRepository.js.map +1 -1
- package/bin/adapter/repositories/LocalStorageRepository.js +6 -0
- package/bin/adapter/repositories/LocalStorageRepository.js.map +1 -1
- package/bin/adapter/repositories/SystemDateRepository.js +15 -3
- package/bin/adapter/repositories/SystemDateRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +61 -9
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/CheerioIssueRepository.js +28 -2
- package/bin/adapter/repositories/issue/CheerioIssueRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/GraphqlProjectItemRepository.js +7 -0
- package/bin/adapter/repositories/issue/GraphqlProjectItemRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/RestIssueRepository.js +1 -0
- package/bin/adapter/repositories/issue/RestIssueRepository.js.map +1 -1
- package/bin/adapter/repositories/utils.js +1 -6
- package/bin/adapter/repositories/utils.js.map +1 -1
- package/bin/domain/usecases/AnalyzeProblemByIssueUseCase.js +98 -65
- package/bin/domain/usecases/AnalyzeProblemByIssueUseCase.js.map +1 -1
- package/bin/domain/usecases/AnalyzeStoriesUseCase.js +108 -0
- package/bin/domain/usecases/AnalyzeStoriesUseCase.js.map +1 -0
- package/bin/domain/usecases/ClearDependedIssueURLUseCase.js +66 -0
- package/bin/domain/usecases/ClearDependedIssueURLUseCase.js.map +1 -0
- package/bin/domain/usecases/CreateEstimationIssueUseCase.js +100 -0
- package/bin/domain/usecases/CreateEstimationIssueUseCase.js.map +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +124 -2
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/utils.js +24 -0
- package/bin/domain/usecases/utils.js.map +1 -0
- package/package.json +2 -2
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +73 -7
- package/src/adapter/repositories/AxiosSlackRepository.test.ts +3 -0
- package/src/adapter/repositories/BaseGitHubRepository.test.ts +3 -1
- package/src/adapter/repositories/BaseGitHubRepository.ts +3 -1
- package/src/adapter/repositories/GraphqlProjectRepository.test.ts +5 -1
- package/src/adapter/repositories/GraphqlProjectRepository.ts +25 -0
- package/src/adapter/repositories/LocalStorageCacheRepository.test.ts +1 -0
- package/src/adapter/repositories/LocalStorageRepository.ts +6 -0
- package/src/adapter/repositories/SystemDateRepository.ts +17 -3
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.test.ts +8 -0
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +103 -16
- package/src/adapter/repositories/issue/ApiV3IssueRepository.test.ts +3 -0
- package/src/adapter/repositories/issue/CheerioIssueRepository.test.ts +10 -0
- package/src/adapter/repositories/issue/CheerioIssueRepository.ts +37 -1
- package/src/adapter/repositories/issue/GraphqlProjectItemRepository.test.ts +7 -1
- package/src/adapter/repositories/issue/GraphqlProjectItemRepository.ts +15 -0
- package/src/adapter/repositories/issue/InternalGraphqlIssueRepository.test.ts +7 -1
- package/src/adapter/repositories/issue/RestIssueRepository.test.ts +3 -0
- package/src/adapter/repositories/issue/RestIssueRepository.ts +5 -2
- package/src/adapter/repositories/utils.test.ts +16 -1
- package/src/adapter/repositories/utils.ts +1 -6
- package/src/domain/entities/Issue.ts +4 -0
- package/src/domain/entities/Project.ts +15 -4
- package/src/domain/usecases/AnalyzeProblemByIssueUseCase.ts +151 -115
- package/src/domain/usecases/AnalyzeStoriesUseCase.ts +167 -0
- package/src/domain/usecases/ClearDependedIssueURLUseCase.test.ts +840 -0
- package/src/domain/usecases/ClearDependedIssueURLUseCase.ts +107 -0
- package/src/domain/usecases/CreateEstimationIssueUseCase.ts +157 -0
- package/src/domain/usecases/GenerateWorkingTimeReportUseCase.test.ts +8 -0
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +171 -2
- package/src/domain/usecases/adapter-interfaces/DateRepository.ts +2 -0
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +8 -1
- package/src/domain/usecases/utils.ts +28 -0
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/repositories/BaseGitHubRepository.d.ts +3 -1
- package/types/adapter/repositories/BaseGitHubRepository.d.ts.map +1 -1
- package/types/adapter/repositories/GraphqlProjectRepository.d.ts.map +1 -1
- package/types/adapter/repositories/LocalStorageRepository.d.ts +1 -0
- package/types/adapter/repositories/LocalStorageRepository.d.ts.map +1 -1
- package/types/adapter/repositories/SystemDateRepository.d.ts +2 -0
- package/types/adapter/repositories/SystemDateRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +14 -5
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/CheerioIssueRepository.d.ts +7 -1
- package/types/adapter/repositories/issue/CheerioIssueRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/GraphqlProjectItemRepository.d.ts +3 -0
- package/types/adapter/repositories/issue/GraphqlProjectItemRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/RestIssueRepository.d.ts +1 -1
- package/types/adapter/repositories/issue/RestIssueRepository.d.ts.map +1 -1
- package/types/adapter/repositories/utils.d.ts.map +1 -1
- package/types/domain/entities/Issue.d.ts +4 -0
- package/types/domain/entities/Issue.d.ts.map +1 -1
- package/types/domain/entities/Project.d.ts +15 -4
- package/types/domain/entities/Project.d.ts.map +1 -1
- package/types/domain/usecases/AnalyzeProblemByIssueUseCase.d.ts +13 -8
- package/types/domain/usecases/AnalyzeProblemByIssueUseCase.d.ts.map +1 -1
- package/types/domain/usecases/AnalyzeStoriesUseCase.d.ts +29 -0
- package/types/domain/usecases/AnalyzeStoriesUseCase.d.ts.map +1 -0
- package/types/domain/usecases/ClearDependedIssueURLUseCase.d.ts +13 -0
- package/types/domain/usecases/ClearDependedIssueURLUseCase.d.ts.map +1 -0
- package/types/domain/usecases/CreateEstimationIssueUseCase.d.ts +33 -0
- package/types/domain/usecases/CreateEstimationIssueUseCase.d.ts.map +1 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +26 -2
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/DateRepository.d.ts +2 -0
- package/types/domain/usecases/adapter-interfaces/DateRepository.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +3 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/utils.d.ts +5 -0
- package/types/domain/usecases/utils.d.ts.map +1 -0
|
@@ -44,11 +44,9 @@ jobs:
|
|
|
44
44
|
with:
|
|
45
45
|
exclude-branches: 'release/**, dependabot/**, project-common/**'
|
|
46
46
|
loose-matching: true
|
|
47
|
-
|
|
48
47
|
- name: Install commitlint
|
|
49
48
|
run: |
|
|
50
49
|
npm install --save-dev @commitlint/{config-conventional,cli}
|
|
51
|
-
|
|
52
50
|
- name: Lint commits
|
|
53
51
|
run: |
|
|
54
52
|
npx commitlint --from=origin/main --to=HEAD --config ./.github/workflows/configs/commitlint.config.js
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Empty format test
|
|
2
|
+
|
|
3
|
+
on: push
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- run: echo "test"
|
|
10
|
+
|
|
11
|
+
format:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
token: ${{ secrets.GH_TOKEN }}
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 20
|
|
22
|
+
- run: git pull
|
|
23
|
+
- run: |
|
|
24
|
+
npx prettier --write "**/*.{md,yaml,yml,js}" --trailing-comma all --print-width 80 --single-quote true
|
|
25
|
+
git --no-pager diff
|
|
26
|
+
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
27
|
+
with:
|
|
28
|
+
commit_message: 'style: re-format / npx prettier --write "**/*.{md,yaml,yml,js}"'
|
|
@@ -22,6 +22,7 @@ jobs:
|
|
|
22
22
|
- name: Build
|
|
23
23
|
run: npm run build
|
|
24
24
|
|
|
25
|
+
- run: mkdir -p tmp && npx -y gh-cookie '${{ secrets.TEST_GH_USER_NAME }}' '${{ secrets.TEST_GH_USER_PASSWORD }}' '${{ secrets.TEST_GH_AUTHENTICATOR_KEY }}' > tmp/github.com.cookies.json
|
|
25
26
|
- name: Run tests
|
|
26
27
|
run: npm run test
|
|
27
28
|
env:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,49 +1,28 @@
|
|
|
1
|
-
# [1.
|
|
1
|
+
# [1.2.0](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.1.0...v1.2.0) (2025-01-02)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* failed to get ids in GraphqlProjectItemRepository ([ca04065](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/ca04065d2742f713295f30bfba1e5d610d292955))
|
|
12
|
-
* failed to get project number correctly in GraphqlProjectRepository ([d888325](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/d8883255efd3234015d5e8cba08987fdf4f3d3d2))
|
|
13
|
-
* failed to get status by classic view ([1d9f478](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/1d9f4786372bc945cef2be9dd74e6d725eff655b))
|
|
14
|
-
* failed to load data from file ([e02931c](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/e02931c18dfb716038e63571a31a894aec426149))
|
|
15
|
-
* failed to render label on issue ([dffa281](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/dffa2813966f4046c14b87dff6d69f65813ad5c4))
|
|
16
|
-
* failed to save file if parent dir is not exists ([ab590e1](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/ab590e1469f9b5012fa916b03702924c93f6de60))
|
|
17
|
-
* get cookie from credential ([133416f](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/133416f4743dab56beeab8f9a5226a6c865f56f9))
|
|
18
|
-
* hide log from axios ([b6cf9b3](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/b6cf9b3194168d51465f16b40a8709879b22bd61))
|
|
19
|
-
* remove decimals before duration calcuration in issueTimelineUrilts ([4d2654f](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/4d2654fddbc26600449708a4f44c4d4c7fc3b1b1))
|
|
20
|
-
* remove octokit to avoid ems error ([cbf30d7](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/cbf30d7549b1fae247d8ab28e334669261e851a2))
|
|
21
|
-
* run for every minutes ([b7ae179](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/b7ae179e62de563a32bcbc43d316161005267e34))
|
|
22
|
-
* save raw working report data to spredsheet at once ([9eb89f9](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/9eb89f9db7b517171779bb46fef0e7b61c176860))
|
|
23
|
-
* separate process pr or issue to get timeline ([6641705](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/6641705f8e0478b86a8cc1316152c727fac15ab5))
|
|
24
|
-
* set datetime after collecting issues ([dd85d6c](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/dd85d6c6d99a8e4bae4387ba9a28375388595366))
|
|
25
|
-
* sleep to avoid 429 on slack api ([98aa47c](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/98aa47cd5fb1a320421c1dac1e523493adf1a68c))
|
|
26
|
-
* updated wrong lastExecutionDate ([c0c900a](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/c0c900a5eaaab5e1e34a9b225c540dcc1ae83d87))
|
|
27
|
-
* wait 2sec after created issue ([b4bd107](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/b4bd107bb74025ff322ef495cf7fdc6179a5fc63))
|
|
28
|
-
* wait 2sec after upload image in AxiusSlackRepository ([06ff9f5](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/06ff9f569246d21e3b07727467066acdf32874da))
|
|
29
|
-
* wait 5sec after change story ([721bdc1](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/721bdc1f786d83378354aa52fd9e529469147bc4))
|
|
30
|
-
* wait 5sec to create announcement issue ([1d6c7b6](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/1d6c7b67bc622aeab06c9561469ad7b8a5f50637))
|
|
31
|
-
* wait 5sec to create working time report issue ([664c503](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/664c50310b0a11a2e08ad303ba6c3238efaf1f97))
|
|
32
|
-
* wrong updateStory parameter in ApiV3CheerioRestIssueRepository ([46d3f74](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/46d3f7495120e6d40fc9a34a906ad9a844a8a9f5))
|
|
6
|
+
* encodeURI for % and & ([d4f1a2e](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/d4f1a2ea4e67b31b14a10ed866d6ea6aef5f133f))
|
|
7
|
+
* failed to get completion date and dependign issue field ([8314a7c](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/8314a7c61e5a549370fa96554be1e1be9d275890))
|
|
8
|
+
* failed to get id when get issue data only 1 ([2bacf46](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/2bacf4677caca918dda7e654d9d944879848611f))
|
|
9
|
+
* failed to normalize field name ([9600dd9](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/9600dd9dd243a459bf123446898a4dee171e3fe1))
|
|
10
|
+
* use red if story color is pink ([64e2dd6](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/64e2dd6a95e00031fe6776456fbc4052128d600e))
|
|
33
11
|
|
|
34
12
|
|
|
35
13
|
### Features
|
|
36
14
|
|
|
37
|
-
* add
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*
|
|
15
|
+
* add formatDateWityDayOfWeek in SystemDatetimeRepository ([18e4d55](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/18e4d559e802be47e54005f6488d6f4f3747a6bc))
|
|
16
|
+
* add new field to issue of dependedIssueUrlSeparatedByComma, completationDate ([bd7c3cc](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/bd7c3cc368c71de7287823baa0c0d0006bd8256e))
|
|
17
|
+
* add remove to LocalStorageRepository ([cb6320e](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/cb6320eab34caeeafd6cf5a661d6784a8bb7a299))
|
|
18
|
+
* add unhandled story to summary ([fa5b622](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/fa5b622b2eafcc70e78a8755bfb909993c87e552))
|
|
19
|
+
* analyze stories at 7:00am ([b91dd0a](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/b91dd0afbbcd782a5d19080c17da19d7f356b117))
|
|
20
|
+
* configure creds in yaml ([5d5dcd4](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/5d5dcd411f93758e8122f629d14c38215cdbf7da))
|
|
21
|
+
* ignore pr when check in progress ([9aececc](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/9aececc82dfadda71182fcc18e615ef78bf8a696))
|
|
22
|
+
* refreshCookie before collecting data ([85f8189](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/85f8189042b30b1f7393e852e81434a5fb50499b))
|
|
23
|
+
* remove mention from working timeline ([87b6958](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/87b69581811167c4966e9fe6892bc21aa81f8785))
|
|
24
|
+
* retry if project is not set ([12cf0be](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/12cf0bed4a2e394c048d6d6e63a4b900e020e59a))
|
|
25
|
+
* run clearDependedIssueURLUseCase ([b4505fc](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/b4505fcb81cdee4fd9283941e5f27a7425bf64f1))
|
|
26
|
+
* show flowchart ([44b2a02](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/44b2a0259ef72b650e19a894b8170346559c7722))
|
|
27
|
+
* skip issue creation if no vioration ([2267263](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/22672632609b4f06f0b516e98084674439431ac9))
|
|
28
|
+
* use createEstimationIssueUseCase ([2cbb9db](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/2cbb9db3c09a3ca37b4d273c55adb23d04fff40c))
|
|
File without changes
|
|
@@ -24,13 +24,20 @@ const SetWorkflowManagementIssueToStoryUseCase_1 = require("../../../domain/usec
|
|
|
24
24
|
const InternalGraphqlIssueRepository_1 = require("../../repositories/issue/InternalGraphqlIssueRepository");
|
|
25
25
|
const ClearNextActionHourUseCase_1 = require("../../../domain/usecases/ClearNextActionHourUseCase");
|
|
26
26
|
const AnalyzeProblemByIssueUseCase_1 = require("../../../domain/usecases/AnalyzeProblemByIssueUseCase");
|
|
27
|
+
const AnalyzeStoriesUseCase_1 = require("../../../domain/usecases/AnalyzeStoriesUseCase");
|
|
28
|
+
const ClearDependedIssueURLUseCase_1 = require("../../../domain/usecases/ClearDependedIssueURLUseCase");
|
|
29
|
+
const CreateEstimationIssueUseCase_1 = require("../../../domain/usecases/CreateEstimationIssueUseCase");
|
|
27
30
|
class HandleScheduledEventUseCaseHandler {
|
|
28
31
|
constructor() {
|
|
29
32
|
this.handle = async (configFilePath) => {
|
|
30
33
|
const configFileContent = fs_1.default.readFileSync(configFilePath, 'utf8');
|
|
31
34
|
const input = yaml_1.default.parse(configFileContent);
|
|
32
|
-
if (!(() => { const $io0 = input => "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && $io1(input.workingReport)); const $io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && (undefined === input.warningThresholdHour || "number" === typeof input.warningThresholdHour) && "string" === typeof input.spreadsheetUrl && (undefined === input.reportIssueTemplate || "string" === typeof input.reportIssueTemplate) && (Array.isArray(input.reportIssueLabels) && input.reportIssueLabels.every(elem => "string" === typeof elem)); return input => "object" === typeof input && null !== input && $io0(input); })()(input)) {
|
|
33
|
-
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const $io0 = input => "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && $io1(input.workingReport)); const $io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && (undefined === input.warningThresholdHour || "number" === typeof input.warningThresholdHour) && "string" === typeof input.spreadsheetUrl && (undefined === input.reportIssueTemplate || "string" === typeof input.reportIssueTemplate) && (Array.isArray(input.reportIssueLabels) && input.reportIssueLabels.every(elem => "string" === typeof elem)); const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.
|
|
35
|
+
if (!(() => { const $io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && $io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "string" === typeof input.disabledStatus && ("object" === typeof input.credentials && null !== input.credentials && $io2(input.credentials)); const $io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && (undefined === input.warningThresholdHour || "number" === typeof input.warningThresholdHour) && "string" === typeof input.spreadsheetUrl && (undefined === input.reportIssueTemplate || "string" === typeof input.reportIssueTemplate) && (Array.isArray(input.reportIssueLabels) && input.reportIssueLabels.every(elem => "string" === typeof elem)); const $io2 = input => "object" === typeof input.manager && null !== input.manager && $io3(input.manager) && ("object" === typeof input.bot && null !== input.bot && $io7(input.bot)); const $io3 = input => "object" === typeof input.github && null !== input.github && $io4(input.github) && ("object" === typeof input.slack && null !== input.slack && $io5(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && $io6(input.googleServiceAccount)); const $io4 = input => "string" === typeof input.token; const $io5 = input => "string" === typeof input.userToken; const $io6 = input => "string" === typeof input.serviceAccountKey; const $io7 = input => "object" === typeof input.github && null !== input.github && $io8(input.github); const $io8 = input => "string" === typeof input.token && "string" === typeof input.name && "string" === typeof input.password && "string" === typeof input.authenticatorKey; return input => "object" === typeof input && null !== input && $io0(input); })()(input)) {
|
|
36
|
+
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const $io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && $io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "string" === typeof input.disabledStatus && ("object" === typeof input.credentials && null !== input.credentials && $io2(input.credentials)); const $io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && (undefined === input.warningThresholdHour || "number" === typeof input.warningThresholdHour) && "string" === typeof input.spreadsheetUrl && (undefined === input.reportIssueTemplate || "string" === typeof input.reportIssueTemplate) && (Array.isArray(input.reportIssueLabels) && input.reportIssueLabels.every(elem => "string" === typeof elem)); const $io2 = input => "object" === typeof input.manager && null !== input.manager && $io3(input.manager) && ("object" === typeof input.bot && null !== input.bot && $io7(input.bot)); const $io3 = input => "object" === typeof input.github && null !== input.github && $io4(input.github) && ("object" === typeof input.slack && null !== input.slack && $io5(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && $io6(input.googleServiceAccount)); const $io4 = input => "string" === typeof input.token; const $io5 = input => "string" === typeof input.userToken; const $io6 = input => "string" === typeof input.serviceAccountKey; const $io7 = input => "object" === typeof input.github && null !== input.github && $io8(input.github); const $io8 = input => "string" === typeof input.token && "string" === typeof input.name && "string" === typeof input.password && "string" === typeof input.authenticatorKey; const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.projectName || $report(_exceptionable, {
|
|
37
|
+
path: _path + ".projectName",
|
|
38
|
+
expected: "string",
|
|
39
|
+
value: input.projectName
|
|
40
|
+
}), "string" === typeof input.org || $report(_exceptionable, {
|
|
34
41
|
path: _path + ".org",
|
|
35
42
|
expected: "string",
|
|
36
43
|
value: input.org
|
|
@@ -44,12 +51,28 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
44
51
|
value: input.manager
|
|
45
52
|
}), ("object" === typeof input.workingReport && null !== input.workingReport || $report(_exceptionable, {
|
|
46
53
|
path: _path + ".workingReport",
|
|
47
|
-
expected: "__type
|
|
54
|
+
expected: "__type",
|
|
48
55
|
value: input.workingReport
|
|
49
56
|
})) && $vo1(input.workingReport, _path + ".workingReport", true && _exceptionable) || $report(_exceptionable, {
|
|
50
57
|
path: _path + ".workingReport",
|
|
51
|
-
expected: "__type
|
|
58
|
+
expected: "__type",
|
|
52
59
|
value: input.workingReport
|
|
60
|
+
}), "string" === typeof input.urlOfStoryView || $report(_exceptionable, {
|
|
61
|
+
path: _path + ".urlOfStoryView",
|
|
62
|
+
expected: "string",
|
|
63
|
+
value: input.urlOfStoryView
|
|
64
|
+
}), "string" === typeof input.disabledStatus || $report(_exceptionable, {
|
|
65
|
+
path: _path + ".disabledStatus",
|
|
66
|
+
expected: "string",
|
|
67
|
+
value: input.disabledStatus
|
|
68
|
+
}), ("object" === typeof input.credentials && null !== input.credentials || $report(_exceptionable, {
|
|
69
|
+
path: _path + ".credentials",
|
|
70
|
+
expected: "__type.o1",
|
|
71
|
+
value: input.credentials
|
|
72
|
+
})) && $vo2(input.credentials, _path + ".credentials", true && _exceptionable) || $report(_exceptionable, {
|
|
73
|
+
path: _path + ".credentials",
|
|
74
|
+
expected: "__type.o1",
|
|
75
|
+
value: input.credentials
|
|
53
76
|
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.repo || $report(_exceptionable, {
|
|
54
77
|
path: _path + ".repo",
|
|
55
78
|
expected: "string",
|
|
@@ -90,17 +113,93 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
90
113
|
path: _path + ".reportIssueLabels",
|
|
91
114
|
expected: "Array<string>",
|
|
92
115
|
value: input.reportIssueLabels
|
|
116
|
+
})].every(flag => flag); const $vo2 = (input, _path, _exceptionable = true) => [("object" === typeof input.manager && null !== input.manager || $report(_exceptionable, {
|
|
117
|
+
path: _path + ".manager",
|
|
118
|
+
expected: "__type.o2",
|
|
119
|
+
value: input.manager
|
|
120
|
+
})) && $vo3(input.manager, _path + ".manager", true && _exceptionable) || $report(_exceptionable, {
|
|
121
|
+
path: _path + ".manager",
|
|
122
|
+
expected: "__type.o2",
|
|
123
|
+
value: input.manager
|
|
124
|
+
}), ("object" === typeof input.bot && null !== input.bot || $report(_exceptionable, {
|
|
125
|
+
path: _path + ".bot",
|
|
126
|
+
expected: "__type.o6",
|
|
127
|
+
value: input.bot
|
|
128
|
+
})) && $vo7(input.bot, _path + ".bot", true && _exceptionable) || $report(_exceptionable, {
|
|
129
|
+
path: _path + ".bot",
|
|
130
|
+
expected: "__type.o6",
|
|
131
|
+
value: input.bot
|
|
132
|
+
})].every(flag => flag); const $vo3 = (input, _path, _exceptionable = true) => [("object" === typeof input.github && null !== input.github || $report(_exceptionable, {
|
|
133
|
+
path: _path + ".github",
|
|
134
|
+
expected: "__type.o3",
|
|
135
|
+
value: input.github
|
|
136
|
+
})) && $vo4(input.github, _path + ".github", true && _exceptionable) || $report(_exceptionable, {
|
|
137
|
+
path: _path + ".github",
|
|
138
|
+
expected: "__type.o3",
|
|
139
|
+
value: input.github
|
|
140
|
+
}), ("object" === typeof input.slack && null !== input.slack || $report(_exceptionable, {
|
|
141
|
+
path: _path + ".slack",
|
|
142
|
+
expected: "__type.o4",
|
|
143
|
+
value: input.slack
|
|
144
|
+
})) && $vo5(input.slack, _path + ".slack", true && _exceptionable) || $report(_exceptionable, {
|
|
145
|
+
path: _path + ".slack",
|
|
146
|
+
expected: "__type.o4",
|
|
147
|
+
value: input.slack
|
|
148
|
+
}), ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount || $report(_exceptionable, {
|
|
149
|
+
path: _path + ".googleServiceAccount",
|
|
150
|
+
expected: "__type.o5",
|
|
151
|
+
value: input.googleServiceAccount
|
|
152
|
+
})) && $vo6(input.googleServiceAccount, _path + ".googleServiceAccount", true && _exceptionable) || $report(_exceptionable, {
|
|
153
|
+
path: _path + ".googleServiceAccount",
|
|
154
|
+
expected: "__type.o5",
|
|
155
|
+
value: input.googleServiceAccount
|
|
156
|
+
})].every(flag => flag); const $vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.token || $report(_exceptionable, {
|
|
157
|
+
path: _path + ".token",
|
|
158
|
+
expected: "string",
|
|
159
|
+
value: input.token
|
|
160
|
+
})].every(flag => flag); const $vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.userToken || $report(_exceptionable, {
|
|
161
|
+
path: _path + ".userToken",
|
|
162
|
+
expected: "string",
|
|
163
|
+
value: input.userToken
|
|
164
|
+
})].every(flag => flag); const $vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.serviceAccountKey || $report(_exceptionable, {
|
|
165
|
+
path: _path + ".serviceAccountKey",
|
|
166
|
+
expected: "string",
|
|
167
|
+
value: input.serviceAccountKey
|
|
168
|
+
})].every(flag => flag); const $vo7 = (input, _path, _exceptionable = true) => [("object" === typeof input.github && null !== input.github || $report(_exceptionable, {
|
|
169
|
+
path: _path + ".github",
|
|
170
|
+
expected: "__type.o7",
|
|
171
|
+
value: input.github
|
|
172
|
+
})) && $vo8(input.github, _path + ".github", true && _exceptionable) || $report(_exceptionable, {
|
|
173
|
+
path: _path + ".github",
|
|
174
|
+
expected: "__type.o7",
|
|
175
|
+
value: input.github
|
|
176
|
+
})].every(flag => flag); const $vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.token || $report(_exceptionable, {
|
|
177
|
+
path: _path + ".token",
|
|
178
|
+
expected: "string",
|
|
179
|
+
value: input.token
|
|
180
|
+
}), "string" === typeof input.name || $report(_exceptionable, {
|
|
181
|
+
path: _path + ".name",
|
|
182
|
+
expected: "string",
|
|
183
|
+
value: input.name
|
|
184
|
+
}), "string" === typeof input.password || $report(_exceptionable, {
|
|
185
|
+
path: _path + ".password",
|
|
186
|
+
expected: "string",
|
|
187
|
+
value: input.password
|
|
188
|
+
}), "string" === typeof input.authenticatorKey || $report(_exceptionable, {
|
|
189
|
+
path: _path + ".authenticatorKey",
|
|
190
|
+
expected: "string",
|
|
191
|
+
value: input.authenticatorKey
|
|
93
192
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && $io0(input); let errors; let $report; return input => {
|
|
94
193
|
if (false === __is(input)) {
|
|
95
194
|
errors = [];
|
|
96
195
|
$report = typia_1.default.validate.report(errors);
|
|
97
196
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $report(true, {
|
|
98
197
|
path: _path + "",
|
|
99
|
-
expected: "
|
|
198
|
+
expected: "inputType",
|
|
100
199
|
value: input
|
|
101
200
|
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
102
201
|
path: _path + "",
|
|
103
|
-
expected: "
|
|
202
|
+
expected: "inputType",
|
|
104
203
|
value: input
|
|
105
204
|
}))(input, "$input", true);
|
|
106
205
|
const success = 0 === errors.length;
|
|
@@ -119,21 +218,33 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
119
218
|
}
|
|
120
219
|
const systemDateRepository = new SystemDateRepository_1.SystemDateRepository();
|
|
121
220
|
const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
|
|
122
|
-
const googleSpreadsheetRepository = new GoogleSpreadsheetRepository_1.GoogleSpreadsheetRepository(localStorageRepository);
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
221
|
+
const googleSpreadsheetRepository = new GoogleSpreadsheetRepository_1.GoogleSpreadsheetRepository(localStorageRepository, input.credentials.manager.googleServiceAccount.serviceAccountKey);
|
|
222
|
+
const cachePath = `./tmp/cache/${input.projectName}`;
|
|
223
|
+
const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
|
|
224
|
+
const githubRepositoryParams = [
|
|
225
|
+
localStorageRepository,
|
|
226
|
+
`${cachePath}/github.com.cookies.json`,
|
|
227
|
+
input.credentials.bot.github.token,
|
|
228
|
+
input.credentials.bot.github.name,
|
|
229
|
+
input.credentials.bot.github.password,
|
|
230
|
+
input.credentials.bot.github.authenticatorKey,
|
|
231
|
+
];
|
|
232
|
+
const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams);
|
|
233
|
+
const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
|
|
234
|
+
const internalGraphqlIssueRepository = new InternalGraphqlIssueRepository_1.InternalGraphqlIssueRepository(...githubRepositoryParams);
|
|
235
|
+
const cheerioIssueRepository = new CheerioIssueRepository_1.CheerioIssueRepository(internalGraphqlIssueRepository, ...githubRepositoryParams);
|
|
236
|
+
const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams);
|
|
237
|
+
const graphqlProjectItemRepository = new GraphqlProjectItemRepository_1.GraphqlProjectItemRepository(...githubRepositoryParams);
|
|
238
|
+
const issueRepository = new ApiV3CheerioRestIssueRepository_1.ApiV3CheerioRestIssueRepository(apiV3IssueRepository, cheerioIssueRepository, restIssueRepository, graphqlProjectItemRepository, localStorageCacheRepository, ...githubRepositoryParams);
|
|
131
239
|
const generateWorkingTimeReportUseCase = new GenerateWorkingTimeReportUseCase_1.GenerateWorkingTimeReportUseCase(issueRepository, googleSpreadsheetRepository, systemDateRepository);
|
|
132
240
|
const actionAnnouncement = new ActionAnnouncementUseCase_1.ActionAnnouncementUseCase(issueRepository);
|
|
133
241
|
const setWorkflowManagementIssueToStoryUseCase = new SetWorkflowManagementIssueToStoryUseCase_1.SetWorkflowManagementIssueToStoryUseCase(issueRepository);
|
|
134
242
|
const clearNextActionHourUseCase = new ClearNextActionHourUseCase_1.ClearNextActionHourUseCase(issueRepository);
|
|
135
243
|
const analyzeProblemByIssueUseCase = new AnalyzeProblemByIssueUseCase_1.AnalyzeProblemByIssueUseCase(issueRepository, systemDateRepository);
|
|
136
|
-
const
|
|
244
|
+
const analyzeStoriesUseCase = new AnalyzeStoriesUseCase_1.AnalyzeStoriesUseCase(issueRepository, systemDateRepository);
|
|
245
|
+
const clearDependedIssueURLUseCase = new ClearDependedIssueURLUseCase_1.ClearDependedIssueURLUseCase(issueRepository);
|
|
246
|
+
const createEstimationIssueUseCase = new CreateEstimationIssueUseCase_1.CreateEstimationIssueUseCase(issueRepository, systemDateRepository);
|
|
247
|
+
const handleScheduledEventUseCase = new HandleScheduledEventUseCase_1.HandleScheduledEventUseCase(generateWorkingTimeReportUseCase, actionAnnouncement, setWorkflowManagementIssueToStoryUseCase, clearNextActionHourUseCase, analyzeProblemByIssueUseCase, analyzeStoriesUseCase, clearDependedIssueURLUseCase, createEstimationIssueUseCase, systemDateRepository, googleSpreadsheetRepository, projectRepository, issueRepository);
|
|
137
248
|
return await handleScheduledEventUseCase.run(input);
|
|
138
249
|
};
|
|
139
250
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wFAAqF;AACrF,4FAAyF;AACzF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,gHAA6G;AAC7G,sGAAmG;AACnG,gGAA6F;AAC7F,kGAA+F;AAC/F,gIAA6H;AAC7H,4GAAyG;AACzG,oGAAiG;AACjG,wGAAqG;AAIrG,MAAa,kCAAkC;IAA/C;QACE,WAAM,GAAG,KAAK,EACZ,cAAsB,EAMrB,EAAE;YACH,MAAM,iBAAiB,GAAG,YAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,KAAK,GAAY,cAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handl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kBAAkB,GAAG,IAAI,qDAAyB,CAAC,eAAe,CAAC,CAAC;YAC1E,MAAM,wCAAwC,GAC5C,IAAI,mFAAwC,CAAC,eAAe,CAAC,CAAC;YAChE,MAAM,0BAA0B,GAAG,IAAI,uDAA0B,CAC/D,eAAe,CAChB,CAAC;YACF,MAAM,4BAA4B,GAAG,IAAI,2DAA4B,CACnE,eAAe,EACf,oBAAoB,CACrB,CAAC;YACF,MAAM,qBAAqB,GAAG,IAAI,6CAAqB,CACrD,eAAe,EACf,oBAAoB,CACrB,CAAC;YACF,MAAM,4BAA4B,GAAG,IAAI,2DAA4B,CACnE,eAAe,CAChB,CAAC;YACF,MAAM,4BAA4B,GAAG,IAAI,2DAA4B,CACnE,eAAe,EACf,oBAAoB,CACrB,CAAC;YAEF,MAAM,2BAA2B,GAAG,IAAI,yDAA2B,CACjE,gCAAgC,EAChC,kBAAkB,EAClB,wCAAwC,EACxC,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,CAChB,CAAC;YAEF,OAAO,MAAM,2BAA2B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC;CAAA;AArID,gFAqIC"}
|
|
@@ -16,8 +16,9 @@ axios_1.default.interceptors.response.use((response) => response, (error) => {
|
|
|
16
16
|
throw new Error('Network Error');
|
|
17
17
|
});
|
|
18
18
|
class BaseGitHubRepository {
|
|
19
|
-
constructor(jsonFilePath = './tmp/github.com.cookies.json', ghToken = process.env.GH_TOKEN || 'dummy', ghUserName = process.env.GH_USER_NAME, ghUserPassword = process.env.GH_USER_PASSWORD, ghAuthenticatorKey = process.env
|
|
19
|
+
constructor(localStorageRepository, jsonFilePath = './tmp/github.com.cookies.json', ghToken = process.env.GH_TOKEN || 'dummy', ghUserName = process.env.GH_USER_NAME, ghUserPassword = process.env.GH_USER_PASSWORD, ghAuthenticatorKey = process.env
|
|
20
20
|
.GH_AUTHENTICATOR_KEY) {
|
|
21
|
+
this.localStorageRepository = localStorageRepository;
|
|
21
22
|
this.jsonFilePath = jsonFilePath;
|
|
22
23
|
this.ghToken = ghToken;
|
|
23
24
|
this.ghUserName = ghUserName;
|
|
@@ -71,7 +72,7 @@ class BaseGitHubRepository {
|
|
|
71
72
|
throw new Error('No cookie file and no credentials provided');
|
|
72
73
|
}
|
|
73
74
|
const cookie = await (0, gh_cookie_1.getCookieContent)(this.ghUserName, this.ghUserPassword, this.ghAuthenticatorKey);
|
|
74
|
-
|
|
75
|
+
this.localStorageRepository.write(this.jsonFilePath, cookie);
|
|
75
76
|
}
|
|
76
77
|
const data = await fs_1.promises.readFile(this.jsonFilePath, {
|
|
77
78
|
encoding: 'utf-8',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseGitHubRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/BaseGitHubRepository.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA4C;AAC5C,mCAAmC;AACnC,kDAA0C;AAC1C,yCAA6C;AAC7C,4CAAoB;
|
|
1
|
+
{"version":3,"file":"BaseGitHubRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/BaseGitHubRepository.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA4C;AAC5C,mCAAmC;AACnC,kDAA0C;AAC1C,yCAA6C;AAC7C,4CAAoB;AAGpB,eAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAC7B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EACtB,CAAC,KAAiB,EAAE,EAAE;IACpB,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AACnC,CAAC,CACF,C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seGitHubRepository_1.BaseGitHubReposito
|
|
|
127
127
|
const story = project.fields.nodes.find((field) => (0, utils_1.normalizeFieldName)(field.name) === 'story');
|
|
128
128
|
const workflowManagementStory = story?.options.find((option) => (0, utils_1.normalizeFieldName)(option.name).includes('workflowmanagement'));
|
|
129
129
|
const remainignEstimationMinutes = project.fields.nodes.find((field) => (0, utils_1.normalizeFieldName)(field.name) === 'remainingestimationminutes');
|
|
130
|
+
const dependedIssueUrlSeparatedByComma = project.fields.nodes.find((field) => (0, utils_1.normalizeFieldName)(field.name).startsWith('dependedissueurlseparatedbycomma'));
|
|
131
|
+
const completionDate50PercentConfidence = project.fields.nodes.find((field) => (0, utils_1.normalizeFieldName)(field.name).startsWith('completiondate'));
|
|
130
132
|
return {
|
|
131
133
|
id: project.id,
|
|
132
134
|
name: project.title,
|
|
@@ -149,6 +151,8 @@ class GraphqlProjectRepository extends BaseGitHubRepository_1.BaseGitHubReposito
|
|
|
149
151
|
stories: story.options.map((option) => ({
|
|
150
152
|
id: option.id,
|
|
151
153
|
name: option.name,
|
|
154
|
+
color: option.color,
|
|
155
|
+
description: option.description,
|
|
152
156
|
})),
|
|
153
157
|
workflowManagementStory,
|
|
154
158
|
}
|
|
@@ -159,6 +163,18 @@ class GraphqlProjectRepository extends BaseGitHubRepository_1.BaseGitHubReposito
|
|
|
159
163
|
fieldId: remainignEstimationMinutes.id,
|
|
160
164
|
}
|
|
161
165
|
: null,
|
|
166
|
+
dependedIssueUrlSeparatedByComma: dependedIssueUrlSeparatedByComma
|
|
167
|
+
? {
|
|
168
|
+
name: dependedIssueUrlSeparatedByComma.name,
|
|
169
|
+
fieldId: dependedIssueUrlSeparatedByComma.id,
|
|
170
|
+
}
|
|
171
|
+
: null,
|
|
172
|
+
completionDate50PercentConfidence: completionDate50PercentConfidence
|
|
173
|
+
? {
|
|
174
|
+
name: completionDate50PercentConfidence.name,
|
|
175
|
+
fieldId: completionDate50PercentConfidence.id,
|
|
176
|
+
}
|
|
177
|
+
: null,
|
|
162
178
|
};
|
|
163
179
|
};
|
|
164
180
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphqlProjectRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/GraphqlProjectRepository.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,iEAA8D;AAG9D,mCAA6C;AAE7C,MAAa,wBACX,SAAQ,2CAAoB;IAD9B;;QAIE,0BAAqB,GAAG,CACtB,UAAkB,EAIlB,EAAE;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;YAChC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;QAClC,CAAC,CAAC;QACF,mBAAc,GAAG,KAAK,EACpB,KAAa,EACb,aAAqB,EACJ,EAAE;YACnB,MAAM,YAAY,GAAG;gBACnB,KAAK,EAAE;;;;;;;;;;;EAWX;gBACI,SAAS,EAAE;oBACT,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,aAAa;iBACtB;aACF,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAazB;gBACD,GAAG,EAAE,gCAAgC;gBACrC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,IAAI,CAAC,OAAO,EAAE;oBACvC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;aACnC,CAAC,CAAC;YAEH,MAAM,SAAS,GACb,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE;gBAC9C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;QACF,uBAAkB,GAAG,KAAK,EACxB,UAAkB,EACa,EAAE;YACjC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;YACxE,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACzD,CAAC,CAAC;QACF,eAAU,GAAG,KAAK,EAAE,SAAwB,EAA2B,EAAE;YACvE,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDjB,CAAC;YACE,MAAM,SAAS,GAAG;gBAChB,SAAS,EAAE,SAAS;aACrB,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"GraphqlProjectRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/GraphqlProjectRepository.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,iEAA8D;AAG9D,mCAA6C;AAE7C,MAAa,wBACX,SAAQ,2CAAoB;IAD9B;;QAIE,0BAAqB,GAAG,CACtB,UAAkB,EAIlB,EAAE;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;YAChC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;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C;wBACH,uBAAuB;qBACxB;oBACH,CAAC,CAAC,IAAI;gBACV,0BAA0B,EAAE,0BAA0B;oBACpD,CAAC,CAAC;wBACE,IAAI,EAAE,0BAA0B,CAAC,IAAI;wBACrC,OAAO,EAAE,0BAA0B,CAAC,EAAE;qBACvC;oBACH,CAAC,CAAC,IAAI;gBACR,gCAAgC,EAAE,gCAAgC;oBAChE,CAAC,CAAC;wBACE,IAAI,EAAE,gCAAgC,CAAC,IAAI;wBAC3C,OAAO,EAAE,gCAAgC,CAAC,EAAE;qBAC7C;oBACH,CAAC,CAAC,IAAI;gBACR,iCAAiC,EAAE,iCAAiC;oBAClE,CAAC,CAAC;wBACE,IAAI,EAAE,iCAAiC,CAAC,IAAI;wBAC5C,OAAO,EAAE,iCAAiC,CAAC,EAAE;qBAC9C;oBACH,CAAC,CAAC,IAAI;aACT,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AA9PD,4DA8PC"}
|
|
@@ -24,6 +24,12 @@ class LocalStorageRepository {
|
|
|
24
24
|
this.mkdir = (dirPath) => {
|
|
25
25
|
fs_1.default.mkdirSync(dirPath, { recursive: true });
|
|
26
26
|
};
|
|
27
|
+
this.remove = (path) => {
|
|
28
|
+
fs_1.default.rmSync(path, {
|
|
29
|
+
force: true,
|
|
30
|
+
recursive: true,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
exports.LocalStorageRepository = LocalStorageRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStorageRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/LocalStorageRepository.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,MAAa,sBAAsB;IAAnC;QACE,UAAK,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;YACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACpB,YAAE,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC;QACF,SAAI,GAAG,CAAC,IAAY,EAAiB,EAAE;YACrC,OAAO,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC,CAAC;QACF,cAAS,GAAG,CAAC,OAAe,EAAY,EAAE;YACxC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,OAAO,YAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC;QACF,UAAK,GAAG,CAAC,OAAe,EAAE,EAAE;YAC1B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC;IACJ,CAAC;CAAA;
|
|
1
|
+
{"version":3,"file":"LocalStorageRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/LocalStorageRepository.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,MAAa,sBAAsB;IAAnC;QACE,UAAK,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;YACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACpB,YAAE,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC;QACF,SAAI,GAAG,CAAC,IAAY,EAAiB,EAAE;YACrC,OAAO,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC,CAAC;QACF,cAAS,GAAG,CAAC,OAAe,EAAY,EAAE;YACxC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,OAAO,YAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC;QACF,UAAK,GAAG,CAAC,OAAe,EAAE,EAAE;YAC1B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC;QACF,WAAM,GAAG,CAAC,IAAY,EAAE,EAAE;YACxB,YAAE,CAAC,MAAM,CAAC,IAAI,EAAE;gBACd,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;CAAA;AAxBD,wDAwBC"}
|
|
@@ -10,12 +10,24 @@ class SystemDateRepository {
|
|
|
10
10
|
return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
|
|
11
11
|
};
|
|
12
12
|
this.formatDateTimeWithDayOfWeek = (date) => {
|
|
13
|
+
const dateWithDayOfWeek = this.formatDateWithDayOfWeek(date);
|
|
14
|
+
const hours = String(date.getHours()).padStart(2, '0');
|
|
15
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
16
|
+
return `${dateWithDayOfWeek} ${hours}:${minutes}`;
|
|
17
|
+
};
|
|
18
|
+
this.formatDateWithDayOfWeek = (date) => {
|
|
13
19
|
const dayOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][date.getDay()];
|
|
14
20
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
15
21
|
const day = String(date.getDate()).padStart(2, '0');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
return `${date.getFullYear()}/${month}/${day} (${dayOfWeek})`;
|
|
23
|
+
};
|
|
24
|
+
this.formatStartEnd = (start, end) => {
|
|
25
|
+
const endDate = start.getFullYear() === end.getFullYear() &&
|
|
26
|
+
start.getMonth() === end.getMonth() &&
|
|
27
|
+
start.getDate() === end.getDate()
|
|
28
|
+
? `${String(end.getHours()).padStart(2, '0')}:${String(end.getMinutes()).padStart(2, '0')}`
|
|
29
|
+
: this.formatDateTimeWithDayOfWeek(end);
|
|
30
|
+
return `${this.formatDateTimeWithDayOfWeek(start)} - ${endDate}`;
|
|
19
31
|
};
|
|
20
32
|
}
|
|
21
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemDateRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/SystemDateRepository.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAAjC;QACE,QAAG,GAAG,KAAK,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;QAC7B,yBAAoB,GAAG,CAAC,eAAuB,EAAU,EAAE;YACzD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC;YAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC;YACjD,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACjF,CAAC,CAAC;QACF,gCAA2B,GAAG,CAAC,IAAU,EAAU,EAAE;YACnD,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CACjE,IAAI,CAAC,MAAM,EAAE,CACd,CAAC;YACF,MAAM,KAAK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