@infuro/cms-core 1.0.44 → 1.0.46

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 (66) hide show
  1. package/README.md +19 -2
  2. package/dist/admin.cjs +1413 -620
  3. package/dist/admin.d.cts +8 -2
  4. package/dist/admin.d.ts +8 -2
  5. package/dist/admin.js +1414 -621
  6. package/dist/api.cjs +40 -37
  7. package/dist/api.d.cts +3 -1
  8. package/dist/api.d.ts +3 -1
  9. package/dist/api.js +8 -5
  10. package/dist/auth.cjs +23 -23
  11. package/dist/auth.d.cts +1 -0
  12. package/dist/auth.d.ts +1 -0
  13. package/dist/auth.js +2 -2
  14. package/dist/chunk-2KUCQVAQ.js +936 -0
  15. package/dist/chunk-3K5AIEIZ.js +256 -0
  16. package/dist/{chunk-I6NH72MO.js → chunk-57O3HZPG.js} +9 -1
  17. package/dist/chunk-7PMHZRF3.cjs +872 -0
  18. package/dist/chunk-BXYZDMTZ.cjs +953 -0
  19. package/dist/chunk-CQHXW4TR.js +107 -0
  20. package/dist/{chunk-NNQBWDCI.js → chunk-CRYKVJTO.js} +55 -959
  21. package/dist/chunk-DBPSJYLZ.js +47 -0
  22. package/dist/{chunk-TAHX46EI.cjs → chunk-FBKDMRQL.cjs} +9 -1
  23. package/dist/chunk-GUSHM5HN.js +862 -0
  24. package/dist/chunk-HY3AXLOI.cjs +265 -0
  25. package/dist/chunk-L3525VXI.js +243 -0
  26. package/dist/{chunk-ZMRQ72F6.cjs → chunk-NBY4NVTY.cjs} +3 -3
  27. package/dist/chunk-OY2YTBMP.cjs +50 -0
  28. package/dist/{chunk-BLR6H5GL.js → chunk-SF2XKMCI.js} +3 -3
  29. package/dist/{chunk-22FFHLTO.cjs → chunk-TCSGFAWB.cjs} +56 -970
  30. package/dist/{chunk-P2IWWBJV.cjs → chunk-UDVLFVEC.cjs} +1314 -601
  31. package/dist/{chunk-SQGBHYJF.js → chunk-UKC3HYXI.js} +1245 -548
  32. package/dist/chunk-V25RDUOU.cjs +248 -0
  33. package/dist/chunk-XMRMZ6NQ.cjs +109 -0
  34. package/dist/cli.cjs +9 -4
  35. package/dist/cli.js +9 -4
  36. package/dist/{email-queue-TPZWLTIV.cjs → email-queue-6NJY6HNM.cjs} +7 -5
  37. package/dist/email-queue-OI2HSCGE.js +4 -0
  38. package/dist/erp-order-invoice-3GXDE443.js +3 -0
  39. package/dist/erp-order-invoice-EYYNR526.cjs +24 -0
  40. package/dist/index.cjs +426 -359
  41. package/dist/index.d.cts +308 -20
  42. package/dist/index.d.ts +308 -20
  43. package/dist/index.js +31 -110
  44. package/dist/migrations/1781800000000-CustomerPhoneNullable.ts +53 -0
  45. package/dist/migrations/1781810000000-OrderItemsVariantId.ts +44 -0
  46. package/dist/migrations/1781900000000-UserInviteStatusToken.ts +46 -0
  47. package/dist/migrations/1782000000000-ComboSlug.ts +58 -0
  48. package/dist/migrations/1782100000000-DiscountDeviceType.ts +20 -0
  49. package/dist/order-inventory-2MYRKEPC.cjs +39 -0
  50. package/dist/order-inventory-76V4XIGW.js +2 -0
  51. package/dist/order-notification-dispatcher-SBQAMM5V.cjs +21 -0
  52. package/dist/{order-notification-dispatcher-XWIJYDGA.js → order-notification-dispatcher-ZJZB2HUN.js} +5 -2
  53. package/dist/retire-soft-deleted-unique-5VXBA5XX.cjs +15 -0
  54. package/dist/retire-soft-deleted-unique-NXQIH4BC.js +2 -0
  55. package/dist/send-order-placed-emails-B5ZVJT7T.cjs +15 -0
  56. package/dist/send-order-placed-emails-WPI37KRZ.js +6 -0
  57. package/package.json +5 -4
  58. package/src/admin/admin.css +27 -24
  59. package/dist/chunk-5ELSW2UP.js +0 -150
  60. package/dist/chunk-PNOKNSG2.cjs +0 -222
  61. package/dist/chunk-WEMDMVHQ.js +0 -216
  62. package/dist/chunk-XW5ATPRW.cjs +0 -155
  63. package/dist/email-queue-CGZBVVAS.js +0 -2
  64. package/dist/erp-order-invoice-3YISSOWW.js +0 -3
  65. package/dist/erp-order-invoice-ZR5F2KTA.cjs +0 -12
  66. package/dist/order-notification-dispatcher-RU7BTGGX.cjs +0 -18
@@ -0,0 +1,47 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+
3
+ // src/lib/retire-soft-deleted-unique.ts
4
+ async function retireSoftDeletedUniqueValue(repo, column, value) {
5
+ const trimmed = typeof value === "string" ? value.trim() : "";
6
+ if (!trimmed) return;
7
+ const cols = new Set(repo.metadata.columns.map((c) => c.propertyName));
8
+ if (!cols.has(column) || !cols.has("deleted")) return;
9
+ const rows = await repo.find({
10
+ where: {
11
+ [column]: trimmed,
12
+ deleted: true
13
+ }
14
+ });
15
+ for (const row of rows) {
16
+ const id = row.id;
17
+ if (!Number.isFinite(id)) continue;
18
+ const current = String(row[column] ?? "");
19
+ if (current.includes("__deleted_")) continue;
20
+ await repo.update(id, {
21
+ [column]: `${trimmed}__deleted_${id}`
22
+ });
23
+ }
24
+ }
25
+ __name(retireSoftDeletedUniqueValue, "retireSoftDeletedUniqueValue");
26
+ async function activeUniqueValueExists(repo, column, value, excludeId) {
27
+ const trimmed = typeof value === "string" ? value.trim() : "";
28
+ if (!trimmed) return false;
29
+ const cols = new Set(repo.metadata.columns.map((c) => c.propertyName));
30
+ if (!cols.has(column)) return false;
31
+ const qb = repo.createQueryBuilder("row").where(`row.${column} = :value`, {
32
+ value: trimmed
33
+ });
34
+ if (cols.has("deleted")) {
35
+ qb.andWhere("row.deleted = false");
36
+ }
37
+ if (excludeId != null && Number.isFinite(excludeId) && excludeId > 0) {
38
+ qb.andWhere("row.id != :excludeId", {
39
+ excludeId
40
+ });
41
+ }
42
+ const hit = await qb.getOne();
43
+ return !!hit;
44
+ }
45
+ __name(activeUniqueValueExists, "activeUniqueValueExists");
46
+
47
+ export { activeUniqueValueExists, retireSoftDeletedUniqueValue };
@@ -405,6 +405,14 @@ function getNextAuthOptions(config) {
405
405
  });
406
406
  return null;
407
407
  }
408
+ if (user.inviteStatus === "pending") {
409
+ logAuth("authorize(credentials) rejected", {
410
+ reason: "invite_pending",
411
+ email,
412
+ userId: user.id
413
+ });
414
+ return null;
415
+ }
408
416
  if (user.deleted) {
409
417
  logAuth("authorize(credentials) rejected", {
410
418
  reason: "deleted",
@@ -494,7 +502,7 @@ function getNextAuthOptions(config) {
494
502
  channel: ch,
495
503
  code
496
504
  });
497
- if (!user || user.blocked || user.deleted) return null;
505
+ if (!user || user.blocked || user.inviteStatus === "pending" || user.deleted) return null;
498
506
  if (isCustomerGroupUser(user) && !permitsCustomerLogin(allowCustomerLogin, creds)) {
499
507
  logAuth("authorize(otp) rejected", {
500
508
  reason: "customer_group",