@gitsheets/core-napi 0.7.0 → 0.8.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/binding.cjs CHANGED
@@ -152,6 +152,8 @@ module.exports = {
152
152
  treeReadBlob: wrap(addon.treeReadBlob),
153
153
  treeEntryHash: wrap(addon.treeEntryHash),
154
154
  blobRead: wrap(addon.blobRead),
155
+ treeList: wrap(addon.treeList),
156
+ tagSet: wrap(addon.tagSet),
155
157
  blobHeader: wrap(addon.blobHeader),
156
158
  templateFieldNames: wrap(addon.templateFieldNames),
157
159
  // Secondary indexing (lazy, in-memory). A unique conflict surfaces as a typed
package/index.d.ts CHANGED
@@ -279,6 +279,24 @@ export interface JsBlobHeader {
279
279
  * "Blob metadata and bounded buffering").
280
280
  */
281
281
  export declare function blobHeader(gitDir: string, hash: string): JsBlobHeader | null
282
+ /** One direct entry of a tree (`repo.listTree`). */
283
+ export interface JsTreeEntry {
284
+ name: string
285
+ /** `blob` / `tree` / `commit`. */
286
+ type: string
287
+ mode: string
288
+ hash: string
289
+ }
290
+ /**
291
+ * The direct entries of the tree at `treeRef:path`, sorted by name; `null`
292
+ * when nothing (or a blob) is at `path`.
293
+ */
294
+ export declare function treeList(gitDir: string, treeRef: string, path: string): Array<JsTreeEntry> | null
295
+ /**
296
+ * Point the lightweight tag `refs/tags/<name>` at `target`; refuses an
297
+ * existing tag unless `force`. Returns the tagged object id.
298
+ */
299
+ export declare function tagSet(gitDir: string, name: string, target: string, force: boolean): string
282
300
  /** A blob read by `treeRef:path`: its object id and bytes. */
283
301
  export interface JsBlobEntry {
284
302
  hash: string
@@ -668,6 +686,13 @@ export declare class CoreTransaction {
668
686
  * lazy-body switch. Read-only.
669
687
  */
670
688
  readRecord(name: string, recordPath: string, withBody: boolean): JsValue | null
689
+ /**
690
+ * A raw file at `path` (repo-root-relative) in this transaction's
691
+ * private tree — staged writes included — as `{ hash, content }`, or
692
+ * `null` when nothing (or a subtree) is there. Backs tx-bound config
693
+ * loading (specs/api/transaction.md "Read isolation").
694
+ */
695
+ readFile(path: string): JsBlobEntry | null
671
696
  /** The parent commit hash captured at open (null on a fresh repo). */
672
697
  parentCommitHash(): string | null
673
698
  /**
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { roundtrip, parseRecords, serializeRecords, renderPathsBatch, validateBatch, canonicalContractHash, validateContractName, contractPath, checkContractDocument, contractLoad, verifySheetContract, runComparator, collatorSort, CompiledDefinition, recordRead, recordWrite, recordDelete, recordList, writeBlob, substrateStats, substrateReset, recordQuery, treeReadBlob, treeEntryHash, blobRead, blobHeader, recordQueryCandidates, templateFieldNames, recordIndexUnique, recordIndexMulti, createPatch, applyMergePatch, diffRecords, simulateCoreError, CoreTransaction, syncBranch, isAncestor, mergeSheets, mergeRecordTexts, coreDiscoverSheets, sheetConfigCheck, coreCheckValidators, markdownSerialize, markdownNormalizeBody, markdownParse, markdownParseHeaderOnly, markdownExtractH1, markdownRewriteH1 } = nativeBinding
313
+ const { roundtrip, parseRecords, serializeRecords, renderPathsBatch, validateBatch, canonicalContractHash, validateContractName, contractPath, checkContractDocument, contractLoad, verifySheetContract, runComparator, collatorSort, CompiledDefinition, recordRead, recordWrite, recordDelete, recordList, writeBlob, substrateStats, substrateReset, recordQuery, treeReadBlob, treeEntryHash, blobRead, blobHeader, treeList, tagSet, recordQueryCandidates, templateFieldNames, recordIndexUnique, recordIndexMulti, createPatch, applyMergePatch, diffRecords, simulateCoreError, CoreTransaction, syncBranch, isAncestor, mergeSheets, mergeRecordTexts, coreDiscoverSheets, sheetConfigCheck, coreCheckValidators, markdownSerialize, markdownNormalizeBody, markdownParse, markdownParseHeaderOnly, markdownExtractH1, markdownRewriteH1 } = nativeBinding
314
314
 
315
315
  module.exports.roundtrip = roundtrip
316
316
  module.exports.parseRecords = parseRecords
@@ -338,6 +338,8 @@ module.exports.treeReadBlob = treeReadBlob
338
338
  module.exports.treeEntryHash = treeEntryHash
339
339
  module.exports.blobRead = blobRead
340
340
  module.exports.blobHeader = blobHeader
341
+ module.exports.treeList = treeList
342
+ module.exports.tagSet = tagSet
341
343
  module.exports.recordQueryCandidates = recordQueryCandidates
342
344
  module.exports.templateFieldNames = templateFieldNames
343
345
  module.exports.recordIndexUnique = recordIndexUnique
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitsheets/core-napi",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Node.js native binding for gitsheets-core — the FFI marshalling boundary.",
5
5
  "main": "binding.cjs",
6
6
  "types": "index.d.ts",
@@ -33,12 +33,12 @@
33
33
  "index.d.ts"
34
34
  ],
35
35
  "optionalDependencies": {
36
- "@gitsheets/core-napi-linux-x64-gnu": "0.7.0",
37
- "@gitsheets/core-napi-linux-arm64-gnu": "0.7.0",
38
- "@gitsheets/core-napi-linux-x64-musl": "0.7.0",
39
- "@gitsheets/core-napi-darwin-arm64": "0.7.0",
40
- "@gitsheets/core-napi-darwin-x64": "0.7.0",
41
- "@gitsheets/core-napi-win32-x64-msvc": "0.7.0"
36
+ "@gitsheets/core-napi-linux-x64-gnu": "0.8.0",
37
+ "@gitsheets/core-napi-linux-arm64-gnu": "0.8.0",
38
+ "@gitsheets/core-napi-linux-x64-musl": "0.8.0",
39
+ "@gitsheets/core-napi-darwin-arm64": "0.8.0",
40
+ "@gitsheets/core-napi-darwin-x64": "0.8.0",
41
+ "@gitsheets/core-napi-win32-x64-msvc": "0.8.0"
42
42
  },
43
43
  "scripts": {
44
44
  "artifacts": "napi artifacts",
@@ -54,6 +54,6 @@
54
54
  "ajv": "^8.20.0",
55
55
  "ajv-formats": "^3.0.1",
56
56
  "rfc6902": "^5.2.0",
57
- "smol-toml": "^1.8.0"
57
+ "smol-toml": "^1.9.1"
58
58
  }
59
59
  }