@makeswift/runtime 0.11.12 → 0.11.14

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.cjs.js CHANGED
@@ -868,10 +868,12 @@ Received "${apiKey}" instead.`);
868
868
  } = {}) {
869
869
  var _a;
870
870
  const siteVersion = (_a = this.siteVersion) != null ? _a : previewOverride ? MakeswiftSiteVersion.Working : MakeswiftSiteVersion.Live;
871
- const searchParams = new URLSearchParams();
871
+ const url = new URL(`${this.siteVersion == null ? "v1" : "v2"}/pages/${encodeURIComponent(pathname)}`, this.apiOrigin);
872
872
  if (localeInput)
873
- searchParams.set("locale", localeInput);
874
- const response = await this.fetch(`v1/pages/${encodeURIComponent(pathname)}?${searchParams.toString()}`, { headers: { "Makeswift-Site-Version": siteVersion } });
873
+ url.searchParams.set("locale", localeInput);
874
+ const response = await this.fetch(url.pathname + url.search, {
875
+ headers: { "Makeswift-Site-Version": siteVersion }
876
+ });
875
877
  if (!response.ok) {
876
878
  if (response.status === 404)
877
879
  return null;
@@ -1249,7 +1251,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1249
1251
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1250
1252
  return res.json(fonts2);
1251
1253
  }
1252
- const version = "0.11.12";
1254
+ const version = "0.11.14";
1253
1255
  async function handler(req, res, { apiKey, siteVersions }) {
1254
1256
  if (req.query.secret !== apiKey) {
1255
1257
  return res.status(401).json({ message: "Unauthorized" });