@riverbankcms/sdk 0.84.1 → 0.84.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.
Files changed (51) hide show
  1. package/dist/{PreviewEditorSidebar-X7RLMEI6.mjs → PreviewEditorSidebar-4PH35ZIE.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-CT67N4O3.mjs → PreviewEditorUI-WHMCRJGM.mjs} +11 -6
  3. package/dist/SdkPreviewModeRuntime-4FGSVUYI.mjs +8 -0
  4. package/dist/_dts/api/src/bookingConfig.d.ts +2 -0
  5. package/dist/_dts/api/src/index.d.ts +2 -2
  6. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +2 -1
  7. package/dist/_dts/api/src/sdk-event-payment-terms.d.ts +16 -0
  8. package/dist/_dts/api/src/sdk-event-upsert.d.ts +11 -2
  9. package/dist/_dts/api/src/sdkContracts.d.ts +3 -0
  10. package/dist/_dts/api/src/types.d.ts +1 -0
  11. package/dist/_dts/api/src/url.d.ts +12 -4
  12. package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +2 -0
  13. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +3 -1
  14. package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +8 -0
  15. package/dist/_dts/preview-next/src/client/preview/MaintenanceModeBadge.d.ts +3 -2
  16. package/dist/_dts/preview-next/src/client/preview/PreviewEditorUI.d.ts +2 -1
  17. package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
  18. package/dist/_dts/sdk/src/client/management/types.d.ts +6 -0
  19. package/dist/_dts/sdk/src/version.d.ts +1 -1
  20. package/dist/{chunk-LBBPD2IW.mjs → chunk-4QNLOTES.mjs} +11 -16
  21. package/dist/{chunk-X5ZCSU6F.mjs → chunk-NFWGLRZZ.mjs} +1 -70
  22. package/dist/{chunk-QRKJDWT7.mjs → chunk-OCGTXHSO.mjs} +8 -7
  23. package/dist/{chunk-3LXFQS7T.mjs → chunk-PYDHOMEO.mjs} +1 -1
  24. package/dist/{chunk-RCTJAZSK.mjs → chunk-WFPYN7KA.mjs} +2 -2
  25. package/dist/{chunk-O62NDCTI.mjs → chunk-ZR2GQK2A.mjs} +6 -37
  26. package/dist/cli/index.mjs +10 -11
  27. package/dist/client/{bookingForm-DYXT6YB6.mjs → bookingForm-36CWQUMV.mjs} +1 -1
  28. package/dist/client/bookings.mjs +1 -4
  29. package/dist/client/{chunk-UHDWIXVR.mjs → chunk-3C2VTPWI.mjs} +3 -2
  30. package/dist/client/{chunk-GFSQNTRW.mjs → chunk-SDIYSQAY.mjs} +0 -4
  31. package/dist/client/client.mjs +12 -16
  32. package/dist/client/{courseRegistration-YBOGURTA.mjs → courseRegistration-TMKU6ABO.mjs} +1 -1
  33. package/dist/client/{eventCalendar-K4QJVCMD.mjs → eventCalendar-G6TI32X6.mjs} +2 -2
  34. package/dist/client/{eventCombined-MTXGMTCZ.mjs → eventCombined-SCKEMNAR.mjs} +2 -2
  35. package/dist/client/{eventDetails-3PC4NL3U.mjs → eventDetails-XPIFXXPK.mjs} +2 -2
  36. package/dist/client/{eventListing-TFJET6DN.mjs → eventListing-7QFMEMGT.mjs} +2 -2
  37. package/dist/client/{eventRegistration-QGPBGJTW.mjs → eventRegistration-TOODSZUI.mjs} +2 -2
  38. package/dist/client/{form-MDKR4FNB.mjs → form-MTCMVCZT.mjs} +1 -1
  39. package/dist/client/{newsletterForm-ZR5UDGBT.mjs → newsletterForm-PCAIPFMA.mjs} +1 -1
  40. package/dist/client/rendering/client.mjs +2 -5
  41. package/dist/client/rendering/islands.mjs +9 -9
  42. package/dist/client/rendering.mjs +2 -5
  43. package/dist/client/spam-protection.mjs +0 -4
  44. package/dist/preview-next/client/runtime.mjs +5 -5
  45. package/dist/{sdk-runtime-7HJYPRWQ.mjs → sdk-runtime-QLOCYKVU.mjs} +6 -6
  46. package/dist/server/index.mjs +10 -11
  47. package/dist/server/next.mjs +10 -11
  48. package/dist/server/prebuild.mjs +1 -1
  49. package/dist/server/server.mjs +10 -11
  50. package/package.json +1 -1
  51. package/dist/SdkPreviewModeRuntime-EIMQ3S2V.mjs +0 -8
@@ -66894,17 +66894,21 @@ function looksLikeLocalAuthority(authority) {
66894
66894
  const normalized = authority.toLowerCase();
66895
66895
  return normalized === "localhost" || normalized.startsWith("localhost:") || normalized.startsWith("127.") || normalized.startsWith("0.0.0.0") || normalized.includes(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".test");
66896
66896
  }
66897
- function normalizeDashboardUrlBase(input) {
66897
+ function normalizeDashboardOrigin(input) {
66898
66898
  const trimmed = input.trim();
66899
66899
  if (!trimmed) return "";
66900
66900
  const withoutTrailingSlash = trimmed.replace(/\/+$/, "");
66901
66901
  const withoutApiSuffix = withoutTrailingSlash.replace(/\/api\/?$/, "");
66902
66902
  if (/^https?:\/\//i.test(withoutApiSuffix)) {
66903
- return withoutApiSuffix;
66903
+ return new URL(withoutApiSuffix).origin;
66904
66904
  }
66905
66905
  const authority = withoutApiSuffix.replace(/^\/+/, "");
66906
66906
  const protocol = looksLikeLocalAuthority(authority) ? "http" : "https";
66907
- return `${protocol}://${authority}`;
66907
+ return new URL(`${protocol}://${authority}`).origin;
66908
+ }
66909
+ function deriveCmsApiUrlFromDashboardUrl(input) {
66910
+ const origin = normalizeDashboardOrigin(input);
66911
+ return origin ? `${origin}/api` : "";
66908
66912
  }
66909
66913
  function getCmsApiUrl() {
66910
66914
  if (typeof window !== "undefined") {
@@ -66916,15 +66920,10 @@ function getCmsApiUrl() {
66916
66920
  }
66917
66921
  const dashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL;
66918
66922
  if (dashboardUrl) {
66919
- const base = normalizeDashboardUrlBase(dashboardUrl);
66920
- return `${base}/api`;
66921
- }
66922
- const legacyApiUrl = process.env.NEXT_PUBLIC_CMS_API_URL;
66923
- if (legacyApiUrl) {
66924
- return legacyApiUrl.replace(/\/$/, "");
66923
+ return deriveCmsApiUrlFromDashboardUrl(dashboardUrl);
66925
66924
  }
66926
66925
  throw new Error(
66927
- "NEXT_PUBLIC_DASHBOARD_URL is not configured. Set it to your dashboard URL (e.g., http://localhost:4000)"
66926
+ "CMS_API_URL or NEXT_PUBLIC_DASHBOARD_URL is not configured. Set NEXT_PUBLIC_DASHBOARD_URL to your dashboard URL (e.g., http://localhost:4000)"
66928
66927
  );
66929
66928
  }
66930
66929
  function resolveApiBaseUrl() {
@@ -70343,7 +70342,7 @@ var CircuitOpenError = class extends Error {
70343
70342
  };
70344
70343
 
70345
70344
  // src/version.ts
70346
- var SDK_VERSION = "0.84.1";
70345
+ var SDK_VERSION = "0.84.2";
70347
70346
 
70348
70347
  // src/next/content-load-failure.ts
70349
70348
  var SdkContentLoadError = RiverbankContentLoadError;
@@ -4,7 +4,7 @@ import * as path from "path";
4
4
  import * as crypto from "crypto";
5
5
 
6
6
  // src/version.ts
7
- var SDK_VERSION = "0.84.1";
7
+ var SDK_VERSION = "0.84.2";
8
8
 
9
9
  // src/constants.ts
10
10
  var PREBUILD_PAGE_SIZE = 50;
@@ -6443,17 +6443,21 @@ function looksLikeLocalAuthority(authority) {
6443
6443
  const normalized = authority.toLowerCase();
6444
6444
  return normalized === "localhost" || normalized.startsWith("localhost:") || normalized.startsWith("127.") || normalized.startsWith("0.0.0.0") || normalized.includes(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".test");
6445
6445
  }
6446
- function normalizeDashboardUrlBase(input) {
6446
+ function normalizeDashboardOrigin(input) {
6447
6447
  const trimmed = input.trim();
6448
6448
  if (!trimmed) return "";
6449
6449
  const withoutTrailingSlash = trimmed.replace(/\/+$/, "");
6450
6450
  const withoutApiSuffix = withoutTrailingSlash.replace(/\/api\/?$/, "");
6451
6451
  if (/^https?:\/\//i.test(withoutApiSuffix)) {
6452
- return withoutApiSuffix;
6452
+ return new URL(withoutApiSuffix).origin;
6453
6453
  }
6454
6454
  const authority = withoutApiSuffix.replace(/^\/+/, "");
6455
6455
  const protocol = looksLikeLocalAuthority(authority) ? "http" : "https";
6456
- return `${protocol}://${authority}`;
6456
+ return new URL(`${protocol}://${authority}`).origin;
6457
+ }
6458
+ function deriveCmsApiUrlFromDashboardUrl(input) {
6459
+ const origin = normalizeDashboardOrigin(input);
6460
+ return origin ? `${origin}/api` : "";
6457
6461
  }
6458
6462
  function getCmsApiUrl() {
6459
6463
  if (typeof window !== "undefined") {
@@ -6465,15 +6469,10 @@ function getCmsApiUrl() {
6465
6469
  }
6466
6470
  const dashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL;
6467
6471
  if (dashboardUrl) {
6468
- const base = normalizeDashboardUrlBase(dashboardUrl);
6469
- return `${base}/api`;
6470
- }
6471
- const legacyApiUrl = process.env.NEXT_PUBLIC_CMS_API_URL;
6472
- if (legacyApiUrl) {
6473
- return legacyApiUrl.replace(/\/$/, "");
6472
+ return deriveCmsApiUrlFromDashboardUrl(dashboardUrl);
6474
6473
  }
6475
6474
  throw new Error(
6476
- "NEXT_PUBLIC_DASHBOARD_URL is not configured. Set it to your dashboard URL (e.g., http://localhost:4000)"
6475
+ "CMS_API_URL or NEXT_PUBLIC_DASHBOARD_URL is not configured. Set NEXT_PUBLIC_DASHBOARD_URL to your dashboard URL (e.g., http://localhost:4000)"
6477
6476
  );
6478
6477
  }
6479
6478
  function resolveApiBaseUrl() {
@@ -6999,7 +6998,7 @@ var SimpleCache = class {
6999
6998
  };
7000
6999
 
7001
7000
  // src/version.ts
7002
- var SDK_VERSION = "0.84.1";
7001
+ var SDK_VERSION = "0.84.2";
7003
7002
 
7004
7003
  // src/client/error.ts
7005
7004
  var RiverbankApiError = class _RiverbankApiError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riverbankcms/sdk",
3
- "version": "0.84.1",
3
+ "version": "0.84.2",
4
4
  "description": "Riverbank CMS SDK for headless content consumption",
5
5
  "main": "./dist/server/index.mjs",
6
6
  "module": "./dist/server/index.mjs",
@@ -1,8 +0,0 @@
1
- "use client";
2
- export { SdkPreviewModeRuntime } from './chunk-QRKJDWT7.mjs';
3
- import './chunk-3LXFQS7T.mjs';
4
- import './chunk-X5ZCSU6F.mjs';
5
- import './chunk-RCTJAZSK.mjs';
6
- import './chunk-O62NDCTI.mjs';
7
- import './chunk-LBBPD2IW.mjs';
8
- import './chunk-R7POPVJR.mjs';