github-issue-tower-defence-management 1.42.3 → 1.43.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 +20 -0
- package/bin/adapter/entry-points/cli/index.js +2 -2
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/repositories/GoogleSpreadsheetRepository.js +25 -21
- package/bin/adapter/repositories/GoogleSpreadsheetRepository.js.map +1 -1
- package/bin/adapter/repositories/OauthAPIProxyClaudeRepository.js +27 -0
- package/bin/adapter/repositories/OauthAPIProxyClaudeRepository.js.map +1 -0
- package/bin/adapter/repositories/OauthProxyClaudeRepository.js +77 -0
- package/bin/adapter/repositories/OauthProxyClaudeRepository.js.map +1 -0
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.ts +2 -2
- package/src/adapter/repositories/GoogleSpreadsheetRepository.integration.test.ts +120 -0
- package/src/adapter/repositories/GoogleSpreadsheetRepository.test.ts +273 -71
- package/src/adapter/repositories/GoogleSpreadsheetRepository.ts +82 -20
- package/src/adapter/repositories/OauthAPIProxyClaudeRepository.test.ts +166 -0
- package/src/adapter/repositories/OauthAPIProxyClaudeRepository.ts +32 -0
- package/src/adapter/repositories/OauthProxyClaudeRepository.test.ts +231 -0
- package/src/adapter/repositories/OauthProxyClaudeRepository.ts +97 -0
- package/types/adapter/repositories/GoogleSpreadsheetRepository.d.ts +67 -1
- package/types/adapter/repositories/GoogleSpreadsheetRepository.d.ts.map +1 -1
- package/types/adapter/repositories/OauthAPIProxyClaudeRepository.d.ts +10 -0
- package/types/adapter/repositories/OauthAPIProxyClaudeRepository.d.ts.map +1 -0
- package/types/adapter/repositories/OauthProxyClaudeRepository.d.ts +9 -0
- package/types/adapter/repositories/OauthProxyClaudeRepository.d.ts.map +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ClaudeRepository } from '../../domain/usecases/adapter-interfaces/ClaudeRepository';
|
|
2
|
+
import { ClaudeWindowUsage } from '../../domain/entities/ClaudeWindowUsage';
|
|
3
|
+
import { OauthProxyClaudeRepository } from './OauthProxyClaudeRepository';
|
|
4
|
+
import { OauthAPIClaudeRepository } from './OauthAPIClaudeRepository';
|
|
5
|
+
|
|
6
|
+
export class OauthAPIProxyClaudeRepository implements ClaudeRepository {
|
|
7
|
+
constructor(
|
|
8
|
+
private readonly proxyRepository: Pick<
|
|
9
|
+
ClaudeRepository,
|
|
10
|
+
'getUsage'
|
|
11
|
+
> = new OauthProxyClaudeRepository(),
|
|
12
|
+
private readonly apiRepository: ClaudeRepository = new OauthAPIClaudeRepository(),
|
|
13
|
+
) {}
|
|
14
|
+
|
|
15
|
+
async getUsage(): Promise<ClaudeWindowUsage[]> {
|
|
16
|
+
const proxyUsages = await this.proxyRepository.getUsage();
|
|
17
|
+
if (proxyUsages.length > 0) {
|
|
18
|
+
return proxyUsages;
|
|
19
|
+
}
|
|
20
|
+
return this.apiRepository.getUsage();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async isClaudeAvailable(threshold: number): Promise<boolean> {
|
|
24
|
+
const proxyUsages = await this.proxyRepository.getUsage();
|
|
25
|
+
if (proxyUsages.length > 0) {
|
|
26
|
+
return proxyUsages.every(
|
|
27
|
+
(usage) => usage.utilizationPercentage < threshold,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return this.apiRepository.isClaudeAvailable(threshold);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
jest.mock('fs');
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import { OauthProxyClaudeRepository } from './OauthProxyClaudeRepository';
|
|
5
|
+
import { ClaudeWindowUsage } from '../../domain/entities/ClaudeWindowUsage';
|
|
6
|
+
|
|
7
|
+
describe('OauthProxyClaudeRepository', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
jest.resetAllMocks();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('getUsage', () => {
|
|
13
|
+
interface TestCase {
|
|
14
|
+
name: string;
|
|
15
|
+
fileExists: boolean;
|
|
16
|
+
fileContent: string | null;
|
|
17
|
+
expected: ClaudeWindowUsage[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const testCases: TestCase[] = [
|
|
21
|
+
{
|
|
22
|
+
name: 'returns empty array when file does not exist',
|
|
23
|
+
fileExists: false,
|
|
24
|
+
fileContent: null,
|
|
25
|
+
expected: [],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'returns empty array when file content is invalid JSON',
|
|
29
|
+
fileExists: true,
|
|
30
|
+
fileContent: 'invalid-json',
|
|
31
|
+
expected: [],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'returns empty array when file has no headers property',
|
|
35
|
+
fileExists: true,
|
|
36
|
+
fileContent: JSON.stringify({ ts: 1234567890 }),
|
|
37
|
+
expected: [],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'returns 5h usage from proxy file',
|
|
41
|
+
fileExists: true,
|
|
42
|
+
fileContent: JSON.stringify({
|
|
43
|
+
headers: {
|
|
44
|
+
'anthropic-ratelimit-unified-5h-utilization': '0.23',
|
|
45
|
+
'anthropic-ratelimit-unified-5h-reset': '1772575200',
|
|
46
|
+
},
|
|
47
|
+
ts: 1234567890,
|
|
48
|
+
}),
|
|
49
|
+
expected: [
|
|
50
|
+
{
|
|
51
|
+
hour: 5,
|
|
52
|
+
utilizationPercentage: 23,
|
|
53
|
+
resetsAt: new Date(1772575200 * 1000),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'returns 7d usage from proxy file',
|
|
59
|
+
fileExists: true,
|
|
60
|
+
fileContent: JSON.stringify({
|
|
61
|
+
headers: {
|
|
62
|
+
'anthropic-ratelimit-unified-7d-utilization': '0.34',
|
|
63
|
+
'anthropic-ratelimit-unified-7d-reset': '1772769600',
|
|
64
|
+
},
|
|
65
|
+
ts: 1234567890,
|
|
66
|
+
}),
|
|
67
|
+
expected: [
|
|
68
|
+
{
|
|
69
|
+
hour: 168,
|
|
70
|
+
utilizationPercentage: 34,
|
|
71
|
+
resetsAt: new Date(1772769600 * 1000),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'returns both 5h and 7d usage from proxy file',
|
|
77
|
+
fileExists: true,
|
|
78
|
+
fileContent: JSON.stringify({
|
|
79
|
+
headers: {
|
|
80
|
+
'anthropic-ratelimit-unified-5h-utilization': '0.23',
|
|
81
|
+
'anthropic-ratelimit-unified-5h-reset': '1772575200',
|
|
82
|
+
'anthropic-ratelimit-unified-7d-utilization': '0.34',
|
|
83
|
+
'anthropic-ratelimit-unified-7d-reset': '1772769600',
|
|
84
|
+
},
|
|
85
|
+
ts: 1234567890,
|
|
86
|
+
}),
|
|
87
|
+
expected: [
|
|
88
|
+
{
|
|
89
|
+
hour: 5,
|
|
90
|
+
utilizationPercentage: 23,
|
|
91
|
+
resetsAt: new Date(1772575200 * 1000),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
hour: 168,
|
|
95
|
+
utilizationPercentage: 34,
|
|
96
|
+
resetsAt: new Date(1772769600 * 1000),
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'skips utilization entries with non-numeric header values',
|
|
102
|
+
fileExists: true,
|
|
103
|
+
fileContent: JSON.stringify({
|
|
104
|
+
headers: {
|
|
105
|
+
'anthropic-ratelimit-unified-5h-utilization': 'unknown',
|
|
106
|
+
'anthropic-ratelimit-unified-7d-utilization': '0.34',
|
|
107
|
+
'anthropic-ratelimit-unified-7d-reset': '1772769600',
|
|
108
|
+
},
|
|
109
|
+
ts: 1234567890,
|
|
110
|
+
}),
|
|
111
|
+
expected: [
|
|
112
|
+
{
|
|
113
|
+
hour: 168,
|
|
114
|
+
utilizationPercentage: 34,
|
|
115
|
+
resetsAt: new Date(1772769600 * 1000),
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
test.each(testCases)(
|
|
122
|
+
'$name',
|
|
123
|
+
async ({ fileExists, fileContent, expected }) => {
|
|
124
|
+
jest.mocked(fs.existsSync).mockReturnValue(fileExists);
|
|
125
|
+
if (fileContent !== null) {
|
|
126
|
+
jest.mocked(fs.readFileSync).mockReturnValue(fileContent);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const repository = new OauthProxyClaudeRepository(
|
|
130
|
+
'/tmp/test-claude-ratelimit.json',
|
|
131
|
+
);
|
|
132
|
+
const result = await repository.getUsage();
|
|
133
|
+
|
|
134
|
+
expect(result).toEqual(expected);
|
|
135
|
+
},
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe('isClaudeAvailable', () => {
|
|
140
|
+
interface TestCase {
|
|
141
|
+
name: string;
|
|
142
|
+
fileExists: boolean;
|
|
143
|
+
fileContent: string | null;
|
|
144
|
+
threshold: number;
|
|
145
|
+
expected: boolean;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const testCases: TestCase[] = [
|
|
149
|
+
{
|
|
150
|
+
name: 'returns false when no proxy data available',
|
|
151
|
+
fileExists: false,
|
|
152
|
+
fileContent: null,
|
|
153
|
+
threshold: 90,
|
|
154
|
+
expected: false,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'returns true when all usages are under threshold',
|
|
158
|
+
fileExists: true,
|
|
159
|
+
fileContent: JSON.stringify({
|
|
160
|
+
headers: {
|
|
161
|
+
'anthropic-ratelimit-unified-5h-utilization': '0.50',
|
|
162
|
+
'anthropic-ratelimit-unified-5h-reset': '1772575200',
|
|
163
|
+
'anthropic-ratelimit-unified-7d-utilization': '0.30',
|
|
164
|
+
'anthropic-ratelimit-unified-7d-reset': '1772769600',
|
|
165
|
+
},
|
|
166
|
+
ts: 1234567890,
|
|
167
|
+
}),
|
|
168
|
+
threshold: 90,
|
|
169
|
+
expected: true,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'returns false when 5h usage is above threshold',
|
|
173
|
+
fileExists: true,
|
|
174
|
+
fileContent: JSON.stringify({
|
|
175
|
+
headers: {
|
|
176
|
+
'anthropic-ratelimit-unified-5h-utilization': '0.95',
|
|
177
|
+
'anthropic-ratelimit-unified-5h-reset': '1772575200',
|
|
178
|
+
},
|
|
179
|
+
ts: 1234567890,
|
|
180
|
+
}),
|
|
181
|
+
threshold: 90,
|
|
182
|
+
expected: false,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'returns false when 7d usage is above threshold',
|
|
186
|
+
fileExists: true,
|
|
187
|
+
fileContent: JSON.stringify({
|
|
188
|
+
headers: {
|
|
189
|
+
'anthropic-ratelimit-unified-5h-utilization': '0.50',
|
|
190
|
+
'anthropic-ratelimit-unified-5h-reset': '1772575200',
|
|
191
|
+
'anthropic-ratelimit-unified-7d-utilization': '0.95',
|
|
192
|
+
'anthropic-ratelimit-unified-7d-reset': '1772769600',
|
|
193
|
+
},
|
|
194
|
+
ts: 1234567890,
|
|
195
|
+
}),
|
|
196
|
+
threshold: 90,
|
|
197
|
+
expected: false,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'returns false when usage equals threshold',
|
|
201
|
+
fileExists: true,
|
|
202
|
+
fileContent: JSON.stringify({
|
|
203
|
+
headers: {
|
|
204
|
+
'anthropic-ratelimit-unified-5h-utilization': '0.90',
|
|
205
|
+
'anthropic-ratelimit-unified-5h-reset': '1772575200',
|
|
206
|
+
},
|
|
207
|
+
ts: 1234567890,
|
|
208
|
+
}),
|
|
209
|
+
threshold: 90,
|
|
210
|
+
expected: false,
|
|
211
|
+
},
|
|
212
|
+
];
|
|
213
|
+
|
|
214
|
+
test.each(testCases)(
|
|
215
|
+
'$name',
|
|
216
|
+
async ({ fileExists, fileContent, threshold, expected }) => {
|
|
217
|
+
jest.mocked(fs.existsSync).mockReturnValue(fileExists);
|
|
218
|
+
if (fileContent !== null) {
|
|
219
|
+
jest.mocked(fs.readFileSync).mockReturnValue(fileContent);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const repository = new OauthProxyClaudeRepository(
|
|
223
|
+
'/tmp/test-claude-ratelimit.json',
|
|
224
|
+
);
|
|
225
|
+
const result = await repository.isClaudeAvailable(threshold);
|
|
226
|
+
|
|
227
|
+
expect(result).toBe(expected);
|
|
228
|
+
},
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ClaudeRepository } from '../../domain/usecases/adapter-interfaces/ClaudeRepository';
|
|
2
|
+
import { ClaudeWindowUsage } from '../../domain/entities/ClaudeWindowUsage';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
|
|
5
|
+
type ProxyFileHeaders = {
|
|
6
|
+
'anthropic-ratelimit-unified-5h-utilization'?: string;
|
|
7
|
+
'anthropic-ratelimit-unified-7d-utilization'?: string;
|
|
8
|
+
'anthropic-ratelimit-unified-5h-reset'?: string;
|
|
9
|
+
'anthropic-ratelimit-unified-7d-reset'?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type ProxyFile = {
|
|
13
|
+
headers?: ProxyFileHeaders;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const isProxyFile = (value: unknown): value is ProxyFile => {
|
|
17
|
+
if (typeof value !== 'object' || value === null) return false;
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class OauthProxyClaudeRepository implements ClaudeRepository {
|
|
22
|
+
private readonly filePath: string;
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
filePath: string = process.env['CLAUDE_RATELIMIT_FILE'] ??
|
|
26
|
+
'/tmp/claude-ratelimit.json',
|
|
27
|
+
) {
|
|
28
|
+
this.filePath = filePath;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async getUsage(): Promise<ClaudeWindowUsage[]> {
|
|
32
|
+
if (!fs.existsSync(this.filePath)) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let parsed: unknown;
|
|
37
|
+
try {
|
|
38
|
+
const content = fs.readFileSync(this.filePath, 'utf-8');
|
|
39
|
+
parsed = JSON.parse(content);
|
|
40
|
+
} catch {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!isProxyFile(parsed)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const headers = parsed.headers;
|
|
49
|
+
if (!headers) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const usages: ClaudeWindowUsage[] = [];
|
|
54
|
+
|
|
55
|
+
const fiveHourUtilization =
|
|
56
|
+
headers['anthropic-ratelimit-unified-5h-utilization'];
|
|
57
|
+
const fiveHourReset = headers['anthropic-ratelimit-unified-5h-reset'];
|
|
58
|
+
if (fiveHourUtilization !== undefined) {
|
|
59
|
+
const utilizationPercentage = parseFloat(fiveHourUtilization) * 100;
|
|
60
|
+
if (!isNaN(utilizationPercentage)) {
|
|
61
|
+
usages.push({
|
|
62
|
+
hour: 5,
|
|
63
|
+
utilizationPercentage,
|
|
64
|
+
resetsAt: fiveHourReset
|
|
65
|
+
? new Date(parseInt(fiveHourReset, 10) * 1000)
|
|
66
|
+
: new Date(),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const sevenDayUtilization =
|
|
72
|
+
headers['anthropic-ratelimit-unified-7d-utilization'];
|
|
73
|
+
const sevenDayReset = headers['anthropic-ratelimit-unified-7d-reset'];
|
|
74
|
+
if (sevenDayUtilization !== undefined) {
|
|
75
|
+
const utilizationPercentage = parseFloat(sevenDayUtilization) * 100;
|
|
76
|
+
if (!isNaN(utilizationPercentage)) {
|
|
77
|
+
usages.push({
|
|
78
|
+
hour: 168,
|
|
79
|
+
utilizationPercentage,
|
|
80
|
+
resetsAt: sevenDayReset
|
|
81
|
+
? new Date(parseInt(sevenDayReset, 10) * 1000)
|
|
82
|
+
: new Date(),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return usages;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async isClaudeAvailable(threshold: number): Promise<boolean> {
|
|
91
|
+
const usages = await this.getUsage();
|
|
92
|
+
if (usages.length === 0) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return usages.every((usage) => usage.utilizationPercentage < threshold);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -1,13 +1,79 @@
|
|
|
1
1
|
import { SpreadsheetRepository } from '../../domain/usecases/adapter-interfaces/SpreadsheetRepository';
|
|
2
2
|
import { LocalStorageRepository } from './LocalStorageRepository';
|
|
3
|
+
interface SheetsApiClient {
|
|
4
|
+
spreadsheets: {
|
|
5
|
+
get(params: {
|
|
6
|
+
spreadsheetId: string;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
status: number;
|
|
9
|
+
data: {
|
|
10
|
+
sheets?: Array<{
|
|
11
|
+
properties?: {
|
|
12
|
+
title?: string | null;
|
|
13
|
+
} | null;
|
|
14
|
+
}> | null;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
values: {
|
|
18
|
+
get(params: {
|
|
19
|
+
spreadsheetId: string;
|
|
20
|
+
range: string;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
status: number;
|
|
23
|
+
data: {
|
|
24
|
+
values?: unknown[][] | null;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
update(params: {
|
|
28
|
+
spreadsheetId: string;
|
|
29
|
+
range: string;
|
|
30
|
+
valueInputOption: string;
|
|
31
|
+
requestBody: {
|
|
32
|
+
values: string[][];
|
|
33
|
+
};
|
|
34
|
+
}): Promise<{
|
|
35
|
+
status: number;
|
|
36
|
+
data: unknown;
|
|
37
|
+
}>;
|
|
38
|
+
append(params: {
|
|
39
|
+
spreadsheetId: string;
|
|
40
|
+
range: string;
|
|
41
|
+
valueInputOption: string;
|
|
42
|
+
requestBody: {
|
|
43
|
+
values: string[][];
|
|
44
|
+
};
|
|
45
|
+
}): Promise<{
|
|
46
|
+
status: number;
|
|
47
|
+
data: unknown;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
batchUpdate(params: {
|
|
51
|
+
spreadsheetId: string;
|
|
52
|
+
requestBody: {
|
|
53
|
+
requests: Array<{
|
|
54
|
+
addSheet?: {
|
|
55
|
+
properties?: {
|
|
56
|
+
title?: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
}): Promise<{
|
|
62
|
+
status: number;
|
|
63
|
+
data: unknown;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
3
67
|
export declare class GoogleSpreadsheetRepository implements SpreadsheetRepository {
|
|
4
68
|
readonly localStorageRepository: LocalStorageRepository;
|
|
5
69
|
keyFile: string;
|
|
6
|
-
|
|
70
|
+
private readonly sheetsClient;
|
|
71
|
+
constructor(localStorageRepository: LocalStorageRepository, serviceAccountKey?: string, sheetsClientFactory?: () => SheetsApiClient);
|
|
7
72
|
getSpreadsheetId: (spreadsheetUrl: string) => string;
|
|
8
73
|
getSheet: (spreadsheetUrl: string, sheetName: string) => Promise<string[][] | null>;
|
|
9
74
|
updateCell: (spreadsheetUrl: string, sheetName: string, row: number, column: number, value: string) => Promise<void>;
|
|
10
75
|
createNewSheetIfNotExists: (spreadsheetUrl: string, sheetName: string) => Promise<void>;
|
|
11
76
|
appendSheetValues: (spreadsheetUrl: string, sheetName: string, values: string[][]) => Promise<void>;
|
|
12
77
|
}
|
|
78
|
+
export {};
|
|
13
79
|
//# sourceMappingURL=GoogleSpreadsheetRepository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleSpreadsheetRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/GoogleSpreadsheetRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAC;AAEvG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,qBAAa,2BAA4B,YAAW,qBAAqB;
|
|
1
|
+
{"version":3,"file":"GoogleSpreadsheetRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/GoogleSpreadsheetRepository.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClaudeRepository } from '../../domain/usecases/adapter-interfaces/ClaudeRepository';
|
|
2
|
+
import { ClaudeWindowUsage } from '../../domain/entities/ClaudeWindowUsage';
|
|
3
|
+
export declare class OauthAPIProxyClaudeRepository implements ClaudeRepository {
|
|
4
|
+
private readonly proxyRepository;
|
|
5
|
+
private readonly apiRepository;
|
|
6
|
+
constructor(proxyRepository?: Pick<ClaudeRepository, 'getUsage'>, apiRepository?: ClaudeRepository);
|
|
7
|
+
getUsage(): Promise<ClaudeWindowUsage[]>;
|
|
8
|
+
isClaudeAvailable(threshold: number): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=OauthAPIProxyClaudeRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OauthAPIProxyClaudeRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/OauthAPIProxyClaudeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAI5E,qBAAa,6BAA8B,YAAW,gBAAgB;IAElE,OAAO,CAAC,QAAQ,CAAC,eAAe;IAIhC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAJb,eAAe,GAAE,IAAI,CACpC,gBAAgB,EAChB,UAAU,CACwB,EACnB,aAAa,GAAE,gBAAiD;IAG7E,QAAQ,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAQxC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAS7D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ClaudeRepository } from '../../domain/usecases/adapter-interfaces/ClaudeRepository';
|
|
2
|
+
import { ClaudeWindowUsage } from '../../domain/entities/ClaudeWindowUsage';
|
|
3
|
+
export declare class OauthProxyClaudeRepository implements ClaudeRepository {
|
|
4
|
+
private readonly filePath;
|
|
5
|
+
constructor(filePath?: string);
|
|
6
|
+
getUsage(): Promise<ClaudeWindowUsage[]>;
|
|
7
|
+
isClaudeAvailable(threshold: number): Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=OauthProxyClaudeRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OauthProxyClaudeRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/OauthProxyClaudeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAmB5E,qBAAa,0BAA2B,YAAW,gBAAgB;IACjE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAGhC,QAAQ,GAAE,MACoB;IAK1B,QAAQ,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA2DxC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAO7D"}
|