@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
@@ -1,107 +0,0 @@
1
- import { parseEmailRecipientsFromConfig } from './chunk-CRYKVJTO.js';
2
- import { queueOrderPlacedEmails } from './chunk-L3525VXI.js';
3
- import { mergeEmailLayoutCompanyDetails } from './chunk-2KUCQVAQ.js';
4
- import { __name } from './chunk-SHUYVCID.js';
5
-
6
- // src/lib/send-order-placed-emails.ts
7
- async function getSettingsGroup(deps, group) {
8
- const ds = await deps.getDataSource();
9
- const rows = await ds.getRepository(deps.entityMap.configs).find({
10
- where: {
11
- settings: group,
12
- deleted: false
13
- }
14
- });
15
- return Object.fromEntries(rows.map((r) => [
16
- r.key,
17
- r.value
18
- ]));
19
- }
20
- __name(getSettingsGroup, "getSettingsGroup");
21
- async function sendOrderPlacedEmailsAfterConfirmation(orderId, deps) {
22
- try {
23
- let addrToRecord2 = function(a) {
24
- if (!a) return void 0;
25
- const out = {};
26
- const set = /* @__PURE__ */ __name((k, v) => {
27
- const t = v != null ? String(v).trim() : "";
28
- if (t) out[k] = t;
29
- }, "set");
30
- set("line1", a.line1);
31
- set("line2", a.line2);
32
- set("city", a.city);
33
- set("state", a.state);
34
- set("postalCode", a.postalCode);
35
- set("country", a.country);
36
- return Object.keys(out).length ? out : void 0;
37
- };
38
- var addrToRecord = addrToRecord2;
39
- __name(addrToRecord2, "addrToRecord");
40
- const ds = await deps.getDataSource();
41
- const order = await ds.getRepository(deps.entityMap.orders).findOne({
42
- where: {
43
- id: orderId
44
- },
45
- relations: [
46
- "contact",
47
- "billingAddress",
48
- "shippingAddress"
49
- ]
50
- });
51
- if (!order) return;
52
- const o = order;
53
- const contact = o.contact;
54
- const customerEmail = contact?.email?.trim() || null;
55
- const customerName = contact?.name?.trim() || void 0;
56
- const itemRows = await ds.getRepository(deps.entityMap.order_items).find({
57
- where: {
58
- orderId
59
- },
60
- relations: [
61
- "product"
62
- ],
63
- order: {
64
- id: "ASC"
65
- }
66
- });
67
- const lineItems = itemRows.map((row) => {
68
- const r = row;
69
- const name = r.product?.name && String(r.product.name).trim() || `Product #${r.productId}`;
70
- return {
71
- productName: name,
72
- quantity: Math.max(0, Math.floor(Number(r.quantity) || 0)),
73
- unitPrice: r.unitPrice,
74
- lineTotal: r.total,
75
- sku: r.product?.sku && String(r.product.sku).trim() ? r.product.sku : void 0,
76
- tax: r.tax != null && Number(r.tax) !== 0 ? r.tax : void 0,
77
- hsn: r.hsn && String(r.hsn).trim() ? r.hsn : void 0
78
- };
79
- });
80
- const [branding, emailSettings] = await Promise.all([
81
- getSettingsGroup(deps, "branding"),
82
- getSettingsGroup(deps, "email")
83
- ]);
84
- const companyDetails = mergeEmailLayoutCompanyDetails(branding, emailSettings);
85
- const salesTeamEmails = parseEmailRecipientsFromConfig(emailSettings.salesTeamEmails ?? emailSettings.salesTeamEmail);
86
- const cms = await deps.getCms();
87
- await queueOrderPlacedEmails(cms, {
88
- orderId,
89
- orderNumber: o.orderNumber,
90
- total: o.total,
91
- subtotal: o.subtotal,
92
- tax: o.tax,
93
- currency: o.currency,
94
- customerName,
95
- customerEmail,
96
- salesTeamEmails,
97
- companyDetails,
98
- lineItems,
99
- billingAddress: addrToRecord2(o.billingAddress),
100
- shippingAddress: addrToRecord2(o.shippingAddress)
101
- });
102
- } catch {
103
- }
104
- }
105
- __name(sendOrderPlacedEmailsAfterConfirmation, "sendOrderPlacedEmailsAfterConfirmation");
106
-
107
- export { sendOrderPlacedEmailsAfterConfirmation };