@infuro/cms-core 1.0.72 → 1.0.74

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 (43) hide show
  1. package/dist/admin.cjs +543 -120
  2. package/dist/admin.js +545 -122
  3. package/dist/api.cjs +37 -37
  4. package/dist/api.d.cts +13 -6
  5. package/dist/api.d.ts +13 -6
  6. package/dist/api.js +5 -5
  7. package/dist/auth.cjs +11 -11
  8. package/dist/auth.d.cts +15 -0
  9. package/dist/auth.d.ts +15 -0
  10. package/dist/auth.js +1 -1
  11. package/dist/{chunk-BQQMTQ4C.cjs → chunk-25T6HP5T.cjs} +2 -2
  12. package/dist/{chunk-TTOEY7AH.cjs → chunk-2JV4EDY3.cjs} +3 -3
  13. package/dist/{chunk-LJ5C4RBF.js → chunk-6TRH3VY7.js} +1 -1
  14. package/dist/{chunk-4MNVIGVJ.cjs → chunk-D3SR6CYU.cjs} +3 -3
  15. package/dist/{chunk-PQJIJ4ZX.js → chunk-DAUBLBTP.js} +1 -1
  16. package/dist/{chunk-SCE2GIKH.js → chunk-DEGN4BTH.js} +9 -0
  17. package/dist/{chunk-CKTRA3Q2.cjs → chunk-F3FKBNMQ.cjs} +9 -0
  18. package/dist/{chunk-SRGDHASW.cjs → chunk-H4UIIBFD.cjs} +2571 -2096
  19. package/dist/{chunk-YHVA5NHI.js → chunk-LUSJITTI.js} +43 -6
  20. package/dist/{chunk-43UVXBEH.js → chunk-OQOO2JMB.js} +2529 -2054
  21. package/dist/{chunk-HZZTDM5J.js → chunk-R5HLPH6P.js} +1 -1
  22. package/dist/{chunk-3LF4RYAJ.js → chunk-X3IJG25M.js} +1 -1
  23. package/dist/{chunk-2JHGIWH7.cjs → chunk-X5ILLSTD.cjs} +43 -6
  24. package/dist/{chunk-NIBEGDD4.cjs → chunk-ZBSH4GWB.cjs} +1 -1
  25. package/dist/{email-queue-MWP4R67H.js → email-queue-5TOJJT3P.js} +3 -3
  26. package/dist/{email-queue-BJDH2ID7.cjs → email-queue-X2A46VD3.cjs} +7 -7
  27. package/dist/{emit-order-notification-trigger-TBXAZAPS.js → emit-order-notification-trigger-3RAVWKLG.js} +1 -1
  28. package/dist/{emit-order-notification-trigger-I4HQSTEN.cjs → emit-order-notification-trigger-MY3KP7CD.cjs} +3 -3
  29. package/dist/{erp-order-invoice-5O42ZKC5.cjs → erp-order-invoice-23BDWC2H.cjs} +6 -6
  30. package/dist/{erp-order-invoice-JEQKFXG4.js → erp-order-invoice-SEZZUDMW.js} +2 -2
  31. package/dist/generate-local-invoice-pdf-V5FHS23Z.js +3 -0
  32. package/dist/{generate-local-invoice-pdf-2NCA2WBL.cjs → generate-local-invoice-pdf-XYBVKHNP.cjs} +2 -2
  33. package/dist/index.cjs +243 -243
  34. package/dist/index.d.cts +31 -9
  35. package/dist/index.d.ts +31 -9
  36. package/dist/index.js +10 -10
  37. package/dist/migrations/1783400000000-MakeProductConfigTaxIdNullable.ts +40 -0
  38. package/dist/{order-completion-otp-handlers-KHLZQQJX.js → order-completion-otp-handlers-2WOFSORP.js} +4 -4
  39. package/dist/{order-completion-otp-handlers-2ZKRK5SN.cjs → order-completion-otp-handlers-EWY47XUA.cjs} +6 -6
  40. package/dist/{order-notification-dispatcher-Z3MXNF4U.js → order-notification-dispatcher-COR2ZHM3.js} +4 -4
  41. package/dist/{order-notification-dispatcher-37KDVHBM.cjs → order-notification-dispatcher-KTOAMMSD.cjs} +9 -9
  42. package/package.json +1 -1
  43. package/dist/generate-local-invoice-pdf-XUH6GYEJ.js +0 -3
@@ -94,7 +94,7 @@ async function emitOrderNotificationTrigger(triggerKey, orderId, deps, extra) {
94
94
  orderId
95
95
  });
96
96
  try {
97
- const { dispatchOrderNotificationDirectly } = await import('./order-notification-dispatcher-Z3MXNF4U.js');
97
+ const { dispatchOrderNotificationDirectly } = await import('./order-notification-dispatcher-COR2ZHM3.js');
98
98
  await dispatchOrderNotificationDirectly(triggerKey, triggerPayload, deps.dataSource, deps.entityMap);
99
99
  } catch (err) {
100
100
  notifyLog.error("TRIGGER", "direct dispatch failed", {
@@ -2,7 +2,7 @@ import { queueWhatsApp, queueSms } from './chunk-K6JT7BKY.js';
2
2
  import { notifyLog, logFcmToken, maskNotifyEmail, maskNotifyPhone, notificationTriggerEmitter } from './chunk-W2ZTGLUH.js';
3
3
  import { applyTemplateVars } from './chunk-ECNYZG6T.js';
4
4
  import { sesRegionSupportsSmtp, sesSmtpHost, EmailService, renderLayout } from './chunk-CFUSYGSA.js';
5
- import { queueEmail } from './chunk-LJ5C4RBF.js';
5
+ import { queueEmail } from './chunk-6TRH3VY7.js';
6
6
  import { mergeEmailLayoutCompanyDetails } from './chunk-YDMHG6BA.js';
7
7
  import { __name } from './chunk-5BKT4CS5.js';
8
8
  import * as crypto from 'crypto';
@@ -2371,6 +2371,41 @@ function wrapText(text, font, size, maxWidth) {
2371
2371
  return lines.slice(0, 4);
2372
2372
  }
2373
2373
  chunkXHPRD45G_cjs.__name(wrapText, "wrapText");
2374
+ function wrapLinesToWidth(lines, font, size, maxWidth) {
2375
+ const result = [];
2376
+ for (const rawLine of lines) {
2377
+ if (!rawLine || !rawLine.trim()) continue;
2378
+ const words = winAnsiSafe(rawLine).split(/\s+/).filter(Boolean);
2379
+ if (!words.length) continue;
2380
+ let current = "";
2381
+ for (let word of words) {
2382
+ while (font.widthOfTextAtSize(word, size) > maxWidth) {
2383
+ let cut = word.length - 1;
2384
+ while (cut > 0 && font.widthOfTextAtSize(word.slice(0, cut), size) > maxWidth) {
2385
+ cut--;
2386
+ }
2387
+ if (cut <= 0) cut = 1;
2388
+ const head = word.slice(0, cut);
2389
+ if (current) {
2390
+ result.push(current);
2391
+ current = "";
2392
+ }
2393
+ result.push(head);
2394
+ word = word.slice(cut);
2395
+ }
2396
+ const candidate = current ? `${current} ${word}` : word;
2397
+ if (font.widthOfTextAtSize(candidate, size) <= maxWidth) {
2398
+ current = candidate;
2399
+ } else {
2400
+ if (current) result.push(current);
2401
+ current = word;
2402
+ }
2403
+ }
2404
+ if (current) result.push(current);
2405
+ }
2406
+ return result;
2407
+ }
2408
+ chunkXHPRD45G_cjs.__name(wrapLinesToWidth, "wrapLinesToWidth");
2374
2409
  async function tryEmbedLogo(doc, logoUrl, maxW, maxH) {
2375
2410
  const url = String(logoUrl ?? "").trim();
2376
2411
  if (!url || !/^https?:\/\//i.test(url)) return null;
@@ -2534,21 +2569,23 @@ async function generateLocalInvoicePdf(input) {
2534
2569
  drawText(page, "Bill to", margin, y, fontBold, 10, theme.accent);
2535
2570
  drawText(page, "Ship to", margin + colW + 16, y, fontBold, 10, theme.accent);
2536
2571
  y -= 14;
2537
- const bill = [
2572
+ const billRaw = [
2538
2573
  input.customerName,
2539
2574
  input.customerEmail || "",
2540
2575
  input.customerPhone || "",
2541
2576
  ...addrLines(input.billingAddress)
2542
2577
  ].filter(Boolean);
2543
- const ship = addrLines(input.shippingAddress).length ? [
2578
+ const shipRaw = addrLines(input.shippingAddress).length ? [
2544
2579
  input.customerName,
2545
2580
  ...addrLines(input.shippingAddress)
2546
- ] : bill;
2547
- const rows = Math.max(bill.length, ship.length, 1);
2581
+ ] : billRaw;
2582
+ const billLines = wrapLinesToWidth(billRaw, font, 9, colW);
2583
+ const shipLines = wrapLinesToWidth(shipRaw, font, 9, colW);
2584
+ const rows = Math.max(billLines.length, shipLines.length, 1);
2548
2585
  for (let i = 0; i < rows; i++) {
2549
2586
  ensureSpace(14);
2550
- if (bill[i]) drawText(page, bill[i], margin, y, font, 9, theme.text);
2551
- if (ship[i]) drawText(page, ship[i], margin + colW + 16, y, font, 9, theme.text);
2587
+ if (billLines[i]) drawText(page, billLines[i], margin, y, font, 9, theme.text);
2588
+ if (shipLines[i]) drawText(page, shipLines[i], margin + colW + 16, y, font, 9, theme.text);
2552
2589
  y -= 12;
2553
2590
  }
2554
2591
  y -= 12;
@@ -96,7 +96,7 @@ async function emitOrderNotificationTrigger(triggerKey, orderId, deps, extra) {
96
96
  orderId
97
97
  });
98
98
  try {
99
- const { dispatchOrderNotificationDirectly } = await import('./order-notification-dispatcher-37KDVHBM.cjs');
99
+ const { dispatchOrderNotificationDirectly } = await import('./order-notification-dispatcher-KTOAMMSD.cjs');
100
100
  await dispatchOrderNotificationDirectly(triggerKey, triggerPayload, deps.dataSource, deps.entityMap);
101
101
  } catch (err) {
102
102
  chunkK742UE6S_cjs.notifyLog.error("TRIGGER", "direct dispatch failed", {
@@ -1,7 +1,7 @@
1
- export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-LJ5C4RBF.js';
2
- import './chunk-PQJIJ4ZX.js';
1
+ export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-6TRH3VY7.js';
2
+ import './chunk-DAUBLBTP.js';
3
3
  import './chunk-WQZ4AH2P.js';
4
- import './chunk-YHVA5NHI.js';
4
+ import './chunk-LUSJITTI.js';
5
5
  import './chunk-K6RXCLD5.js';
6
6
  import './chunk-5DSY3GQI.js';
7
7
  import './chunk-YDMHG6BA.js';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk4MNVIGVJ_cjs = require('./chunk-4MNVIGVJ.cjs');
4
- require('./chunk-BQQMTQ4C.cjs');
3
+ var chunkD3SR6CYU_cjs = require('./chunk-D3SR6CYU.cjs');
4
+ require('./chunk-25T6HP5T.cjs');
5
5
  require('./chunk-RQCXRCYM.cjs');
6
- require('./chunk-2JHGIWH7.cjs');
6
+ require('./chunk-X5ILLSTD.cjs');
7
7
  require('./chunk-E62LKM6Z.cjs');
8
8
  require('./chunk-47G65M5Q.cjs');
9
9
  require('./chunk-EYUBL7YH.cjs');
@@ -13,17 +13,17 @@ require('./chunk-XHPRD45G.cjs');
13
13
 
14
14
  Object.defineProperty(exports, "queueEmail", {
15
15
  enumerable: true,
16
- get: function () { return chunk4MNVIGVJ_cjs.queueEmail; }
16
+ get: function () { return chunkD3SR6CYU_cjs.queueEmail; }
17
17
  });
18
18
  Object.defineProperty(exports, "queueOrderPlacedEmails", {
19
19
  enumerable: true,
20
- get: function () { return chunk4MNVIGVJ_cjs.queueOrderPlacedEmails; }
20
+ get: function () { return chunkD3SR6CYU_cjs.queueOrderPlacedEmails; }
21
21
  });
22
22
  Object.defineProperty(exports, "queueVendorOnboardEmails", {
23
23
  enumerable: true,
24
- get: function () { return chunk4MNVIGVJ_cjs.queueVendorOnboardEmails; }
24
+ get: function () { return chunkD3SR6CYU_cjs.queueVendorOnboardEmails; }
25
25
  });
26
26
  Object.defineProperty(exports, "registerEmailQueueProcessor", {
27
27
  enumerable: true,
28
- get: function () { return chunk4MNVIGVJ_cjs.registerEmailQueueProcessor; }
28
+ get: function () { return chunkD3SR6CYU_cjs.registerEmailQueueProcessor; }
29
29
  });
@@ -1,3 +1,3 @@
1
- export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-HZZTDM5J.js';
1
+ export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-R5HLPH6P.js';
2
2
  import './chunk-W2ZTGLUH.js';
3
3
  import './chunk-5BKT4CS5.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkNIBEGDD4_cjs = require('./chunk-NIBEGDD4.cjs');
3
+ var chunkZBSH4GWB_cjs = require('./chunk-ZBSH4GWB.cjs');
4
4
  require('./chunk-K742UE6S.cjs');
5
5
  require('./chunk-XHPRD45G.cjs');
6
6
 
@@ -8,9 +8,9 @@ require('./chunk-XHPRD45G.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "emitOrderNotificationTrigger", {
10
10
  enumerable: true,
11
- get: function () { return chunkNIBEGDD4_cjs.emitOrderNotificationTrigger; }
11
+ get: function () { return chunkZBSH4GWB_cjs.emitOrderNotificationTrigger; }
12
12
  });
13
13
  Object.defineProperty(exports, "fireOrderNotificationTrigger", {
14
14
  enumerable: true,
15
- get: function () { return chunkNIBEGDD4_cjs.fireOrderNotificationTrigger; }
15
+ get: function () { return chunkZBSH4GWB_cjs.fireOrderNotificationTrigger; }
16
16
  });
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkBQQMTQ4C_cjs = require('./chunk-BQQMTQ4C.cjs');
3
+ var chunk25T6HP5T_cjs = require('./chunk-25T6HP5T.cjs');
4
4
  require('./chunk-RQCXRCYM.cjs');
5
- require('./chunk-2JHGIWH7.cjs');
5
+ require('./chunk-X5ILLSTD.cjs');
6
6
  require('./chunk-E62LKM6Z.cjs');
7
7
  require('./chunk-47G65M5Q.cjs');
8
8
  require('./chunk-EYUBL7YH.cjs');
@@ -12,17 +12,17 @@ require('./chunk-XHPRD45G.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES", {
14
14
  enumerable: true,
15
- get: function () { return chunkBQQMTQ4C_cjs.ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES; }
15
+ get: function () { return chunk25T6HP5T_cjs.ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES; }
16
16
  });
17
17
  Object.defineProperty(exports, "isOrderEligibleForInvoiceEmail", {
18
18
  enumerable: true,
19
- get: function () { return chunkBQQMTQ4C_cjs.isOrderEligibleForInvoiceEmail; }
19
+ get: function () { return chunk25T6HP5T_cjs.isOrderEligibleForInvoiceEmail; }
20
20
  });
21
21
  Object.defineProperty(exports, "resolveOrderInvoicePdfBytes", {
22
22
  enumerable: true,
23
- get: function () { return chunkBQQMTQ4C_cjs.resolveOrderInvoicePdfBytes; }
23
+ get: function () { return chunk25T6HP5T_cjs.resolveOrderInvoicePdfBytes; }
24
24
  });
25
25
  Object.defineProperty(exports, "streamOrderInvoicePdf", {
26
26
  enumerable: true,
27
- get: function () { return chunkBQQMTQ4C_cjs.streamOrderInvoicePdf; }
27
+ get: function () { return chunk25T6HP5T_cjs.streamOrderInvoicePdf; }
28
28
  });
@@ -1,6 +1,6 @@
1
- export { ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES, isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes, streamOrderInvoicePdf } from './chunk-PQJIJ4ZX.js';
1
+ export { ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES, isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes, streamOrderInvoicePdf } from './chunk-DAUBLBTP.js';
2
2
  import './chunk-WQZ4AH2P.js';
3
- import './chunk-YHVA5NHI.js';
3
+ import './chunk-LUSJITTI.js';
4
4
  import './chunk-K6RXCLD5.js';
5
5
  import './chunk-5DSY3GQI.js';
6
6
  import './chunk-YDMHG6BA.js';
@@ -0,0 +1,3 @@
1
+ export { generateLocalInvoicePdf } from './chunk-LUSJITTI.js';
2
+ import './chunk-K6RXCLD5.js';
3
+ import './chunk-5BKT4CS5.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2JHGIWH7_cjs = require('./chunk-2JHGIWH7.cjs');
3
+ var chunkX5ILLSTD_cjs = require('./chunk-X5ILLSTD.cjs');
4
4
  require('./chunk-E62LKM6Z.cjs');
5
5
  require('./chunk-XHPRD45G.cjs');
6
6
 
@@ -8,5 +8,5 @@ require('./chunk-XHPRD45G.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "generateLocalInvoicePdf", {
10
10
  enumerable: true,
11
- get: function () { return chunk2JHGIWH7_cjs.generateLocalInvoicePdf; }
11
+ get: function () { return chunkX5ILLSTD_cjs.generateLocalInvoicePdf; }
12
12
  });