@eventcatalog/sdk 2.18.1 → 2.18.2

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/dist/index.mjs CHANGED
@@ -1438,8 +1438,11 @@ var resolveDomainWriteDirectory = async (directory, id, version) => {
1438
1438
  if (!existingResource) return directory;
1439
1439
  const normalizedPath = existingResource.replace(/\\/g, "/");
1440
1440
  const lastDomainsIndex = normalizedPath.lastIndexOf("/domains/");
1441
- if (lastDomainsIndex === -1) return directory;
1442
- return existingResource.substring(0, lastDomainsIndex + "/domains".length);
1441
+ const lastSubdomainsIndex = normalizedPath.lastIndexOf("/subdomains/");
1442
+ const lastIndex = Math.max(lastDomainsIndex, lastSubdomainsIndex);
1443
+ if (lastIndex === -1) return directory;
1444
+ const segment = lastSubdomainsIndex > lastDomainsIndex ? "/subdomains" : "/domains";
1445
+ return existingResource.substring(0, lastIndex + segment.length);
1443
1446
  };
1444
1447
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
1445
1448
  var getDomains = (directory) => async (options) => getResources(directory, {