browser-git-ops 0.0.4 → 0.0.5
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 +292 -67
- package/dist/git/abstractAdapter.d.ts +0 -16
- package/dist/git/abstractAdapter.d.ts.map +1 -1
- package/dist/git/githubAdapter.d.ts +2 -74
- package/dist/git/githubAdapter.d.ts.map +1 -1
- package/dist/git/gitlabAdapter.d.ts +3 -94
- package/dist/git/gitlabAdapter.d.ts.map +1 -1
- package/dist/index.js +658 -420
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +658 -420
- package/dist/index.mjs.map +2 -2
- package/dist/virtualfs/indexedDatabaseStorage.d.ts.map +1 -1
- package/dist/virtualfs/inmemoryStorage.d.ts.map +1 -1
- package/dist/virtualfs/metadataManager.d.ts +0 -4
- package/dist/virtualfs/metadataManager.d.ts.map +1 -1
- package/dist/virtualfs/opfsStorage.d.ts.map +1 -1
- package/dist/virtualfs/remoteSynchronizer.d.ts +3 -3
- package/dist/virtualfs/storageBackend.d.ts +2 -2
- package/dist/virtualfs/storageBackend.d.ts.map +1 -1
- package/dist/virtualfs/virtualfs.d.ts +190 -27
- package/dist/virtualfs/virtualfs.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -46,7 +46,7 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
46
46
|
private _parseJsonArray;
|
|
47
47
|
/**
|
|
48
48
|
* GitLab のページングヘッダを解析します(x-next-page / x-total-pages)。
|
|
49
|
-
|
|
49
|
+
* @returns {{nextPage?: number, lastPage?: number}} ページ番号情報
|
|
50
50
|
*/
|
|
51
51
|
private _parsePagingHeaders;
|
|
52
52
|
/**
|
|
@@ -55,11 +55,6 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
55
55
|
* @returns {import('./adapter').CommitSummary}
|
|
56
56
|
*/
|
|
57
57
|
private _mapGitLabCommitToSummary;
|
|
58
|
-
/**
|
|
59
|
-
* コンテンツから sha1 を算出します。
|
|
60
|
-
* @param {string} content コンテンツ
|
|
61
|
-
* @returns {string} sha1 ハッシュ
|
|
62
|
-
*/
|
|
63
58
|
/**
|
|
64
59
|
* 変更一覧から blob sha のマップを作成します(疑似実装)。
|
|
65
60
|
* @param {any[]} changes 変更一覧
|
|
@@ -101,9 +96,6 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
101
96
|
path: string;
|
|
102
97
|
content?: string;
|
|
103
98
|
}>, expectedParentSha?: string): Promise<any>;
|
|
104
|
-
/**
|
|
105
|
-
* Retrieve project metadata (default branch, name, id) and cache it.
|
|
106
|
-
*/
|
|
107
99
|
/**
|
|
108
100
|
* Retrieve project metadata (default branch, name, id) and cache it.
|
|
109
101
|
* @returns {Promise<import('../virtualfs/types.ts').RepositoryMetadata>} repository metadata
|
|
@@ -155,14 +147,9 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
155
147
|
private _mapBranchItems;
|
|
156
148
|
/**
|
|
157
149
|
* Convert change descriptors to GitLab API actions
|
|
158
|
-
|
|
150
|
+
* @returns {Array<any>} API-compatible actions array
|
|
159
151
|
*/
|
|
160
152
|
private createActions;
|
|
161
|
-
/**
|
|
162
|
-
* Verify remote branch head matches expected parent SHA.
|
|
163
|
-
* @throws Error if non-fast-forward
|
|
164
|
-
* @returns {Promise<void>}
|
|
165
|
-
*/
|
|
166
153
|
/**
|
|
167
154
|
* Verify that remote branch head matches expected parent SHA.
|
|
168
155
|
* Throws when non-fast-forward detected.
|
|
@@ -177,10 +164,6 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
177
164
|
* @returns {any} parsed commit id/object
|
|
178
165
|
*/
|
|
179
166
|
private parseCommitResponse;
|
|
180
|
-
/**
|
|
181
|
-
* Post commit request and parse response
|
|
182
|
-
* @returns {Promise<any>}
|
|
183
|
-
*/
|
|
184
167
|
/**
|
|
185
168
|
* Post commit request and return parsed commit response.
|
|
186
169
|
* @param {string} url endpoint URL
|
|
@@ -188,50 +171,17 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
188
171
|
* @returns {Promise<any>} parsed commit response
|
|
189
172
|
*/
|
|
190
173
|
private postCommit;
|
|
191
|
-
/**
|
|
192
|
-
* fetch をリトライ付きで実行します。
|
|
193
|
-
* @param {string} url リクエスト URL
|
|
194
|
-
* @param {RequestInit} opts fetch オプション
|
|
195
|
-
* @param {number} [retries] 最大リトライ回数
|
|
196
|
-
* @returns {Promise<Response>} レスポンス
|
|
197
|
-
*/
|
|
198
|
-
/**
|
|
199
|
-
* Wait helper for fetch retry backoff.
|
|
200
|
-
* @param attempt Attempt number
|
|
201
|
-
* @returns {Promise<void>} resolves after backoff
|
|
202
|
-
*/
|
|
203
174
|
/**
|
|
204
175
|
* Wait helper for retry backoff.
|
|
205
176
|
* @param {number} attempt attempt number
|
|
206
177
|
* @returns {Promise<void>}
|
|
207
178
|
*/
|
|
208
179
|
private _waitAttempt;
|
|
209
|
-
/**
|
|
210
|
-
* ステータスが再試行対象か判定します。
|
|
211
|
-
* @param {number} status ステータスコード
|
|
212
|
-
* @returns {boolean}
|
|
213
|
-
*/
|
|
214
|
-
/**
|
|
215
|
-
* バックオフ時間を計算します。
|
|
216
|
-
* @param {number} attempt 試行回数(1..)
|
|
217
|
-
* @returns {number} ミリ秒
|
|
218
|
-
*/
|
|
219
|
-
/**
|
|
220
|
-
* 並列マッピングユーティリティ
|
|
221
|
-
* @template T, R
|
|
222
|
-
* @param {T[]} items 入力配列
|
|
223
|
-
* @param {(t:T)=>Promise<R>} mapper マッピング関数
|
|
224
|
-
* @param {number} concurrency 同時実行数
|
|
225
|
-
* @returns {Promise<R[]>}
|
|
226
|
-
*/
|
|
227
180
|
/**
|
|
228
181
|
* Prepare JSON body for commit API call.
|
|
229
182
|
* @returns {string} JSON body
|
|
230
183
|
*/
|
|
231
184
|
private _prepareCommitBody;
|
|
232
|
-
/**
|
|
233
|
-
* Optionally verify parent SHA; swallow non-422 errors.
|
|
234
|
-
*/
|
|
235
185
|
/**
|
|
236
186
|
* Optionally verify parent SHA; rethrow errors after logging.
|
|
237
187
|
* @param {string} expectedParentSha expected SHA
|
|
@@ -242,35 +192,21 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
242
192
|
/**
|
|
243
193
|
* リポジトリのスナップショットを取得します。
|
|
244
194
|
* @param {string} branch ブランチ名 (default: 'main')
|
|
245
|
-
|
|
195
|
+
* @returns {Promise<{headSha:string,shas:Record<string,string>,fetchContent:(paths:string[])=>Promise<Record<string,string>>}>}
|
|
246
196
|
*/
|
|
247
197
|
fetchSnapshot(branch?: string, concurrency?: number): Promise<any>;
|
|
248
|
-
/**
|
|
249
|
-
* Determine the remote head SHA for a branch. Falls back to branch name on error.
|
|
250
|
-
* @param {string} branch Branch name
|
|
251
|
-
* @returns {Promise<string>} head SHA or branch
|
|
252
|
-
*/
|
|
253
198
|
/**
|
|
254
199
|
* Determine the head SHA for a branch; fallback to branch name if unavailable.
|
|
255
200
|
* @param {string} branch branch name
|
|
256
201
|
* @returns {Promise<string>} head SHA or branch
|
|
257
202
|
*/
|
|
258
203
|
private _determineHeadSha;
|
|
259
|
-
/**
|
|
260
|
-
* Fetch repository tree and build shas/fileSet.
|
|
261
|
-
* @param {string} branch Branch name
|
|
262
|
-
* @returns {Promise<{shas:Record<string,string>,fileSet:Set<string>}>}
|
|
263
|
-
*/
|
|
264
204
|
/**
|
|
265
205
|
* Fetch repository tree and build shas map and fileSet.
|
|
266
206
|
* @param {string} branch branch name
|
|
267
207
|
* @returns {Promise<{shas:Record<string,string>,fileSet:Set<string>}>}
|
|
268
208
|
*/
|
|
269
209
|
private _fetchTreeAndBuildShas;
|
|
270
|
-
/**
|
|
271
|
-
* Helper to fetch files from the repository tree with caching and concurrency.
|
|
272
|
-
* @returns {Promise<Record<string,string>>}
|
|
273
|
-
*/
|
|
274
210
|
/**
|
|
275
211
|
* Fetch contents for requested paths from a FileSet with caching.
|
|
276
212
|
* @param {Set<string>} fileSet set of available files
|
|
@@ -282,14 +218,6 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
282
218
|
* @returns {Promise<Record<string,string>>}
|
|
283
219
|
*/
|
|
284
220
|
private _fetchContentFromFileSet;
|
|
285
|
-
/**
|
|
286
|
-
* 指定パスのファイル内容を取得し、キャッシュと snapshot を更新します。
|
|
287
|
-
* @param {Map<string,string>} cache キャッシュマップ
|
|
288
|
-
* @param {Record<string,string>} snapshot スナップショットマップ
|
|
289
|
-
* @param {string} p ファイルパス
|
|
290
|
-
* @param {string} branch ブランチ名
|
|
291
|
-
* @returns {Promise<string|null>} ファイル内容または null
|
|
292
|
-
*/
|
|
293
221
|
/**
|
|
294
222
|
* Fetch the content for a single file path, updating cache and snapshot.
|
|
295
223
|
* @param {Map<string,string>} cache cache map
|
|
@@ -299,12 +227,6 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
299
227
|
* @returns {Promise<string|null>} file content or null
|
|
300
228
|
*/
|
|
301
229
|
private _fetchFileContentForPath;
|
|
302
|
-
/**
|
|
303
|
-
* ファイルの raw コンテンツを取得して返します。失敗時は null を返します。
|
|
304
|
-
* @param {string} path ファイルパス
|
|
305
|
-
* @param {string} branch ブランチ名
|
|
306
|
-
* @returns {Promise<string|null>} ファイル内容または null
|
|
307
|
-
*/
|
|
308
230
|
/**
|
|
309
231
|
* Fetch raw file content from GitLab; return null on failure.
|
|
310
232
|
* @param {string} path file path
|
|
@@ -312,24 +234,11 @@ export declare class GitLabAdapter extends AbstractGitAdapter implements GitAdap
|
|
|
312
234
|
* @returns {Promise<string|null>} file content or null
|
|
313
235
|
*/
|
|
314
236
|
private _fetchFileRaw;
|
|
315
|
-
/** Build shas map and fileSet from tree entries */
|
|
316
237
|
/**
|
|
317
238
|
* Build shas map and fileSet from tree entries
|
|
318
239
|
* @returns {{shas:Record<string,string>,fileSet:Set<string>}}
|
|
319
240
|
*/
|
|
320
241
|
private _buildShasAndFileSet;
|
|
321
|
-
/**
|
|
322
|
-
* Resolve a commit-ish (branch name, tag name, or SHA) to a commit SHA.
|
|
323
|
-
* Resolution order: branch -> tag -> commits endpoint -> treat as SHA
|
|
324
|
-
* Throws if not resolvable.
|
|
325
|
-
*/
|
|
326
|
-
/**
|
|
327
|
-
* Resolve a commit-ish (branch, tag, or SHA) to a commit SHA.
|
|
328
|
-
* Resolution order: branch -> tag -> commits endpoint -> treat as SHA
|
|
329
|
-
* Throws if not resolvable.
|
|
330
|
-
* @param {string} reference commit-ish to resolve
|
|
331
|
-
* @returns {Promise<string>} resolved commit SHA
|
|
332
|
-
*/
|
|
333
242
|
/**
|
|
334
243
|
* Resolve a commit-ish (branch, tag, or SHA) to a commit SHA.
|
|
335
244
|
* Resolution order: branch -> tag -> commits endpoint -> treat as SHA
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlabAdapter.d.ts","sourceRoot":"","sources":["../../src/git/gitlabAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,kBAA0C,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"gitlabAdapter.d.ts","sourceRoot":"","sources":["../../src/git/gitlabAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,kBAA0C,MAAM,sBAAsB,CAAA;AAE7E,KAAK,SAAS,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,kBAAmB,YAAW,UAAU;IACzE,OAAO,CAAC,cAAc,CAA8E;IACpG,OAAO,CAAC,eAAe,CAAkE;IAEzF;;;OAGG;gBACS,OAAO,EAAE,SAAS;IAa9B;;;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