@hardlydifficult/repo-processor 1.0.141 → 1.0.142
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/README.md +126 -274
- package/dist/GitYamlStore.d.ts +27 -40
- package/dist/GitYamlStore.d.ts.map +1 -1
- package/dist/GitYamlStore.js +155 -142
- package/dist/GitYamlStore.js.map +1 -1
- package/dist/RepoProcessor.d.ts +22 -22
- package/dist/RepoProcessor.d.ts.map +1 -1
- package/dist/RepoProcessor.js +188 -103
- package/dist/RepoProcessor.js.map +1 -1
- package/dist/RepoWatcher.d.ts +19 -62
- package/dist/RepoWatcher.d.ts.map +1 -1
- package/dist/RepoWatcher.js +74 -103
- package/dist/RepoWatcher.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +42 -0
- package/dist/internalTypes.d.ts.map +1 -0
- package/dist/internalTypes.js +3 -0
- package/dist/internalTypes.js.map +1 -0
- package/dist/resolveDirectories.d.ts +3 -12
- package/dist/resolveDirectories.d.ts.map +1 -1
- package/dist/resolveDirectories.js +9 -24
- package/dist/resolveDirectories.js.map +1 -1
- package/dist/types.d.ts +66 -56
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -11
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @hardlydifficult/repo-processor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Opinionated GitHub repo processing with git-backed YAML results.
|
|
4
|
+
|
|
5
|
+
The package is built around one happy path:
|
|
6
|
+
|
|
7
|
+
1. Open a processor for one source repo.
|
|
8
|
+
2. Describe how to turn files and directories into results.
|
|
9
|
+
3. Run it or attach a watcher.
|
|
4
10
|
|
|
5
11
|
## Installation
|
|
6
12
|
|
|
@@ -11,316 +17,162 @@ npm install @hardlydifficult/repo-processor
|
|
|
11
17
|
## Quick Start
|
|
12
18
|
|
|
13
19
|
```typescript
|
|
14
|
-
import { RepoProcessor
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Create and run the processor
|
|
43
|
-
const processor = new RepoProcessor({
|
|
44
|
-
githubClient: github,
|
|
45
|
-
store,
|
|
46
|
-
callbacks,
|
|
47
|
-
concurrency: 5, // Optional: default 5
|
|
48
|
-
branch: "main", // Optional: default "main"
|
|
20
|
+
import { RepoProcessor } from "@hardlydifficult/repo-processor";
|
|
21
|
+
|
|
22
|
+
const processor = await RepoProcessor.open({
|
|
23
|
+
repo: "hardlydifficult/typescript",
|
|
24
|
+
ref: "main",
|
|
25
|
+
results: {
|
|
26
|
+
repo: "hardlydifficult/repo-data",
|
|
27
|
+
directory: "./repo-data",
|
|
28
|
+
},
|
|
29
|
+
include(file) {
|
|
30
|
+
return file.path.endsWith(".ts");
|
|
31
|
+
},
|
|
32
|
+
async processFile(file) {
|
|
33
|
+
return {
|
|
34
|
+
path: file.path,
|
|
35
|
+
sha: file.sha,
|
|
36
|
+
length: file.content.length,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
async processDirectory(directory) {
|
|
40
|
+
return {
|
|
41
|
+
path: directory.path,
|
|
42
|
+
fileCount: directory.files.length,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
49
45
|
});
|
|
50
46
|
|
|
51
|
-
const result = await processor.run(
|
|
52
|
-
|
|
47
|
+
const result = await processor.run({
|
|
48
|
+
onProgress(progress) {
|
|
49
|
+
console.log(progress.phase, progress.message);
|
|
50
|
+
},
|
|
53
51
|
});
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
console.log(result);
|
|
56
54
|
// {
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
55
|
+
// repo: "hardlydifficult/typescript",
|
|
56
|
+
// sourceSha: "...",
|
|
57
|
+
// processedFiles: 12,
|
|
58
|
+
// removedFiles: 0,
|
|
59
|
+
// processedDirectories: 5
|
|
60
60
|
// }
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
##
|
|
64
|
-
|
|
65
|
-
Processes GitHub repositories incrementally by fetching file trees, detecting changes via SHA diffing, and persisting results.
|
|
63
|
+
## Why This API
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
- `RepoProcessor.open()` binds the source repo once.
|
|
66
|
+
- `run()` does not ask for `owner` and `repo` again.
|
|
67
|
+
- GitHub auth and git-backed YAML persistence are built in.
|
|
68
|
+
- The default results layout is `repos/<owner>/<repo>`.
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|-----------|-------------|
|
|
71
|
-
| `githubClient` | GitHub client for fetching trees and file contents |
|
|
72
|
-
| `store` | Persistence layer implementing `ProcessorStore` |
|
|
73
|
-
| `callbacks` | Domain logic callbacks (`shouldProcess`, `processFile`, `processDirectory`) |
|
|
74
|
-
| `concurrency?` | Parallel batch size (default: `5`) |
|
|
75
|
-
| `branch?` | Git branch to fetch from (default: `"main"`) |
|
|
70
|
+
## API
|
|
76
71
|
|
|
77
|
-
### `
|
|
72
|
+
### `await RepoProcessor.open(options)`
|
|
78
73
|
|
|
79
|
-
Processes the repository and returns a summary.
|
|
80
|
-
|
|
81
|
-
**Returns:**
|
|
82
74
|
```typescript
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
interface RepoProcessorOptions<TFileResult, TDirResult = never> {
|
|
76
|
+
repo: string;
|
|
77
|
+
githubToken?: string;
|
|
78
|
+
ref?: string;
|
|
79
|
+
concurrency?: number;
|
|
80
|
+
results: {
|
|
81
|
+
repo: string;
|
|
82
|
+
directory: string;
|
|
83
|
+
root?: string;
|
|
84
|
+
branch?: string;
|
|
85
|
+
gitUser?: { name: string; email: string };
|
|
86
|
+
};
|
|
87
|
+
include?: (file: {
|
|
88
|
+
path: string;
|
|
89
|
+
sha: string;
|
|
90
|
+
size?: number;
|
|
91
|
+
}) => boolean;
|
|
92
|
+
processFile(file: {
|
|
93
|
+
repo: string;
|
|
94
|
+
path: string;
|
|
95
|
+
sha: string;
|
|
96
|
+
content: string;
|
|
97
|
+
}): Promise<TFileResult>;
|
|
98
|
+
processDirectory?: (directory: {
|
|
99
|
+
repo: string;
|
|
100
|
+
path: string;
|
|
101
|
+
sha: string;
|
|
102
|
+
files: readonly string[];
|
|
103
|
+
children: readonly {
|
|
104
|
+
name: string;
|
|
105
|
+
path: string;
|
|
106
|
+
type: "file" | "directory";
|
|
107
|
+
}[];
|
|
108
|
+
}) => Promise<TDirResult>;
|
|
87
109
|
}
|
|
88
110
|
```
|
|
89
111
|
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
const result = await processor.run("hardlydifficult", "typescript", (progress) => {
|
|
93
|
-
console.log(`Phase: ${progress.phase}, Files: ${progress.filesCompleted}/${progress.filesTotal}`);
|
|
94
|
-
});
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Directory Processing
|
|
98
|
-
|
|
99
|
-
Directories are processed bottom-up (deepest first) after all files. Each directory context includes:
|
|
100
|
-
- `path`: Directory path (empty string for root)
|
|
101
|
-
- `sha`: Git tree SHA
|
|
102
|
-
- `subtreeFilePaths`: All file paths beneath the directory
|
|
103
|
-
- `children`: Immediate children (files and subdirectories)
|
|
104
|
-
- `tree`: Full repo tree entries
|
|
112
|
+
Notes:
|
|
105
113
|
|
|
106
|
-
|
|
114
|
+
- `repo` and `results.repo` accept either `owner/repo` or a GitHub URL.
|
|
115
|
+
- `githubToken` defaults to `GH_PAT`, then `GITHUB_TOKEN`.
|
|
116
|
+
- `results.root` defaults to `"repos"`.
|
|
117
|
+
- `results.branch` defaults to the checked-out branch in the results clone.
|
|
118
|
+
- `results.gitUser` defaults to local git config (`user.name` and `user.email`).
|
|
107
119
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
### Constructor
|
|
120
|
+
### `await processor.run({ onProgress? })`
|
|
111
121
|
|
|
112
122
|
```typescript
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
onEvent?: (event: StateTrackerEvent) => void;
|
|
121
|
-
maxAttempts?: number; // Retry attempts (default: 1)
|
|
122
|
-
}
|
|
123
|
+
type RepoProcessorRunResult = {
|
|
124
|
+
repo: string;
|
|
125
|
+
sourceSha: string;
|
|
126
|
+
processedFiles: number;
|
|
127
|
+
removedFiles: number;
|
|
128
|
+
processedDirectories: number;
|
|
129
|
+
};
|
|
123
130
|
```
|
|
124
131
|
|
|
125
|
-
### Methods
|
|
126
|
-
|
|
127
|
-
| Method | Description |
|
|
128
|
-
|--------|-------------|
|
|
129
|
-
| `init()` | Load persisted state from disk |
|
|
130
|
-
| `handlePush(owner, name, sha)` | Handle GitHub push event. Queues processing if SHA changed |
|
|
131
|
-
| `trigger(owner, name)` | Manually trigger processing (skips SHA check) |
|
|
132
|
-
| `triggerManual(owner, name)` | Synchronous trigger. Returns `{ success, result }` |
|
|
133
|
-
| `isRunning(owner, name)` | Check if repo is currently processing |
|
|
134
|
-
| `getLastSha(key)` | Get last processed SHA for a repo key |
|
|
135
|
-
| `setLastSha(key, sha)` | Manually set last processed SHA |
|
|
136
|
-
|
|
137
|
-
**Example:**
|
|
138
132
|
```typescript
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
onComplete: (owner, name, result, sha) => {
|
|
147
|
-
console.log(`Processed ${owner}/${name}, SHA: ${sha}`);
|
|
148
|
-
},
|
|
149
|
-
maxAttempts: 3,
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
await watcher.init();
|
|
153
|
-
watcher.handlePush("hardlydifficult", "typescript", "abc123");
|
|
133
|
+
type RepoProcessorProgress = {
|
|
134
|
+
phase: "loading" | "files" | "directories" | "committing";
|
|
135
|
+
message: string;
|
|
136
|
+
files: { total: number; completed: number };
|
|
137
|
+
directories: { total: number; completed: number };
|
|
138
|
+
};
|
|
154
139
|
```
|
|
155
140
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
Persists processing results as YAML files in a git repository.
|
|
159
|
-
|
|
160
|
-
### Constructor
|
|
161
|
-
|
|
162
|
-
| Parameter | Description |
|
|
163
|
-
|-----------|-------------|
|
|
164
|
-
| `cloneUrl` | URL of the git repository to clone/pull |
|
|
165
|
-
| `localPath` | Local directory to clone the repo into |
|
|
166
|
-
| `resultDir` | Function mapping `(owner, repo)` to result subdirectory |
|
|
167
|
-
| `authToken?` | GitHub token for authenticated operations (fallback: `GITHUB_TOKEN` env) |
|
|
168
|
-
| `gitUser` | Git committer identity: `{ name: string, email: string }` |
|
|
169
|
-
|
|
170
|
-
### Result Storage
|
|
141
|
+
If `processDirectory` is omitted, directory diffing and directory result writes are skipped.
|
|
171
142
|
|
|
172
|
-
|
|
173
|
-
- Directory results: `<resultDir>/<dirPath>/dir.yml`
|
|
143
|
+
### Reading Stored Results
|
|
174
144
|
|
|
175
|
-
Each YAML file includes a `sha` field for change detection.
|
|
176
|
-
|
|
177
|
-
**Example:**
|
|
178
145
|
```typescript
|
|
179
|
-
const
|
|
180
|
-
cloneUrl: "https://github.com/owner/repo-data.git",
|
|
181
|
-
localPath: "./data",
|
|
182
|
-
resultDir: (owner, repo) => `results/${owner}/${repo}`,
|
|
183
|
-
gitUser: { name: "Processor Bot", email: "bot@example.com" },
|
|
184
|
-
});
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Typed Load Helpers
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
// Load file result with Zod validation
|
|
191
|
-
const result = await store.loadFileResult(
|
|
192
|
-
"owner",
|
|
193
|
-
"repo",
|
|
146
|
+
const fileResult = await processor.readFileResult(
|
|
194
147
|
"src/index.ts",
|
|
195
|
-
|
|
148
|
+
schema
|
|
196
149
|
);
|
|
197
150
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"repo",
|
|
202
|
-
"src/utils",
|
|
203
|
-
z.object({ path: z.string(), fileCount: z.number() })
|
|
151
|
+
const directoryResult = await processor.readDirectoryResult(
|
|
152
|
+
"src",
|
|
153
|
+
schema
|
|
204
154
|
);
|
|
205
155
|
```
|
|
206
156
|
|
|
207
|
-
##
|
|
208
|
-
|
|
209
|
-
Identifies directories requiring reprocessing by combining SHA-based stale detection with diff-derived stale directories.
|
|
210
|
-
|
|
211
|
-
### Signature
|
|
157
|
+
## Watching A Repo
|
|
212
158
|
|
|
213
159
|
```typescript
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
): Promise<string[]>
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
**Logic:**
|
|
225
|
-
1. Start with stale directories from file diff
|
|
226
|
-
2. Add any directory whose stored SHA is missing or differs from current tree SHA
|
|
227
|
-
3. Always include root directory if missing
|
|
228
|
-
|
|
229
|
-
**Example:**
|
|
230
|
-
```typescript
|
|
231
|
-
const staleDirs = await resolveStaleDirectories(
|
|
232
|
-
"owner",
|
|
233
|
-
"repo",
|
|
234
|
-
["src"], // directories with changed children
|
|
235
|
-
["src/index.ts", "src/utils/helper.ts"],
|
|
236
|
-
treeEntries,
|
|
237
|
-
store
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
// Returns ["src", "src/utils"] if SHAs differ or missing
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
## Types
|
|
244
|
-
|
|
245
|
-
### ProcessorStore Interface
|
|
246
|
-
|
|
247
|
-
| Method | Description |
|
|
248
|
-
|--------|-------------|
|
|
249
|
-
| `ensureReady?(owner, repo)` | One-time init (e.g. clone repo). Optional |
|
|
250
|
-
| `getFileManifest(owner, repo)` | Get manifest of previous file SHAs |
|
|
251
|
-
| `getDirSha(owner, repo, dirPath)` | Get stored directory SHA |
|
|
252
|
-
| `writeFileResult(owner, repo, path, sha, result)` | Persist file result |
|
|
253
|
-
| `writeDirResult(owner, repo, path, sha, result)` | Persist directory result |
|
|
254
|
-
| `deleteFileResult(owner, repo, path)` | Delete result for removed file |
|
|
255
|
-
| `commitBatch(owner, repo, count)` | Commit changes |
|
|
256
|
-
|
|
257
|
-
### Callback Interfaces
|
|
258
|
-
|
|
259
|
-
```typescript
|
|
260
|
-
interface FileContext {
|
|
261
|
-
entry: TreeEntry;
|
|
262
|
-
content: string;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
interface DirectoryContext {
|
|
266
|
-
path: string;
|
|
267
|
-
sha: string;
|
|
268
|
-
subtreeFilePaths: readonly string[];
|
|
269
|
-
children: readonly DirectoryChild[];
|
|
270
|
-
tree: readonly TreeEntry[];
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
interface DirectoryChild {
|
|
274
|
-
name: string;
|
|
275
|
-
isDir: boolean;
|
|
276
|
-
fullPath: string;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface ProcessorCallbacks {
|
|
280
|
-
shouldProcess(entry: TreeEntry): boolean;
|
|
281
|
-
processFile(ctx: FileContext): Promise<unknown>;
|
|
282
|
-
processDirectory(ctx: DirectoryContext): Promise<unknown>;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
interface ProcessingProgress {
|
|
286
|
-
phase: "loading" | "files" | "directories" | "committing";
|
|
287
|
-
message: string;
|
|
288
|
-
filesTotal: number;
|
|
289
|
-
filesCompleted: number;
|
|
290
|
-
dirsTotal: number;
|
|
291
|
-
dirsCompleted: number;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
interface ProcessingResult {
|
|
295
|
-
filesProcessed: number;
|
|
296
|
-
filesRemoved: number;
|
|
297
|
-
dirsProcessed: number;
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
## Error Handling
|
|
302
|
-
|
|
303
|
-
File and directory processing failures throw descriptive errors:
|
|
160
|
+
const watcher = await processor.watch({
|
|
161
|
+
stateDirectory: "./state",
|
|
162
|
+
maxAttempts: 3,
|
|
163
|
+
onComplete(result, sha) {
|
|
164
|
+
console.log("processed", sha, result.processedFiles);
|
|
165
|
+
},
|
|
166
|
+
});
|
|
304
167
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
await processor.run("owner", "repo");
|
|
308
|
-
} catch (error) {
|
|
309
|
-
// Error includes all failed paths and messages
|
|
310
|
-
// e.g., "2 file(s) failed to process:\nfile1.ts: Connection timeout\nfile2.ts: Invalid format"
|
|
311
|
-
}
|
|
168
|
+
watcher.handlePush("abc123");
|
|
169
|
+
await watcher.runNow();
|
|
312
170
|
```
|
|
313
171
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
`RepoWatcher` includes automatic retries for transient failures:
|
|
172
|
+
Watcher methods:
|
|
317
173
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
console.error(`Failed for ${owner}/${name}: ${error}`);
|
|
324
|
-
},
|
|
325
|
-
});
|
|
326
|
-
```
|
|
174
|
+
- `handlePush(sha)`
|
|
175
|
+
- `runNow()`
|
|
176
|
+
- `isRunning()`
|
|
177
|
+
- `getLastSha()`
|
|
178
|
+
- `setLastSha(sha)`
|
package/dist/GitYamlStore.d.ts
CHANGED
|
@@ -1,55 +1,42 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
-
import type { FileManifest,
|
|
2
|
+
import type { BoundRepoRef, FileManifest, ResultsStore } from "./internalTypes.js";
|
|
3
|
+
import type { GitIdentity } from "./types.js";
|
|
3
4
|
export interface GitYamlStoreConfig {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Local directory to clone the repo into. */
|
|
5
|
+
sourceRepo: BoundRepoRef;
|
|
6
|
+
resultsRepo: BoundRepoRef;
|
|
7
7
|
localPath: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** GitHub token for authenticated clone/push. Falls back to GITHUB_TOKEN env. */
|
|
8
|
+
root: string;
|
|
9
|
+
branch?: string;
|
|
11
10
|
authToken?: string;
|
|
12
|
-
|
|
13
|
-
gitUser: {
|
|
14
|
-
name: string;
|
|
15
|
-
email: string;
|
|
16
|
-
};
|
|
11
|
+
gitUser?: GitIdentity;
|
|
17
12
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* File results are stored at `<resultDir>/<filePath>.yml`.
|
|
23
|
-
* Directory results are stored at `<resultDir>/<dirPath>/dir.yml`.
|
|
24
|
-
* Each YAML file includes a `sha` field for change detection.
|
|
25
|
-
*/
|
|
26
|
-
export declare class GitYamlStore implements ProcessorStore {
|
|
27
|
-
private readonly localPath;
|
|
13
|
+
/** Persists file and directory processing results as YAML in a Git repo. */
|
|
14
|
+
export declare class GitYamlStore implements ResultsStore {
|
|
15
|
+
private readonly sourceRepo;
|
|
28
16
|
private readonly cloneUrl;
|
|
17
|
+
private readonly localPath;
|
|
18
|
+
private readonly root;
|
|
29
19
|
private readonly authToken;
|
|
30
|
-
private readonly
|
|
31
|
-
private readonly
|
|
20
|
+
private readonly requestedBranch;
|
|
21
|
+
private readonly configuredGitUser;
|
|
32
22
|
private initialized;
|
|
23
|
+
private activeBranch;
|
|
24
|
+
private gitUser;
|
|
33
25
|
constructor(config: GitYamlStoreConfig);
|
|
34
26
|
ensureReady(): Promise<void>;
|
|
35
|
-
getFileManifest(
|
|
36
|
-
getDirSha(
|
|
37
|
-
writeFileResult(
|
|
38
|
-
writeDirResult(
|
|
39
|
-
deleteFileResult(
|
|
40
|
-
commitBatch(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* Returns null if the file doesn't exist or fails validation.
|
|
44
|
-
*/
|
|
45
|
-
loadFileResult<T>(owner: string, repo: string, filePath: string, schema: z.ZodType<T>): Promise<T | null>;
|
|
46
|
-
/**
|
|
47
|
-
* Load a directory result, parsed and validated with the given Zod schema.
|
|
48
|
-
* Returns null if the file doesn't exist or fails validation.
|
|
49
|
-
*/
|
|
50
|
-
loadDirResult<T>(owner: string, repo: string, dirPath: string, schema: z.ZodType<T>): Promise<T | null>;
|
|
27
|
+
getFileManifest(): Promise<FileManifest>;
|
|
28
|
+
getDirSha(dirPath: string): Promise<string | null>;
|
|
29
|
+
writeFileResult(filePath: string, sha: string, result: unknown): Promise<void>;
|
|
30
|
+
writeDirResult(dirPath: string, sha: string, result: unknown): Promise<void>;
|
|
31
|
+
deleteFileResult(filePath: string): Promise<void>;
|
|
32
|
+
commitBatch(sourceRepo: string, count: number): Promise<void>;
|
|
33
|
+
readFileResult<T>(filePath: string, schema: z.ZodType<T>): Promise<T | null>;
|
|
34
|
+
readDirectoryResult<T>(dirPath: string, schema: z.ZodType<T>): Promise<T | null>;
|
|
51
35
|
private getResultDir;
|
|
52
36
|
private getAuthenticatedUrl;
|
|
37
|
+
private resolveBranch;
|
|
38
|
+
private checkoutBranch;
|
|
39
|
+
private resolveGitUser;
|
|
53
40
|
private walkDir;
|
|
54
41
|
}
|
|
55
42
|
//# sourceMappingURL=GitYamlStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitYamlStore.d.ts","sourceRoot":"","sources":["../src/GitYamlStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GitYamlStore.d.ts","sourceRoot":"","sources":["../src/GitYamlStore.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACb,MAAM,oBAAo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