@scolladon/tsgit 1.0.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/README.md +29 -137
- package/dist/cjs/adapters/browser/index.cjs +1 -1
- package/dist/cjs/adapters/browser/index.cjs.map +1 -1
- package/dist/cjs/adapters/memory/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs.map +1 -1
- package/dist/cjs/adapters/node/index.cjs +1 -1
- package/dist/cjs/adapters/node/index.cjs.map +1 -1
- package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs +2 -0
- package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs.map +1 -0
- package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +1 -1
- package/dist/cjs/chunks/error-CDLOBdNU.cjs +2 -0
- package/dist/cjs/chunks/error-CDLOBdNU.cjs.map +1 -0
- package/dist/cjs/chunks/index-BVArBKuk.cjs +2 -0
- package/dist/cjs/chunks/index-BVArBKuk.cjs.map +1 -0
- package/dist/cjs/chunks/index-DE9HSiWf.cjs +2 -0
- package/dist/cjs/chunks/index-DE9HSiWf.cjs.map +1 -0
- package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs → logger-CVG0zcPH.cjs} +2 -2
- package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs.map → logger-CVG0zcPH.cjs.map} +1 -1
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs +2 -0
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs.map +1 -0
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs +2 -0
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs.map +1 -0
- package/dist/cjs/chunks/{progress-CK7CT9vU.cjs → progress-Bj2w-90A.cjs} +2 -2
- package/dist/cjs/chunks/{progress-CK7CT9vU.cjs.map → progress-Bj2w-90A.cjs.map} +1 -1
- package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs +2 -0
- package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs.map +1 -0
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs +2 -0
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs.map +1 -0
- package/dist/cjs/commands/index.cjs +1 -1
- package/dist/cjs/index.browser.cjs +1 -1
- package/dist/cjs/index.browser.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.default.cjs +1 -1
- package/dist/cjs/index.default.cjs.map +1 -1
- package/dist/cjs/index.node.cjs +1 -1
- package/dist/cjs/index.node.cjs.map +1 -1
- package/dist/cjs/operators/index.cjs +1 -1
- package/dist/cjs/operators/index.cjs.map +1 -1
- package/dist/cjs/primitives/index.cjs +1 -1
- package/dist/cjs/primitives/index.cjs.map +1 -1
- package/dist/cjs/transport/index.cjs.map +1 -1
- package/dist/esm/adapters/browser/index.js +1 -1
- package/dist/esm/adapters/browser/index.js.map +1 -1
- package/dist/esm/adapters/memory/index.js +1 -1
- package/dist/esm/adapters/memory/index.js.map +1 -1
- package/dist/esm/adapters/node/index.js +1 -1
- package/dist/esm/adapters/node/index.js.map +1 -1
- package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js +2 -0
- package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js.map +1 -0
- package/dist/esm/chunks/context-CumKOV7K.js.map +1 -1
- package/dist/esm/chunks/error-MOmSzp9Z.js +2 -0
- package/dist/esm/chunks/error-MOmSzp9Z.js.map +1 -0
- package/dist/esm/chunks/index-BjmofbKE.js +2 -0
- package/dist/esm/chunks/index-BjmofbKE.js.map +1 -0
- package/dist/esm/chunks/index-Jh5R-UmU.js +2 -0
- package/dist/esm/chunks/index-Jh5R-UmU.js.map +1 -0
- package/dist/esm/chunks/{logger-84ixEPbQ.js → logger-DP2cCpvL.js} +2 -2
- package/dist/esm/chunks/{logger-84ixEPbQ.js.map → logger-DP2cCpvL.js.map} +1 -1
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js +2 -0
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js.map +1 -0
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js +2 -0
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js.map +1 -0
- package/dist/esm/chunks/{progress-OTDhgmPO.js → progress-NePjO3Kd.js} +2 -2
- package/dist/esm/chunks/{progress-OTDhgmPO.js.map → progress-NePjO3Kd.js.map} +1 -1
- package/dist/esm/chunks/readable-stream-CGuf8k1J.js +2 -0
- package/dist/esm/chunks/readable-stream-CGuf8k1J.js.map +1 -0
- package/dist/esm/chunks/repository-Cs-dbHqO.js +2 -0
- package/dist/esm/chunks/repository-Cs-dbHqO.js.map +1 -0
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.browser.js.map +1 -1
- package/dist/esm/index.default.js +1 -1
- package/dist/esm/index.default.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.node.js +1 -1
- package/dist/esm/index.node.js.map +1 -1
- package/dist/esm/operators/index.js +1 -1
- package/dist/esm/operators/index.js.map +1 -1
- package/dist/esm/primitives/index.js +1 -1
- package/dist/esm/primitives/index.js.map +1 -1
- package/dist/esm/transport/index.js.map +1 -1
- package/dist/types/adapters/browser/index.d.cts +2 -1
- package/dist/types/adapters/browser/index.d.ts +2 -1
- package/dist/types/adapters/memory/index.d.cts +23 -2
- package/dist/types/adapters/memory/index.d.ts +23 -2
- package/dist/types/adapters/node/index.d.cts +178 -3
- package/dist/types/adapters/node/index.d.ts +178 -3
- package/dist/types/chunks/{context-CTaXSPiP.d.ts → context-BORy7yXb.d.ts} +133 -20
- package/dist/types/chunks/{context-d36639-i.d.cts → context-CMrHCVwK.d.cts} +133 -20
- package/dist/types/chunks/reflog-entry-BIf-zt__.d.cts +331 -0
- package/dist/types/chunks/reflog-entry-D9P2hCgv.d.ts +331 -0
- package/dist/types/chunks/{repository-CFT9j9H6.d.cts → repository-BqibvTOu.d.cts} +23 -4
- package/dist/types/chunks/{repository-ntg7eXb2.d.ts → repository-C4rN09Am.d.ts} +23 -4
- package/dist/types/chunks/write-tree-B8G6kgTy.d.cts +154 -0
- package/dist/types/chunks/write-tree-BXCDChvv.d.ts +154 -0
- package/dist/types/commands/index.d.cts +229 -37
- package/dist/types/commands/index.d.ts +229 -37
- package/dist/types/index.browser.d.cts +4 -4
- package/dist/types/index.browser.d.ts +4 -4
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.default.d.cts +4 -4
- package/dist/types/index.default.d.ts +4 -4
- package/dist/types/index.node.d.cts +4 -4
- package/dist/types/index.node.d.ts +4 -4
- package/dist/types/operators/index.d.cts +17 -1
- package/dist/types/operators/index.d.ts +17 -1
- package/dist/types/primitives/index.d.cts +393 -171
- package/dist/types/primitives/index.d.ts +393 -171
- package/package.json +76 -10
- package/dist/cjs/chunks/browser-http-transport-BBF8uw-f.cjs +0 -2
- package/dist/cjs/chunks/browser-http-transport-BBF8uw-f.cjs.map +0 -1
- package/dist/cjs/chunks/error-DL4SHCBJ.cjs +0 -2
- package/dist/cjs/chunks/error-DL4SHCBJ.cjs.map +0 -1
- package/dist/cjs/chunks/error-DN8Vnwr4.cjs +0 -2
- package/dist/cjs/chunks/error-DN8Vnwr4.cjs.map +0 -1
- package/dist/cjs/chunks/index-iUd-bwwm.cjs +0 -2
- package/dist/cjs/chunks/index-iUd-bwwm.cjs.map +0 -1
- package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs +0 -2
- package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs.map +0 -1
- package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs +0 -2
- package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs.map +0 -1
- package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs +0 -2
- package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs.map +0 -1
- package/dist/cjs/chunks/repository-Cfo6Bj8T.cjs +0 -2
- package/dist/cjs/chunks/repository-Cfo6Bj8T.cjs.map +0 -1
- package/dist/esm/chunks/browser-http-transport-mZQKkInJ.js +0 -2
- package/dist/esm/chunks/browser-http-transport-mZQKkInJ.js.map +0 -1
- package/dist/esm/chunks/error-CnIcr6IG.js +0 -2
- package/dist/esm/chunks/error-CnIcr6IG.js.map +0 -1
- package/dist/esm/chunks/error-DTEP18A3.js +0 -2
- package/dist/esm/chunks/error-DTEP18A3.js.map +0 -1
- package/dist/esm/chunks/index-CJc-SKMj.js +0 -2
- package/dist/esm/chunks/index-CJc-SKMj.js.map +0 -1
- package/dist/esm/chunks/memory-http-transport-BmHjaEWj.js +0 -2
- package/dist/esm/chunks/memory-http-transport-BmHjaEWj.js.map +0 -1
- package/dist/esm/chunks/merge-base-DmuOYxfP.js +0 -2
- package/dist/esm/chunks/merge-base-DmuOYxfP.js.map +0 -1
- package/dist/esm/chunks/node-http-transport-Bz3noIS3.js +0 -2
- package/dist/esm/chunks/node-http-transport-Bz3noIS3.js.map +0 -1
- package/dist/esm/chunks/repository-qcX3-LkP.js +0 -2
- package/dist/esm/chunks/repository-qcX3-LkP.js.map +0 -1
- package/dist/types/chunks/diff-change-B09vxnxy.d.cts +0 -59
- package/dist/types/chunks/diff-change-D7xSeCn9.d.ts +0 -59
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as FilePath, b as Context, R as RefName, O as ObjectId } from '../chunks/context-
|
|
2
|
-
import { A as AuthorIdentity,
|
|
1
|
+
import { d as FilePath, b as Context, R as RefName, O as ObjectId, m as PromisorRemote } from '../chunks/context-BORy7yXb.js';
|
|
2
|
+
import { C as CatFileBatchEntry, A as AuthorIdentity, s as TreeDiff, q as ReflogEntry, S as SubmoduleEntry } from '../chunks/reflog-entry-D9P2hCgv.js';
|
|
3
3
|
import '../chunks/http-transport-DirKfK2S.js';
|
|
4
4
|
|
|
5
5
|
interface AddOptions {
|
|
@@ -13,14 +13,17 @@ interface AddResult {
|
|
|
13
13
|
readonly removed: ReadonlyArray<FilePath>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* 1. Repo + bare + pending-op preflight checks.
|
|
18
|
-
* 2. Path validation for every input (no I/O on rejection).
|
|
19
|
-
* 3. Read working-tree contents → write blob → produce IndexEntry.
|
|
20
|
-
* 4. Atomically replace `.git/index` under the index lock.
|
|
16
|
+
* Stage paths in the index. Two modes:
|
|
21
17
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* - **Literal-path mode** (`paths` non-empty, `all` falsy): every path is
|
|
19
|
+
* validated, read, hashed, and staged. Missing paths reject the whole call.
|
|
20
|
+
* - **Bulk mode** (`paths` empty, `all === true`): walk the working tree,
|
|
21
|
+
* stage every modified/new tracked file plus every untracked, non-ignored
|
|
22
|
+
* file. Files missing from disk but present in the prior index land in
|
|
23
|
+
* `removed`. `.git` and embedded repositories are skipped.
|
|
24
|
+
*
|
|
25
|
+
* Both modes acquire `.git/index.lock` once, read the existing index under
|
|
26
|
+
* the lock, and commit a single replacement — no partial writes.
|
|
24
27
|
*/
|
|
25
28
|
declare const add: (ctx: Context, paths: ReadonlyArray<string>, opts?: AddOptions) => Promise<AddResult>;
|
|
26
29
|
|
|
@@ -63,15 +66,45 @@ type BranchResult = {
|
|
|
63
66
|
};
|
|
64
67
|
declare const branch: (ctx: Context, action: BranchAction) => Promise<BranchResult>;
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
type ConflictType = 'content' | 'add-add' | 'modify-delete' | 'type-change' | 'rename-rename' | 'gitlink' | 'binary';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Tier-1 `catFile` command — wraps the streaming `catFileBatch` primitive in
|
|
73
|
+
* a request/response shape matching the other v2 commands (`submodules`,
|
|
74
|
+
* `log`, `reflog`). String ids are coerced at the boundary via
|
|
75
|
+
* `ObjectId.from`, which throws `INVALID_OBJECT_ID` on malformed input
|
|
76
|
+
* before any read happens.
|
|
77
|
+
*
|
|
78
|
+
* For streaming use cases, callers reach for `repo.primitives.catFileBatch`
|
|
79
|
+
* directly — see `docs/design/cat-file-batch.md` §2.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
interface CatFileInput {
|
|
83
|
+
readonly ids: ReadonlyArray<ObjectId | string>;
|
|
84
|
+
/** Per-object byte cap; forwarded to the underlying `readObject` call. */
|
|
85
|
+
readonly maxBytes?: number;
|
|
86
|
+
}
|
|
87
|
+
interface CatFileResult {
|
|
88
|
+
readonly kind: 'batch';
|
|
89
|
+
readonly entries: ReadonlyArray<CatFileBatchEntry>;
|
|
90
|
+
}
|
|
91
|
+
declare const catFile: (ctx: Context, opts: CatFileInput) => Promise<CatFileResult>;
|
|
92
|
+
|
|
93
|
+
interface CheckoutSwitchOptions {
|
|
67
94
|
readonly target: string;
|
|
68
95
|
readonly detach?: boolean;
|
|
69
96
|
readonly force?: boolean;
|
|
70
97
|
}
|
|
98
|
+
interface CheckoutPathsOptions {
|
|
99
|
+
readonly paths: ReadonlyArray<string>;
|
|
100
|
+
readonly source?: 'index' | 'HEAD' | ObjectId;
|
|
101
|
+
}
|
|
102
|
+
type CheckoutOptions = CheckoutSwitchOptions | CheckoutPathsOptions;
|
|
71
103
|
interface CheckoutResult {
|
|
72
104
|
readonly branch: RefName | undefined;
|
|
73
105
|
readonly id: ObjectId;
|
|
74
106
|
readonly detached: boolean;
|
|
107
|
+
readonly changedPaths: number;
|
|
75
108
|
}
|
|
76
109
|
declare const checkout: (ctx: Context, opts: CheckoutOptions) => Promise<CheckoutResult>;
|
|
77
110
|
|
|
@@ -82,11 +115,21 @@ interface CloneOptions {
|
|
|
82
115
|
readonly url: string;
|
|
83
116
|
readonly bare?: boolean;
|
|
84
117
|
readonly initialBranch?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Shallow clone depth. When set, sends `deepen N` and persists the
|
|
120
|
+
* resulting shallow boundaries to `.git/shallow`.
|
|
121
|
+
*/
|
|
85
122
|
readonly depth?: number;
|
|
86
123
|
/** DNS resolver injected by the caller; required to enforce SSRF guards. */
|
|
87
124
|
readonly resolver?: DnsResolver;
|
|
88
125
|
readonly allowInsecure?: boolean;
|
|
89
126
|
readonly allowPrivateNetworks?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Partial-clone object filter (`blob:none`, `blob:limit=<n>`, `tree:<n>`).
|
|
129
|
+
* When set, the server omits the filtered objects, a promisor remote is
|
|
130
|
+
* recorded in `.git/config`, and omitted objects are lazy-fetched on read.
|
|
131
|
+
*/
|
|
132
|
+
readonly filter?: string;
|
|
90
133
|
}
|
|
91
134
|
interface CloneResult {
|
|
92
135
|
readonly path: FilePath;
|
|
@@ -104,6 +147,8 @@ interface CommitOptions {
|
|
|
104
147
|
readonly committer?: AuthorIdentity;
|
|
105
148
|
readonly allowEmpty?: boolean;
|
|
106
149
|
readonly allowEmptyMessage?: boolean;
|
|
150
|
+
/** Skip the `pre-commit` and `commit-msg` hooks (git's `--no-verify`). */
|
|
151
|
+
readonly noVerify?: boolean;
|
|
107
152
|
}
|
|
108
153
|
interface CommitResult {
|
|
109
154
|
readonly id: ObjectId;
|
|
@@ -139,18 +184,51 @@ interface FetchOptions {
|
|
|
139
184
|
readonly remote?: string;
|
|
140
185
|
readonly refspecs?: ReadonlyArray<string>;
|
|
141
186
|
readonly prune?: boolean;
|
|
187
|
+
/** Shallow clone depth. Delegates to fetchPack's deepen path. */
|
|
188
|
+
readonly depth?: number;
|
|
189
|
+
}
|
|
190
|
+
interface FetchUpdate {
|
|
191
|
+
readonly name: RefName;
|
|
192
|
+
readonly oldId: ObjectId | undefined;
|
|
193
|
+
readonly newId: ObjectId;
|
|
142
194
|
}
|
|
143
195
|
interface FetchResult {
|
|
144
196
|
readonly remote: string;
|
|
145
197
|
readonly url: string;
|
|
146
|
-
readonly updatedRefs: ReadonlyArray<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
198
|
+
readonly updatedRefs: ReadonlyArray<FetchUpdate>;
|
|
199
|
+
/** Refs deleted because the server no longer advertises them (prune semantics). */
|
|
200
|
+
readonly prunedRefs: ReadonlyArray<RefName>;
|
|
201
|
+
/** New shallow boundaries written to `.git/shallow` during this fetch. */
|
|
202
|
+
readonly shallow: ReadonlyArray<ObjectId>;
|
|
203
|
+
/** Commits that crossed the shallow → non-shallow boundary during this fetch. */
|
|
204
|
+
readonly unshallow: ReadonlyArray<ObjectId>;
|
|
151
205
|
}
|
|
152
206
|
declare const fetch: (ctx: Context, opts?: FetchOptions) => Promise<FetchResult>;
|
|
153
207
|
|
|
208
|
+
interface FetchMissingOptions {
|
|
209
|
+
/** Object ids to fetch. Ones already present locally are skipped. */
|
|
210
|
+
readonly oids: ReadonlyArray<ObjectId>;
|
|
211
|
+
}
|
|
212
|
+
interface FetchMissingResult {
|
|
213
|
+
/** The promisor remote the objects were fetched from. */
|
|
214
|
+
readonly remote: string;
|
|
215
|
+
/** Objects the caller asked for. */
|
|
216
|
+
readonly requested: number;
|
|
217
|
+
/** Objects that were missing locally and got fetched. */
|
|
218
|
+
readonly fetched: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Fetch the named objects from the repository's promisor remote. Throws
|
|
222
|
+
* `NO_PROMISOR_REMOTE` when the repository is not a partial clone.
|
|
223
|
+
*/
|
|
224
|
+
declare const fetchMissing: (ctx: Context, opts: FetchMissingOptions) => Promise<FetchMissingResult>;
|
|
225
|
+
/**
|
|
226
|
+
* `PromisorRemote` port implementation — the seam `readObject` calls on a
|
|
227
|
+
* miss. A non-partial repository yields `attempted: false` (rather than
|
|
228
|
+
* throwing) so `readObject` falls through to its normal `OBJECT_NOT_FOUND`.
|
|
229
|
+
*/
|
|
230
|
+
declare const createPromisorRemote: (ctx: Context) => PromisorRemote;
|
|
231
|
+
|
|
154
232
|
interface InitOptions {
|
|
155
233
|
readonly initialBranch?: string;
|
|
156
234
|
readonly bare?: boolean;
|
|
@@ -167,7 +245,7 @@ interface InitResult {
|
|
|
167
245
|
*
|
|
168
246
|
* For non-bare repos, the gitDir is `<workDir>/.git`. For bare, gitDir IS the
|
|
169
247
|
* working dir — callers must construct a Context with `bare: true` for that
|
|
170
|
-
* shape
|
|
248
|
+
* shape.
|
|
171
249
|
*/
|
|
172
250
|
declare const init: (ctx: Context, opts?: InitOptions) => Promise<InitResult>;
|
|
173
251
|
|
|
@@ -200,6 +278,10 @@ interface MergeOptions {
|
|
|
200
278
|
readonly author?: AuthorIdentity;
|
|
201
279
|
readonly committer?: AuthorIdentity;
|
|
202
280
|
}
|
|
281
|
+
interface MergeConflictDescriptor {
|
|
282
|
+
readonly path: FilePath;
|
|
283
|
+
readonly type: ConflictType;
|
|
284
|
+
}
|
|
203
285
|
type MergeResult = {
|
|
204
286
|
readonly kind: 'up-to-date';
|
|
205
287
|
readonly id: ObjectId;
|
|
@@ -212,14 +294,24 @@ type MergeResult = {
|
|
|
212
294
|
readonly id: ObjectId;
|
|
213
295
|
readonly branch: RefName;
|
|
214
296
|
readonly parents: ReadonlyArray<ObjectId>;
|
|
297
|
+
} | {
|
|
298
|
+
readonly kind: 'conflict';
|
|
299
|
+
readonly conflicts: ReadonlyArray<MergeConflictDescriptor>;
|
|
300
|
+
readonly mergeHead: ObjectId;
|
|
301
|
+
readonly origHead: ObjectId;
|
|
215
302
|
};
|
|
216
303
|
/**
|
|
217
|
-
* Merge `target` into the current HEAD branch.
|
|
218
|
-
*
|
|
219
|
-
* -
|
|
220
|
-
* -
|
|
221
|
-
*
|
|
222
|
-
*
|
|
304
|
+
* Merge `target` into the current HEAD branch.
|
|
305
|
+
*
|
|
306
|
+
* - Up-to-date: target is ancestor of HEAD → no-op.
|
|
307
|
+
* - Fast-forward: HEAD is ancestor of target → branch advances.
|
|
308
|
+
* - True merge for diverged histories:.4a wired the three-way
|
|
309
|
+
* tree merge (`mergeTrees` + `mergeContent`) so a CLEAN merge commits
|
|
310
|
+
* the merged tree directly.4b persists conflict state on
|
|
311
|
+
* disk (marker files, stage-1/2/3 index entries, MERGE_HEAD /
|
|
312
|
+
* MERGE_MSG / ORIG_HEAD) and returns `{ kind: 'conflict',... }`.
|
|
313
|
+
* Resolution path: edit the marker files, `repo.add(paths)`,
|
|
314
|
+
* `repo.commit({ message })` — the resulting commit has two parents.
|
|
223
315
|
*/
|
|
224
316
|
declare const merge: (ctx: Context, opts: MergeOptions) => Promise<MergeResult>;
|
|
225
317
|
|
|
@@ -228,18 +320,64 @@ interface PushOptions {
|
|
|
228
320
|
readonly refspecs?: ReadonlyArray<string>;
|
|
229
321
|
readonly force?: boolean;
|
|
230
322
|
readonly forceWithLease?: ObjectId | 'auto';
|
|
323
|
+
/** Skip the `pre-push` hook (git's `--no-verify`). */
|
|
324
|
+
readonly noVerify?: boolean;
|
|
325
|
+
}
|
|
326
|
+
interface PushedRef {
|
|
327
|
+
readonly name: RefName;
|
|
328
|
+
readonly oldId: ObjectId;
|
|
329
|
+
readonly newId: ObjectId;
|
|
330
|
+
readonly status: 'ok' | 'rejected';
|
|
331
|
+
readonly reason?: string;
|
|
231
332
|
}
|
|
232
333
|
interface PushResult {
|
|
233
334
|
readonly remote: string;
|
|
234
335
|
readonly url: string;
|
|
235
|
-
readonly pushedRefs: ReadonlyArray<
|
|
236
|
-
readonly name: RefName;
|
|
237
|
-
readonly newId: ObjectId;
|
|
238
|
-
readonly status: 'ok' | 'rejected';
|
|
239
|
-
}>;
|
|
336
|
+
readonly pushedRefs: ReadonlyArray<PushedRef>;
|
|
240
337
|
}
|
|
241
338
|
declare const push: (ctx: Context, opts?: PushOptions) => Promise<PushResult>;
|
|
242
339
|
|
|
340
|
+
type ReflogAction = {
|
|
341
|
+
readonly action?: 'show';
|
|
342
|
+
readonly ref?: string;
|
|
343
|
+
} | {
|
|
344
|
+
readonly action: 'exists';
|
|
345
|
+
readonly ref: string;
|
|
346
|
+
} | {
|
|
347
|
+
readonly action: 'delete';
|
|
348
|
+
readonly ref: string;
|
|
349
|
+
readonly index: number;
|
|
350
|
+
readonly rewrite?: boolean;
|
|
351
|
+
} | {
|
|
352
|
+
readonly action: 'expire';
|
|
353
|
+
readonly ref?: string;
|
|
354
|
+
readonly all?: boolean;
|
|
355
|
+
readonly expire?: string;
|
|
356
|
+
readonly expireUnreachable?: string;
|
|
357
|
+
};
|
|
358
|
+
/** One reflog entry as `show` presents it: newest-first, with a selector. */
|
|
359
|
+
interface ReflogShowEntry {
|
|
360
|
+
readonly index: number;
|
|
361
|
+
readonly selector: string;
|
|
362
|
+
readonly entry: ReflogEntry;
|
|
363
|
+
}
|
|
364
|
+
type ReflogResult = {
|
|
365
|
+
readonly kind: 'show';
|
|
366
|
+
readonly ref: RefName;
|
|
367
|
+
readonly entries: ReadonlyArray<ReflogShowEntry>;
|
|
368
|
+
} | {
|
|
369
|
+
readonly kind: 'exists';
|
|
370
|
+
readonly exists: boolean;
|
|
371
|
+
} | {
|
|
372
|
+
readonly kind: 'expire';
|
|
373
|
+
readonly removed: number;
|
|
374
|
+
readonly kept: number;
|
|
375
|
+
} | {
|
|
376
|
+
readonly kind: 'delete';
|
|
377
|
+
readonly removed: ReflogEntry;
|
|
378
|
+
};
|
|
379
|
+
declare const reflog: (ctx: Context, opts?: ReflogAction) => Promise<ReflogResult>;
|
|
380
|
+
|
|
243
381
|
type ResetMode = 'soft' | 'mixed' | 'hard';
|
|
244
382
|
interface ResetOptions {
|
|
245
383
|
readonly mode: ResetMode;
|
|
@@ -253,13 +391,18 @@ interface ResetResult {
|
|
|
253
391
|
/**
|
|
254
392
|
* Reset HEAD (and optionally index/working tree) to `target`.
|
|
255
393
|
*
|
|
256
|
-
* - `soft`:
|
|
257
|
-
* - `mixed`: HEAD +
|
|
258
|
-
*
|
|
394
|
+
* - `soft`: HEAD only.
|
|
395
|
+
* - `mixed`: HEAD + rebuild the index from the target commit's tree
|
|
396
|
+
* (stat-cache donor strategy preserves cache for unchanged paths —
|
|
397
|
+
* ). Working tree is NOT touched.
|
|
398
|
+
* - `hard`: HEAD + index + working tree — materialise the target tree onto
|
|
399
|
+
* the working tree with `force: true`, then commit the post-write
|
|
400
|
+
* index entries. Bare repos are rejected upfront.
|
|
259
401
|
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
402
|
+
* Ordering: working tree → index → HEAD. The index lock wraps both the
|
|
403
|
+
* working-tree write AND the index commit, matching tightened
|
|
404
|
+
* pattern. A crash between the index commit and HEAD update leaves the index
|
|
405
|
+
* ahead of HEAD — same recoverable hazard as canonical git.
|
|
263
406
|
*/
|
|
264
407
|
declare const reset: (ctx: Context, opts: ResetOptions) => Promise<ResetResult>;
|
|
265
408
|
|
|
@@ -278,6 +421,37 @@ interface RmResult {
|
|
|
278
421
|
*/
|
|
279
422
|
declare const rm: (ctx: Context, paths: ReadonlyArray<string>, opts?: RmOptions) => Promise<RmResult>;
|
|
280
423
|
|
|
424
|
+
type SparseCheckoutAction = {
|
|
425
|
+
readonly action: 'list';
|
|
426
|
+
} | {
|
|
427
|
+
readonly action: 'set';
|
|
428
|
+
readonly patterns: ReadonlyArray<string>;
|
|
429
|
+
readonly cone?: boolean;
|
|
430
|
+
readonly force?: boolean;
|
|
431
|
+
} | {
|
|
432
|
+
readonly action: 'add';
|
|
433
|
+
readonly patterns: ReadonlyArray<string>;
|
|
434
|
+
readonly force?: boolean;
|
|
435
|
+
} | {
|
|
436
|
+
readonly action: 'reapply';
|
|
437
|
+
readonly force?: boolean;
|
|
438
|
+
} | {
|
|
439
|
+
readonly action: 'disable';
|
|
440
|
+
readonly force?: boolean;
|
|
441
|
+
};
|
|
442
|
+
type SparseCheckoutResult = {
|
|
443
|
+
readonly kind: 'list';
|
|
444
|
+
readonly cone: boolean;
|
|
445
|
+
readonly patterns: ReadonlyArray<string>;
|
|
446
|
+
} | {
|
|
447
|
+
readonly kind: 'applied';
|
|
448
|
+
readonly cone: boolean;
|
|
449
|
+
readonly materialized: number;
|
|
450
|
+
readonly removed: number;
|
|
451
|
+
readonly retained: ReadonlyArray<FilePath>;
|
|
452
|
+
};
|
|
453
|
+
declare const sparseCheckout: (ctx: Context, opts: SparseCheckoutAction) => Promise<SparseCheckoutResult>;
|
|
454
|
+
|
|
281
455
|
type ChangeKind = 'modified' | 'added' | 'deleted' | 'untracked';
|
|
282
456
|
interface ChangeEntry {
|
|
283
457
|
readonly kind: ChangeKind;
|
|
@@ -293,10 +467,10 @@ interface StatusResult {
|
|
|
293
467
|
/**
|
|
294
468
|
* Summarize the state of the working tree relative to the index, and the
|
|
295
469
|
* branch HEAD points at. Working-tree-vs-HEAD diff (Git's "staged" column)
|
|
296
|
-
* is approximated via index-vs-working-tree comparisons until
|
|
470
|
+
* is approximated via index-vs-working-tree comparisons until
|
|
297
471
|
* adds the stat-cache fast path.
|
|
298
472
|
*
|
|
299
|
-
* Progress reporting
|
|
473
|
+
* Progress reporting: emits `status:scan` start before the
|
|
300
474
|
* fan-out, updates at every 100 lstat completions, and end in a finally
|
|
301
475
|
* block so the consumer always pairs start with end. `total` is undefined
|
|
302
476
|
* — design choice that prevents revealing repository size to non-trusted
|
|
@@ -304,6 +478,24 @@ interface StatusResult {
|
|
|
304
478
|
*/
|
|
305
479
|
declare const status: (ctx: Context) => Promise<StatusResult>;
|
|
306
480
|
|
|
481
|
+
type SubmodulesAction = {
|
|
482
|
+
readonly action?: 'list';
|
|
483
|
+
/** Tree-ish to walk. Default: `'HEAD'`. */
|
|
484
|
+
readonly ref?: string;
|
|
485
|
+
/** Descend into nested submodules' own `.gitmodules`. Default: `false`. */
|
|
486
|
+
readonly recursive?: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* Cap on recursion depth. Default: `MAX_SUBMODULE_DEPTH`. Entries at exactly
|
|
489
|
+
* this depth are yielded but not recursed into.
|
|
490
|
+
*/
|
|
491
|
+
readonly maxDepth?: number;
|
|
492
|
+
};
|
|
493
|
+
type SubmodulesResult = {
|
|
494
|
+
readonly kind: 'list';
|
|
495
|
+
readonly entries: ReadonlyArray<SubmoduleEntry>;
|
|
496
|
+
};
|
|
497
|
+
declare const submodules: (ctx: Context, opts?: SubmodulesAction) => Promise<SubmodulesResult>;
|
|
498
|
+
|
|
307
499
|
type TagAction = {
|
|
308
500
|
readonly kind: 'list';
|
|
309
501
|
} | {
|
|
@@ -332,5 +524,5 @@ type TagResult = {
|
|
|
332
524
|
};
|
|
333
525
|
declare const tag: (ctx: Context, action: TagAction) => Promise<TagResult>;
|
|
334
526
|
|
|
335
|
-
export { add, branch, checkout, clone, commit, diff, fetch, init, log, merge, push, reset, revParse, rm, status, tag };
|
|
336
|
-
export type { AddOptions, AddResult, BranchAction, BranchInfo, BranchResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CloneOptions, CloneResult, CommitOptions, CommitResult, DiffOptions, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, PushOptions, PushResult, ResetMode, ResetOptions, ResetResult, RmOptions, RmResult, StatusResult, TagAction, TagInfo, TagResult };
|
|
527
|
+
export { CatFileBatchEntry, SubmoduleEntry, add, branch, catFile, checkout, clone, commit, createPromisorRemote, diff, fetch, fetchMissing, init, log, merge, push, reflog, reset, revParse, rm, sparseCheckout, status, submodules, tag };
|
|
528
|
+
export type { AddOptions, AddResult, BranchAction, BranchInfo, BranchResult, CatFileInput, CatFileResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CloneOptions, CloneResult, CommitOptions, CommitResult, DiffOptions, FetchMissingOptions, FetchMissingResult, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, PushOptions, PushResult, ReflogAction, ReflogResult, ReflogShowEntry, ResetMode, ResetOptions, ResetResult, RmOptions, RmResult, SparseCheckoutAction, SparseCheckoutResult, StatusResult, SubmodulesAction, SubmodulesResult, TagAction, TagInfo, TagResult };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-BqibvTOu.cjs';
|
|
2
2
|
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './index.cjs';
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-CMrHCVwK.cjs';
|
|
4
4
|
import './commands/index.cjs';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import './
|
|
5
|
+
import './chunks/reflog-entry-BIf-zt__.cjs';
|
|
6
|
+
import './chunks/write-tree-B8G6kgTy.cjs';
|
|
7
7
|
import './chunks/http-transport-DirKfK2S.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-C4rN09Am.js';
|
|
2
2
|
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './index.js';
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-BORy7yXb.js';
|
|
4
4
|
import './commands/index.js';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import './
|
|
5
|
+
import './chunks/reflog-entry-D9P2hCgv.js';
|
|
6
|
+
import './chunks/write-tree-BXCDChvv.js';
|
|
7
7
|
import './chunks/http-transport-DirKfK2S.js';
|
|
8
8
|
|
|
9
9
|
/**
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as FileSystem, H as HashService, C as Compressor, P as ProgressReporter } from './chunks/context-
|
|
2
|
-
export { A as AuthStrategy, a as AuthorIdentity, b as Context, c as CreateContextParts, D as DirEntry, e as FileStat, g as Hasher, L as Logger,
|
|
1
|
+
import { f as FileSystem, H as HashService, C as Compressor, P as ProgressReporter } from './chunks/context-CMrHCVwK.cjs';
|
|
2
|
+
export { A as AuthStrategy, a as AuthorIdentity, b as Context, c as CreateContextParts, D as DirEntry, e as FileStat, g as Hasher, h as HookName, i as HookRequest, j as HookResult, k as HookRunner, L as Logger, l as PromisorFetchOutcome, m as PromisorRemote, n as RepositoryConfig, o as RepositoryLayout, p as createContext, q as noopLogger, w as wrapLoggerSanitizer } from './chunks/context-CMrHCVwK.cjs';
|
|
3
3
|
import { b as HttpTransport } from './chunks/http-transport-DirKfK2S.cjs';
|
|
4
4
|
export { H as HttpRequest, a as HttpResponse } from './chunks/http-transport-DirKfK2S.cjs';
|
|
5
|
-
export { AddOptions, AddResult, BranchAction, BranchInfo, BranchResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CloneOptions, CloneResult, CommitOptions, CommitResult, DiffOptions, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, PushOptions, PushResult, ResetMode, ResetOptions, ResetResult, RmOptions, RmResult, StatusResult, TagAction, TagInfo, TagResult, add, branch, checkout, clone, commit, diff, fetch, init, log, merge, push, reset, revParse, rm, status, tag } from './commands/index.cjs';
|
|
6
|
-
|
|
5
|
+
export { AddOptions, AddResult, BranchAction, BranchInfo, BranchResult, CatFileInput, CatFileResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CloneOptions, CloneResult, CommitOptions, CommitResult, DiffOptions, FetchMissingOptions, FetchMissingResult, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, PushOptions, PushResult, ReflogAction, ReflogResult, ReflogShowEntry, ResetMode, ResetOptions, ResetResult, RmOptions, RmResult, SparseCheckoutAction, SparseCheckoutResult, StatusResult, SubmodulesAction, SubmodulesResult, TagAction, TagInfo, TagResult, add, branch, catFile, checkout, clone, commit, createPromisorRemote, diff, fetch, fetchMissing, init, log, merge, push, reflog, reset, revParse, rm, sparseCheckout, status, submodules, tag } from './commands/index.cjs';
|
|
6
|
+
export { C as CatFileBatchEntry, S as SubmoduleEntry } from './chunks/reflog-entry-BIf-zt__.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The four adapter ports the facade plumbs into the Context. Each runtime
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as FileSystem, H as HashService, C as Compressor, P as ProgressReporter } from './chunks/context-
|
|
2
|
-
export { A as AuthStrategy, a as AuthorIdentity, b as Context, c as CreateContextParts, D as DirEntry, e as FileStat, g as Hasher, L as Logger,
|
|
1
|
+
import { f as FileSystem, H as HashService, C as Compressor, P as ProgressReporter } from './chunks/context-BORy7yXb.js';
|
|
2
|
+
export { A as AuthStrategy, a as AuthorIdentity, b as Context, c as CreateContextParts, D as DirEntry, e as FileStat, g as Hasher, h as HookName, i as HookRequest, j as HookResult, k as HookRunner, L as Logger, l as PromisorFetchOutcome, m as PromisorRemote, n as RepositoryConfig, o as RepositoryLayout, p as createContext, q as noopLogger, w as wrapLoggerSanitizer } from './chunks/context-BORy7yXb.js';
|
|
3
3
|
import { b as HttpTransport } from './chunks/http-transport-DirKfK2S.js';
|
|
4
4
|
export { H as HttpRequest, a as HttpResponse } from './chunks/http-transport-DirKfK2S.js';
|
|
5
|
-
export { AddOptions, AddResult, BranchAction, BranchInfo, BranchResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CloneOptions, CloneResult, CommitOptions, CommitResult, DiffOptions, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, PushOptions, PushResult, ResetMode, ResetOptions, ResetResult, RmOptions, RmResult, StatusResult, TagAction, TagInfo, TagResult, add, branch, checkout, clone, commit, diff, fetch, init, log, merge, push, reset, revParse, rm, status, tag } from './commands/index.js';
|
|
6
|
-
|
|
5
|
+
export { AddOptions, AddResult, BranchAction, BranchInfo, BranchResult, CatFileInput, CatFileResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CloneOptions, CloneResult, CommitOptions, CommitResult, DiffOptions, FetchMissingOptions, FetchMissingResult, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, PushOptions, PushResult, ReflogAction, ReflogResult, ReflogShowEntry, ResetMode, ResetOptions, ResetResult, RmOptions, RmResult, SparseCheckoutAction, SparseCheckoutResult, StatusResult, SubmodulesAction, SubmodulesResult, TagAction, TagInfo, TagResult, add, branch, catFile, checkout, clone, commit, createPromisorRemote, diff, fetch, fetchMissing, init, log, merge, push, reflog, reset, revParse, rm, sparseCheckout, status, submodules, tag } from './commands/index.js';
|
|
6
|
+
export { C as CatFileBatchEntry, S as SubmoduleEntry } from './chunks/reflog-entry-D9P2hCgv.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The four adapter ports the facade plumbs into the Context. Each runtime
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-BqibvTOu.cjs';
|
|
2
2
|
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './index.cjs';
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-CMrHCVwK.cjs';
|
|
4
4
|
import './commands/index.cjs';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import './
|
|
5
|
+
import './chunks/reflog-entry-BIf-zt__.cjs';
|
|
6
|
+
import './chunks/write-tree-B8G6kgTy.cjs';
|
|
7
7
|
import './chunks/http-transport-DirKfK2S.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-C4rN09Am.js';
|
|
2
2
|
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './index.js';
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-BORy7yXb.js';
|
|
4
4
|
import './commands/index.js';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import './
|
|
5
|
+
import './chunks/reflog-entry-D9P2hCgv.js';
|
|
6
|
+
import './chunks/write-tree-BXCDChvv.js';
|
|
7
7
|
import './chunks/http-transport-DirKfK2S.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-BqibvTOu.cjs';
|
|
2
2
|
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './index.cjs';
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-CMrHCVwK.cjs';
|
|
4
4
|
import './commands/index.cjs';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import './
|
|
5
|
+
import './chunks/reflog-entry-BIf-zt__.cjs';
|
|
6
|
+
import './chunks/write-tree-B8G6kgTy.cjs';
|
|
7
7
|
import './chunks/http-transport-DirKfK2S.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-C4rN09Am.js';
|
|
2
2
|
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './index.js';
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-BORy7yXb.js';
|
|
4
4
|
import './commands/index.js';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import './
|
|
5
|
+
import './chunks/reflog-entry-D9P2hCgv.js';
|
|
6
|
+
import './chunks/write-tree-BXCDChvv.js';
|
|
7
7
|
import './chunks/http-transport-DirKfK2S.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -28,9 +28,25 @@ declare function pipe<A, B, C, D, E, F, G, H>(a: A, ab: UnaryFn<A, B>, bc: Unary
|
|
|
28
28
|
declare function pipe<A, B, C, D, E, F, G, H, I>(a: A, ab: UnaryFn<A, B>, bc: UnaryFn<B, C>, cd: UnaryFn<C, D>, de: UnaryFn<D, E>, ef: UnaryFn<E, F>, fg: UnaryFn<F, G>, gh: UnaryFn<G, H>, hi: UnaryFn<H, I>): I;
|
|
29
29
|
declare function pipe<A, B, C, D, E, F, G, H, I, J>(a: A, ab: UnaryFn<A, B>, bc: UnaryFn<B, C>, cd: UnaryFn<C, D>, de: UnaryFn<D, E>, ef: UnaryFn<E, F>, fg: UnaryFn<F, G>, gh: UnaryFn<G, H>, hi: UnaryFn<H, I>, ij: UnaryFn<I, J>): J;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Adapt a Web `ReadableStream<Uint8Array>` (the type `fetch` returns on
|
|
33
|
+
* `Response.body`) to an `AsyncIterable<Uint8Array>` that the pkt-line
|
|
34
|
+
* decoder and other AsyncIterable consumers can drive.
|
|
35
|
+
*
|
|
36
|
+
* Why this lives in `src/operators/`: both the `fetch-pack` primitive and
|
|
37
|
+
* the `commands/internal/upload-pack-client` helper need it, and a primitive
|
|
38
|
+
* cannot import from `commands/`. The operators module is the natural home —
|
|
39
|
+
* it owns AsyncIterable composition helpers with zero domain dependencies.
|
|
40
|
+
*
|
|
41
|
+
* Lifecycle: on early exit (consumer throws or breaks) the iterator's
|
|
42
|
+
* `return` hook calls `cancel()` so the stream + underlying socket close
|
|
43
|
+
* cleanly. `releaseLock` alone leaves the stream open.
|
|
44
|
+
*/
|
|
45
|
+
declare const readableStreamToAsyncIterable: (stream: ReadableStream<Uint8Array>) => AsyncIterable<Uint8Array>;
|
|
46
|
+
|
|
31
47
|
declare function take<T>(count: number): (source: AsyncIterable<T>) => AsyncIterable<T>;
|
|
32
48
|
|
|
33
49
|
declare function toArray<T>(source: AsyncIterable<T>, limit?: number): Promise<T[]>;
|
|
34
50
|
|
|
35
|
-
export { filter, find, flatMap, groupBy, map, pipe, take, toArray };
|
|
51
|
+
export { filter, find, flatMap, groupBy, map, pipe, readableStreamToAsyncIterable, take, toArray };
|
|
36
52
|
export type { Awaitable };
|
|
@@ -28,9 +28,25 @@ declare function pipe<A, B, C, D, E, F, G, H>(a: A, ab: UnaryFn<A, B>, bc: Unary
|
|
|
28
28
|
declare function pipe<A, B, C, D, E, F, G, H, I>(a: A, ab: UnaryFn<A, B>, bc: UnaryFn<B, C>, cd: UnaryFn<C, D>, de: UnaryFn<D, E>, ef: UnaryFn<E, F>, fg: UnaryFn<F, G>, gh: UnaryFn<G, H>, hi: UnaryFn<H, I>): I;
|
|
29
29
|
declare function pipe<A, B, C, D, E, F, G, H, I, J>(a: A, ab: UnaryFn<A, B>, bc: UnaryFn<B, C>, cd: UnaryFn<C, D>, de: UnaryFn<D, E>, ef: UnaryFn<E, F>, fg: UnaryFn<F, G>, gh: UnaryFn<G, H>, hi: UnaryFn<H, I>, ij: UnaryFn<I, J>): J;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Adapt a Web `ReadableStream<Uint8Array>` (the type `fetch` returns on
|
|
33
|
+
* `Response.body`) to an `AsyncIterable<Uint8Array>` that the pkt-line
|
|
34
|
+
* decoder and other AsyncIterable consumers can drive.
|
|
35
|
+
*
|
|
36
|
+
* Why this lives in `src/operators/`: both the `fetch-pack` primitive and
|
|
37
|
+
* the `commands/internal/upload-pack-client` helper need it, and a primitive
|
|
38
|
+
* cannot import from `commands/`. The operators module is the natural home —
|
|
39
|
+
* it owns AsyncIterable composition helpers with zero domain dependencies.
|
|
40
|
+
*
|
|
41
|
+
* Lifecycle: on early exit (consumer throws or breaks) the iterator's
|
|
42
|
+
* `return` hook calls `cancel()` so the stream + underlying socket close
|
|
43
|
+
* cleanly. `releaseLock` alone leaves the stream open.
|
|
44
|
+
*/
|
|
45
|
+
declare const readableStreamToAsyncIterable: (stream: ReadableStream<Uint8Array>) => AsyncIterable<Uint8Array>;
|
|
46
|
+
|
|
31
47
|
declare function take<T>(count: number): (source: AsyncIterable<T>) => AsyncIterable<T>;
|
|
32
48
|
|
|
33
49
|
declare function toArray<T>(source: AsyncIterable<T>, limit?: number): Promise<T[]>;
|
|
34
50
|
|
|
35
|
-
export { filter, find, flatMap, groupBy, map, pipe, take, toArray };
|
|
51
|
+
export { filter, find, flatMap, groupBy, map, pipe, readableStreamToAsyncIterable, take, toArray };
|
|
36
52
|
export type { Awaitable };
|