@infuro/cms-core 1.0.46 → 1.0.50

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 (65) hide show
  1. package/README.md +30 -16
  2. package/dist/admin.cjs +4568 -2716
  3. package/dist/admin.d.cts +18 -4
  4. package/dist/admin.d.ts +18 -4
  5. package/dist/admin.js +3475 -1625
  6. package/dist/api.cjs +38 -39
  7. package/dist/api.d.cts +9 -3
  8. package/dist/api.d.ts +9 -3
  9. package/dist/api.js +6 -7
  10. package/dist/auth.cjs +84 -51
  11. package/dist/auth.d.cts +105 -4
  12. package/dist/auth.d.ts +105 -4
  13. package/dist/auth.js +4 -3
  14. package/dist/chunk-2IAXTKQN.cjs +19 -0
  15. package/dist/chunk-3EOM4V2M.cjs +452 -0
  16. package/dist/{chunk-X6UQFV4X.cjs → chunk-77NUXO6A.cjs} +14 -12
  17. package/dist/{chunk-KFFB6EMZ.js → chunk-AYERBA7I.js} +3 -7
  18. package/dist/chunk-EIZKW2PF.js +13 -0
  19. package/dist/{chunk-CRYKVJTO.js → chunk-IPDHT2UV.js} +1420 -3
  20. package/dist/{chunk-UDVLFVEC.cjs → chunk-JCMOOPNX.cjs} +3820 -2907
  21. package/dist/{chunk-X47PBV4I.js → chunk-JE22VP6S.js} +1 -0
  22. package/dist/{chunk-DN65KDIA.js → chunk-JIWUVQ6B.js} +14 -13
  23. package/dist/{chunk-HT5DI3XW.cjs → chunk-KOTXDSQB.cjs} +1 -0
  24. package/dist/{chunk-UKC3HYXI.js → chunk-LT2WOPKA.js} +3733 -2813
  25. package/dist/chunk-RK5ETF2I.js +434 -0
  26. package/dist/{chunk-SPQFNIYJ.cjs → chunk-TJ2MIQUT.cjs} +3 -7
  27. package/dist/{chunk-TCSGFAWB.cjs → chunk-UUWAUHUW.cjs} +1451 -3
  28. package/dist/{chunk-57O3HZPG.js → chunk-WRKV6MHB.js} +415 -3
  29. package/dist/{chunk-FBKDMRQL.cjs → chunk-YV5PK4JW.cjs} +427 -7
  30. package/dist/cli.cjs +13 -22
  31. package/dist/cli.js +13 -22
  32. package/dist/{emit-order-notification-trigger-IVLWKKJL.js → emit-order-notification-trigger-6XX7LSC4.js} +1 -1
  33. package/dist/{emit-order-notification-trigger-D2N3KFHL.cjs → emit-order-notification-trigger-NASG7ZEO.cjs} +3 -3
  34. package/dist/{event-order-defaults-EMWBIGL3.cjs → event-order-defaults-DU7V3YND.cjs} +9 -9
  35. package/dist/{event-order-defaults-SDRNAZHC.js → event-order-defaults-H4RT7NMR.js} +1 -1
  36. package/dist/hooks.cjs +43 -0
  37. package/dist/hooks.d.cts +10 -1
  38. package/dist/hooks.d.ts +10 -1
  39. package/dist/hooks.js +39 -1
  40. package/dist/index.cjs +479 -339
  41. package/dist/index.d.cts +181 -20
  42. package/dist/index.d.ts +181 -20
  43. package/dist/index.js +115 -13
  44. package/dist/migrations/1782200000000-VendorTeamProfiles.ts +233 -0
  45. package/dist/migrations/1782300000000-AddTypeToOrderNotificationBindings.ts +75 -0
  46. package/dist/migrations/1782400000000-CreateUserDeviceTokens.ts +36 -0
  47. package/dist/migrations/1782500000000-AddPushToOrderNotificationBindingsChannelEnum.ts +15 -0
  48. package/dist/{order-notification-dispatcher-ZJZB2HUN.js → order-notification-dispatcher-3TA4ETYJ.js} +1 -2
  49. package/dist/{order-notification-dispatcher-SBQAMM5V.cjs → order-notification-dispatcher-ZEAZ5SHV.cjs} +7 -4
  50. package/dist/{rbac-debug-db-2SGNLANF.js → rbac-debug-db-6EMIVMGF.js} +1 -1
  51. package/dist/{rbac-debug-db-4Z6A425H.cjs → rbac-debug-db-6PWTLBEL.cjs} +2 -2
  52. package/dist/theme.cjs +6 -1
  53. package/dist/theme.d.cts +4 -1
  54. package/dist/theme.d.ts +4 -1
  55. package/dist/theme.js +3 -1
  56. package/package.json +1 -1
  57. package/src/admin/admin.css +7 -0
  58. package/dist/chunk-7PMHZRF3.cjs +0 -872
  59. package/dist/chunk-CQHXW4TR.js +0 -107
  60. package/dist/chunk-GUSHM5HN.js +0 -862
  61. package/dist/chunk-NBY4NVTY.cjs +0 -182
  62. package/dist/chunk-SF2XKMCI.js +0 -171
  63. package/dist/chunk-XMRMZ6NQ.cjs +0 -109
  64. package/dist/send-order-placed-emails-B5ZVJT7T.cjs +0 -15
  65. package/dist/send-order-placed-emails-WPI37KRZ.js +0 -6
package/dist/cli.js CHANGED
@@ -200,7 +200,7 @@ export async function PATCH(req: Request, ctx: { params: Promise<{ path?: string
200
200
  export async function DELETE(req: Request, ctx: { params: Promise<{ path?: string[] }> }) { return handle('DELETE', req, ctx); }
201
201
  `,
202
202
  "src/app/api/auth/[...nextauth]/route.ts": `import NextAuth from 'next-auth';
203
- import { getNextAuthOptions } from '@infuro/cms-core/auth';
203
+ import { buildNextAuthOptions } from '@infuro/cms-core/auth';
204
204
  import { getDataSourceInitialized } from '@/lib/data-source';
205
205
  import { CMS_ENTITY_MAP, enrichUserWithVendorContext } from '@infuro/cms-core';
206
206
  import bcrypt from 'bcryptjs';
@@ -208,7 +208,9 @@ import bcrypt from 'bcryptjs';
208
208
  async function getOptions() {
209
209
  const dataSource = await getDataSourceInitialized();
210
210
  const userRepo = dataSource.getRepository(CMS_ENTITY_MAP.users);
211
- return getNextAuthOptions({
211
+ return buildNextAuthOptions({
212
+ dataSource,
213
+ entityMap: CMS_ENTITY_MAP,
212
214
  getUserByEmail: async (email: string) => {
213
215
  const user = await userRepo.findOne({
214
216
  where: { email },
@@ -222,24 +224,17 @@ async function getOptions() {
222
224
  });
223
225
  }
224
226
 
225
- let handler: ReturnType<typeof NextAuth> | null = null;
226
-
227
- async function getHandler() {
228
- if (!handler) handler = NextAuth(await getOptions());
229
- return handler;
230
- }
231
-
232
227
  type NextAuthContext = { params: Promise<{ nextauth?: string[] }> };
233
228
 
234
229
  export async function GET(req: Request, context: NextAuthContext) {
235
- return (await getHandler())(req, context);
230
+ return NextAuth(await getOptions())(req, context);
236
231
  }
237
232
  export async function POST(req: Request, context: NextAuthContext) {
238
- return (await getHandler())(req, context);
233
+ return NextAuth(await getOptions())(req, context);
239
234
  }
240
235
  `,
241
236
  "src/app/api/storefront-auth/[...nextauth]/route.ts": `import NextAuth from 'next-auth';
242
- import { getStorefrontNextAuthOptions } from '@infuro/cms-core/auth';
237
+ import { buildStorefrontNextAuthOptions } from '@infuro/cms-core/auth';
243
238
  import { getDataSourceInitialized } from '@/lib/data-source';
244
239
  import { CMS_ENTITY_MAP, enrichUserWithVendorContext } from '@infuro/cms-core';
245
240
  import bcrypt from 'bcryptjs';
@@ -247,7 +242,9 @@ import bcrypt from 'bcryptjs';
247
242
  async function getOptions() {
248
243
  const dataSource = await getDataSourceInitialized();
249
244
  const userRepo = dataSource.getRepository(CMS_ENTITY_MAP.users);
250
- return getStorefrontNextAuthOptions({
245
+ return buildStorefrontNextAuthOptions({
246
+ dataSource,
247
+ entityMap: CMS_ENTITY_MAP,
251
248
  getUserByEmail: async (email: string) => {
252
249
  const user = await userRepo.findOne({
253
250
  where: { email },
@@ -261,20 +258,13 @@ async function getOptions() {
261
258
  });
262
259
  }
263
260
 
264
- let handler: ReturnType<typeof NextAuth> | null = null;
265
-
266
- async function getHandler() {
267
- if (!handler) handler = NextAuth(await getOptions());
268
- return handler;
269
- }
270
-
271
261
  type NextAuthContext = { params: Promise<{ nextauth?: string[] }> };
272
262
 
273
263
  export async function GET(req: Request, context: NextAuthContext) {
274
- return (await getHandler())(req, context);
264
+ return NextAuth(await getOptions())(req, context);
275
265
  }
276
266
  export async function POST(req: Request, context: NextAuthContext) {
277
- return (await getHandler())(req, context);
267
+ return NextAuth(await getOptions())(req, context);
278
268
  }
279
269
  `,
280
270
  "src/app/admin/layout.tsx": `'use client';
@@ -315,6 +305,7 @@ const cmsMiddleware = createCmsMiddleware({
315
305
  '/api/users/forgot-password': ['POST'],
316
306
  '/api/users/set-password': ['POST'],
317
307
  '/api/users/invite': ['GET', 'POST'],
308
+ '/api/settings/auth_providers': ['GET'],
318
309
  },
319
310
  });
320
311
 
@@ -1,3 +1,3 @@
1
- export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-X47PBV4I.js';
1
+ export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-JE22VP6S.js';
2
2
  import './chunk-HCIRL37O.js';
3
3
  import './chunk-SHUYVCID.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHT5DI3XW_cjs = require('./chunk-HT5DI3XW.cjs');
3
+ var chunkKOTXDSQB_cjs = require('./chunk-KOTXDSQB.cjs');
4
4
  require('./chunk-UCKN4BBY.cjs');
5
5
  require('./chunk-USNT2KNT.cjs');
6
6
 
@@ -8,9 +8,9 @@ require('./chunk-USNT2KNT.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "emitOrderNotificationTrigger", {
10
10
  enumerable: true,
11
- get: function () { return chunkHT5DI3XW_cjs.emitOrderNotificationTrigger; }
11
+ get: function () { return chunkKOTXDSQB_cjs.emitOrderNotificationTrigger; }
12
12
  });
13
13
  Object.defineProperty(exports, "fireOrderNotificationTrigger", {
14
14
  enumerable: true,
15
- get: function () { return chunkHT5DI3XW_cjs.fireOrderNotificationTrigger; }
15
+ get: function () { return chunkKOTXDSQB_cjs.fireOrderNotificationTrigger; }
16
16
  });
@@ -1,39 +1,39 @@
1
1
  'use strict';
2
2
 
3
- var chunkSPQFNIYJ_cjs = require('./chunk-SPQFNIYJ.cjs');
3
+ var chunkTJ2MIQUT_cjs = require('./chunk-TJ2MIQUT.cjs');
4
4
  require('./chunk-USNT2KNT.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS", {
9
9
  enumerable: true,
10
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS; }
10
+ get: function () { return chunkTJ2MIQUT_cjs.EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS; }
11
11
  });
12
12
  Object.defineProperty(exports, "EVENT_ORDER_TEMPLATE_KEY", {
13
13
  enumerable: true,
14
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_TEMPLATE_KEY; }
14
+ get: function () { return chunkTJ2MIQUT_cjs.EVENT_ORDER_TEMPLATE_KEY; }
15
15
  });
16
16
  Object.defineProperty(exports, "EVENT_ORDER_TEMPLATE_VARIABLES", {
17
17
  enumerable: true,
18
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_TEMPLATE_VARIABLES; }
18
+ get: function () { return chunkTJ2MIQUT_cjs.EVENT_ORDER_TEMPLATE_VARIABLES; }
19
19
  });
20
20
  Object.defineProperty(exports, "EVENT_ORDER_TEMPLATE_VARIABLE_HINTS", {
21
21
  enumerable: true,
22
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_TEMPLATE_VARIABLE_HINTS; }
22
+ get: function () { return chunkTJ2MIQUT_cjs.EVENT_ORDER_TEMPLATE_VARIABLE_HINTS; }
23
23
  });
24
24
  Object.defineProperty(exports, "EVENT_ORDER_WHATSAPP_PARAM_KEYS", {
25
25
  enumerable: true,
26
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_WHATSAPP_PARAM_KEYS; }
26
+ get: function () { return chunkTJ2MIQUT_cjs.EVENT_ORDER_WHATSAPP_PARAM_KEYS; }
27
27
  });
28
28
  Object.defineProperty(exports, "getEventOrderTemplateDefault", {
29
29
  enumerable: true,
30
- get: function () { return chunkSPQFNIYJ_cjs.getEventOrderTemplateDefault; }
30
+ get: function () { return chunkTJ2MIQUT_cjs.getEventOrderTemplateDefault; }
31
31
  });
32
32
  Object.defineProperty(exports, "pickWhatsAppTemplateParams", {
33
33
  enumerable: true,
34
- get: function () { return chunkSPQFNIYJ_cjs.pickWhatsAppTemplateParams; }
34
+ get: function () { return chunkTJ2MIQUT_cjs.pickWhatsAppTemplateParams; }
35
35
  });
36
36
  Object.defineProperty(exports, "resolveEventOrderTemplate", {
37
37
  enumerable: true,
38
- get: function () { return chunkSPQFNIYJ_cjs.resolveEventOrderTemplate; }
38
+ get: function () { return chunkTJ2MIQUT_cjs.resolveEventOrderTemplate; }
39
39
  });
@@ -1,2 +1,2 @@
1
- export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, EVENT_ORDER_TEMPLATE_VARIABLE_HINTS, EVENT_ORDER_WHATSAPP_PARAM_KEYS, getEventOrderTemplateDefault, pickWhatsAppTemplateParams, resolveEventOrderTemplate } from './chunk-KFFB6EMZ.js';
1
+ export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, EVENT_ORDER_TEMPLATE_VARIABLE_HINTS, EVENT_ORDER_WHATSAPP_PARAM_KEYS, getEventOrderTemplateDefault, pickWhatsAppTemplateParams, resolveEventOrderTemplate } from './chunk-AYERBA7I.js';
2
2
  import './chunk-SHUYVCID.js';
package/dist/hooks.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var chunk2IAXTKQN_cjs = require('./chunk-2IAXTKQN.cjs');
3
4
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
4
5
  var React2 = require('react');
5
6
 
@@ -364,13 +365,55 @@ function useCaptchaPayload() {
364
365
  ]);
365
366
  }
366
367
  chunkUSNT2KNT_cjs.__name(useCaptchaPayload, "useCaptchaPayload");
368
+ function useForceLightMode() {
369
+ React2.useEffect(() => {
370
+ if (typeof window === "undefined") return;
371
+ const root = document.documentElement;
372
+ const body = document.body;
373
+ const applyLight = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => {
374
+ if (root.classList.contains("dark")) root.classList.remove("dark");
375
+ if (body && body.classList.contains("dark")) body.classList.remove("dark");
376
+ if (root.style.colorScheme !== "light") root.style.colorScheme = "light";
377
+ if (body && body.style.colorScheme !== "light") body.style.colorScheme = "light";
378
+ }, "applyLight");
379
+ applyLight();
380
+ const observer = new MutationObserver(() => {
381
+ applyLight();
382
+ });
383
+ observer.observe(root, {
384
+ attributes: true,
385
+ attributeFilter: [
386
+ "class",
387
+ "style"
388
+ ]
389
+ });
390
+ if (body) {
391
+ observer.observe(body, {
392
+ attributes: true,
393
+ attributeFilter: [
394
+ "class",
395
+ "style"
396
+ ]
397
+ });
398
+ }
399
+ return () => {
400
+ observer.disconnect();
401
+ };
402
+ }, []);
403
+ }
404
+ chunkUSNT2KNT_cjs.__name(useForceLightMode, "useForceLightMode");
367
405
 
406
+ Object.defineProperty(exports, "ForceLightMode", {
407
+ enumerable: true,
408
+ get: function () { return chunk2IAXTKQN_cjs.ForceLightMode; }
409
+ });
368
410
  exports.CaptchaProvider = CaptchaProvider;
369
411
  exports.PluginProvider = PluginProvider;
370
412
  exports.useAnalytics = useAnalytics;
371
413
  exports.useCaptchaPayload = useCaptchaPayload;
372
414
  exports.useCatalogCategories = useCatalogCategories;
373
415
  exports.useCatalogCollections = useCatalogCollections;
416
+ exports.useForceLightMode = useForceLightMode;
374
417
  exports.useIsMobile = useIsMobile;
375
418
  exports.usePlugin = usePlugin;
376
419
  exports.vendorCategoryWorkspaceUrl = vendorCategoryWorkspaceUrl;
package/dist/hooks.d.cts CHANGED
@@ -83,4 +83,13 @@ declare function CaptchaProvider({ children }: {
83
83
  /** Returns a function that resolves to captcha fields for JSON bodies, or {} if disabled / not ready. */
84
84
  declare function useCaptchaPayload(): () => Promise<Record<string, string>>;
85
85
 
86
- export { CaptchaProvider, type CatalogCategory, type CatalogCollection, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
86
+ /** Component wrapper that forces light mode */
87
+ declare function ForceLightMode(): React.ReactElement;
88
+
89
+ /**
90
+ * Universally enforce light mode across all websites and admin panels using webcore.
91
+ * Removes `dark` class from <html> and <body> and continuously blocks system/app dark mode.
92
+ */
93
+ declare function useForceLightMode(): void;
94
+
95
+ export { CaptchaProvider, type CatalogCategory, type CatalogCollection, ForceLightMode, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useForceLightMode, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
package/dist/hooks.d.ts CHANGED
@@ -83,4 +83,13 @@ declare function CaptchaProvider({ children }: {
83
83
  /** Returns a function that resolves to captcha fields for JSON bodies, or {} if disabled / not ready. */
84
84
  declare function useCaptchaPayload(): () => Promise<Record<string, string>>;
85
85
 
86
- export { CaptchaProvider, type CatalogCategory, type CatalogCollection, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
86
+ /** Component wrapper that forces light mode */
87
+ declare function ForceLightMode(): React.ReactElement;
88
+
89
+ /**
90
+ * Universally enforce light mode across all websites and admin panels using webcore.
91
+ * Removes `dark` class from <html> and <body> and continuously blocks system/app dark mode.
92
+ */
93
+ declare function useForceLightMode(): void;
94
+
95
+ export { CaptchaProvider, type CatalogCategory, type CatalogCollection, ForceLightMode, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useForceLightMode, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
package/dist/hooks.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { ForceLightMode } from './chunk-EIZKW2PF.js';
1
2
  import { __name } from './chunk-SHUYVCID.js';
2
3
  import React2, { createContext, useState, useEffect, useContext, useRef, useCallback, useMemo } from 'react';
3
4
 
@@ -358,5 +359,42 @@ function useCaptchaPayload() {
358
359
  ]);
359
360
  }
360
361
  __name(useCaptchaPayload, "useCaptchaPayload");
362
+ function useForceLightMode() {
363
+ useEffect(() => {
364
+ if (typeof window === "undefined") return;
365
+ const root = document.documentElement;
366
+ const body = document.body;
367
+ const applyLight = /* @__PURE__ */ __name(() => {
368
+ if (root.classList.contains("dark")) root.classList.remove("dark");
369
+ if (body && body.classList.contains("dark")) body.classList.remove("dark");
370
+ if (root.style.colorScheme !== "light") root.style.colorScheme = "light";
371
+ if (body && body.style.colorScheme !== "light") body.style.colorScheme = "light";
372
+ }, "applyLight");
373
+ applyLight();
374
+ const observer = new MutationObserver(() => {
375
+ applyLight();
376
+ });
377
+ observer.observe(root, {
378
+ attributes: true,
379
+ attributeFilter: [
380
+ "class",
381
+ "style"
382
+ ]
383
+ });
384
+ if (body) {
385
+ observer.observe(body, {
386
+ attributes: true,
387
+ attributeFilter: [
388
+ "class",
389
+ "style"
390
+ ]
391
+ });
392
+ }
393
+ return () => {
394
+ observer.disconnect();
395
+ };
396
+ }, []);
397
+ }
398
+ __name(useForceLightMode, "useForceLightMode");
361
399
 
362
- export { CaptchaProvider, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
400
+ export { CaptchaProvider, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useForceLightMode, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };