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.
@@ -1678,11 +1678,12 @@ async function findMatchingMembers(libraries, candidate, candidateIdentity) {
1678
1678
  ...library.isDefault ? {} : { publicId: library.publicId }
1679
1679
  });
1680
1680
  for (const archive of archives) {
1681
- if (archive.file === void 0) continue;
1681
+ const physical = archive.file ?? archive.directory;
1682
+ if (physical === void 0) continue;
1682
1683
  members.push({
1683
1684
  archive,
1684
1685
  library,
1685
- memberPath: getNodeResourcePath(archive.file)
1686
+ memberPath: getNodeResourcePath(physical)
1686
1687
  });
1687
1688
  }
1688
1689
  }
@@ -1720,13 +1721,25 @@ async function readFileIdentity(path) {
1720
1721
  var import_wiki_graph_core6 = require("wiki-graph-core");
1721
1722
  async function writeWikiGraphArchiveLocation(location, operation, options = {}) {
1722
1723
  const cacheOnly = options.searchIndexWritebackPolicy === "cache";
1723
- const write = async (archiveFile = location.archiveFile) => await new import_wiki_graph_core6.WikiGraphArchiveFile(archiveFile).write(operation, {
1724
- ...cacheOnly ? {} : { derivedStateKeys: [location.archiveKey, location.archivePath] },
1725
- ...options.invalidateContinuationCursors === void 0 ? {} : {
1726
- invalidateContinuationCursors: options.invalidateContinuationCursors
1727
- },
1728
- ...options.searchIndexWritebackPolicy === void 0 ? {} : { searchIndexWritebackPolicy: options.searchIndexWritebackPolicy }
1729
- });
1724
+ const write = async (archiveFile = location.archiveFile) => {
1725
+ const writeOptions = {
1726
+ ...cacheOnly ? {} : { derivedStateKeys: [location.archiveKey, location.archivePath] },
1727
+ ...options.invalidateContinuationCursors === void 0 ? {} : {
1728
+ invalidateContinuationCursors: options.invalidateContinuationCursors
1729
+ },
1730
+ ...options.searchIndexWritebackPolicy === void 0 ? {} : { searchIndexWritebackPolicy: options.searchIndexWritebackPolicy }
1731
+ };
1732
+ if (archiveFile.kind === "directory") {
1733
+ return await new import_wiki_graph_core6.WikiGraphDirectoryFile(archiveFile).write(
1734
+ operation,
1735
+ writeOptions
1736
+ );
1737
+ }
1738
+ return await new import_wiki_graph_core6.WikiGraphArchiveFile(archiveFile).write(
1739
+ operation,
1740
+ writeOptions
1741
+ );
1742
+ };
1730
1743
  if (location.libraryArchiveTarget === void 0 || cacheOnly || options.refreshLibraryIndex === false) {
1731
1744
  return await write();
1732
1745
  }