github-issue-tower-defence-management 2.4.0 → 2.5.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/CHANGELOG.md +13 -0
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +13 -3
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/entry-points/handlers/subscriptionDisabledTokenHandler.js +27 -0
- package/bin/adapter/entry-points/handlers/subscriptionDisabledTokenHandler.js.map +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +1 -11
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/SubscriptionDisabledIssueUseCase.js +42 -0
- package/bin/domain/usecases/SubscriptionDisabledIssueUseCase.js.map +1 -0
- package/bin/domain/usecases/TriagerApprovalDispatchUseCase.js +9 -4
- package/bin/domain/usecases/TriagerApprovalDispatchUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.test.ts +0 -8
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +17 -4
- package/src/adapter/entry-points/handlers/subscriptionDisabledTokenHandler.ts +41 -0
- package/src/adapter/repositories/githubGraphqlClient.test.ts +2 -2
- package/src/domain/usecases/HandleScheduledEventUseCase.test.ts +0 -56
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +0 -13
- package/src/domain/usecases/SubscriptionDisabledIssueUseCase.test.ts +197 -0
- package/src/domain/usecases/SubscriptionDisabledIssueUseCase.ts +74 -0
- package/src/domain/usecases/TriagerApprovalDispatchUseCase.test.ts +83 -0
- package/src/domain/usecases/TriagerApprovalDispatchUseCase.ts +12 -4
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/subscriptionDisabledTokenHandler.d.ts +9 -0
- package/types/adapter/entry-points/handlers/subscriptionDisabledTokenHandler.d.ts.map +1 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +1 -4
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/SubscriptionDisabledIssueUseCase.d.ts +16 -0
- package/types/domain/usecases/SubscriptionDisabledIssueUseCase.d.ts.map +1 -0
- package/types/domain/usecases/TriagerApprovalDispatchUseCase.d.ts.map +1 -1
- package/src/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.test.ts +0 -1638
- package/src/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.ts +0 -192
|
@@ -9,7 +9,6 @@ import { ClearDependedIssueURLUseCase } from './ClearDependedIssueURLUseCase';
|
|
|
9
9
|
import { SetDependedIssueUrlForOpenTaskPRsUseCase } from './SetDependedIssueUrlForOpenTaskPRsUseCase';
|
|
10
10
|
import { StaleTaskPullRequestCloseUseCase } from './StaleTaskPullRequestCloseUseCase';
|
|
11
11
|
import { CreateEstimationIssueUseCase } from './CreateEstimationIssueUseCase';
|
|
12
|
-
import { ConvertCheckboxToIssueInStoryIssueUseCase } from './ConvertCheckboxToIssueInStoryIssueUseCase';
|
|
13
12
|
import { DateRepository } from './adapter-interfaces/DateRepository';
|
|
14
13
|
import { SpreadsheetRepository } from './adapter-interfaces/SpreadsheetRepository';
|
|
15
14
|
import { ProjectRepository } from './adapter-interfaces/ProjectRepository';
|
|
@@ -112,8 +111,6 @@ describe('HandleScheduledEventUseCase', () => {
|
|
|
112
111
|
mock<StaleTaskPullRequestCloseUseCase>();
|
|
113
112
|
const mockCreateEstimationIssueUseCase =
|
|
114
113
|
mock<CreateEstimationIssueUseCase>();
|
|
115
|
-
const mockConvertCheckboxToIssueInStoryIssueUseCase =
|
|
116
|
-
mock<ConvertCheckboxToIssueInStoryIssueUseCase>();
|
|
117
114
|
const mockChangeStatusByStoryColorUseCase =
|
|
118
115
|
mock<ChangeStatusByStoryColorUseCase>();
|
|
119
116
|
const mockSetNoStoryIssueToStoryUseCase =
|
|
@@ -158,7 +155,6 @@ describe('HandleScheduledEventUseCase', () => {
|
|
|
158
155
|
mockSetDependedIssueUrlForOpenTaskPRsUseCase,
|
|
159
156
|
mockStaleTaskPullRequestCloseUseCase,
|
|
160
157
|
mockCreateEstimationIssueUseCase,
|
|
161
|
-
mockConvertCheckboxToIssueInStoryIssueUseCase,
|
|
162
158
|
mockChangeStatusByStoryColorUseCase,
|
|
163
159
|
mockSetNoStoryIssueToStoryUseCase,
|
|
164
160
|
mockCreateNewStoryByLabelUseCase,
|
|
@@ -353,57 +349,6 @@ describe('HandleScheduledEventUseCase', () => {
|
|
|
353
349
|
expect(mockProjectRepository.findProjectIdByUrl).toHaveBeenCalled();
|
|
354
350
|
});
|
|
355
351
|
|
|
356
|
-
it('should pass createTaskFromStoryBodyCheckboxEnabled false to ConvertCheckboxToIssueInStoryIssueUseCase when the field is absent', async () => {
|
|
357
|
-
const input = {
|
|
358
|
-
projectName: 'test-project',
|
|
359
|
-
org: 'test-org',
|
|
360
|
-
projectUrl: 'https://github.com/test-org/test-project',
|
|
361
|
-
manager: 'test-manager',
|
|
362
|
-
workingReport: {
|
|
363
|
-
repo: 'test-repo',
|
|
364
|
-
members: ['member1'],
|
|
365
|
-
spreadsheetUrl: 'https://docs.google.com/spreadsheets/test',
|
|
366
|
-
},
|
|
367
|
-
urlOfStoryView: 'https://github.com/test-org/test-project/issues',
|
|
368
|
-
disabled: false,
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
await useCase.run(input);
|
|
372
|
-
expect(
|
|
373
|
-
mockConvertCheckboxToIssueInStoryIssueUseCase.run,
|
|
374
|
-
).toHaveBeenCalledWith(
|
|
375
|
-
expect.objectContaining({
|
|
376
|
-
createTaskFromStoryBodyCheckboxEnabled: false,
|
|
377
|
-
}),
|
|
378
|
-
);
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
it('should pass createTaskFromStoryBodyCheckboxEnabled true to ConvertCheckboxToIssueInStoryIssueUseCase when the field is true', async () => {
|
|
382
|
-
const input = {
|
|
383
|
-
projectName: 'test-project',
|
|
384
|
-
org: 'test-org',
|
|
385
|
-
projectUrl: 'https://github.com/test-org/test-project',
|
|
386
|
-
manager: 'test-manager',
|
|
387
|
-
workingReport: {
|
|
388
|
-
repo: 'test-repo',
|
|
389
|
-
members: ['member1'],
|
|
390
|
-
spreadsheetUrl: 'https://docs.google.com/spreadsheets/test',
|
|
391
|
-
},
|
|
392
|
-
urlOfStoryView: 'https://github.com/test-org/test-project/issues',
|
|
393
|
-
disabled: false,
|
|
394
|
-
createTaskFromStoryBodyCheckboxEnabled: true,
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
await useCase.run(input);
|
|
398
|
-
expect(
|
|
399
|
-
mockConvertCheckboxToIssueInStoryIssueUseCase.run,
|
|
400
|
-
).toHaveBeenCalledWith(
|
|
401
|
-
expect.objectContaining({
|
|
402
|
-
createTaskFromStoryBodyCheckboxEnabled: true,
|
|
403
|
-
}),
|
|
404
|
-
);
|
|
405
|
-
});
|
|
406
|
-
|
|
407
352
|
it('should pass storyProgressCommentEnabled true to AnalyzeProblemByIssueUseCase when the field is absent', async () => {
|
|
408
353
|
const input = {
|
|
409
354
|
projectName: 'test-project',
|
|
@@ -1872,7 +1817,6 @@ describe('HandleScheduledEventUseCase', () => {
|
|
|
1872
1817
|
mock<SetDependedIssueUrlForOpenTaskPRsUseCase>(),
|
|
1873
1818
|
mock<StaleTaskPullRequestCloseUseCase>(),
|
|
1874
1819
|
mock<CreateEstimationIssueUseCase>(),
|
|
1875
|
-
mock<ConvertCheckboxToIssueInStoryIssueUseCase>(),
|
|
1876
1820
|
mock<ChangeStatusByStoryColorUseCase>(),
|
|
1877
1821
|
mock<SetNoStoryIssueToStoryUseCase>(),
|
|
1878
1822
|
mock<CreateNewStoryByLabelUseCase>(),
|
|
@@ -15,7 +15,6 @@ import { ClearDependedIssueURLUseCase } from './ClearDependedIssueURLUseCase';
|
|
|
15
15
|
import { SetDependedIssueUrlForOpenTaskPRsUseCase } from './SetDependedIssueUrlForOpenTaskPRsUseCase';
|
|
16
16
|
import { StaleTaskPullRequestCloseUseCase } from './StaleTaskPullRequestCloseUseCase';
|
|
17
17
|
import { CreateEstimationIssueUseCase } from './CreateEstimationIssueUseCase';
|
|
18
|
-
import { ConvertCheckboxToIssueInStoryIssueUseCase } from './ConvertCheckboxToIssueInStoryIssueUseCase';
|
|
19
18
|
import { ChangeStatusByStoryColorUseCase } from './ChangeStatusByStoryColorUseCase';
|
|
20
19
|
import { SetNoStoryIssueToStoryUseCase } from './SetNoStoryIssueToStoryUseCase';
|
|
21
20
|
import { CreateNewStoryByLabelUseCase } from './CreateNewStoryByLabelUseCase';
|
|
@@ -130,7 +129,6 @@ export class HandleScheduledEventUseCase {
|
|
|
130
129
|
readonly setDependedIssueUrlForOpenTaskPRsUseCase: SetDependedIssueUrlForOpenTaskPRsUseCase,
|
|
131
130
|
readonly staleTaskPullRequestCloseUseCase: StaleTaskPullRequestCloseUseCase,
|
|
132
131
|
readonly createEstimationIssueUseCase: CreateEstimationIssueUseCase,
|
|
133
|
-
readonly convertCheckboxToIssueInStoryIssueUseCase: ConvertCheckboxToIssueInStoryIssueUseCase,
|
|
134
132
|
readonly changeStatusByStoryColorUseCase: ChangeStatusByStoryColorUseCase,
|
|
135
133
|
readonly setNoStoryIssueToStoryUseCase: SetNoStoryIssueToStoryUseCase,
|
|
136
134
|
readonly createNewStoryByLabelUseCase: CreateNewStoryByLabelUseCase,
|
|
@@ -191,7 +189,6 @@ export class HandleScheduledEventUseCase {
|
|
|
191
189
|
} | null;
|
|
192
190
|
thresholdForAutoReject?: number;
|
|
193
191
|
thresholdForDispatchLoop?: number;
|
|
194
|
-
createTaskFromStoryBodyCheckboxEnabled?: boolean;
|
|
195
192
|
queryToAddProjectEnabled?: boolean;
|
|
196
193
|
queryToAddProject?: string | null;
|
|
197
194
|
storyProgressCommentEnabled?: boolean;
|
|
@@ -615,16 +612,6 @@ ${JSON.stringify(e)}
|
|
|
615
612
|
urlOfStoryView: input.urlOfStoryView,
|
|
616
613
|
storyObjectMap: storyObjectMap,
|
|
617
614
|
});
|
|
618
|
-
await this.convertCheckboxToIssueInStoryIssueUseCase.run({
|
|
619
|
-
project,
|
|
620
|
-
issues,
|
|
621
|
-
cacheUsed,
|
|
622
|
-
urlOfStoryView: input.urlOfStoryView,
|
|
623
|
-
storyObjectMap: storyObjectMap,
|
|
624
|
-
manager: input.manager,
|
|
625
|
-
createTaskFromStoryBodyCheckboxEnabled:
|
|
626
|
-
input.createTaskFromStoryBodyCheckboxEnabled ?? false,
|
|
627
|
-
});
|
|
628
615
|
await this.changeStatusByStoryColorUseCase.run({
|
|
629
616
|
project,
|
|
630
617
|
cacheUsed,
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { mock } from 'jest-mock-extended';
|
|
2
|
+
import { IssueRepository } from './adapter-interfaces/IssueRepository';
|
|
3
|
+
import { SubscriptionDisabledIssueUseCase } from './SubscriptionDisabledIssueUseCase';
|
|
4
|
+
|
|
5
|
+
const ORG = 'test-org';
|
|
6
|
+
const REPO = 'test-repo';
|
|
7
|
+
|
|
8
|
+
const buildEntry = (name: string, subscriptionDisabled: boolean) => ({
|
|
9
|
+
name,
|
|
10
|
+
subscriptionDisabled,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
describe('SubscriptionDisabledIssueUseCase', () => {
|
|
14
|
+
describe('when no tokens are disabled', () => {
|
|
15
|
+
it('does not create any issue or comment', async () => {
|
|
16
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
17
|
+
|
|
18
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
19
|
+
|
|
20
|
+
await useCase.run({
|
|
21
|
+
tokenEntries: [buildEntry('dev1', false), buildEntry('dev2', false)],
|
|
22
|
+
org: ORG,
|
|
23
|
+
repo: REPO,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
expect(mockIssueRepository.searchIssue.mock.calls).toHaveLength(0);
|
|
27
|
+
expect(mockIssueRepository.createNewIssue.mock.calls).toHaveLength(0);
|
|
28
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls).toHaveLength(0);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('when a token is disabled and no open issue exists', () => {
|
|
33
|
+
it('creates a new issue naming the token by display name only', async () => {
|
|
34
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
35
|
+
mockIssueRepository.searchIssue.mockResolvedValue([]);
|
|
36
|
+
mockIssueRepository.createNewIssue.mockResolvedValue(42);
|
|
37
|
+
|
|
38
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
39
|
+
|
|
40
|
+
await useCase.run({
|
|
41
|
+
tokenEntries: [buildEntry('dev3', true)],
|
|
42
|
+
org: ORG,
|
|
43
|
+
repo: REPO,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(mockIssueRepository.searchIssue.mock.calls).toHaveLength(1);
|
|
47
|
+
expect(mockIssueRepository.searchIssue.mock.calls[0][0]).toEqual({
|
|
48
|
+
owner: ORG,
|
|
49
|
+
repositoryName: REPO,
|
|
50
|
+
type: 'issue',
|
|
51
|
+
state: 'open',
|
|
52
|
+
title: 'Restore Claude subscription access for dev3',
|
|
53
|
+
});
|
|
54
|
+
expect(mockIssueRepository.createNewIssue.mock.calls).toHaveLength(1);
|
|
55
|
+
expect(mockIssueRepository.createNewIssue.mock.calls[0][0]).toBe(ORG);
|
|
56
|
+
expect(mockIssueRepository.createNewIssue.mock.calls[0][1]).toBe(REPO);
|
|
57
|
+
expect(mockIssueRepository.createNewIssue.mock.calls[0][2]).toBe(
|
|
58
|
+
'Restore Claude subscription access for dev3',
|
|
59
|
+
);
|
|
60
|
+
expect(mockIssueRepository.createNewIssue.mock.calls[0][3]).toContain(
|
|
61
|
+
'dev3',
|
|
62
|
+
);
|
|
63
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls).toHaveLength(0);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('does not include the token value in the issue body', async () => {
|
|
67
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
68
|
+
mockIssueRepository.searchIssue.mockResolvedValue([]);
|
|
69
|
+
mockIssueRepository.createNewIssue.mockResolvedValue(1);
|
|
70
|
+
|
|
71
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
72
|
+
|
|
73
|
+
const SECRET_TOKEN = 'sk-ant-secret-abc123';
|
|
74
|
+
await useCase.run({
|
|
75
|
+
tokenEntries: [{ name: 'dev3', subscriptionDisabled: true }],
|
|
76
|
+
org: ORG,
|
|
77
|
+
repo: REPO,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
expect(mockIssueRepository.createNewIssue.mock.calls[0][3]).not.toContain(
|
|
81
|
+
SECRET_TOKEN,
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('when a token is disabled and an open issue already exists', () => {
|
|
87
|
+
it('comments on the existing issue instead of creating a new one', async () => {
|
|
88
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
89
|
+
const existingIssueUrl =
|
|
90
|
+
'https://github.com/test-org/test-repo/issues/99';
|
|
91
|
+
mockIssueRepository.searchIssue.mockResolvedValue([
|
|
92
|
+
{
|
|
93
|
+
url: existingIssueUrl,
|
|
94
|
+
title: 'Restore Claude subscription access for dev3',
|
|
95
|
+
number: '99',
|
|
96
|
+
},
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
100
|
+
|
|
101
|
+
await useCase.run({
|
|
102
|
+
tokenEntries: [buildEntry('dev3', true)],
|
|
103
|
+
org: ORG,
|
|
104
|
+
repo: REPO,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
expect(mockIssueRepository.createNewIssue.mock.calls).toHaveLength(0);
|
|
108
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls).toHaveLength(1);
|
|
109
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls[0][0]).toBe(
|
|
110
|
+
existingIssueUrl,
|
|
111
|
+
);
|
|
112
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls[0][1]).toContain(
|
|
113
|
+
'dev3',
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe('when multiple tokens have different states', () => {
|
|
119
|
+
it('only handles disabled tokens', async () => {
|
|
120
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
121
|
+
mockIssueRepository.searchIssue.mockResolvedValue([]);
|
|
122
|
+
mockIssueRepository.createNewIssue.mockResolvedValue(1);
|
|
123
|
+
|
|
124
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
125
|
+
|
|
126
|
+
await useCase.run({
|
|
127
|
+
tokenEntries: [
|
|
128
|
+
buildEntry('dev1', false),
|
|
129
|
+
buildEntry('dev2', true),
|
|
130
|
+
buildEntry('dev3', false),
|
|
131
|
+
buildEntry('dev4', true),
|
|
132
|
+
],
|
|
133
|
+
org: ORG,
|
|
134
|
+
repo: REPO,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
expect(mockIssueRepository.searchIssue.mock.calls).toHaveLength(2);
|
|
138
|
+
expect(mockIssueRepository.createNewIssue.mock.calls).toHaveLength(2);
|
|
139
|
+
expect(mockIssueRepository.searchIssue.mock.calls[0][0]).toEqual(
|
|
140
|
+
expect.objectContaining({
|
|
141
|
+
title: 'Restore Claude subscription access for dev2',
|
|
142
|
+
}),
|
|
143
|
+
);
|
|
144
|
+
expect(mockIssueRepository.searchIssue.mock.calls[1][0]).toEqual(
|
|
145
|
+
expect.objectContaining({
|
|
146
|
+
title: 'Restore Claude subscription access for dev4',
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
describe('when the token list is empty', () => {
|
|
153
|
+
it('does nothing', async () => {
|
|
154
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
155
|
+
|
|
156
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
157
|
+
|
|
158
|
+
await useCase.run({
|
|
159
|
+
tokenEntries: [],
|
|
160
|
+
org: ORG,
|
|
161
|
+
repo: REPO,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
expect(mockIssueRepository.searchIssue.mock.calls).toHaveLength(0);
|
|
165
|
+
expect(mockIssueRepository.createNewIssue.mock.calls).toHaveLength(0);
|
|
166
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls).toHaveLength(0);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
describe('when searchIssue returns issues but none with exact title match', () => {
|
|
171
|
+
it('creates a new issue when title does not exactly match', async () => {
|
|
172
|
+
const mockIssueRepository = mock<IssueRepository>();
|
|
173
|
+
mockIssueRepository.searchIssue.mockResolvedValue([
|
|
174
|
+
{
|
|
175
|
+
url: 'https://github.com/test-org/test-repo/issues/5',
|
|
176
|
+
title: 'Restore Claude subscription access for dev3-old',
|
|
177
|
+
number: '5',
|
|
178
|
+
},
|
|
179
|
+
]);
|
|
180
|
+
mockIssueRepository.createNewIssue.mockResolvedValue(6);
|
|
181
|
+
|
|
182
|
+
const useCase = new SubscriptionDisabledIssueUseCase(mockIssueRepository);
|
|
183
|
+
|
|
184
|
+
await useCase.run({
|
|
185
|
+
tokenEntries: [buildEntry('dev3', true)],
|
|
186
|
+
org: ORG,
|
|
187
|
+
repo: REPO,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
expect(mockIssueRepository.createNewIssue.mock.calls).toHaveLength(1);
|
|
191
|
+
expect(mockIssueRepository.createNewIssue.mock.calls[0][2]).toBe(
|
|
192
|
+
'Restore Claude subscription access for dev3',
|
|
193
|
+
);
|
|
194
|
+
expect(mockIssueRepository.createCommentByUrl.mock.calls).toHaveLength(0);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { IssueRepository } from './adapter-interfaces/IssueRepository';
|
|
2
|
+
|
|
3
|
+
export type SubscriptionDisabledTokenEntry = {
|
|
4
|
+
name: string;
|
|
5
|
+
subscriptionDisabled: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export class SubscriptionDisabledIssueUseCase {
|
|
9
|
+
constructor(
|
|
10
|
+
private readonly issueRepository: Pick<
|
|
11
|
+
IssueRepository,
|
|
12
|
+
'searchIssue' | 'createNewIssue' | 'createCommentByUrl'
|
|
13
|
+
>,
|
|
14
|
+
) {}
|
|
15
|
+
|
|
16
|
+
run = async (input: {
|
|
17
|
+
tokenEntries: SubscriptionDisabledTokenEntry[];
|
|
18
|
+
org: string;
|
|
19
|
+
repo: string;
|
|
20
|
+
}): Promise<void> => {
|
|
21
|
+
for (const entry of input.tokenEntries) {
|
|
22
|
+
if (!entry.subscriptionDisabled) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
await this.handleDisabledToken(entry.name, input.org, input.repo);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(
|
|
29
|
+
`SubscriptionDisabledIssue: error handling token ${entry.name}: ${error instanceof Error ? error.message : String(error)}`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
private handleDisabledToken = async (
|
|
36
|
+
tokenName: string,
|
|
37
|
+
org: string,
|
|
38
|
+
repo: string,
|
|
39
|
+
): Promise<void> => {
|
|
40
|
+
const issueTitle = `Restore Claude subscription access for ${tokenName}`;
|
|
41
|
+
const existingIssues = await this.issueRepository.searchIssue({
|
|
42
|
+
owner: org,
|
|
43
|
+
repositoryName: repo,
|
|
44
|
+
type: 'issue',
|
|
45
|
+
state: 'open',
|
|
46
|
+
title: issueTitle,
|
|
47
|
+
});
|
|
48
|
+
const existingIssue = existingIssues.find(
|
|
49
|
+
(issue) => issue.title === issueTitle,
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
if (existingIssue) {
|
|
53
|
+
await this.issueRepository.createCommentByUrl(
|
|
54
|
+
existingIssue.url,
|
|
55
|
+
`The Claude subscription access for the token displayed as \`${tokenName}\` remains disabled. Please restore the account's Claude Code subscription access.`,
|
|
56
|
+
);
|
|
57
|
+
console.log(
|
|
58
|
+
`SubscriptionDisabledIssue: commented on existing issue for token ${tokenName}: ${existingIssue.url}`,
|
|
59
|
+
);
|
|
60
|
+
} else {
|
|
61
|
+
const issueNumber = await this.issueRepository.createNewIssue(
|
|
62
|
+
org,
|
|
63
|
+
repo,
|
|
64
|
+
issueTitle,
|
|
65
|
+
`The Claude subscription access for the token displayed as \`${tokenName}\` has been disabled.\n\nPlease restore the account's Claude Code subscription access to resume operations.`,
|
|
66
|
+
[],
|
|
67
|
+
[],
|
|
68
|
+
);
|
|
69
|
+
console.log(
|
|
70
|
+
`SubscriptionDisabledIssue: created issue #${issueNumber} for token ${tokenName}`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -964,5 +964,88 @@ describe('TriagerApprovalDispatchUseCase', () => {
|
|
|
964
964
|
expect(mockIssueRepository.updateStory.mock.calls).toEqual([]);
|
|
965
965
|
expect(mockIssueRepository.setIssueAgentField.mock.calls).toHaveLength(1);
|
|
966
966
|
});
|
|
967
|
+
|
|
968
|
+
it('should not dispatch again when TRIAGER_PROPOSAL_APPROVED was already posted after the approval', async () => {
|
|
969
|
+
const issue = createMockIssue({
|
|
970
|
+
status: 'Awaiting Workspace',
|
|
971
|
+
author: 'owner-user',
|
|
972
|
+
agent: null,
|
|
973
|
+
});
|
|
974
|
+
mockIssueRepository.getAllIssues.mockResolvedValue({
|
|
975
|
+
project: mockProject,
|
|
976
|
+
issues: [issue],
|
|
977
|
+
cacheUsed: false,
|
|
978
|
+
});
|
|
979
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
980
|
+
createComment(
|
|
981
|
+
'bot',
|
|
982
|
+
TRIAGER_PROPOSAL_COMMENT(
|
|
983
|
+
'developer',
|
|
984
|
+
'regular / workflow improvement',
|
|
985
|
+
false,
|
|
986
|
+
),
|
|
987
|
+
),
|
|
988
|
+
createComment('owner-user', 'ok'),
|
|
989
|
+
createComment(
|
|
990
|
+
'bot',
|
|
991
|
+
'Auto Status Check: TRIAGER_PROPOSAL_APPROVED\nAgent: developer\nStory: regular / workflow improvement',
|
|
992
|
+
),
|
|
993
|
+
]);
|
|
994
|
+
|
|
995
|
+
await useCase.run({
|
|
996
|
+
projectUrl: 'https://github.com/orgs/owner/projects/1',
|
|
997
|
+
allowedIssueAuthors: ['owner-user'],
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
expect(mockIssueRepository.updateStatus.mock.calls).toEqual([]);
|
|
1001
|
+
expect(mockIssueRepository.setIssueAgentField.mock.calls).toEqual([]);
|
|
1002
|
+
expect(mockIssueCommentRepository.createComment.mock.calls).toEqual([]);
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
it('should dispatch again when the issue returns to AW after the agent ran and TRIAGER_PROPOSAL_APPROVED was posted without a subsequent new proposal+approval', async () => {
|
|
1006
|
+
const issue = createMockIssue({
|
|
1007
|
+
status: 'Awaiting Workspace',
|
|
1008
|
+
author: 'owner-user',
|
|
1009
|
+
agent: null,
|
|
1010
|
+
});
|
|
1011
|
+
mockIssueRepository.getAllIssues.mockResolvedValue({
|
|
1012
|
+
project: mockProject,
|
|
1013
|
+
issues: [issue],
|
|
1014
|
+
cacheUsed: false,
|
|
1015
|
+
});
|
|
1016
|
+
// second proposal after TRIAGER_PROPOSAL_APPROVED, with a new owner approval
|
|
1017
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
1018
|
+
createComment(
|
|
1019
|
+
'bot',
|
|
1020
|
+
TRIAGER_PROPOSAL_COMMENT(
|
|
1021
|
+
'developer',
|
|
1022
|
+
'regular / workflow improvement',
|
|
1023
|
+
false,
|
|
1024
|
+
),
|
|
1025
|
+
),
|
|
1026
|
+
createComment('owner-user', 'ok'),
|
|
1027
|
+
createComment(
|
|
1028
|
+
'bot',
|
|
1029
|
+
'Auto Status Check: TRIAGER_PROPOSAL_APPROVED\nAgent: developer\nStory: regular / workflow improvement',
|
|
1030
|
+
),
|
|
1031
|
+
createComment(
|
|
1032
|
+
'bot',
|
|
1033
|
+
TRIAGER_PROPOSAL_COMMENT(
|
|
1034
|
+
'developer',
|
|
1035
|
+
'regular / workflow improvement',
|
|
1036
|
+
true,
|
|
1037
|
+
),
|
|
1038
|
+
),
|
|
1039
|
+
createComment('owner-user', 'ok'),
|
|
1040
|
+
]);
|
|
1041
|
+
|
|
1042
|
+
await useCase.run({
|
|
1043
|
+
projectUrl: 'https://github.com/orgs/owner/projects/1',
|
|
1044
|
+
allowedIssueAuthors: ['owner-user'],
|
|
1045
|
+
});
|
|
1046
|
+
|
|
1047
|
+
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
1048
|
+
expect(mockIssueRepository.setIssueAgentField.mock.calls).toHaveLength(1);
|
|
1049
|
+
});
|
|
967
1050
|
});
|
|
968
1051
|
});
|
|
@@ -197,7 +197,7 @@ export class TriagerApprovalDispatchUseCase {
|
|
|
197
197
|
continue;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
let
|
|
200
|
+
let approvalIndex = -1;
|
|
201
201
|
for (let i = firstProposalIndex + 1; i < comments.length; i++) {
|
|
202
202
|
const comment = comments[i];
|
|
203
203
|
if (
|
|
@@ -207,12 +207,20 @@ export class TriagerApprovalDispatchUseCase {
|
|
|
207
207
|
allowedIssueAuthors ?? [],
|
|
208
208
|
)
|
|
209
209
|
) {
|
|
210
|
-
|
|
211
|
-
break;
|
|
210
|
+
approvalIndex = i;
|
|
212
211
|
}
|
|
213
212
|
}
|
|
214
213
|
|
|
215
|
-
if (
|
|
214
|
+
if (approvalIndex === -1) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const alreadyDispatched = comments
|
|
219
|
+
.slice(approvalIndex + 1)
|
|
220
|
+
.some((c) =>
|
|
221
|
+
c.content.startsWith('Auto Status Check: TRIAGER_PROPOSAL_APPROVED'),
|
|
222
|
+
);
|
|
223
|
+
if (alreadyDispatched) {
|
|
216
224
|
continue;
|
|
217
225
|
}
|
|
218
226
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AA0D3D,qBAAa,kCAAkC;IAC7C,MAAM,GACJ,gBAAgB,MAAM,EACtB,UAAU,OAAO,EACjB,6BAA4B,MAAM,EAAE,GAAG,IAAW,KACjD,OAAO,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,IAAI,EAAE,CAAC;KACzB,GAAG,IAAI,CAAC,CAy1BP;CACH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
2
|
+
export type SubscriptionDisabledTokenHandlerParams = {
|
|
3
|
+
tokenListJsonPath: string | null;
|
|
4
|
+
org: string;
|
|
5
|
+
repo: string;
|
|
6
|
+
issueRepository: Pick<IssueRepository, 'searchIssue' | 'createNewIssue' | 'createCommentByUrl'>;
|
|
7
|
+
};
|
|
8
|
+
export declare const handleSubscriptionDisabledTokens: (params: SubscriptionDisabledTokenHandlerParams) => Promise<void>;
|
|
9
|
+
//# sourceMappingURL=subscriptionDisabledTokenHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptionDisabledTokenHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/subscriptionDisabledTokenHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAK9F,MAAM,MAAM,sCAAsC,GAAG;IACnD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,IAAI,CACnB,eAAe,EACf,aAAa,GAAG,gBAAgB,GAAG,oBAAoB,CACxD,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,sCAAsC,KAC7C,OAAO,CAAC,IAAI,CAuBd,CAAC"}
|
|
@@ -15,7 +15,6 @@ import { ClearDependedIssueURLUseCase } from './ClearDependedIssueURLUseCase';
|
|
|
15
15
|
import { SetDependedIssueUrlForOpenTaskPRsUseCase } from './SetDependedIssueUrlForOpenTaskPRsUseCase';
|
|
16
16
|
import { StaleTaskPullRequestCloseUseCase } from './StaleTaskPullRequestCloseUseCase';
|
|
17
17
|
import { CreateEstimationIssueUseCase } from './CreateEstimationIssueUseCase';
|
|
18
|
-
import { ConvertCheckboxToIssueInStoryIssueUseCase } from './ConvertCheckboxToIssueInStoryIssueUseCase';
|
|
19
18
|
import { ChangeStatusByStoryColorUseCase } from './ChangeStatusByStoryColorUseCase';
|
|
20
19
|
import { SetNoStoryIssueToStoryUseCase } from './SetNoStoryIssueToStoryUseCase';
|
|
21
20
|
import { CreateNewStoryByLabelUseCase } from './CreateNewStoryByLabelUseCase';
|
|
@@ -49,7 +48,6 @@ export declare class HandleScheduledEventUseCase {
|
|
|
49
48
|
readonly setDependedIssueUrlForOpenTaskPRsUseCase: SetDependedIssueUrlForOpenTaskPRsUseCase;
|
|
50
49
|
readonly staleTaskPullRequestCloseUseCase: StaleTaskPullRequestCloseUseCase;
|
|
51
50
|
readonly createEstimationIssueUseCase: CreateEstimationIssueUseCase;
|
|
52
|
-
readonly convertCheckboxToIssueInStoryIssueUseCase: ConvertCheckboxToIssueInStoryIssueUseCase;
|
|
53
51
|
readonly changeStatusByStoryColorUseCase: ChangeStatusByStoryColorUseCase;
|
|
54
52
|
readonly setNoStoryIssueToStoryUseCase: SetNoStoryIssueToStoryUseCase;
|
|
55
53
|
readonly createNewStoryByLabelUseCase: CreateNewStoryByLabelUseCase;
|
|
@@ -70,7 +68,7 @@ export declare class HandleScheduledEventUseCase {
|
|
|
70
68
|
readonly spreadsheetRepository: SpreadsheetRepository;
|
|
71
69
|
readonly projectRepository: ProjectRepository;
|
|
72
70
|
readonly issueRepository: IssueRepository;
|
|
73
|
-
constructor(projectRequiredFieldCreateUseCase: ProjectRequiredFieldCreateUseCase, setupTowerDefenceProjectUseCase: SetupTowerDefenceProjectUseCase, actionAnnouncementUseCase: ActionAnnouncementUseCase, setWorkflowManagementIssueToStoryUseCase: SetWorkflowManagementIssueToStoryUseCase, clearPastNextActionUseCase: ClearPastNextActionDateHourUseCase, analyzeProblemByIssueUseCase: AnalyzeProblemByIssueUseCase, analyzeStoriesUseCase: AnalyzeStoriesUseCase, clearDependedIssueURLUseCase: ClearDependedIssueURLUseCase, setDependedIssueUrlForOpenTaskPRsUseCase: SetDependedIssueUrlForOpenTaskPRsUseCase, staleTaskPullRequestCloseUseCase: StaleTaskPullRequestCloseUseCase, createEstimationIssueUseCase: CreateEstimationIssueUseCase,
|
|
71
|
+
constructor(projectRequiredFieldCreateUseCase: ProjectRequiredFieldCreateUseCase, setupTowerDefenceProjectUseCase: SetupTowerDefenceProjectUseCase, actionAnnouncementUseCase: ActionAnnouncementUseCase, setWorkflowManagementIssueToStoryUseCase: SetWorkflowManagementIssueToStoryUseCase, clearPastNextActionUseCase: ClearPastNextActionDateHourUseCase, analyzeProblemByIssueUseCase: AnalyzeProblemByIssueUseCase, analyzeStoriesUseCase: AnalyzeStoriesUseCase, clearDependedIssueURLUseCase: ClearDependedIssueURLUseCase, setDependedIssueUrlForOpenTaskPRsUseCase: SetDependedIssueUrlForOpenTaskPRsUseCase, staleTaskPullRequestCloseUseCase: StaleTaskPullRequestCloseUseCase, createEstimationIssueUseCase: CreateEstimationIssueUseCase, changeStatusByStoryColorUseCase: ChangeStatusByStoryColorUseCase, setNoStoryIssueToStoryUseCase: SetNoStoryIssueToStoryUseCase, createNewStoryByLabelUseCase: CreateNewStoryByLabelUseCase, assignNoAssigneeIssueToManagerUseCase: AssignNoAssigneeIssueToManagerUseCase, updateIssueStatusByLabelUseCase: UpdateIssueStatusByLabelUseCase, issueNoStatusUpdateUseCase: IssueNoStatusUpdateUseCase, startPreparationUseCase: StartPreparationUseCase, revertOrphanedPreparationUseCase: RevertOrphanedPreparationUseCase, conflictedIssueRevertUseCase: ConflictedIssueRevertUseCase, revertNotReadyReviewQueueIssueUseCase: RevertNotReadyReviewQueueIssueUseCase, triagerApprovalDispatchUseCase: TriagerApprovalDispatchUseCase, agentDesignationLabelAdoptUseCase: AgentDesignationLabelAdoptUseCase, updateRateLimitCacheUseCase: UpdateRateLimitCacheUseCase | null, dailySecurityScanUseCase: DailySecurityScanUseCase | null, qualityCheckAdvanceUseCase: QualityCheckAdvanceUseCase, reopenedDoneIssueRevertUseCase: ReopenedDoneIssueRevertUseCase, dateRepository: DateRepository, spreadsheetRepository: SpreadsheetRepository, projectRepository: ProjectRepository, issueRepository: IssueRepository);
|
|
74
72
|
run: (input: {
|
|
75
73
|
projectName: string;
|
|
76
74
|
org: string;
|
|
@@ -109,7 +107,6 @@ export declare class HandleScheduledEventUseCase {
|
|
|
109
107
|
} | null;
|
|
110
108
|
thresholdForAutoReject?: number;
|
|
111
109
|
thresholdForDispatchLoop?: number;
|
|
112
|
-
createTaskFromStoryBodyCheckboxEnabled?: boolean;
|
|
113
110
|
queryToAddProjectEnabled?: boolean;
|
|
114
111
|
queryToAddProject?: string | null;
|
|
115
112
|
storyProgressCommentEnabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/HandleScheduledEventUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAA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AC,CAAC,CAAC,KACvB,OAAO,CAAC,CAAC,CAAC,CAkCX;IACF,4CAA4C,GAC1C,gBAAgB,MAAM,EACtB,KAAK,IAAI,EACT,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,SAAS,MAAM,CAAC,MAAM,CAAC,KACtB,OAAO,CAAC,IAAI,EAAE,CAAC,CA4DhB;IACF,kBAAkB,GAChB,gBAAgB,MAAM,EACtB,KAAK,IAAI,EACT,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,SAAS,MAAM,CAAC,MAAM,CAAC,KACtB,OAAO,CAAC,OAAO,CAAC,CAsDjB;IACF,WAAW,GAAU,OAAO;QAC1B,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,EAAE,CAAC;KACjB,KAAG,OAAO,CAAC,cAAc,CAAC,CAoBzB;CACH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IssueRepository } from './adapter-interfaces/IssueRepository';
|
|
2
|
+
export type SubscriptionDisabledTokenEntry = {
|
|
3
|
+
name: string;
|
|
4
|
+
subscriptionDisabled: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class SubscriptionDisabledIssueUseCase {
|
|
7
|
+
private readonly issueRepository;
|
|
8
|
+
constructor(issueRepository: Pick<IssueRepository, 'searchIssue' | 'createNewIssue' | 'createCommentByUrl'>);
|
|
9
|
+
run: (input: {
|
|
10
|
+
tokenEntries: SubscriptionDisabledTokenEntry[];
|
|
11
|
+
org: string;
|
|
12
|
+
repo: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
private handleDisabledToken;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=SubscriptionDisabledIssueUseCase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionDisabledIssueUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/SubscriptionDisabledIssueUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,qBAAa,gCAAgC;IAEzC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,IAAI,CACpC,eAAe,EACf,aAAa,GAAG,gBAAgB,GAAG,oBAAoB,CACxD;IAGH,GAAG,GAAU,OAAO;QAClB,YAAY,EAAE,8BAA8B,EAAE,CAAC;QAC/C,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,KAAG,OAAO,CAAC,IAAI,CAAC,CAaf;IAEF,OAAO,CAAC,mBAAmB,CAsCzB;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriagerApprovalDispatchUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/TriagerApprovalDispatchUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAsF3E,qBAAa,8BAA8B;IAEvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAQlC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAIhC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;gBAZtB,iBAAiB,EAAE,IAAI,CACtC,iBAAiB,EACf,oBAAoB,GACpB,YAAY,GACZ,aAAa,GACb,UAAU,GACV,iBAAiB,CACpB,EACgB,eAAe,EAAE,IAAI,CACpC,eAAe,EACf,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,oBAAoB,CACvE,EACgB,sBAAsB,EAAE,IAAI,CAC3C,sBAAsB,EACtB,sBAAsB,GAAG,eAAe,CACzC;IAGH,GAAG,GAAU,QAAQ;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACtC,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"TriagerApprovalDispatchUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/TriagerApprovalDispatchUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAsF3E,qBAAa,8BAA8B;IAEvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAQlC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAIhC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;gBAZtB,iBAAiB,EAAE,IAAI,CACtC,iBAAiB,EACf,oBAAoB,GACpB,YAAY,GACZ,aAAa,GACb,UAAU,GACV,iBAAiB,CACpB,EACgB,eAAe,EAAE,IAAI,CACpC,eAAe,EACf,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,oBAAoB,CACvE,EACgB,sBAAsB,EAAE,IAAI,CAC3C,sBAAsB,EACtB,sBAAsB,GAAG,eAAe,CACzC;IAGH,GAAG,GAAU,QAAQ;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACtC,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAG,OAAO,CAAC,IAAI,CAAC,CAgKf;CACH"}
|