@rovela-ai/sdk 0.16.4 → 0.18.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.
Files changed (149) hide show
  1. package/dist/admin/api/branding.d.ts +79 -0
  2. package/dist/admin/api/branding.d.ts.map +1 -0
  3. package/dist/admin/api/branding.js +238 -0
  4. package/dist/admin/api/branding.js.map +1 -0
  5. package/dist/admin/api/orders.d.ts.map +1 -1
  6. package/dist/admin/api/orders.js +10 -3
  7. package/dist/admin/api/orders.js.map +1 -1
  8. package/dist/admin/api/refund.d.ts.map +1 -1
  9. package/dist/admin/api/refund.js +1 -0
  10. package/dist/admin/api/refund.js.map +1 -1
  11. package/dist/admin/api/return.d.ts.map +1 -1
  12. package/dist/admin/api/return.js +1 -0
  13. package/dist/admin/api/return.js.map +1 -1
  14. package/dist/admin/api/settings.d.ts.map +1 -1
  15. package/dist/admin/api/settings.js +27 -4
  16. package/dist/admin/api/settings.js.map +1 -1
  17. package/dist/admin/api/stats.d.ts.map +1 -1
  18. package/dist/admin/api/stats.js +5 -2
  19. package/dist/admin/api/stats.js.map +1 -1
  20. package/dist/admin/components/AdminTopBar.d.ts +1 -1
  21. package/dist/admin/components/AdminTopBar.d.ts.map +1 -1
  22. package/dist/admin/components/AdminTopBar.js +19 -2
  23. package/dist/admin/components/AdminTopBar.js.map +1 -1
  24. package/dist/admin/components/BrandingAssetUpload.d.ts +14 -0
  25. package/dist/admin/components/BrandingAssetUpload.d.ts.map +1 -0
  26. package/dist/admin/components/BrandingAssetUpload.js +207 -0
  27. package/dist/admin/components/BrandingAssetUpload.js.map +1 -0
  28. package/dist/admin/components/CookieBannerConfigurator.d.ts +9 -0
  29. package/dist/admin/components/CookieBannerConfigurator.d.ts.map +1 -0
  30. package/dist/admin/components/CookieBannerConfigurator.js +97 -0
  31. package/dist/admin/components/CookieBannerConfigurator.js.map +1 -0
  32. package/dist/admin/components/CustomerDetails.d.ts.map +1 -1
  33. package/dist/admin/components/CustomerDetails.js +5 -17
  34. package/dist/admin/components/CustomerDetails.js.map +1 -1
  35. package/dist/admin/components/CustomerTable.d.ts.map +1 -1
  36. package/dist/admin/components/CustomerTable.js +4 -8
  37. package/dist/admin/components/CustomerTable.js.map +1 -1
  38. package/dist/admin/components/FilesManager.d.ts.map +1 -1
  39. package/dist/admin/components/FilesManager.js +7 -3
  40. package/dist/admin/components/FilesManager.js.map +1 -1
  41. package/dist/admin/components/LogoUpload.d.ts +11 -10
  42. package/dist/admin/components/LogoUpload.d.ts.map +1 -1
  43. package/dist/admin/components/LogoUpload.js +8 -192
  44. package/dist/admin/components/LogoUpload.js.map +1 -1
  45. package/dist/admin/components/OrderDetails.d.ts.map +1 -1
  46. package/dist/admin/components/OrderDetails.js +4 -10
  47. package/dist/admin/components/OrderDetails.js.map +1 -1
  48. package/dist/admin/components/OrderTable.d.ts.map +1 -1
  49. package/dist/admin/components/OrderTable.js +4 -10
  50. package/dist/admin/components/OrderTable.js.map +1 -1
  51. package/dist/admin/components/RecentOrders.d.ts.map +1 -1
  52. package/dist/admin/components/RecentOrders.js +4 -9
  53. package/dist/admin/components/RecentOrders.js.map +1 -1
  54. package/dist/admin/components/RevenueChart.d.ts.map +1 -1
  55. package/dist/admin/components/RevenueChart.js +6 -11
  56. package/dist/admin/components/RevenueChart.js.map +1 -1
  57. package/dist/admin/components/StoreSettings.d.ts.map +1 -1
  58. package/dist/admin/components/StoreSettings.js +54 -15
  59. package/dist/admin/components/StoreSettings.js.map +1 -1
  60. package/dist/admin/components/UsersTable.d.ts.map +1 -1
  61. package/dist/admin/components/UsersTable.js +5 -7
  62. package/dist/admin/components/UsersTable.js.map +1 -1
  63. package/dist/admin/components/index.d.ts +4 -0
  64. package/dist/admin/components/index.d.ts.map +1 -1
  65. package/dist/admin/components/index.js +2 -0
  66. package/dist/admin/components/index.js.map +1 -1
  67. package/dist/admin/hooks/useAdminDates.d.ts +11 -0
  68. package/dist/admin/hooks/useAdminDates.d.ts.map +1 -0
  69. package/dist/admin/hooks/useAdminDates.js +46 -0
  70. package/dist/admin/hooks/useAdminDates.js.map +1 -0
  71. package/dist/admin/index.d.ts +2 -2
  72. package/dist/admin/index.d.ts.map +1 -1
  73. package/dist/admin/index.js +1 -1
  74. package/dist/admin/index.js.map +1 -1
  75. package/dist/admin/types.d.ts +3 -0
  76. package/dist/admin/types.d.ts.map +1 -1
  77. package/dist/analytics/api/dashboard.d.ts.map +1 -1
  78. package/dist/analytics/api/dashboard.js +4 -1
  79. package/dist/analytics/api/dashboard.js.map +1 -1
  80. package/dist/analytics/server/queries.d.ts +1 -1
  81. package/dist/analytics/server/queries.d.ts.map +1 -1
  82. package/dist/analytics/server/queries.js +6 -4
  83. package/dist/analytics/server/queries.js.map +1 -1
  84. package/dist/analytics/views/DashboardsView.d.ts.map +1 -1
  85. package/dist/analytics/views/DashboardsView.js +5 -7
  86. package/dist/analytics/views/DashboardsView.js.map +1 -1
  87. package/dist/analytics/views/EventsView.d.ts.map +1 -1
  88. package/dist/analytics/views/EventsView.js +7 -2
  89. package/dist/analytics/views/EventsView.js.map +1 -1
  90. package/dist/analytics/views/VisitorsView.d.ts.map +1 -1
  91. package/dist/analytics/views/VisitorsView.js +6 -2
  92. package/dist/analytics/views/VisitorsView.js.map +1 -1
  93. package/dist/core/StoreSettingsProvider.d.ts +4 -0
  94. package/dist/core/StoreSettingsProvider.d.ts.map +1 -1
  95. package/dist/core/StoreSettingsProvider.js +4 -1
  96. package/dist/core/StoreSettingsProvider.js.map +1 -1
  97. package/dist/core/api/settings.d.ts +1 -0
  98. package/dist/core/api/settings.d.ts.map +1 -1
  99. package/dist/core/api/settings.js +6 -2
  100. package/dist/core/api/settings.js.map +1 -1
  101. package/dist/core/cookie-consent/CookieBanner.d.ts.map +1 -1
  102. package/dist/core/cookie-consent/CookieBanner.js +266 -92
  103. package/dist/core/cookie-consent/CookieBanner.js.map +1 -1
  104. package/dist/core/cookie-consent/CookieConsentProvider.d.ts +11 -2
  105. package/dist/core/cookie-consent/CookieConsentProvider.d.ts.map +1 -1
  106. package/dist/core/cookie-consent/CookieConsentProvider.js +26 -7
  107. package/dist/core/cookie-consent/CookieConsentProvider.js.map +1 -1
  108. package/dist/core/cookie-consent/CookiePreferencesLink.d.ts.map +1 -1
  109. package/dist/core/cookie-consent/CookiePreferencesLink.js +5 -3
  110. package/dist/core/cookie-consent/CookiePreferencesLink.js.map +1 -1
  111. package/dist/core/cookie-consent/index.d.ts +2 -1
  112. package/dist/core/cookie-consent/index.d.ts.map +1 -1
  113. package/dist/core/cookie-consent/index.js +1 -0
  114. package/dist/core/cookie-consent/index.js.map +1 -1
  115. package/dist/core/cookie-consent/types.d.ts +70 -4
  116. package/dist/core/cookie-consent/types.d.ts.map +1 -1
  117. package/dist/core/cookie-consent/types.js +117 -5
  118. package/dist/core/cookie-consent/types.js.map +1 -1
  119. package/dist/core/dates.d.ts +15 -0
  120. package/dist/core/dates.d.ts.map +1 -0
  121. package/dist/core/dates.js +22 -0
  122. package/dist/core/dates.js.map +1 -0
  123. package/dist/core/db/queries.d.ts +34 -30
  124. package/dist/core/db/queries.d.ts.map +1 -1
  125. package/dist/core/db/queries.js +46 -17
  126. package/dist/core/db/queries.js.map +1 -1
  127. package/dist/core/db/schema.d.ts +39 -1
  128. package/dist/core/db/schema.d.ts.map +1 -1
  129. package/dist/core/db/schema.js +10 -1
  130. package/dist/core/db/schema.js.map +1 -1
  131. package/dist/core/index.d.ts +1 -0
  132. package/dist/core/index.d.ts.map +1 -1
  133. package/dist/core/index.js +2 -0
  134. package/dist/core/index.js.map +1 -1
  135. package/dist/core/useStoreFormatting.js +1 -1
  136. package/dist/core/useStoreFormatting.js.map +1 -1
  137. package/dist/emails/config.d.ts +6 -0
  138. package/dist/emails/config.d.ts.map +1 -1
  139. package/dist/emails/config.js +19 -1
  140. package/dist/emails/config.js.map +1 -1
  141. package/dist/emails/send/auth.js +1 -1
  142. package/dist/emails/send/auth.js.map +1 -1
  143. package/dist/emails/types.d.ts +2 -0
  144. package/dist/emails/types.d.ts.map +1 -1
  145. package/dist/emails/utils.d.ts +2 -2
  146. package/dist/emails/utils.d.ts.map +1 -1
  147. package/dist/emails/utils.js +8 -2
  148. package/dist/emails/utils.js.map +1 -1
  149. package/package.json +5 -1
@@ -97,7 +97,10 @@ function writeStoredConsent(record) {
97
97
  // for the session; user re-prompts next visit.
98
98
  }
99
99
  }
100
- export function CookieConsentProvider({ enabled, children, }) {
100
+ export function CookieConsentProvider({ enabled, config, regionExempt = false, children, }) {
101
+ // Region-exempt visitors follow the exact disabled-banner path: implicit
102
+ // grant, no banner, no preferences affordances.
103
+ const effectiveEnabled = enabled && !regionExempt;
101
104
  // SSR-safe initial state — provider always starts with "not decided";
102
105
  // the post-mount effect reads localStorage and updates. Means we don't
103
106
  // hydration-mismatch between server and client.
@@ -106,9 +109,9 @@ export function CookieConsentProvider({ enabled, children, }) {
106
109
  const [preferencesOpen, setPreferencesOpen] = React.useState(false);
107
110
  // On mount, read the stored decision (if any within re-prompt window).
108
111
  React.useEffect(() => {
109
- if (!enabled) {
110
- // Admin disabled the banner grant everything so analytics/
111
- // marketing scripts can run. This is the merchant's call.
112
+ if (!effectiveEnabled) {
113
+ // Admin disabled the banner (or the visitor is outside the configured
114
+ // region) grant everything so analytics/marketing scripts can run.
112
115
  setConsent(fullGrant());
113
116
  setHydrated(true);
114
117
  return;
@@ -117,7 +120,22 @@ export function CookieConsentProvider({ enabled, children, }) {
117
120
  if (stored)
118
121
  setConsent(stored);
119
122
  setHydrated(true);
120
- }, [enabled]);
123
+ }, [effectiveEnabled]);
124
+ // Pixel bridge: expose the consent state to NON-React scripts (CC-installed
125
+ // pixel tags, Google Consent Mode wiring). `window.rovelaConsent` is the
126
+ // current state; 'rovela:consent-changed' fires on every change so tags can
127
+ // gate + update consent-mode signals without importing the hook.
128
+ React.useEffect(() => {
129
+ if (typeof window === 'undefined')
130
+ return;
131
+ const detail = {
132
+ analytics: consent.analytics,
133
+ marketing: consent.marketing,
134
+ decided: consent.decidedAt !== null,
135
+ };
136
+ window.rovelaConsent = detail;
137
+ window.dispatchEvent(new CustomEvent('rovela:consent-changed', { detail }));
138
+ }, [consent]);
121
139
  const update = React.useCallback((categories) => {
122
140
  const next = {
123
141
  essential: true,
@@ -138,12 +156,13 @@ export function CookieConsentProvider({ enabled, children, }) {
138
156
  const value = React.useMemo(() => ({
139
157
  consent,
140
158
  hasDecided: consent.decidedAt !== null,
141
- bannerDisabled: !enabled,
159
+ bannerDisabled: !effectiveEnabled,
142
160
  update,
143
161
  openPreferences,
144
162
  preferencesOpen,
145
163
  closePreferences,
146
- }), [consent, enabled, update, openPreferences, preferencesOpen, closePreferences]);
164
+ config: config ?? {},
165
+ }), [consent, effectiveEnabled, config, update, openPreferences, preferencesOpen, closePreferences]);
147
166
  // Don't flash children with stale SSR state → the first client render
148
167
  // is default (not-decided) which is safe: no scripts gate on it yet.
149
168
  void hydrated;
@@ -1 +1 @@
1
- {"version":3,"file":"CookieConsentProvider.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/CookieConsentProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,sDAAsD;AACtD,MAAM,WAAW,GAAG,uBAAuB,CAAA;AAE3C;;mCAEmC;AACnC,MAAM,OAAO,GAAG,CAAC,CAAA;AAEjB;oCACoC;AACpC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AA8B/B,MAAM,oBAAoB,GACxB,KAAK,CAAC,aAAa,CAAmC,IAAI,CAAC,CAAA;AAE7D,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,SAAS,cAAc;IACrB,OAAO;QACL,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,OAAO;K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AAK,CACb,8DAA8D,CAC/D,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
1
+ {"version":3,"file":"CookieConsentProvider.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/CookieConsentProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,sDAAsD;AACtD,MAAM,WAAW,GAAG,uBAAuB,CAAA;AAE3C;;mCAEmC;AACnC,MAAM,OAAO,GAAG,CAAC,CAAA;AAEjB;oCACoC;AACpC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAgC/B,MAAM,oBAAoB,GACxB,KAAK,CAAC,aAAa,CAAmC,IAAI,CAAC,CAAA;AAE7D,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,SAAS,cAAc;IACrB,OAAO;QACL,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,OAAO;KACjB,CAAA;AACH,CAAC;AAED,SAAS,SAAS;IAChB,OAAO;QACL,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,OAAO,EAAE,OAAO;KACjB,CAAA;AACH,CAAC;AAED,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAEhF,SAAS,iBAAiB;IACxB,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAA;IAC9C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAA;QACrB,MAAM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ChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;IAClD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CookiePreferencesLink.d.ts","sourceRoot":"","sources":["../../../src/core/cookie-consent/CookiePreferencesLink.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,SAAS,GAAG,MAAM,CACnB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,0BAA0B,kDAa5B"}
1
+ {"version":3,"file":"CookiePreferencesLink.d.ts","sourceRoot":"","sources":["../../../src/core/cookie-consent/CookiePreferencesLink.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,SAAS,GAAG,MAAM,CACnB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,0BAA0B,kDAe5B"}
@@ -4,10 +4,12 @@ import { useConsentContext } from './CookieConsentProvider';
4
4
  import { useT } from '../i18n';
5
5
  export function CookiePreferencesLink({ children, ...props }) {
6
6
  const t = useT();
7
- const { openPreferences, bannerDisabled } = useConsentContext();
7
+ const { openPreferences, bannerDisabled, config } = useConsentContext();
8
8
  // If the merchant has disabled the banner entirely, there are no
9
- // preferences to manage — don't render the link at all.
10
- if (bannerDisabled)
9
+ // preferences to manage — don't render the link at all. Same when the
10
+ // reopen affordance is configured as badge-ONLY (the floating badge is
11
+ // the sole reopen surface then).
12
+ if (bannerDisabled || config.reopen === 'badge')
11
13
  return null;
12
14
  return (_jsx("button", { type: "button", onClick: openPreferences, ...props, children: children ?? t('consent.title') }));
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CookiePreferencesLink.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/CookiePreferencesLink.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAeZ,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAO9B,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EACR,GAAG,KAAK,EACmB;IAC3B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAA;IAChB,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAE/D,iEAAiE;IACjE,wDAAwD;IACxD,IAAI,cAAc;QAAE,OAAO,IAAI,CAAA;IAE/B,OAAO,CACL,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,eAAe,KAAM,KAAK,YACtD,QAAQ,IAAI,CAAC,CAAC,eAAe,CAAC,GACxB,CACV,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"CookiePreferencesLink.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/CookiePreferencesLink.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAeZ,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAO9B,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EACR,GAAG,KAAK,EACmB;IAC3B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAA;IAChB,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEvE,iEAAiE;IACjE,sEAAsE;IACtE,uEAAuE;IACvE,iCAAiC;IACjC,IAAI,cAAc,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO;QAAE,OAAO,IAAI,CAAA;IAE5D,OAAO,CACL,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,eAAe,KAAM,KAAK,YACtD,QAAQ,IAAI,CAAC,CAAC,eAAe,CAAC,GACxB,CACV,CAAA;AACH,CAAC"}
@@ -13,5 +13,6 @@ export { CookieConsentProvider, type CookieConsentProviderProps, } from './Cooki
13
13
  export { CookieBanner } from './CookieBanner';
14
14
  export { CookiePreferencesLink, type CookiePreferencesLinkProps, } from './CookiePreferencesLink';
15
15
  export { useCookieConsent, type UseCookieConsentReturn } from './useCookieConsent';
16
- export type { ConsentCategories, ConsentRecord, CategoryKey } from './types';
16
+ export type { ConsentCategories, ConsentRecord, CategoryKey, CookieConsentConfig, ConsentBannerLayout, ConsentBannerPosition, ConsentBannerTheme, ConsentBannerColors, ConsentCopyOverrides, ConsentRegionRule, ConsentReopenAffordance, } from './types';
17
+ export { CONSENT_EU_REGION, consentRegionExempt, sanitizeCookieConsentConfig, } from './types';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/cookie-consent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAClF,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/cookie-consent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAClF,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,SAAS,CAAA"}
@@ -13,4 +13,5 @@ export { CookieConsentProvider, } from './CookieConsentProvider';
13
13
  export { CookieBanner } from './CookieBanner';
14
14
  export { CookiePreferencesLink, } from './CookiePreferencesLink';
15
15
  export { useCookieConsent } from './useCookieConsent';
16
+ export { CONSENT_EU_REGION, consentRegionExempt, sanitizeCookieConsentConfig, } from './types';
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,qBAAqB,GAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,qBAAqB,GAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAA+B,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,qBAAqB,GAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,qBAAqB,GAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAA+B,MAAM,oBAAoB,CAAA;AAclF,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,SAAS,CAAA"}
@@ -1,10 +1,16 @@
1
1
  /**
2
- * Cookie consent types (R021).
2
+ * Cookie consent types + banner configuration (R021).
3
3
  *
4
- * Shared shape between provider, banner, hook. Keep lean — the minimum
5
- * viable EDPB-compliant categorization is Essential / Analytics /
6
- * Marketing. We do NOT ship per-vendor granularity; categories are the
4
+ * Consent state stays lean — the minimum viable EDPB-compliant
5
+ * categorization is Essential / Analytics / Marketing; categories are the
7
6
  * contract any storefront script follows via `useCookieConsent()`.
7
+ *
8
+ * COMPLIANCE GUARDRAILS ARE NOT CONFIGURABLE — reject parity, no pre-ticked
9
+ * boxes, close-equals-refusal, the three-category model and the 12-month
10
+ * re-consent window are hard-coded in the banner. The config below only
11
+ * shapes presentation (layout, colors, copy), audience (region rule) and
12
+ * the reopen affordance. That is the guarantee: when the merchant enables
13
+ * the banner, the compliant behavior cannot be configured away.
8
14
  */
9
15
  export interface ConsentCategories {
10
16
  /** Strictly necessary (cart, session, login). Always on, never
@@ -28,4 +34,64 @@ export interface ConsentRecord extends ConsentCategories {
28
34
  version: number;
29
35
  }
30
36
  export type CategoryKey = 'analytics' | 'marketing';
37
+ export type ConsentBannerLayout = 'card' | 'bar' | 'modal';
38
+ export type ConsentBannerPosition = 'bottom-left' | 'bottom-right' | 'bottom-center';
39
+ export type ConsentBannerTheme = 'auto' | 'light' | 'dark' | 'custom';
40
+ export type ConsentRegionRule = 'worldwide' | 'eu-only';
41
+ export type ConsentReopenAffordance = 'link' | 'badge' | 'both';
42
+ export interface ConsentBannerColors {
43
+ /** Card/bar background. */
44
+ background?: string;
45
+ /** Body text color. */
46
+ text?: string;
47
+ /** Accept-all button background. */
48
+ accent?: string;
49
+ /** Accept-all button text. */
50
+ accentText?: string;
51
+ }
52
+ /** Per-locale copy overrides. Missing keys fall back to the i18n catalog. */
53
+ export interface ConsentCopyOverrides {
54
+ title?: string;
55
+ intro?: string;
56
+ acceptAll?: string;
57
+ rejectAll?: string;
58
+ customize?: string;
59
+ }
60
+ export interface CookieConsentConfig {
61
+ /** Banner shell: floating card (default) / full-width bar / centered modal. */
62
+ layout?: ConsentBannerLayout;
63
+ /** Corner for the card layout (bar is always bottom, modal always center). */
64
+ position?: ConsentBannerPosition;
65
+ /** 'auto' (default) derives from the store's CSS tokens; light/dark fix
66
+ * the neutrals; 'custom' uses `colors`. */
67
+ theme?: ConsentBannerTheme;
68
+ colors?: ConsentBannerColors;
69
+ /** Per-locale copy overrides keyed by locale code ('en', 'fr', ...). */
70
+ copy?: Record<string, ConsentCopyOverrides>;
71
+ /** Who sees the banner. 'eu-only' shows it to EU/EEA/UK/CH visitors and
72
+ * grants-by-default elsewhere; 'worldwide' (default) shows it to everyone. */
73
+ region?: ConsentRegionRule;
74
+ /** How users re-open preferences after deciding: footer link (default),
75
+ * a floating badge, or both. */
76
+ reopen?: ConsentReopenAffordance;
77
+ }
78
+ /**
79
+ * ISO-3166-1 alpha-2 countries where GDPR/ePrivacy-style prior consent
80
+ * applies: all 27 EU members + EEA (IS, LI, NO) + UK + Switzerland.
81
+ * (Deliberately broader than the seed's banner-default heuristic — this set
82
+ * gates a compliance RULE, not a default.)
83
+ */
84
+ export declare const CONSENT_EU_REGION: Set<string>;
85
+ /**
86
+ * Whether a visitor is exempt from the banner under the config's region
87
+ * rule. Unknown country (no geo header — sandbox, self-hosted, bots) is
88
+ * NEVER exempt: fail closed toward showing the banner.
89
+ */
90
+ export declare function consentRegionExempt(config: CookieConsentConfig | null | undefined, country: string | null | undefined): boolean;
91
+ /**
92
+ * Validate + strip unknown keys from a raw config object (admin PUT body or
93
+ * a store_settings row). Never throws; anything unrecognized is dropped so
94
+ * a hand-edited row can degrade but never break the storefront.
95
+ */
96
+ export declare function sanitizeCookieConsentConfig(raw: unknown): CookieConsentConfig;
31
97
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/cookie-consent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,iBAAiB;IAChC;;8DAE0D;IAC1D,SAAS,EAAE,IAAI,CAAA;IACf;4BACwB;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB;sDACkD;IAClD,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;+CAC2C;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;4EAEwE;IACxE,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,WAAW,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/cookie-consent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,WAAW,iBAAiB;IAChC;;8DAE0D;IAC1D,SAAS,EAAE,IAAI,CAAA;IACf;4BACwB;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB;sDACkD;IAClD,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;+CAC2C;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;4EAEwE;IACxE,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GA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BAAuB,CAAA;CACjC;AAMD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,aAM5B,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,EAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,OAAO,CAIT;AAwBD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CA6C7E"}
@@ -1,10 +1,122 @@
1
1
  /**
2
- * Cookie consent types (R021).
2
+ * Cookie consent types + banner configuration (R021).
3
3
  *
4
- * Shared shape between provider, banner, hook. Keep lean — the minimum
5
- * viable EDPB-compliant categorization is Essential / Analytics /
6
- * Marketing. We do NOT ship per-vendor granularity; categories are the
4
+ * Consent state stays lean — the minimum viable EDPB-compliant
5
+ * categorization is Essential / Analytics / Marketing; categories are the
7
6
  * contract any storefront script follows via `useCookieConsent()`.
7
+ *
8
+ * COMPLIANCE GUARDRAILS ARE NOT CONFIGURABLE — reject parity, no pre-ticked
9
+ * boxes, close-equals-refusal, the three-category model and the 12-month
10
+ * re-consent window are hard-coded in the banner. The config below only
11
+ * shapes presentation (layout, colors, copy), audience (region rule) and
12
+ * the reopen affordance. That is the guarantee: when the merchant enables
13
+ * the banner, the compliant behavior cannot be configured away.
14
+ */
15
+ // =============================================================================
16
+ // Region rule — the compliance-correct EU/EEA + UK + CH set
17
+ // =============================================================================
18
+ /**
19
+ * ISO-3166-1 alpha-2 countries where GDPR/ePrivacy-style prior consent
20
+ * applies: all 27 EU members + EEA (IS, LI, NO) + UK + Switzerland.
21
+ * (Deliberately broader than the seed's banner-default heuristic — this set
22
+ * gates a compliance RULE, not a default.)
23
+ */
24
+ export const CONSENT_EU_REGION = new Set([
25
+ 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR',
26
+ 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL',
27
+ 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE',
28
+ 'IS', 'LI', 'NO',
29
+ 'GB', 'CH',
30
+ ]);
31
+ /**
32
+ * Whether a visitor is exempt from the banner under the config's region
33
+ * rule. Unknown country (no geo header — sandbox, self-hosted, bots) is
34
+ * NEVER exempt: fail closed toward showing the banner.
35
+ */
36
+ export function consentRegionExempt(config, country) {
37
+ if (config?.region !== 'eu-only')
38
+ return false;
39
+ if (!country)
40
+ return false;
41
+ return !CONSENT_EU_REGION.has(country.toUpperCase());
42
+ }
43
+ // =============================================================================
44
+ // Config sanitizer — the ONLY ingress for merchant-supplied config JSON
45
+ // =============================================================================
46
+ const LAYOUTS = ['card', 'bar', 'modal'];
47
+ const POSITIONS = ['bottom-left', 'bottom-right', 'bottom-center'];
48
+ const THEMES = ['auto', 'light', 'dark', 'custom'];
49
+ const REGIONS = ['worldwide', 'eu-only'];
50
+ const REOPENS = ['link', 'badge', 'both'];
51
+ const COPY_KEYS = [
52
+ 'title', 'intro', 'acceptAll', 'rejectAll', 'customize',
53
+ ];
54
+ const HEX_RE = /^#[0-9a-fA-F]{3,8}$/;
55
+ const MAX_COPY = 500;
56
+ const MAX_LOCALES = 12;
57
+ function pickEnum(value, allowed) {
58
+ return typeof value === 'string' && allowed.includes(value)
59
+ ? value
60
+ : undefined;
61
+ }
62
+ /**
63
+ * Validate + strip unknown keys from a raw config object (admin PUT body or
64
+ * a store_settings row). Never throws; anything unrecognized is dropped so
65
+ * a hand-edited row can degrade but never break the storefront.
8
66
  */
9
- export {};
67
+ export function sanitizeCookieConsentConfig(raw) {
68
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw))
69
+ return {};
70
+ const r = raw;
71
+ const out = {};
72
+ const layout = pickEnum(r.layout, LAYOUTS);
73
+ if (layout)
74
+ out.layout = layout;
75
+ const position = pickEnum(r.position, POSITIONS);
76
+ if (position)
77
+ out.position = position;
78
+ const theme = pickEnum(r.theme, THEMES);
79
+ if (theme)
80
+ out.theme = theme;
81
+ const region = pickEnum(r.region, REGIONS);
82
+ if (region)
83
+ out.region = region;
84
+ const reopen = pickEnum(r.reopen, REOPENS);
85
+ if (reopen)
86
+ out.reopen = reopen;
87
+ if (r.colors && typeof r.colors === 'object' && !Array.isArray(r.colors)) {
88
+ const c = r.colors;
89
+ const colors = {};
90
+ for (const key of ['background', 'text', 'accent', 'accentText']) {
91
+ const v = c[key];
92
+ if (typeof v === 'string' && HEX_RE.test(v))
93
+ colors[key] = v;
94
+ }
95
+ if (Object.keys(colors).length > 0)
96
+ out.colors = colors;
97
+ }
98
+ if (r.copy && typeof r.copy === 'object' && !Array.isArray(r.copy)) {
99
+ const copy = {};
100
+ for (const [locale, entry] of Object.entries(r.copy)) {
101
+ if (Object.keys(copy).length >= MAX_LOCALES)
102
+ break;
103
+ if (!/^[a-z]{2}(-[A-Z]{2})?$/.test(locale))
104
+ continue;
105
+ if (!entry || typeof entry !== 'object' || Array.isArray(entry))
106
+ continue;
107
+ const clean = {};
108
+ for (const key of COPY_KEYS) {
109
+ const v = entry[key];
110
+ if (typeof v === 'string' && v.trim() !== '') {
111
+ clean[key] = v.slice(0, MAX_COPY);
112
+ }
113
+ }
114
+ if (Object.keys(clean).length > 0)
115
+ copy[locale] = clean;
116
+ }
117
+ if (Object.keys(copy).length > 0)
118
+ out.copy = copy;
119
+ }
120
+ return out;
121
+ }
10
122
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/cookie-consent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgFH,gFAAgF;AAChF,4DAA4D;AAC5D,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;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GAAyB,EAAE,CAAA;YACtC,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;gBAC5B,MAAM,CAAC,GAAI,KAAiC,CAAC,GAAG,CAAC,CAAA;gBACjD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;oBAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;gBACnC,CAAC;YACH,CAAC;YACD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAA;QACzD,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;YAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;IACnD,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @rovela/sdk/core/dates
3
+ *
4
+ * Timezone-safe date rendering helpers shared across modules (admin +
5
+ * analytics views). Pure functions — no React, safe on server and client.
6
+ */
7
+ /**
8
+ * Format a server-produced plain day key ('YYYY-MM-DD') for display WITHOUT
9
+ * timezone shifting. `new Date('2026-07-10')` parses as UTC midnight, so
10
+ * `toLocaleDateString` in a negative-offset browser zone renders Jul 9 —
11
+ * off by one. Server day buckets are already computed in the store's
12
+ * timezone; this renders the key verbatim as a calendar date.
13
+ */
14
+ export declare function formatDayLabel(dayKey: string, locale?: string, options?: Intl.DateTimeFormatOptions): string;
15
+ //# sourceMappingURL=dates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../src/core/dates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAgB,EACxB,OAAO,GAAE,IAAI,CAAC,qBAA0D,GACvE,MAAM,CAMR"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @rovela/sdk/core/dates
3
+ *
4
+ * Timezone-safe date rendering helpers shared across modules (admin +
5
+ * analytics views). Pure functions — no React, safe on server and client.
6
+ */
7
+ /**
8
+ * Format a server-produced plain day key ('YYYY-MM-DD') for display WITHOUT
9
+ * timezone shifting. `new Date('2026-07-10')` parses as UTC midnight, so
10
+ * `toLocaleDateString` in a negative-offset browser zone renders Jul 9 —
11
+ * off by one. Server day buckets are already computed in the store's
12
+ * timezone; this renders the key verbatim as a calendar date.
13
+ */
14
+ export function formatDayLabel(dayKey, locale = 'en-US', options = { month: 'short', day: 'numeric' }) {
15
+ const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(dayKey);
16
+ if (!m)
17
+ return dayKey;
18
+ // Construct at UTC noon + format in UTC — immune to any zone shift.
19
+ const d = new Date(Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3]), 12));
20
+ return d.toLocaleDateString(locale, { ...options, timeZone: 'UTC' });
21
+ }
22
+ //# sourceMappingURL=dates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.js","sourceRoot":"","sources":["../../src/core/dates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,SAAiB,OAAO,EACxB,UAAsC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE;IAExE,MAAM,CAAC,GAAG,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACjD,IAAI,CAAC,CAAC;QAAE,OAAO,MAAM,CAAA;IACrB,oEAAoE;IACpE,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IAC9E,OAAO,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAA;AACtE,CAAC"}
@@ -50,7 +50,7 @@ export declare function findProducts(options?: FindProductsOptions): Promise<{
50
50
  comparePrice: string | null;
51
51
  images: string[];
52
52
  videos: string[];
53
- status: "active" | "draft" | "archived";
53
+ status: "draft" | "active" | "archived";
54
54
  categoryId: string | null;
55
55
  hasVariants: boolean;
56
56
  sku: string | null;
@@ -87,7 +87,7 @@ export declare function findProductBySlug(slug: string): Promise<{
87
87
  comparePrice: string | null;
88
88
  images: string[];
89
89
  videos: string[];
90
- status: "active" | "draft" | "archived";
90
+ status: "draft" | "active" | "archived";
91
91
  categoryId: string | null;
92
92
  hasVariants: boolean;
93
93
  sku: string | null;
@@ -124,7 +124,7 @@ export declare function findProductById(id: string): Promise<{
124
124
  comparePrice: string | null;
125
125
  images: string[];
126
126
  videos: string[];
127
- status: "active" | "draft" | "archived";
127
+ status: "draft" | "active" | "archived";
128
128
  categoryId: string | null;
129
129
  hasVariants: boolean;
130
130
  sku: string | null;
@@ -538,17 +538,17 @@ export declare const GUEST_PASSWORD_HASH = "";
538
538
  * for the duplicate case, so it is safe to call inline in the checkout webhook.
539
539
  */
540
540
  export declare function findOrCreateGuestCustomer(email: string, name?: string | null): Promise<{
541
- email: string;
542
- name: string | null;
543
541
  id: string;
542
+ name: string | null;
544
543
  createdAt: Date;
545
544
  updatedAt: Date;
545
+ email: string;
546
+ locale: string | null;
546
547
  phone: string | null;
547
548
  passwordHash: string;
548
549
  stripeCustomerId: string | null;
549
550
  emailVerified: Date | null;
550
551
  groupId: string | null;
551
- locale: string | null;
552
552
  }>;
553
553
  /**
554
554
  * Find customer by email
@@ -803,18 +803,18 @@ export declare function getRecentOrders(limit?: number, periodDays?: number): Pr
803
803
  * Create a new order
804
804
  */
805
805
  export declare function createOrder(data: schema.NewOrder): Promise<{
806
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
807
- email: string;
808
806
  id: string;
807
+ status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
809
808
  createdAt: Date;
810
809
  updatedAt: Date;
811
- locale: string | null;
812
- total: string;
813
810
  customerId: string | null;
811
+ email: string;
814
812
  subtotal: string;
815
813
  tax: string;
816
814
  shipping: string;
815
+ total: string;
817
816
  currency: string | null;
817
+ locale: string | null;
818
818
  refundAmount: string | null;
819
819
  returnReason: string | null;
820
820
  discountCode: string | null;
@@ -860,15 +860,15 @@ export declare function createOrder(data: schema.NewOrder): Promise<{
860
860
  * Create order items for an order
861
861
  */
862
862
  export declare function createOrderItems(items: schema.NewOrderItem[]): Promise<{
863
- name: string;
864
863
  id: string;
865
- createdAt: Date;
866
- orderId: string;
864
+ name: string;
867
865
  price: string;
866
+ createdAt: Date;
868
867
  productId: string;
868
+ attributes: Record<string, string> | null;
869
+ orderId: string;
869
870
  variantId: string | null;
870
871
  quantity: number;
871
- attributes: Record<string, string> | null;
872
872
  }[]>;
873
873
  /**
874
874
  * Update order status
@@ -1369,13 +1369,13 @@ export interface CustomerGroupInput {
1369
1369
  sortOrder?: number;
1370
1370
  }
1371
1371
  export declare function createCustomerGroup(data: CustomerGroupInput): Promise<{
1372
- name: string;
1373
1372
  id: string;
1373
+ name: string;
1374
1374
  description: string | null;
1375
1375
  createdAt: Date;
1376
+ updatedAt: Date;
1376
1377
  isActive: boolean;
1377
1378
  sortOrder: number;
1378
- updatedAt: Date;
1379
1379
  }>;
1380
1380
  export declare function updateCustomerGroup(id: string, data: Partial<CustomerGroupInput>): Promise<{
1381
1381
  id: string;
@@ -1478,16 +1478,16 @@ export interface PaymentMethodInput {
1478
1478
  visibleToGroups?: string[];
1479
1479
  }
1480
1480
  export declare function createPaymentMethod(data: PaymentMethodInput): Promise<{
1481
- name: string;
1482
1481
  id: string;
1482
+ name: string;
1483
1483
  createdAt: Date;
1484
- sortOrder: number;
1485
1484
  updatedAt: Date;
1486
- enabled: boolean;
1485
+ sortOrder: number;
1486
+ visibleToGroups: string[];
1487
1487
  kind: string;
1488
1488
  instructions: string | null;
1489
+ enabled: boolean;
1489
1490
  config: Record<string, unknown>;
1490
- visibleToGroups: string[];
1491
1491
  }>;
1492
1492
  export declare function updatePaymentMethod(id: string, data: Partial<PaymentMethodInput>): Promise<{
1493
1493
  id: string;
@@ -1659,14 +1659,15 @@ export interface DiscountInput {
1659
1659
  sortOrder?: number;
1660
1660
  }
1661
1661
  export declare function createDiscount(data: DiscountInput): Promise<{
1662
- code: string | null;
1663
1662
  id: string;
1664
1663
  createdAt: Date;
1665
- sortOrder: number;
1666
1664
  updatedAt: Date;
1667
- type: string;
1665
+ sortOrder: number;
1666
+ code: string | null;
1667
+ enabled: boolean;
1668
1668
  method: string;
1669
1669
  title: string;
1670
+ type: string;
1670
1671
  value: string;
1671
1672
  appliesTo: string;
1672
1673
  targetIds: string[];
@@ -1676,6 +1677,7 @@ export declare function createDiscount(data: DiscountInput): Promise<{
1676
1677
  groupIds: string[];
1677
1678
  usageLimit: number | null;
1678
1679
  oncePerCustomer: boolean;
1680
+ usedCount: number;
1679
1681
  combinesWith: {
1680
1682
  product?: boolean;
1681
1683
  order?: boolean;
@@ -1684,8 +1686,6 @@ export declare function createDiscount(data: DiscountInput): Promise<{
1684
1686
  bxgy: schema.BxgyConfig | null;
1685
1687
  startsAt: Date | null;
1686
1688
  endsAt: Date | null;
1687
- enabled: boolean;
1688
- usedCount: number;
1689
1689
  }>;
1690
1690
  export declare function updateDiscount(id: string, data: Partial<DiscountInput>): Promise<{
1691
1691
  id: string;
@@ -1850,19 +1850,19 @@ export interface StoreLocationInput {
1850
1850
  sortOrder?: number;
1851
1851
  }
1852
1852
  export declare function createStoreLocation(data: StoreLocationInput): Promise<{
1853
- email: string | null;
1854
- name: string;
1855
1853
  id: string;
1854
+ name: string;
1856
1855
  description: string | null;
1857
1856
  createdAt: Date;
1858
- isActive: boolean;
1859
- sortOrder: number;
1860
1857
  updatedAt: Date;
1858
+ email: string | null;
1861
1859
  phone: string | null;
1862
1860
  city: string | null;
1863
1861
  state: string | null;
1864
1862
  postalCode: string | null;
1865
1863
  country: string | null;
1864
+ isActive: boolean;
1865
+ sortOrder: number;
1866
1866
  address1: string | null;
1867
1867
  address2: string | null;
1868
1868
  latitude: string | null;
@@ -1917,7 +1917,7 @@ export declare function countOrders(options?: {
1917
1917
  *
1918
1918
  * Date format is `YYYY-MM-DD` in UTC (matches Postgres `DATE()` output).
1919
1919
  */
1920
- export declare function getRevenueByPeriod(days: number): Promise<{
1920
+ export declare function getRevenueByPeriod(days: number, timeZone?: string): Promise<{
1921
1921
  date: string;
1922
1922
  revenue: number;
1923
1923
  }[]>;
@@ -1939,6 +1939,8 @@ export interface StoreSettingsData {
1939
1939
  storeName: string | null;
1940
1940
  storeEmail: string | null;
1941
1941
  logoUrl: string | null;
1942
+ /** Favicon URL (small square mark; render surfaces fall back to logoUrl). */
1943
+ faviconUrl: string | null;
1942
1944
  storeCurrency: string | null;
1943
1945
  storeTimezone: string | null;
1944
1946
  /** ISO 3166-1 alpha-2 home country (e.g. 'FR'). Drives every country default. */
@@ -1949,6 +1951,8 @@ export interface StoreSettingsData {
1949
1951
  enabledLocales: string[] | null;
1950
1952
  /** Email theme (Phase D). NULL = derive from the store's brand. */
1951
1953
  emailTheme: Record<string, unknown> | null;
1954
+ /** Cookie-banner configuration (SDK 0.18.0). NULL/{} = defaults. */
1955
+ cookieConsent: Record<string, unknown> | null;
1952
1956
  taxIncludedInPrices: boolean | null;
1953
1957
  shippingEnabled: boolean | null;
1954
1958
  freeShippingThreshold: number | null;