@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.
- package/dist/admin.cjs +543 -120
- package/dist/admin.js +545 -122
- package/dist/api.cjs +37 -37
- package/dist/api.d.cts +13 -6
- package/dist/api.d.ts +13 -6
- package/dist/api.js +5 -5
- package/dist/auth.cjs +11 -11
- package/dist/auth.d.cts +15 -0
- package/dist/auth.d.ts +15 -0
- package/dist/auth.js +1 -1
- package/dist/{chunk-BQQMTQ4C.cjs → chunk-25T6HP5T.cjs} +2 -2
- package/dist/{chunk-TTOEY7AH.cjs → chunk-2JV4EDY3.cjs} +3 -3
- package/dist/{chunk-LJ5C4RBF.js → chunk-6TRH3VY7.js} +1 -1
- package/dist/{chunk-4MNVIGVJ.cjs → chunk-D3SR6CYU.cjs} +3 -3
- package/dist/{chunk-PQJIJ4ZX.js → chunk-DAUBLBTP.js} +1 -1
- package/dist/{chunk-SCE2GIKH.js → chunk-DEGN4BTH.js} +9 -0
- package/dist/{chunk-CKTRA3Q2.cjs → chunk-F3FKBNMQ.cjs} +9 -0
- package/dist/{chunk-SRGDHASW.cjs → chunk-H4UIIBFD.cjs} +2571 -2096
- package/dist/{chunk-YHVA5NHI.js → chunk-LUSJITTI.js} +43 -6
- package/dist/{chunk-43UVXBEH.js → chunk-OQOO2JMB.js} +2529 -2054
- package/dist/{chunk-HZZTDM5J.js → chunk-R5HLPH6P.js} +1 -1
- package/dist/{chunk-3LF4RYAJ.js → chunk-X3IJG25M.js} +1 -1
- package/dist/{chunk-2JHGIWH7.cjs → chunk-X5ILLSTD.cjs} +43 -6
- package/dist/{chunk-NIBEGDD4.cjs → chunk-ZBSH4GWB.cjs} +1 -1
- package/dist/{email-queue-MWP4R67H.js → email-queue-5TOJJT3P.js} +3 -3
- package/dist/{email-queue-BJDH2ID7.cjs → email-queue-X2A46VD3.cjs} +7 -7
- package/dist/{emit-order-notification-trigger-TBXAZAPS.js → emit-order-notification-trigger-3RAVWKLG.js} +1 -1
- package/dist/{emit-order-notification-trigger-I4HQSTEN.cjs → emit-order-notification-trigger-MY3KP7CD.cjs} +3 -3
- package/dist/{erp-order-invoice-5O42ZKC5.cjs → erp-order-invoice-23BDWC2H.cjs} +6 -6
- package/dist/{erp-order-invoice-JEQKFXG4.js → erp-order-invoice-SEZZUDMW.js} +2 -2
- package/dist/generate-local-invoice-pdf-V5FHS23Z.js +3 -0
- package/dist/{generate-local-invoice-pdf-2NCA2WBL.cjs → generate-local-invoice-pdf-XYBVKHNP.cjs} +2 -2
- package/dist/index.cjs +243 -243
- package/dist/index.d.cts +31 -9
- package/dist/index.d.ts +31 -9
- package/dist/index.js +10 -10
- package/dist/migrations/1783400000000-MakeProductConfigTaxIdNullable.ts +40 -0
- package/dist/{order-completion-otp-handlers-KHLZQQJX.js → order-completion-otp-handlers-2WOFSORP.js} +4 -4
- package/dist/{order-completion-otp-handlers-2ZKRK5SN.cjs → order-completion-otp-handlers-EWY47XUA.cjs} +6 -6
- package/dist/{order-notification-dispatcher-Z3MXNF4U.js → order-notification-dispatcher-COR2ZHM3.js} +4 -4
- package/dist/{order-notification-dispatcher-37KDVHBM.cjs → order-notification-dispatcher-KTOAMMSD.cjs} +9 -9
- package/package.json +1 -1
- 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-
|
|
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-
|
|
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
|
|
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
|
|
2578
|
+
const shipRaw = addrLines(input.shippingAddress).length ? [
|
|
2544
2579
|
input.customerName,
|
|
2545
2580
|
...addrLines(input.shippingAddress)
|
|
2546
|
-
] :
|
|
2547
|
-
const
|
|
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 (
|
|
2551
|
-
if (
|
|
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-
|
|
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-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-6TRH3VY7.js';
|
|
2
|
+
import './chunk-DAUBLBTP.js';
|
|
3
3
|
import './chunk-WQZ4AH2P.js';
|
|
4
|
-
import './chunk-
|
|
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
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkD3SR6CYU_cjs = require('./chunk-D3SR6CYU.cjs');
|
|
4
|
+
require('./chunk-25T6HP5T.cjs');
|
|
5
5
|
require('./chunk-RQCXRCYM.cjs');
|
|
6
|
-
require('./chunk-
|
|
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
|
|
16
|
+
get: function () { return chunkD3SR6CYU_cjs.queueEmail; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "queueOrderPlacedEmails", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkD3SR6CYU_cjs.queueOrderPlacedEmails; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "queueVendorOnboardEmails", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkD3SR6CYU_cjs.queueVendorOnboardEmails; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "registerEmailQueueProcessor", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkD3SR6CYU_cjs.registerEmailQueueProcessor; }
|
|
29
29
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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
|
|
11
|
+
get: function () { return chunkZBSH4GWB_cjs.emitOrderNotificationTrigger; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "fireOrderNotificationTrigger", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkZBSH4GWB_cjs.fireOrderNotificationTrigger; }
|
|
16
16
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk25T6HP5T_cjs = require('./chunk-25T6HP5T.cjs');
|
|
4
4
|
require('./chunk-RQCXRCYM.cjs');
|
|
5
|
-
require('./chunk-
|
|
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
|
|
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
|
|
19
|
+
get: function () { return chunk25T6HP5T_cjs.isOrderEligibleForInvoiceEmail; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "resolveOrderInvoicePdfBytes", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk25T6HP5T_cjs.resolveOrderInvoicePdfBytes; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "streamOrderInvoicePdf", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
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-
|
|
1
|
+
export { ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES, isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes, streamOrderInvoicePdf } from './chunk-DAUBLBTP.js';
|
|
2
2
|
import './chunk-WQZ4AH2P.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-LUSJITTI.js';
|
|
4
4
|
import './chunk-K6RXCLD5.js';
|
|
5
5
|
import './chunk-5DSY3GQI.js';
|
|
6
6
|
import './chunk-YDMHG6BA.js';
|
package/dist/{generate-local-invoice-pdf-2NCA2WBL.cjs → generate-local-invoice-pdf-XYBVKHNP.cjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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
|
|
11
|
+
get: function () { return chunkX5ILLSTD_cjs.generateLocalInvoicePdf; }
|
|
12
12
|
});
|