@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.es.js CHANGED
@@ -835,10 +835,12 @@ Received "${apiKey}" instead.`);
835
835
  } = {}) {
836
836
  var _a;
837
837
  const siteVersion = (_a = this.siteVersion) != null ? _a : previewOverride ? MakeswiftSiteVersion.Working : MakeswiftSiteVersion.Live;
838
- const searchParams = new URLSearchParams();
838
+ const url = new URL(`${this.siteVersion == null ? "v1" : "v2"}/pages/${encodeURIComponent(pathname)}`, this.apiOrigin);
839
839
  if (localeInput)
840
- searchParams.set("locale", localeInput);
841
- const response = await this.fetch(`v1/pages/${encodeURIComponent(pathname)}?${searchParams.toString()}`, { headers: { "Makeswift-Site-Version": siteVersion } });
840
+ url.searchParams.set("locale", localeInput);
841
+ const response = await this.fetch(url.pathname + url.search, {
842
+ headers: { "Makeswift-Site-Version": siteVersion }
843
+ });
842
844
  if (!response.ok) {
843
845
  if (response.status === 404)
844
846
  return null;
@@ -1216,7 +1218,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1216
1218
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1217
1219
  return res.json(fonts2);
1218
1220
  }
1219
- const version = "0.11.12";
1221
+ const version = "0.11.14";
1220
1222
  async function handler(req, res, { apiKey, siteVersions }) {
1221
1223
  if (req.query.secret !== apiKey) {
1222
1224
  return res.status(401).json({ message: "Unauthorized" });