wiki-graph-sdk 0.8.4 → 0.9.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.
@@ -1689,11 +1689,12 @@ async function findMatchingMembers(libraries, candidate, candidateIdentity) {
1689
1689
  ...library.isDefault ? {} : { publicId: library.publicId }
1690
1690
  });
1691
1691
  for (const archive of archives) {
1692
- if (archive.file === void 0) continue;
1692
+ const physical = archive.file ?? archive.directory;
1693
+ if (physical === void 0) continue;
1693
1694
  members.push({
1694
1695
  archive,
1695
1696
  library,
1696
- memberPath: getNodeResourcePath(archive.file)
1697
+ memberPath: getNodeResourcePath(physical)
1697
1698
  });
1698
1699
  }
1699
1700
  }
@@ -1730,17 +1731,30 @@ async function readFileIdentity(path) {
1730
1731
  // src/archive/write.ts
1731
1732
  import {
1732
1733
  WikiGraphArchiveFile,
1734
+ WikiGraphDirectoryFile,
1733
1735
  writeWikiGraphLibraryArchive
1734
1736
  } from "wiki-graph-core";
1735
1737
  async function writeWikiGraphArchiveLocation(location, operation, options = {}) {
1736
1738
  const cacheOnly = options.searchIndexWritebackPolicy === "cache";
1737
- const write = async (archiveFile = location.archiveFile) => await new WikiGraphArchiveFile(archiveFile).write(operation, {
1738
- ...cacheOnly ? {} : { derivedStateKeys: [location.archiveKey, location.archivePath] },
1739
- ...options.invalidateContinuationCursors === void 0 ? {} : {
1740
- invalidateContinuationCursors: options.invalidateContinuationCursors
1741
- },
1742
- ...options.searchIndexWritebackPolicy === void 0 ? {} : { searchIndexWritebackPolicy: options.searchIndexWritebackPolicy }
1743
- });
1739
+ const write = async (archiveFile = location.archiveFile) => {
1740
+ const writeOptions = {
1741
+ ...cacheOnly ? {} : { derivedStateKeys: [location.archiveKey, location.archivePath] },
1742
+ ...options.invalidateContinuationCursors === void 0 ? {} : {
1743
+ invalidateContinuationCursors: options.invalidateContinuationCursors
1744
+ },
1745
+ ...options.searchIndexWritebackPolicy === void 0 ? {} : { searchIndexWritebackPolicy: options.searchIndexWritebackPolicy }
1746
+ };
1747
+ if (archiveFile.kind === "directory") {
1748
+ return await new WikiGraphDirectoryFile(archiveFile).write(
1749
+ operation,
1750
+ writeOptions
1751
+ );
1752
+ }
1753
+ return await new WikiGraphArchiveFile(archiveFile).write(
1754
+ operation,
1755
+ writeOptions
1756
+ );
1757
+ };
1744
1758
  if (location.libraryArchiveTarget === void 0 || cacheOnly || options.refreshLibraryIndex === false) {
1745
1759
  return await write();
1746
1760
  }