@infuro/cms-core 1.0.67 → 1.0.69
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/{OrderTrackPage-W3J6WIG2.js → OrderTrackPage-VBZUVZOU.js} +1 -1
- package/dist/{OrderTrackPage-Z6FCJQYY.cjs → OrderTrackPage-VFIXWJOW.cjs} +4 -4
- package/dist/admin.cjs +121 -12
- package/dist/admin.js +121 -12
- package/dist/api.cjs +57 -54
- package/dist/api.js +24 -21
- package/dist/auth.cjs +62 -62
- package/dist/auth.js +6 -6
- package/dist/{chunk-XJNNOSJR.js → chunk-2BNVRFUQ.js} +1 -1
- package/dist/chunk-2JHGIWH7.cjs +2700 -0
- package/dist/{chunk-3DZRIZOD.cjs → chunk-3ASNJS2H.cjs} +3 -3
- package/dist/{chunk-7NMT3GBR.cjs → chunk-3LQS4ATQ.cjs} +4 -4
- package/dist/{chunk-GWDI752Q.js → chunk-3XCTGADT.js} +1 -1
- package/dist/chunk-47G65M5Q.cjs +18 -0
- package/dist/{chunk-XFDIIVZB.cjs → chunk-4MNVIGVJ.cjs} +11 -11
- package/dist/{chunk-OY2YTBMP.cjs → chunk-4WZNRVEZ.cjs} +3 -3
- package/dist/{chunk-OVTOP42W.js → chunk-53AMBXMM.js} +1 -1
- package/dist/chunk-5BKT4CS5.js +28 -0
- package/dist/chunk-5DSY3GQI.js +16 -0
- package/dist/{chunk-AYERBA7I.js → chunk-5NVGWJSY.js} +1 -1
- package/dist/{chunk-HF3L2GIT.cjs → chunk-5YMKJ3TH.cjs} +16 -16
- package/dist/{chunk-WFMVD567.cjs → chunk-6MM5OMRL.cjs} +11 -11
- package/dist/{chunk-5MZFQRDW.cjs → chunk-747MJJCZ.cjs} +147 -147
- package/dist/{chunk-SYBOCAWB.js → chunk-7QJI56OL.js} +1 -1
- package/dist/{chunk-DBPSJYLZ.js → chunk-BK5XW5XH.js} +1 -1
- package/dist/chunk-BQQMTQ4C.cjs +455 -0
- package/dist/{chunk-6YOQ7G5O.js → chunk-CFUSYGSA.js} +1 -1
- package/dist/{chunk-OOTLNH63.cjs → chunk-CIZZX57T.cjs} +2 -2
- package/dist/{chunk-7L6KWI7S.cjs → chunk-CTTV375J.cjs} +13 -13
- package/dist/{chunk-ZY64VJMS.js → chunk-D4LR3S77.js} +2 -2
- package/dist/{chunk-GLLCLRCQ.js → chunk-DBBYLSQP.js} +179 -49
- package/dist/{chunk-5NOZSG6J.js → chunk-DWNQTFJ5.js} +2 -2
- package/dist/{chunk-2IAXTKQN.cjs → chunk-DZNWS2MM.cjs} +2 -2
- package/dist/chunk-E62LKM6Z.cjs +49 -0
- package/dist/{chunk-CRFV5WJK.js → chunk-ECNYZG6T.js} +1 -1
- package/dist/{chunk-TZEMLHSP.cjs → chunk-EYUBL7YH.cjs} +7 -7
- package/dist/{chunk-WMMZZRDJ.cjs → chunk-HGR4IA7I.cjs} +18 -18
- package/dist/{chunk-TJ2MIQUT.cjs → chunk-JRW3GQD4.cjs} +4 -4
- package/dist/{chunk-3K5AIEIZ.js → chunk-JYRFSFXH.js} +1 -1
- package/dist/chunk-K6RXCLD5.js +45 -0
- package/dist/{chunk-TU23GJPJ.js → chunk-LJ5C4RBF.js} +3 -3
- package/dist/{chunk-O4AFPDQ4.cjs → chunk-LXWF6T7F.cjs} +33 -33
- package/dist/{chunk-EIZKW2PF.js → chunk-LY7CDNC6.js} +1 -1
- package/dist/{chunk-PA6YDMFZ.cjs → chunk-M5QDJOUP.cjs} +12 -12
- package/dist/{chunk-MQBT33IV.js → chunk-MGT4DJ2D.js} +1 -1
- package/dist/{chunk-2ISSXYBZ.js → chunk-MJDNS324.js} +5 -5
- package/dist/{chunk-H3IVLIPR.cjs → chunk-OXFC3DAM.cjs} +4 -4
- package/dist/chunk-PQJIJ4ZX.js +445 -0
- package/dist/{chunk-HY3AXLOI.cjs → chunk-PRXVSSIF.cjs} +13 -13
- package/dist/{chunk-TDV6EJHV.js → chunk-PRZOLCFW.js} +2 -2
- package/dist/{chunk-BVLN75LP.cjs → chunk-QL44NCZC.cjs} +1221 -1091
- package/dist/{chunk-VM6OVUUM.cjs → chunk-QN6PZLAP.cjs} +40 -40
- package/dist/{chunk-OV5TRZET.cjs → chunk-QXAQ3V7R.cjs} +27 -27
- package/dist/{chunk-NV5IRHI3.js → chunk-RBKVMHBH.js} +9 -9
- package/dist/{chunk-UPLVMVRX.cjs → chunk-RQCXRCYM.cjs} +2 -2
- package/dist/{chunk-WUQAOTHA.js → chunk-SERRQ736.js} +1 -1
- package/dist/{chunk-SS3K7OIM.cjs → chunk-SWSTGV4F.cjs} +81 -81
- package/dist/{chunk-RCE5SJBA.js → chunk-T47VP2ZT.js} +3 -3
- package/dist/{chunk-FLUF2GZH.js → chunk-WHMIWJL7.js} +1 -1
- package/dist/{chunk-JC6DLWTE.js → chunk-WQZ4AH2P.js} +1 -1
- package/dist/{chunk-D5FBNKQM.cjs → chunk-WXH3GMCF.cjs} +8 -8
- package/dist/chunk-XHPRD45G.cjs +32 -0
- package/dist/{chunk-THL5JDWJ.cjs → chunk-Y54WDY2O.cjs} +2 -2
- package/dist/{chunk-YRCKEGL2.js → chunk-YDMHG6BA.js} +1 -1
- package/dist/chunk-YHVA5NHI.js +2698 -0
- package/dist/{chunk-JXF23MPG.js → chunk-ZMIMKNSQ.js} +1 -1
- package/dist/cli.cjs +10 -10
- package/dist/cli.js +1 -1
- package/dist/email-queue-BJDH2ID7.cjs +29 -0
- package/dist/email-queue-MWP4R67H.js +8 -0
- package/dist/email-service-6JODEMUA.js +3 -0
- package/dist/email-service-VA4Q4ZRB.cjs +28 -0
- package/dist/emit-order-notification-trigger-X36V4DOH.cjs +16 -0
- package/dist/emit-order-notification-trigger-XKN2TWVF.js +3 -0
- package/dist/erp-config-enabled-32XTHBBT.cjs +11 -0
- package/dist/erp-config-enabled-CASE5YVI.js +2 -0
- package/dist/erp-order-invoice-5O42ZKC5.cjs +28 -0
- package/dist/erp-order-invoice-JEQKFXG4.js +7 -0
- package/dist/{event-order-defaults-DU7V3YND.cjs → event-order-defaults-TR45WAQQ.cjs} +10 -10
- package/dist/{event-order-defaults-H4RT7NMR.js → event-order-defaults-VXYO6NHT.js} +2 -2
- package/dist/generate-local-invoice-pdf-2NCA2WBL.cjs +12 -0
- package/dist/generate-local-invoice-pdf-XUH6GYEJ.js +3 -0
- package/dist/hooks.cjs +24 -24
- package/dist/hooks.js +2 -2
- package/dist/index.cjs +497 -494
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +39 -36
- package/dist/interpolate-KD37IRF2.js +2 -0
- package/dist/interpolate-WP6OSJHN.cjs +11 -0
- package/dist/invoice-templates-2ESQ7K4N.cjs +19 -0
- package/dist/invoice-templates-3AXTXERZ.js +2 -0
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.js +2 -2
- package/dist/{order-assignees-handlers-L3RVKUBS.js → order-assignees-handlers-F7WOZHOG.js} +1 -1
- package/dist/{order-assignees-handlers-KF7RMTV5.cjs → order-assignees-handlers-JEJ5IDID.cjs} +3 -3
- package/dist/{order-completion-otp-handlers-HFGCPC4O.js → order-completion-otp-handlers-FIW7PZ6W.js} +12 -9
- package/dist/{order-completion-otp-handlers-DZAXK4GQ.cjs → order-completion-otp-handlers-LNAZTMTS.cjs} +25 -22
- package/dist/{order-inventory-76V4XIGW.js → order-inventory-R3AU6N4V.js} +2 -2
- package/dist/{order-inventory-2MYRKEPC.cjs → order-inventory-UUFPWLBW.cjs} +10 -10
- package/dist/order-notification-dispatcher-FS54ANAV.js +13 -0
- package/dist/order-notification-dispatcher-GG5C4LKZ.cjs +38 -0
- package/dist/paid-order-erp-GRXR2OG6.js +3 -0
- package/dist/paid-order-erp-X5QHPI23.cjs +12 -0
- package/dist/pg-boss-service-CMW3KQJM.js +2 -0
- package/dist/pg-boss-service-GA6ZVD5G.cjs +15 -0
- package/dist/{razorpay-U23LGY72.cjs → razorpay-GP2DXVP2.cjs} +2 -2
- package/dist/{razorpay-KLO2KNCB.js → razorpay-I3G5LNYH.js} +1 -1
- package/dist/{rbac-debug-db-KWV7D5PQ.cjs → rbac-debug-db-2ZI3XKA4.cjs} +4 -4
- package/dist/{rbac-debug-db-DFZWZ6GV.js → rbac-debug-db-IRKT6G62.js} +2 -2
- package/dist/resolve-invoice-asset-url-64QQUVC3.js +2 -0
- package/dist/resolve-invoice-asset-url-J7WAMD26.cjs +11 -0
- package/dist/retire-soft-deleted-unique-DZALT537.cjs +15 -0
- package/dist/{retire-soft-deleted-unique-NXQIH4BC.js → retire-soft-deleted-unique-F25KZBZK.js} +2 -2
- package/dist/sms-defaults-DSO3M26Y.js +2 -0
- package/dist/{sms-defaults-KCOPKQBA.cjs → sms-defaults-GDFILHHR.cjs} +5 -5
- package/dist/{sms-notification-templates-handlers-SJLO7JGZ.js → sms-notification-templates-handlers-ZGDCVS5Z.js} +1 -1
- package/dist/{sms-notification-templates-handlers-YSB3L2PK.cjs → sms-notification-templates-handlers-ZKLKFRFZ.cjs} +3 -3
- package/dist/{stripe-VU6OEG2D.cjs → stripe-2APRZHKU.cjs} +2 -2
- package/dist/{stripe-4FD27QVJ.js → stripe-7CO2ETTN.js} +1 -1
- package/dist/theme.cjs +10 -10
- package/dist/theme.js +3 -3
- package/dist/vendor-invite-status-45ZCWKCX.js +2 -0
- package/dist/{vendor-invite-status-77O7ZQ3U.cjs → vendor-invite-status-AT2E4FUA.cjs} +5 -5
- package/package.json +2 -1
- package/dist/chunk-GLD263KW.cjs +0 -862
- package/dist/chunk-OPJEV44S.js +0 -847
- package/dist/chunk-SHUYVCID.js +0 -4
- package/dist/chunk-USNT2KNT.cjs +0 -6
- package/dist/email-queue-4OY45JIU.cjs +0 -26
- package/dist/email-queue-HGXB2FIS.js +0 -5
- package/dist/email-service-5O24BSFR.cjs +0 -28
- package/dist/email-service-ADDF52PJ.js +0 -3
- package/dist/emit-order-notification-trigger-EJJZ6XTS.js +0 -3
- package/dist/emit-order-notification-trigger-ZD5YN3JM.cjs +0 -16
- package/dist/erp-config-enabled-CUMQ6N2V.cjs +0 -11
- package/dist/erp-config-enabled-T37X7T34.js +0 -2
- package/dist/erp-order-invoice-H6HCJ7YS.js +0 -4
- package/dist/erp-order-invoice-YUSPZ7CE.cjs +0 -25
- package/dist/interpolate-WAKPN56R.cjs +0 -11
- package/dist/interpolate-WDUWDF3I.js +0 -2
- package/dist/order-notification-dispatcher-ECPFI7CD.js +0 -10
- package/dist/order-notification-dispatcher-LL7ETKLU.cjs +0 -35
- package/dist/paid-order-erp-3USEG6WL.js +0 -3
- package/dist/paid-order-erp-FSQ3GSXE.cjs +0 -12
- package/dist/pg-boss-service-BDGOKM2T.cjs +0 -15
- package/dist/pg-boss-service-WCBJD4JB.js +0 -2
- package/dist/retire-soft-deleted-unique-5VXBA5XX.cjs +0 -15
- package/dist/sms-defaults-2NL24H57.js +0 -2
- package/dist/vendor-invite-status-PWJ3DE76.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
4
4
|
|
|
5
5
|
// src/message-templates/sms-defaults.ts
|
|
6
6
|
var SMS_MESSAGE_TEMPLATE_DEFAULTS = [
|
|
@@ -24,7 +24,7 @@ var SMS_MESSAGE_TEMPLATE_DEFAULTS = [
|
|
|
24
24
|
function getSmsTemplateDefault(templateKey) {
|
|
25
25
|
return SMS_MESSAGE_TEMPLATE_DEFAULTS.find((d) => d.templateKey === templateKey);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
chunkXHPRD45G_cjs.__name(getSmsTemplateDefault, "getSmsTemplateDefault");
|
|
28
28
|
async function resolveSmsTemplateForSend(templateKey, getRow) {
|
|
29
29
|
const def = getSmsTemplateDefault(templateKey);
|
|
30
30
|
if (!def) return null;
|
|
@@ -45,7 +45,7 @@ async function resolveSmsTemplateForSend(templateKey, getRow) {
|
|
|
45
45
|
otpVarKey: otpVarKey || "var1"
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
chunkXHPRD45G_cjs.__name(resolveSmsTemplateForSend, "resolveSmsTemplateForSend");
|
|
49
49
|
|
|
50
50
|
exports.SMS_MESSAGE_TEMPLATE_DEFAULTS = SMS_MESSAGE_TEMPLATE_DEFAULTS;
|
|
51
51
|
exports.getSmsTemplateDefault = getSmsTemplateDefault;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
4
4
|
|
|
5
5
|
// src/lib/vendor-invite-status.ts
|
|
6
6
|
function inviteStatusForActivation(activation) {
|
|
7
7
|
return activation === "invite" ? "pending" : "accepted";
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
chunkXHPRD45G_cjs.__name(inviteStatusForActivation, "inviteStatusForActivation");
|
|
10
10
|
async function markVendorInviteAcceptedForUser(dataSource, vendorEntity, userId) {
|
|
11
11
|
await dataSource.getRepository(vendorEntity).update({
|
|
12
12
|
userId
|
|
@@ -14,7 +14,7 @@ async function markVendorInviteAcceptedForUser(dataSource, vendorEntity, userId)
|
|
|
14
14
|
inviteStatus: "accepted"
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
chunkXHPRD45G_cjs.__name(markVendorInviteAcceptedForUser, "markVendorInviteAcceptedForUser");
|
|
18
18
|
async function markVendorInvitePendingForUser(dataSource, vendorEntity, userId) {
|
|
19
19
|
await dataSource.getRepository(vendorEntity).update({
|
|
20
20
|
userId
|
|
@@ -22,7 +22,7 @@ async function markVendorInvitePendingForUser(dataSource, vendorEntity, userId)
|
|
|
22
22
|
inviteStatus: "pending"
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
chunkXHPRD45G_cjs.__name(markVendorInvitePendingForUser, "markVendorInvitePendingForUser");
|
|
26
26
|
|
|
27
27
|
exports.inviteStatusForActivation = inviteStatusForActivation;
|
|
28
28
|
exports.markVendorInviteAcceptedForUser = markVendorInviteAcceptedForUser;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
4
|
+
|
|
5
|
+
// src/lib/invoice/resolve-invoice-asset-url.ts
|
|
6
|
+
function resolveInvoiceAssetUrl(raw) {
|
|
7
|
+
const t = String(raw ?? "").trim();
|
|
8
|
+
if (!t) return null;
|
|
9
|
+
if (/^https?:\/\//i.test(t)) return t;
|
|
10
|
+
if (t.startsWith("//")) return `https:${t}`;
|
|
11
|
+
const base = (process.env.CMS_PUBLIC_URL || process.env.NEXT_PUBLIC_SITE_URL || process.env.NEXTAUTH_URL || "").trim().replace(/\/+$/, "");
|
|
12
|
+
if (!base) return null;
|
|
13
|
+
if (t.startsWith("/")) return `${base}${t}`;
|
|
14
|
+
return `${base}/${t}`;
|
|
15
|
+
}
|
|
16
|
+
chunkXHPRD45G_cjs.__name(resolveInvoiceAssetUrl, "resolveInvoiceAssetUrl");
|
|
17
|
+
|
|
18
|
+
exports.resolveInvoiceAssetUrl = resolveInvoiceAssetUrl;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkBQQMTQ4C_cjs = require('./chunk-BQQMTQ4C.cjs');
|
|
4
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
5
5
|
|
|
6
6
|
// src/plugins/email/email-queue.ts
|
|
7
7
|
var EMAIL_QUEUE_NAME = "email";
|
|
@@ -50,13 +50,13 @@ async function resolveInvoiceAttachmentForJob(cms, payload, options) {
|
|
|
50
50
|
invoiceAttached: false
|
|
51
51
|
};
|
|
52
52
|
const o = order;
|
|
53
|
-
if (!
|
|
53
|
+
if (!chunkBQQMTQ4C_cjs.isOrderEligibleForInvoiceEmail(o.status, o.orderKind)) {
|
|
54
54
|
return {
|
|
55
55
|
attachments: payload.attachments,
|
|
56
56
|
invoiceAttached: false
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
const resolved = await
|
|
59
|
+
const resolved = await chunkBQQMTQ4C_cjs.resolveOrderInvoicePdfBytes(cms, dataSource, entityMap, payload.orderId);
|
|
60
60
|
if ("error" in resolved) {
|
|
61
61
|
console.warn("[email] order invoice attach failed", {
|
|
62
62
|
orderId: payload.orderId,
|
|
@@ -91,7 +91,7 @@ async function resolveInvoiceAttachmentForJob(cms, payload, options) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
chunkXHPRD45G_cjs.__name(resolveInvoiceAttachmentForJob, "resolveInvoiceAttachmentForJob");
|
|
95
95
|
async function sendRendered(email, to, subject, html, text, attachments) {
|
|
96
96
|
await email.send({
|
|
97
97
|
to,
|
|
@@ -101,7 +101,7 @@ async function sendRendered(email, to, subject, html, text, attachments) {
|
|
|
101
101
|
attachments
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
chunkXHPRD45G_cjs.__name(sendRendered, "sendRendered");
|
|
105
105
|
function registerEmailQueueProcessor(cms, options = {}) {
|
|
106
106
|
registeredInvoiceOptions = options;
|
|
107
107
|
const queue = cms.getPlugin("queue");
|
|
@@ -123,7 +123,7 @@ function registerEmailQueueProcessor(cms, options = {}) {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
chunkXHPRD45G_cjs.__name(registerEmailQueueProcessor, "registerEmailQueueProcessor");
|
|
127
127
|
async function queueEmail(cms, payload) {
|
|
128
128
|
const queue = cms.getPlugin("queue");
|
|
129
129
|
if (queue) {
|
|
@@ -133,7 +133,7 @@ async function queueEmail(cms, payload) {
|
|
|
133
133
|
let email = cms && typeof cms.getPlugin === "function" ? cms.getPlugin("email") : void 0;
|
|
134
134
|
if (!email) {
|
|
135
135
|
try {
|
|
136
|
-
const { EmailService } = await import('./email-service-
|
|
136
|
+
const { EmailService } = await import('./email-service-VA4Q4ZRB.cjs');
|
|
137
137
|
const env = typeof process !== "undefined" && process.env ? process.env : {};
|
|
138
138
|
const type = String(env.SMTP_TYPE || "SMTP").toUpperCase();
|
|
139
139
|
const port = env.SMTP_PORT ? parseInt(env.SMTP_PORT, 10) : void 0;
|
|
@@ -177,7 +177,7 @@ async function queueEmail(cms, payload) {
|
|
|
177
177
|
await sendRendered(email, payload.to, payload.subject, payload.html, payload.text, attachmentsResult.attachments ?? payload.attachments);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
chunkXHPRD45G_cjs.__name(queueEmail, "queueEmail");
|
|
181
181
|
async function queueOrderPlacedEmails(cms, payload) {
|
|
182
182
|
const { orderNumber, total, subtotal, tax, currency, customerName, customerEmail, salesTeamEmails, companyDetails, lineItems, billingAddress, shippingAddress, orderId, attachInvoiceToCustomer = true } = payload;
|
|
183
183
|
const base = {
|
|
@@ -229,7 +229,7 @@ async function queueOrderPlacedEmails(cms, payload) {
|
|
|
229
229
|
}
|
|
230
230
|
await Promise.all(jobs);
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
chunkXHPRD45G_cjs.__name(queueOrderPlacedEmails, "queueOrderPlacedEmails");
|
|
233
233
|
async function queueVendorOnboardEmails(cms, payload) {
|
|
234
234
|
const { vendorName, vendorSlug, ownerName, ownerEmail, activation, inviteLink, signInLink, kind = "vendor_onboard", notifyEmails, companyDetails, sendToOwner = true } = payload;
|
|
235
235
|
const base = {
|
|
@@ -274,7 +274,7 @@ async function queueVendorOnboardEmails(cms, payload) {
|
|
|
274
274
|
}
|
|
275
275
|
await Promise.all(jobs);
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
chunkXHPRD45G_cjs.__name(queueVendorOnboardEmails, "queueVendorOnboardEmails");
|
|
278
278
|
|
|
279
279
|
exports.queueEmail = queueEmail;
|
|
280
280
|
exports.queueOrderPlacedEmails = queueOrderPlacedEmails;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
4
4
|
|
|
5
5
|
// src/lib/retire-soft-deleted-unique.ts
|
|
6
6
|
async function retireSoftDeletedUniqueValue(repo, column, value) {
|
|
@@ -24,7 +24,7 @@ async function retireSoftDeletedUniqueValue(repo, column, value) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
chunkXHPRD45G_cjs.__name(retireSoftDeletedUniqueValue, "retireSoftDeletedUniqueValue");
|
|
28
28
|
async function activeUniqueValueExists(repo, column, value, excludeId) {
|
|
29
29
|
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
30
30
|
if (!trimmed) return false;
|
|
@@ -44,7 +44,7 @@ async function activeUniqueValueExists(repo, column, value, excludeId) {
|
|
|
44
44
|
const hit = await qb.getOne();
|
|
45
45
|
return !!hit;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
chunkXHPRD45G_cjs.__name(activeUniqueValueExists, "activeUniqueValueExists");
|
|
48
48
|
|
|
49
49
|
exports.activeUniqueValueExists = activeUniqueValueExists;
|
|
50
50
|
exports.retireSoftDeletedUniqueValue = retireSoftDeletedUniqueValue;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
export { __commonJS, __name, __toESM };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __name } from './chunk-5BKT4CS5.js';
|
|
2
|
+
|
|
3
|
+
// src/lib/invoice/resolve-invoice-asset-url.ts
|
|
4
|
+
function resolveInvoiceAssetUrl(raw) {
|
|
5
|
+
const t = String(raw ?? "").trim();
|
|
6
|
+
if (!t) return null;
|
|
7
|
+
if (/^https?:\/\//i.test(t)) return t;
|
|
8
|
+
if (t.startsWith("//")) return `https:${t}`;
|
|
9
|
+
const base = (process.env.CMS_PUBLIC_URL || process.env.NEXT_PUBLIC_SITE_URL || process.env.NEXTAUTH_URL || "").trim().replace(/\/+$/, "");
|
|
10
|
+
if (!base) return null;
|
|
11
|
+
if (t.startsWith("/")) return `${base}${t}`;
|
|
12
|
+
return `${base}/${t}`;
|
|
13
|
+
}
|
|
14
|
+
__name(resolveInvoiceAssetUrl, "resolveInvoiceAssetUrl");
|
|
15
|
+
|
|
16
|
+
export { resolveInvoiceAssetUrl };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkWXH3GMCF_cjs = require('./chunk-WXH3GMCF.cjs');
|
|
4
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
5
5
|
|
|
6
6
|
// src/plugins/erp/paid-order-erp.ts
|
|
7
7
|
function roundMoney(major) {
|
|
8
8
|
return Math.round(major * 100) / 100;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
chunkXHPRD45G_cjs.__name(roundMoney, "roundMoney");
|
|
11
11
|
function addressToWebhookDto(a) {
|
|
12
12
|
if (!a) return {};
|
|
13
13
|
return {
|
|
@@ -19,7 +19,7 @@ function addressToWebhookDto(a) {
|
|
|
19
19
|
country: a.country ?? ""
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
chunkXHPRD45G_cjs.__name(addressToWebhookDto, "addressToWebhookDto");
|
|
23
23
|
function orderStatusLabel(status) {
|
|
24
24
|
const s = (status || "").toLowerCase();
|
|
25
25
|
if (s === "confirmed") return "Confirmed";
|
|
@@ -27,7 +27,7 @@ function orderStatusLabel(status) {
|
|
|
27
27
|
if (!status) return "Pending";
|
|
28
28
|
return status.charAt(0).toUpperCase() + status.slice(1);
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
chunkXHPRD45G_cjs.__name(orderStatusLabel, "orderStatusLabel");
|
|
31
31
|
function paymentRowToWebhookDto(p, amountMajorOverride) {
|
|
32
32
|
const currency = String(p.currency || "INR");
|
|
33
33
|
const amountMajor = amountMajorOverride != null && Number.isFinite(amountMajorOverride) ? amountMajorOverride : Number(p.amount);
|
|
@@ -48,7 +48,7 @@ function paymentRowToWebhookDto(p, amountMajorOverride) {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
chunkXHPRD45G_cjs.__name(paymentRowToWebhookDto, "paymentRowToWebhookDto");
|
|
52
52
|
async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId) {
|
|
53
53
|
try {
|
|
54
54
|
const configRepo = dataSource.getRepository(entityMap.configs);
|
|
@@ -61,7 +61,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
61
61
|
for (const row of cfgRows) {
|
|
62
62
|
const r = row;
|
|
63
63
|
if (r.key === "enabled" && r.value === "false") {
|
|
64
|
-
|
|
64
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:skip", {
|
|
65
65
|
orderId,
|
|
66
66
|
reason: "erp_config_disabled"
|
|
67
67
|
});
|
|
@@ -69,7 +69,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
if (!cms.getPlugin("erp")) {
|
|
72
|
-
|
|
72
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:skip", {
|
|
73
73
|
orderId,
|
|
74
74
|
reason: "erp_plugin_missing"
|
|
75
75
|
});
|
|
@@ -90,7 +90,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
90
90
|
]
|
|
91
91
|
});
|
|
92
92
|
if (!ord) {
|
|
93
|
-
|
|
93
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:skip", {
|
|
94
94
|
orderId,
|
|
95
95
|
reason: "order_not_found"
|
|
96
96
|
});
|
|
@@ -99,7 +99,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
99
99
|
const o = ord;
|
|
100
100
|
const okKind = o.orderKind === void 0 || o.orderKind === null || o.orderKind === "sale";
|
|
101
101
|
if (!okKind) {
|
|
102
|
-
|
|
102
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:skip", {
|
|
103
103
|
orderId,
|
|
104
104
|
reason: "order_kind_not_sale",
|
|
105
105
|
orderKind: o.orderKind
|
|
@@ -109,7 +109,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
109
109
|
const rawPayments = o.payments ?? [];
|
|
110
110
|
const completedPayments = rawPayments.filter((pay) => pay.status === "completed" && pay.deleted !== true);
|
|
111
111
|
if (!completedPayments.length) {
|
|
112
|
-
|
|
112
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:skip", {
|
|
113
113
|
orderId,
|
|
114
114
|
reason: "no_completed_payments"
|
|
115
115
|
});
|
|
@@ -134,7 +134,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
134
134
|
};
|
|
135
135
|
});
|
|
136
136
|
if (!lines.length) {
|
|
137
|
-
|
|
137
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:skip", {
|
|
138
138
|
orderId,
|
|
139
139
|
reason: "no_line_items_with_product"
|
|
140
140
|
});
|
|
@@ -168,7 +168,7 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
168
168
|
source: "storefront"
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
|
|
171
|
+
chunkWXH3GMCF_cjs.logErp("paid-order:payload_built", {
|
|
172
172
|
orderId,
|
|
173
173
|
platformOrderId: orderDto.platformOrderId,
|
|
174
174
|
status: orderDto.status,
|
|
@@ -178,17 +178,17 @@ async function queueErpPaidOrderForOrderId(cms, dataSource, entityMap, orderId)
|
|
|
178
178
|
paymentIds: paymentDtos.map((p) => p.id),
|
|
179
179
|
total: orderTotalMajor
|
|
180
180
|
});
|
|
181
|
-
await
|
|
181
|
+
await chunkWXH3GMCF_cjs.queueErp(cms, {
|
|
182
182
|
kind: "order",
|
|
183
183
|
order: orderDto
|
|
184
184
|
});
|
|
185
185
|
} catch (e) {
|
|
186
|
-
|
|
186
|
+
chunkWXH3GMCF_cjs.errorErp("paid-order:enqueue_failed", {
|
|
187
187
|
orderId,
|
|
188
188
|
message: e instanceof Error ? e.message : String(e)
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
chunkXHPRD45G_cjs.__name(queueErpPaidOrderForOrderId, "queueErpPaidOrderForOrderId");
|
|
193
193
|
|
|
194
194
|
exports.queueErpPaidOrderForOrderId = queueErpPaidOrderForOrderId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
4
4
|
var crypto = require('crypto');
|
|
5
5
|
var typeorm = require('typeorm');
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ function registerSmsQueueProcessor(cms) {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
chunkXHPRD45G_cjs.__name(registerSmsQueueProcessor, "registerSmsQueueProcessor");
|
|
35
35
|
async function queueSms(cms, payload) {
|
|
36
36
|
const queue = cms.getPlugin("queue");
|
|
37
37
|
const sms = cms.getPlugin("sms");
|
|
@@ -59,18 +59,18 @@ async function queueSms(cms, payload) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
chunkXHPRD45G_cjs.__name(queueSms, "queueSms");
|
|
63
63
|
var OTP_TTL_MS = 10 * 60 * 1e3;
|
|
64
64
|
var MAX_SENDS_PER_HOUR = 5;
|
|
65
65
|
var MAX_VERIFY_ATTEMPTS = 8;
|
|
66
66
|
function getPepper(explicit) {
|
|
67
67
|
return (explicit || process.env.OTP_PEPPER || process.env.NEXTAUTH_SECRET || "dev-otp-pepper").trim();
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
chunkXHPRD45G_cjs.__name(getPepper, "getPepper");
|
|
70
70
|
function hashOtpCode(code, purpose, identifier, pepper) {
|
|
71
71
|
return crypto.createHmac("sha256", getPepper(pepper)).update(`${purpose}|${identifier}|${code}`).digest("hex");
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
chunkXHPRD45G_cjs.__name(hashOtpCode, "hashOtpCode");
|
|
74
74
|
function verifyOtpCodeHash(code, storedHash, purpose, identifier, pepper) {
|
|
75
75
|
const h = hashOtpCode(code, purpose, identifier, pepper);
|
|
76
76
|
try {
|
|
@@ -79,12 +79,12 @@ function verifyOtpCodeHash(code, storedHash, purpose, identifier, pepper) {
|
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
chunkXHPRD45G_cjs.__name(verifyOtpCodeHash, "verifyOtpCodeHash");
|
|
83
83
|
function generateNumericOtp(length = 6) {
|
|
84
84
|
const max = 10 ** length;
|
|
85
85
|
return crypto.randomInt(0, max).toString().padStart(length, "0");
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
chunkXHPRD45G_cjs.__name(generateNumericOtp, "generateNumericOtp");
|
|
88
88
|
function normalizePhoneE164(raw, defaultCountryCode) {
|
|
89
89
|
const t = raw.trim();
|
|
90
90
|
const digitsOnly = t.replace(/\D/g, "");
|
|
@@ -94,7 +94,7 @@ function normalizePhoneE164(raw, defaultCountryCode) {
|
|
|
94
94
|
if (digitsOnly.length > 10) return `+${digitsOnly}`;
|
|
95
95
|
return `+${cc}${digitsOnly}`;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
chunkXHPRD45G_cjs.__name(normalizePhoneE164, "normalizePhoneE164");
|
|
98
98
|
async function countRecentOtpSends(dataSource, entityMap, purpose, identifier, since) {
|
|
99
99
|
const repo = dataSource.getRepository(entityMap.otp_challenges);
|
|
100
100
|
return repo.count({
|
|
@@ -105,7 +105,7 @@ async function countRecentOtpSends(dataSource, entityMap, purpose, identifier, s
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
chunkXHPRD45G_cjs.__name(countRecentOtpSends, "countRecentOtpSends");
|
|
109
109
|
async function createOtpChallenge(dataSource, entityMap, input) {
|
|
110
110
|
const { purpose, channel, identifier, code, pepper } = input;
|
|
111
111
|
const since = new Date(Date.now() - 60 * 60 * 1e3);
|
|
@@ -138,7 +138,7 @@ async function createOtpChallenge(dataSource, entityMap, input) {
|
|
|
138
138
|
ok: true
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
chunkXHPRD45G_cjs.__name(createOtpChallenge, "createOtpChallenge");
|
|
142
142
|
async function verifyAndConsumeOtpChallenge(dataSource, entityMap, input) {
|
|
143
143
|
const { purpose, identifier, code, pepper } = input;
|
|
144
144
|
const repo = dataSource.getRepository(entityMap.otp_challenges);
|
|
@@ -196,7 +196,7 @@ async function verifyAndConsumeOtpChallenge(dataSource, entityMap, input) {
|
|
|
196
196
|
ok: true
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
chunkXHPRD45G_cjs.__name(verifyAndConsumeOtpChallenge, "verifyAndConsumeOtpChallenge");
|
|
200
200
|
|
|
201
201
|
exports.countRecentOtpSends = countRecentOtpSends;
|
|
202
202
|
exports.createOtpChallenge = createOtpChallenge;
|