@infuro/cms-core 1.0.63 → 1.0.65
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 +183 -65
- package/dist/admin.js +183 -65
- package/dist/api.cjs +40 -40
- package/dist/api.d.cts +2 -0
- package/dist/api.d.ts +2 -0
- package/dist/api.js +8 -8
- package/dist/{chunk-KAOHOHCA.js → chunk-6YOQ7G5O.js} +92 -51
- package/dist/{chunk-BWOITUNI.js → chunk-ACBN6UWZ.js} +320 -81
- package/dist/chunk-BXAKL2TF.cjs +84 -0
- package/dist/{chunk-7L556RGL.cjs → chunk-GLD263KW.cjs} +3 -3
- package/dist/{chunk-EWXG4E74.cjs → chunk-NIRYYJIJ.cjs} +330 -91
- package/dist/{chunk-MWEK7N3F.js → chunk-OPJEV44S.js} +2 -2
- package/dist/{chunk-DTUL3Q5L.js → chunk-RDEVZMO5.js} +36 -20
- package/dist/{chunk-77YWLP4X.js → chunk-SANKKGB3.js} +68 -32
- package/dist/chunk-THL5JDWJ.cjs +101 -0
- package/dist/{chunk-RXTUSF3R.js → chunk-TU23GJPJ.js} +2 -2
- package/dist/{chunk-JLDHK2QE.cjs → chunk-TZEMLHSP.cjs} +20 -14
- package/dist/{chunk-RHYVNRYG.cjs → chunk-V6EYAC7X.cjs} +38 -22
- package/dist/{chunk-YVP4NQII.cjs → chunk-VM6OVUUM.cjs} +93 -52
- package/dist/{chunk-MXABMVF7.cjs → chunk-XFDIIVZB.cjs} +4 -4
- package/dist/chunk-XJNNOSJR.js +98 -0
- package/dist/chunk-YEAXE4U2.js +77 -0
- package/dist/{chunk-CJEOH6QC.cjs → chunk-YHEITFHR.cjs} +112 -76
- package/dist/{chunk-3VZAAQUV.js → chunk-YRCKEGL2.js} +20 -14
- package/dist/{email-queue-VTYL2KFA.cjs → email-queue-4OY45JIU.cjs} +7 -7
- package/dist/{email-queue-YPRSVG56.js → email-queue-HGXB2FIS.js} +3 -3
- package/dist/{email-service-ATCPJFWG.cjs → email-service-5O24BSFR.cjs} +7 -7
- package/dist/{email-service-DPKVQOKP.js → email-service-ADDF52PJ.js} +2 -2
- package/dist/{emit-order-notification-trigger-WI4HGMKH.cjs → emit-order-notification-trigger-DR74TQXN.cjs} +4 -4
- package/dist/{emit-order-notification-trigger-XVG2B5ZF.js → emit-order-notification-trigger-UCKJHDQK.js} +2 -2
- package/dist/{erp-order-invoice-3UGWLICU.js → erp-order-invoice-H6HCJ7YS.js} +2 -2
- package/dist/{erp-order-invoice-KJYJNWMG.cjs → erp-order-invoice-YUSPZ7CE.cjs} +6 -6
- package/dist/index.cjs +279 -265
- package/dist/index.d.cts +46 -22
- package/dist/index.d.ts +46 -22
- package/dist/index.js +43 -29
- package/dist/migrations/1783000000000-AddOrderPendingProcessingCompletedTriggers.ts +15 -39
- package/dist/migrations/1783300000000-SeedOrderNotificationTriggersAndTemplates.ts +155 -0
- package/dist/{order-completion-otp-handlers-WGM7HWG4.js → order-completion-otp-handlers-CH22ZRAI.js} +5 -5
- package/dist/{order-completion-otp-handlers-IMMQGHDR.cjs → order-completion-otp-handlers-RW5RSXH3.cjs} +7 -7
- package/dist/{order-notification-dispatcher-JKFQJYGG.js → order-notification-dispatcher-3TXUAJ7L.js} +6 -6
- package/dist/{order-notification-dispatcher-5TUFCDU7.cjs → order-notification-dispatcher-Y7NZAALH.cjs} +11 -11
- package/dist/{pg-boss-service-L6MTF4EQ.cjs → pg-boss-service-BDGOKM2T.cjs} +3 -3
- package/dist/pg-boss-service-WCBJD4JB.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-AYWDQFJZ.js +0 -27
- package/dist/chunk-GO7PPYNU.js +0 -76
- package/dist/chunk-UEE4PTTB.cjs +0 -30
- package/dist/chunk-XQ3QUHWR.cjs +0 -83
- package/dist/pg-boss-service-4XF2TQ2E.js +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkWFMVD567_cjs = require('./chunk-WFMVD567.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkTHL5JDWJ_cjs = require('./chunk-THL5JDWJ.cjs');
|
|
5
5
|
var chunkHY3AXLOI_cjs = require('./chunk-HY3AXLOI.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkNIRYYJIJ_cjs = require('./chunk-NIRYYJIJ.cjs');
|
|
7
7
|
var chunkH3IVLIPR_cjs = require('./chunk-H3IVLIPR.cjs');
|
|
8
8
|
var chunk7NMT3GBR_cjs = require('./chunk-7NMT3GBR.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkXFDIIVZB_cjs = require('./chunk-XFDIIVZB.cjs');
|
|
10
|
+
var chunkGLD263KW_cjs = require('./chunk-GLD263KW.cjs');
|
|
11
11
|
var chunkUPLVMVRX_cjs = require('./chunk-UPLVMVRX.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkTZEMLHSP_cjs = require('./chunk-TZEMLHSP.cjs');
|
|
13
13
|
var chunk3DZRIZOD_cjs = require('./chunk-3DZRIZOD.cjs');
|
|
14
14
|
var chunkTJ2MIQUT_cjs = require('./chunk-TJ2MIQUT.cjs');
|
|
15
15
|
var chunk4U6DATGZ_cjs = require('./chunk-4U6DATGZ.cjs');
|
|
@@ -5239,7 +5239,7 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
5239
5239
|
const orderIdForNotify = created.id;
|
|
5240
5240
|
const finalCreatedStatus = String(created.status ?? createdStatus ?? "pending").toLowerCase();
|
|
5241
5241
|
const initialPayStatus = String(persistBody.paymentStatus ?? body.paymentStatus ?? "unpaid").toLowerCase();
|
|
5242
|
-
void import('./emit-order-notification-trigger-
|
|
5242
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
5243
5243
|
if (finalCreatedStatus === "pending") {
|
|
5244
5244
|
if (initialPayStatus === "failed") {
|
|
5245
5245
|
fireOrderNotificationTrigger("payment_failed", orderIdForNotify, {
|
|
@@ -5895,6 +5895,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
5895
5895
|
const repo = dataSource.getRepository(entity);
|
|
5896
5896
|
const numericId = Number(id);
|
|
5897
5897
|
let orderInvPrev = null;
|
|
5898
|
+
let existingOrderRow = null;
|
|
5898
5899
|
if (resource === "blogs" && rawBody && typeof rawBody === "object" && entityMap.categories && entityMap.seos && entityMap.tags) {
|
|
5899
5900
|
const existing = await repo.findOne({
|
|
5900
5901
|
where: {
|
|
@@ -6031,6 +6032,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6031
6032
|
status: 404
|
|
6032
6033
|
});
|
|
6033
6034
|
if (resource === "orders") {
|
|
6035
|
+
existingOrderRow = cur;
|
|
6034
6036
|
orderInvPrev = chunkHY3AXLOI_cjs.orderInventorySnapshotFromRow(cur);
|
|
6035
6037
|
}
|
|
6036
6038
|
}
|
|
@@ -6062,16 +6064,13 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6062
6064
|
if (Number.isFinite(aId) && aId > 0) {
|
|
6063
6065
|
scalarUpdate.assignedUserId = aId;
|
|
6064
6066
|
scalarUpdate.assignedAt = /* @__PURE__ */ new Date();
|
|
6065
|
-
if (!scalarUpdate.status && (orderInvPrev?.status === "confirmed" || orderInvPrev?.status === "pending")) {
|
|
6066
|
-
scalarUpdate.status = "processing";
|
|
6067
|
-
}
|
|
6068
6067
|
} else {
|
|
6069
6068
|
scalarUpdate.assignedUserId = null;
|
|
6070
6069
|
scalarUpdate.assignedAt = null;
|
|
6071
6070
|
}
|
|
6072
6071
|
}
|
|
6073
6072
|
if (scalarUpdate.status === "processing") {
|
|
6074
|
-
const effectiveAssignee = scalarUpdate.assignedUserId !== void 0 ? scalarUpdate.assignedUserId :
|
|
6073
|
+
const effectiveAssignee = scalarUpdate.assignedUserId !== void 0 ? scalarUpdate.assignedUserId : existingOrderRow?.assignedUserId ?? null;
|
|
6075
6074
|
if (!effectiveAssignee) {
|
|
6076
6075
|
return json({
|
|
6077
6076
|
error: "Cannot start processing without assigning a teammate. Please assign a teammate first."
|
|
@@ -6318,12 +6317,26 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6318
6317
|
}
|
|
6319
6318
|
const statusUpdated = Boolean(scalarUpdate.status || rawBody.status);
|
|
6320
6319
|
const paymentUpdated = Boolean(rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null);
|
|
6320
|
+
const assigneeUpdated = Boolean(rawBody && typeof rawBody === "object" && "assignedUserId" in rawBody && rawBody.assignedUserId !== void 0 && Number(rawBody.assignedUserId) > 0 && Number(rawBody.assignedUserId) !== Number(existingOrderRow?.assignedUserId));
|
|
6321
|
+
if (assigneeUpdated) {
|
|
6322
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
6323
|
+
fireOrderNotificationTrigger("order_assigned", updatedOrder.id, {
|
|
6324
|
+
dataSource,
|
|
6325
|
+
entityMap
|
|
6326
|
+
});
|
|
6327
|
+
fireOrderNotificationTrigger("order_assigned_assignee", updatedOrder.id, {
|
|
6328
|
+
dataSource,
|
|
6329
|
+
entityMap
|
|
6330
|
+
});
|
|
6331
|
+
}).catch(() => {
|
|
6332
|
+
});
|
|
6333
|
+
}
|
|
6321
6334
|
if (statusUpdated || paymentUpdated) {
|
|
6322
6335
|
const newStatus = scalarUpdate.status ? String(scalarUpdate.status).toLowerCase() : rawBody.status ? String(rawBody.status).toLowerCase() : String(updatedOrder.status || "pending").toLowerCase();
|
|
6323
6336
|
const payments = Array.isArray(updatedOrder.payments) ? updatedOrder.payments : [];
|
|
6324
6337
|
const bodyPayStatus = rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null ? String(rawBody.paymentStatus).toLowerCase() : null;
|
|
6325
6338
|
const curPayStatus = bodyPayStatus || String(payments[0]?.status || "unpaid").toLowerCase();
|
|
6326
|
-
void import('./emit-order-notification-trigger-
|
|
6339
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
6327
6340
|
if (newStatus === "pending") {
|
|
6328
6341
|
if (curPayStatus === "failed") {
|
|
6329
6342
|
fireOrderNotificationTrigger("payment_failed", updatedOrder.id, {
|
|
@@ -6878,16 +6891,13 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6878
6891
|
if (Number.isFinite(aId) && aId > 0) {
|
|
6879
6892
|
updatePayload.assignedUserId = aId;
|
|
6880
6893
|
updatePayload.assignedAt = /* @__PURE__ */ new Date();
|
|
6881
|
-
if (!updatePayload.status && (orderInvPrev.status === "confirmed" || orderInvPrev.status === "pending")) {
|
|
6882
|
-
updatePayload.status = "processing";
|
|
6883
|
-
}
|
|
6884
6894
|
} else {
|
|
6885
6895
|
updatePayload.assignedUserId = null;
|
|
6886
6896
|
updatePayload.assignedAt = null;
|
|
6887
6897
|
}
|
|
6888
6898
|
}
|
|
6889
6899
|
if (updatePayload.status === "processing") {
|
|
6890
|
-
const effectiveAssignee = updatePayload.assignedUserId !== void 0 ? updatePayload.assignedUserId :
|
|
6900
|
+
const effectiveAssignee = updatePayload.assignedUserId !== void 0 ? updatePayload.assignedUserId : existingOrderRow?.assignedUserId ?? null;
|
|
6891
6901
|
if (!effectiveAssignee) {
|
|
6892
6902
|
return json({
|
|
6893
6903
|
error: "Cannot start processing without assigning a teammate. Please assign a teammate first."
|
|
@@ -6980,7 +6990,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6980
6990
|
});
|
|
6981
6991
|
}
|
|
6982
6992
|
if (ordStatus === "pending" || ordStatus === "confirmed") {
|
|
6983
|
-
void import('./emit-order-notification-trigger-
|
|
6993
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
6984
6994
|
fireOrderNotificationTrigger("order_placed", pOrder, {
|
|
6985
6995
|
dataSource,
|
|
6986
6996
|
entityMap
|
|
@@ -6994,7 +7004,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6994
7004
|
}
|
|
6995
7005
|
}
|
|
6996
7006
|
} else if (newPayStatus === "failed") {
|
|
6997
|
-
void import('./emit-order-notification-trigger-
|
|
7007
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
6998
7008
|
fireOrderNotificationTrigger("payment_failed", pOrder, {
|
|
6999
7009
|
dataSource,
|
|
7000
7010
|
entityMap
|
|
@@ -7002,7 +7012,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7002
7012
|
}).catch(() => {
|
|
7003
7013
|
});
|
|
7004
7014
|
} else if (newPayStatus === "refunded") {
|
|
7005
|
-
void import('./emit-order-notification-trigger-
|
|
7015
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
7006
7016
|
fireOrderNotificationTrigger("payment_refund_initiated", pOrder, {
|
|
7007
7017
|
dataSource,
|
|
7008
7018
|
entityMap
|
|
@@ -7127,12 +7137,26 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7127
7137
|
const ord = updated;
|
|
7128
7138
|
const statusUpdated = Boolean(updatePayload.status);
|
|
7129
7139
|
const paymentUpdated = Boolean(rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null);
|
|
7140
|
+
const assigneeUpdated = Boolean(rawBody && typeof rawBody === "object" && "assignedUserId" in rawBody && rawBody.assignedUserId !== void 0 && Number(rawBody.assignedUserId) > 0 && Number(rawBody.assignedUserId) !== Number(existingOrderRow?.assignedUserId));
|
|
7141
|
+
if (assigneeUpdated) {
|
|
7142
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
7143
|
+
fireOrderNotificationTrigger("order_assigned", ord.id, {
|
|
7144
|
+
dataSource,
|
|
7145
|
+
entityMap
|
|
7146
|
+
});
|
|
7147
|
+
fireOrderNotificationTrigger("order_assigned_assignee", ord.id, {
|
|
7148
|
+
dataSource,
|
|
7149
|
+
entityMap
|
|
7150
|
+
});
|
|
7151
|
+
}).catch(() => {
|
|
7152
|
+
});
|
|
7153
|
+
}
|
|
7130
7154
|
if (statusUpdated || paymentUpdated) {
|
|
7131
7155
|
const newStatus = updatePayload.status ? String(updatePayload.status).toLowerCase() : String(ord.status || "pending").toLowerCase();
|
|
7132
7156
|
const payments = Array.isArray(ord.payments) ? ord.payments : [];
|
|
7133
7157
|
const bodyPayStatus = rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null ? String(rawBody.paymentStatus).toLowerCase() : null;
|
|
7134
7158
|
const curPayStatus = bodyPayStatus || String(payments[0]?.status || "unpaid").toLowerCase();
|
|
7135
|
-
void import('./emit-order-notification-trigger-
|
|
7159
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
7136
7160
|
if (newStatus === "pending") {
|
|
7137
7161
|
if (curPayStatus === "failed") {
|
|
7138
7162
|
fireOrderNotificationTrigger("payment_failed", ord.id, {
|
|
@@ -10251,7 +10275,7 @@ function createFormSubmissionHandler(config) {
|
|
|
10251
10275
|
label: f.label && String(f.label).trim() || `Field ${f.id}`,
|
|
10252
10276
|
value: formatSubmissionFieldValue(data[String(f.id)])
|
|
10253
10277
|
}));
|
|
10254
|
-
await
|
|
10278
|
+
await chunkXFDIIVZB_cjs.queueEmail(cms, {
|
|
10255
10279
|
to,
|
|
10256
10280
|
templateName: "formSubmission",
|
|
10257
10281
|
ctx: {
|
|
@@ -10305,7 +10329,7 @@ function createUsersApiHandlers(config) {
|
|
|
10305
10329
|
try {
|
|
10306
10330
|
const cms = await getCms();
|
|
10307
10331
|
const companyDetails = getCompanyDetails ? await getCompanyDetails() : {};
|
|
10308
|
-
await
|
|
10332
|
+
await chunkXFDIIVZB_cjs.queueEmail(cms, {
|
|
10309
10333
|
to: toEmail,
|
|
10310
10334
|
templateName: "invite",
|
|
10311
10335
|
ctx: {
|
|
@@ -11578,7 +11602,7 @@ function createChatHandlers(config) {
|
|
|
11578
11602
|
const notifyEmailAgent = await findLlmAgentByScope(dataSource, entityMap, LLM_AGENT_SCOPE_EMAIL_INTENT_CHATBOT, {
|
|
11579
11603
|
enabledOnly: false
|
|
11580
11604
|
});
|
|
11581
|
-
const emailTool =
|
|
11605
|
+
const emailTool = chunkNIRYYJIJ_cjs.resolveChatEmailToolSettings(llmSettings, {
|
|
11582
11606
|
chatbotValidationRules: agentRow?.validationRules ?? null,
|
|
11583
11607
|
notifyAgent: notifyEmailAgent ? {
|
|
11584
11608
|
systemInstruction: notifyEmailAgent.systemInstruction,
|
|
@@ -11588,7 +11612,7 @@ function createChatHandlers(config) {
|
|
|
11588
11612
|
const emailPlugin2 = cms.getPlugin("email");
|
|
11589
11613
|
const convLeadSent = conv.leadEmailSentAt;
|
|
11590
11614
|
const chatAgentFn = llm.chatAgent?.bind(llm);
|
|
11591
|
-
console.info(
|
|
11615
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline check", {
|
|
11592
11616
|
conversationId,
|
|
11593
11617
|
enabled: emailTool.enabled,
|
|
11594
11618
|
intentCount: emailTool.intents.length,
|
|
@@ -11602,27 +11626,27 @@ function createChatHandlers(config) {
|
|
|
11602
11626
|
mergedPromptIncludesNotify: Boolean(notifyEmailAgent?.systemInstruction?.trim())
|
|
11603
11627
|
});
|
|
11604
11628
|
if (!emailTool.enabled) {
|
|
11605
|
-
console.info(
|
|
11629
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline skipped", {
|
|
11606
11630
|
conversationId,
|
|
11607
11631
|
reason: "email_tool_disabled"
|
|
11608
11632
|
});
|
|
11609
11633
|
} else if (emailTool.intents.length === 0) {
|
|
11610
|
-
console.info(
|
|
11634
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline skipped", {
|
|
11611
11635
|
conversationId,
|
|
11612
11636
|
reason: "no_intents_configured"
|
|
11613
11637
|
});
|
|
11614
11638
|
} else if (!emailPlugin2) {
|
|
11615
|
-
console.info(
|
|
11639
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline skipped", {
|
|
11616
11640
|
conversationId,
|
|
11617
11641
|
reason: "email_plugin_missing"
|
|
11618
11642
|
});
|
|
11619
11643
|
} else if (!chatAgentFn) {
|
|
11620
|
-
console.info(
|
|
11644
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline skipped", {
|
|
11621
11645
|
conversationId,
|
|
11622
11646
|
reason: "llm_chat_agent_unavailable"
|
|
11623
11647
|
});
|
|
11624
11648
|
} else if (convLeadSent) {
|
|
11625
|
-
console.info(
|
|
11649
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline skipped", {
|
|
11626
11650
|
conversationId,
|
|
11627
11651
|
reason: "lead_email_already_sent",
|
|
11628
11652
|
leadEmailSentAt: convLeadSent
|
|
@@ -11635,7 +11659,7 @@ function createChatHandlers(config) {
|
|
|
11635
11659
|
}
|
|
11636
11660
|
});
|
|
11637
11661
|
if (!contactRow) {
|
|
11638
|
-
console.warn(
|
|
11662
|
+
console.warn(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline skipped", {
|
|
11639
11663
|
conversationId,
|
|
11640
11664
|
reason: "contact_not_found",
|
|
11641
11665
|
contactId
|
|
@@ -11643,7 +11667,7 @@ function createChatHandlers(config) {
|
|
|
11643
11667
|
} else {
|
|
11644
11668
|
const c = contactRow;
|
|
11645
11669
|
try {
|
|
11646
|
-
const intent = await
|
|
11670
|
+
const intent = await chunkNIRYYJIJ_cjs.detectChatLeadIntent({
|
|
11647
11671
|
chatAgent: chatAgentFn
|
|
11648
11672
|
}, {
|
|
11649
11673
|
settings: emailTool,
|
|
@@ -11657,15 +11681,15 @@ function createChatHandlers(config) {
|
|
|
11657
11681
|
model: agentRow?.model?.trim() || notifyEmailAgent?.model?.trim() || void 0
|
|
11658
11682
|
});
|
|
11659
11683
|
if (!intent.intent || !intent.emailTo) {
|
|
11660
|
-
console.info(
|
|
11684
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "no email sent", {
|
|
11661
11685
|
conversationId,
|
|
11662
11686
|
reason: intent.intent ? "missing_email_to" : "no_intent_match",
|
|
11663
11687
|
intentLabel: intent.intentLabel,
|
|
11664
11688
|
classifierReason: intent.reason
|
|
11665
11689
|
});
|
|
11666
11690
|
} else {
|
|
11667
|
-
const intentRecipients =
|
|
11668
|
-
console.info(
|
|
11691
|
+
const intentRecipients = chunkNIRYYJIJ_cjs.parseIntentRecipientEmails(intent.emailTo);
|
|
11692
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "intent matched \u2014 sending", {
|
|
11669
11693
|
conversationId,
|
|
11670
11694
|
intent: intent.intent,
|
|
11671
11695
|
emailTo: intent.emailTo,
|
|
@@ -11674,8 +11698,9 @@ function createChatHandlers(config) {
|
|
|
11674
11698
|
});
|
|
11675
11699
|
const emailSettings = await loadSettingsGroupMap(dataSource, entityMap, "email");
|
|
11676
11700
|
const brandingSettings = await loadSettingsGroupMap(dataSource, entityMap, "branding");
|
|
11677
|
-
const
|
|
11678
|
-
const
|
|
11701
|
+
const storeSettings = await loadSettingsGroupMap(dataSource, entityMap, "store");
|
|
11702
|
+
const companyDetails = chunkTZEMLHSP_cjs.mergeEmailLayoutCompanyDetails(brandingSettings, emailSettings, storeSettings);
|
|
11703
|
+
const leadResult = await chunkNIRYYJIJ_cjs.sendChatLeadEmail(cms, emailSettings, brandingSettings, {
|
|
11679
11704
|
contactName: String(c.name ?? "").trim() || "Visitor",
|
|
11680
11705
|
contactEmail: String(c.email ?? "").trim(),
|
|
11681
11706
|
contactPhone: c.phone ?? null,
|
|
@@ -11683,7 +11708,7 @@ function createChatHandlers(config) {
|
|
|
11683
11708
|
latestMessage: message,
|
|
11684
11709
|
intentCode: intent.intent,
|
|
11685
11710
|
intentReason: intent.intentLabel || intent.reason,
|
|
11686
|
-
transcript:
|
|
11711
|
+
transcript: chunkNIRYYJIJ_cjs.buildTranscriptForLeadEmail(history, message),
|
|
11687
11712
|
companyDetails,
|
|
11688
11713
|
recipients: intentRecipients.length > 0 ? intentRecipients : void 0
|
|
11689
11714
|
});
|
|
@@ -11691,13 +11716,13 @@ function createChatHandlers(config) {
|
|
|
11691
11716
|
await convRepo().update(conversationId, {
|
|
11692
11717
|
leadEmailSentAt: /* @__PURE__ */ new Date()
|
|
11693
11718
|
});
|
|
11694
|
-
console.info(
|
|
11719
|
+
console.info(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "lead email recorded", {
|
|
11695
11720
|
conversationId,
|
|
11696
11721
|
sent: true,
|
|
11697
11722
|
recipients: leadResult.recipients
|
|
11698
11723
|
});
|
|
11699
11724
|
} else {
|
|
11700
|
-
console.warn(
|
|
11725
|
+
console.warn(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "lead email not sent", {
|
|
11701
11726
|
conversationId,
|
|
11702
11727
|
sent: false,
|
|
11703
11728
|
error: leadResult.error ?? "unknown",
|
|
@@ -11706,7 +11731,7 @@ function createChatHandlers(config) {
|
|
|
11706
11731
|
}
|
|
11707
11732
|
}
|
|
11708
11733
|
} catch (intentErr) {
|
|
11709
|
-
console.warn(
|
|
11734
|
+
console.warn(chunkNIRYYJIJ_cjs.CHAT_EMAIL_LOG, "pipeline error", {
|
|
11710
11735
|
conversationId,
|
|
11711
11736
|
error: intentErr instanceof Error ? intentErr.message : String(intentErr)
|
|
11712
11737
|
});
|
|
@@ -11723,7 +11748,7 @@ function createChatHandlers(config) {
|
|
|
11723
11748
|
});
|
|
11724
11749
|
if (agentRow && llm.chatAgent) {
|
|
11725
11750
|
const fromAgent = llmAgentToChatAgentOptions(agentRow);
|
|
11726
|
-
const systemPrompt =
|
|
11751
|
+
const systemPrompt = chunkNIRYYJIJ_cjs.buildChatbotSystemPromptWithEmailTool(fromAgent.systemPrompt, parsedValidation.guardrailsForPrompt, emailTool);
|
|
11727
11752
|
const res = await llm.chatAgent({
|
|
11728
11753
|
...fromAgent,
|
|
11729
11754
|
systemPrompt: systemPrompt || void 0,
|
|
@@ -11744,7 +11769,7 @@ ${contextParts.join("\n\n")}` : "";
|
|
|
11744
11769
|
agentRow.systemInstruction?.trim(),
|
|
11745
11770
|
ragSystem
|
|
11746
11771
|
].filter(Boolean).join("\n\n");
|
|
11747
|
-
systemContent =
|
|
11772
|
+
systemContent = chunkNIRYYJIJ_cjs.buildChatbotSystemPromptWithEmailTool(mergedBase || defaultSystem, parsedValidation.guardrailsForPrompt, emailTool) || defaultSystem;
|
|
11748
11773
|
} else {
|
|
11749
11774
|
systemContent = ragSystem || defaultSystem;
|
|
11750
11775
|
}
|
|
@@ -12999,7 +13024,7 @@ function createDeviceTokensHandlers(config) {
|
|
|
12999
13024
|
const title = body.title?.trim() || "Test Push Notification";
|
|
13000
13025
|
const msgBody = body.body?.trim() || "Firebase Push Notification setup is working!";
|
|
13001
13026
|
if (!token || token === "validate" || token === "validate_only") {
|
|
13002
|
-
const valRes = await
|
|
13027
|
+
const valRes = await chunkNIRYYJIJ_cjs.validateFcmCredentials(dataSource, entityMap);
|
|
13003
13028
|
if (!valRes.success) {
|
|
13004
13029
|
return json({
|
|
13005
13030
|
success: false,
|
|
@@ -13016,7 +13041,7 @@ function createDeviceTokensHandlers(config) {
|
|
|
13016
13041
|
clientEmail: valRes.clientEmail
|
|
13017
13042
|
});
|
|
13018
13043
|
}
|
|
13019
|
-
const res = await
|
|
13044
|
+
const res = await chunkNIRYYJIJ_cjs.sendFcmPushNotification(dataSource, entityMap, {
|
|
13020
13045
|
token,
|
|
13021
13046
|
title,
|
|
13022
13047
|
body: msgBody,
|
|
@@ -14004,14 +14029,15 @@ chunkUSNT2KNT_cjs.__name(getVendorEmails, "getVendorEmails");
|
|
|
14004
14029
|
async function sendVendorOnboardEmails(input, deps) {
|
|
14005
14030
|
let ownerEmailSent = false;
|
|
14006
14031
|
try {
|
|
14007
|
-
const [branding, emailSettings, superAdminEmails, vendorEmailSet] = await Promise.all([
|
|
14032
|
+
const [branding, emailSettings, storeSettings, superAdminEmails, vendorEmailSet] = await Promise.all([
|
|
14008
14033
|
getSettingsGroup(deps, "branding"),
|
|
14009
14034
|
getSettingsGroup(deps, "email"),
|
|
14035
|
+
getSettingsGroup(deps, "store"),
|
|
14010
14036
|
getSuperAdminEmails(deps),
|
|
14011
14037
|
getVendorEmails(deps)
|
|
14012
14038
|
]);
|
|
14013
|
-
const companyDetails =
|
|
14014
|
-
const configuredNotify =
|
|
14039
|
+
const companyDetails = chunkTZEMLHSP_cjs.mergeEmailLayoutCompanyDetails(branding, emailSettings, storeSettings);
|
|
14040
|
+
const configuredNotify = chunkNIRYYJIJ_cjs.parseEmailRecipientsFromConfig(emailSettings.salesTeamEmails ?? emailSettings.salesTeamEmail);
|
|
14015
14041
|
const ownerEmail = input.ownerEmail?.trim() || "";
|
|
14016
14042
|
const ownerEmailLower = ownerEmail.toLowerCase();
|
|
14017
14043
|
const sendToOwner = input.sendToOwner !== false;
|
|
@@ -14021,7 +14047,7 @@ async function sendVendorOnboardEmails(input, deps) {
|
|
|
14021
14047
|
];
|
|
14022
14048
|
const notifyEmails = Array.from(new Set(combined.map((e) => e.trim().toLowerCase()).filter((e) => e && e !== ownerEmailLower && !vendorEmailSet.has(e))));
|
|
14023
14049
|
const cms = await deps.getCms();
|
|
14024
|
-
await
|
|
14050
|
+
await chunkXFDIIVZB_cjs.queueVendorOnboardEmails(cms, {
|
|
14025
14051
|
vendorName: input.vendorName,
|
|
14026
14052
|
vendorSlug: input.vendorSlug,
|
|
14027
14053
|
ownerName: input.ownerName,
|
|
@@ -27469,7 +27495,7 @@ async function queueJobScheduleNow(cms, scheduleId) {
|
|
|
27469
27495
|
if (!boss) {
|
|
27470
27496
|
throw new Error("pg-boss is not configured (DATABASE_URL required)");
|
|
27471
27497
|
}
|
|
27472
|
-
const { JOB_RUNNER_QUEUE: JOB_RUNNER_QUEUE2 } = await import('./pg-boss-service-
|
|
27498
|
+
const { JOB_RUNNER_QUEUE: JOB_RUNNER_QUEUE2 } = await import('./pg-boss-service-BDGOKM2T.cjs');
|
|
27473
27499
|
await boss.send(JOB_RUNNER_QUEUE2, {
|
|
27474
27500
|
scheduleId,
|
|
27475
27501
|
triggeredBy: "manual"
|
|
@@ -27723,7 +27749,7 @@ function registerJobRunnerWorker(cms, deps) {
|
|
|
27723
27749
|
const registerQueue = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(async (queueName) => {
|
|
27724
27750
|
await boss.registerWork(queueName, execute);
|
|
27725
27751
|
}, "registerQueue");
|
|
27726
|
-
void boss.registerWork(
|
|
27752
|
+
void boss.registerWork(chunkTHL5JDWJ_cjs.JOB_RUNNER_QUEUE, execute);
|
|
27727
27753
|
void (async () => {
|
|
27728
27754
|
try {
|
|
27729
27755
|
const repo = deps.dataSource.getRepository(exports.JobSchedule);
|
|
@@ -28637,11 +28663,11 @@ function whatsappPlugin(config = {}) {
|
|
|
28637
28663
|
db = await settingsLoader?.() ?? {};
|
|
28638
28664
|
} catch {
|
|
28639
28665
|
}
|
|
28640
|
-
if (!
|
|
28666
|
+
if (!chunkNIRYYJIJ_cjs.isWhatsAppPluginEnabled(db)) {
|
|
28641
28667
|
context.logger.warn("WhatsApp plugin skipped: disabled in Plugins \u2192 WhatsApp");
|
|
28642
28668
|
return null;
|
|
28643
28669
|
}
|
|
28644
|
-
const svc = new
|
|
28670
|
+
const svc = new chunkNIRYYJIJ_cjs.WhatsAppService(env, staticRest, settingsLoader, getMessageTemplateRow);
|
|
28645
28671
|
return {
|
|
28646
28672
|
send: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((opts) => svc.send(opts), "send")
|
|
28647
28673
|
};
|
|
@@ -28714,7 +28740,7 @@ function createMessageTemplateRowLoader(dataSource, entityMap) {
|
|
|
28714
28740
|
}
|
|
28715
28741
|
chunkUSNT2KNT_cjs.__name(createMessageTemplateRowLoader, "createMessageTemplateRowLoader");
|
|
28716
28742
|
function registerMessagingQueueProcessors(cms, entityMap) {
|
|
28717
|
-
|
|
28743
|
+
chunkXFDIIVZB_cjs.registerEmailQueueProcessor(cms, {
|
|
28718
28744
|
getDataSource: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(async () => cms.dataSource, "getDataSource"),
|
|
28719
28745
|
entityMap
|
|
28720
28746
|
});
|
|
@@ -28747,7 +28773,7 @@ async function ensureMessagingPluginsOnCms(base, options) {
|
|
|
28747
28773
|
}
|
|
28748
28774
|
if (!cms.getPlugin("email")) {
|
|
28749
28775
|
try {
|
|
28750
|
-
const instance = await
|
|
28776
|
+
const instance = await chunkNIRYYJIJ_cjs.emailPlugin({
|
|
28751
28777
|
type: "SMTP",
|
|
28752
28778
|
from: config.SMTP_FROM ?? "no-reply@localhost",
|
|
28753
28779
|
to: config.SMTP_TO ?? ""
|
|
@@ -28788,7 +28814,7 @@ function messagingPlugins(options) {
|
|
|
28788
28814
|
const config = options.config ?? (typeof process !== "undefined" ? process.env : {});
|
|
28789
28815
|
return [
|
|
28790
28816
|
queuePlugin(),
|
|
28791
|
-
|
|
28817
|
+
chunkNIRYYJIJ_cjs.emailPlugin({
|
|
28792
28818
|
type: "SMTP",
|
|
28793
28819
|
from: config.SMTP_FROM ?? "no-reply@localhost",
|
|
28794
28820
|
to: config.SMTP_TO ?? ""
|
|
@@ -28922,7 +28948,7 @@ function createCmsApiHandler(config) {
|
|
|
28922
28948
|
} : void 0;
|
|
28923
28949
|
const entityMap = withLlmKnowledgeEntityFallbacks(rawEntityMap);
|
|
28924
28950
|
if (getCms) {
|
|
28925
|
-
|
|
28951
|
+
chunkNIRYYJIJ_cjs.initWhatsappTriggerDispatcher({
|
|
28926
28952
|
dataSource,
|
|
28927
28953
|
entityMap,
|
|
28928
28954
|
getCms
|
|
@@ -29015,7 +29041,7 @@ function createCmsApiHandler(config) {
|
|
|
29015
29041
|
companyDetails
|
|
29016
29042
|
};
|
|
29017
29043
|
if (queue) {
|
|
29018
|
-
const { queueEmail: queueEmail2 } = await import('./email-queue-
|
|
29044
|
+
const { queueEmail: queueEmail2 } = await import('./email-queue-4OY45JIU.cjs');
|
|
29019
29045
|
await queueEmail2(cms, {
|
|
29020
29046
|
to: opts.to,
|
|
29021
29047
|
templateName: "passwordReset",
|
|
@@ -30315,7 +30341,7 @@ function createCmsApiHandler(config) {
|
|
|
30315
30341
|
const pe = await requireEntityPermissionEffective(req, "orders", "read");
|
|
30316
30342
|
if (pe) return pe;
|
|
30317
30343
|
const cms = await getCms();
|
|
30318
|
-
const { streamOrderInvoicePdf: streamOrderInvoicePdf2 } = await import('./erp-order-invoice-
|
|
30344
|
+
const { streamOrderInvoicePdf: streamOrderInvoicePdf2 } = await import('./erp-order-invoice-YUSPZ7CE.cjs');
|
|
30319
30345
|
const oid = Number(path2[1]);
|
|
30320
30346
|
if (!Number.isFinite(oid)) return config.json({
|
|
30321
30347
|
error: "Invalid id"
|
|
@@ -30697,7 +30723,7 @@ function createCmsApiHandler(config) {
|
|
|
30697
30723
|
status: 400
|
|
30698
30724
|
});
|
|
30699
30725
|
}
|
|
30700
|
-
const { resendOrderNotification } = await import('./order-notification-dispatcher-
|
|
30726
|
+
const { resendOrderNotification } = await import('./order-notification-dispatcher-Y7NZAALH.cjs');
|
|
30701
30727
|
const result = await resendOrderNotification(triggerKey, orderId, {
|
|
30702
30728
|
dataSource,
|
|
30703
30729
|
entityMap,
|
|
@@ -30796,7 +30822,7 @@ function createCmsApiHandler(config) {
|
|
|
30796
30822
|
status: "cancelled"
|
|
30797
30823
|
});
|
|
30798
30824
|
const fireOrderCancelledNotification = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((refundAmount) => {
|
|
30799
|
-
void import('./emit-order-notification-trigger-
|
|
30825
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
30800
30826
|
fireOrderNotificationTrigger("order_cancelled", orderId, {
|
|
30801
30827
|
dataSource,
|
|
30802
30828
|
entityMap
|
|
@@ -31041,7 +31067,7 @@ function createCmsApiHandler(config) {
|
|
|
31041
31067
|
}, {
|
|
31042
31068
|
status: 400
|
|
31043
31069
|
});
|
|
31044
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31070
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-RW5RSXH3.cjs');
|
|
31045
31071
|
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms);
|
|
31046
31072
|
return handlers.getChannels(req, orderId);
|
|
31047
31073
|
}
|
|
@@ -31056,7 +31082,7 @@ function createCmsApiHandler(config) {
|
|
|
31056
31082
|
}, {
|
|
31057
31083
|
status: 400
|
|
31058
31084
|
});
|
|
31059
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31085
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-RW5RSXH3.cjs');
|
|
31060
31086
|
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms);
|
|
31061
31087
|
return handlers.sendOtp(req, orderId);
|
|
31062
31088
|
}
|
|
@@ -31071,7 +31097,7 @@ function createCmsApiHandler(config) {
|
|
|
31071
31097
|
}, {
|
|
31072
31098
|
status: 400
|
|
31073
31099
|
});
|
|
31074
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31100
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-RW5RSXH3.cjs');
|
|
31075
31101
|
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms);
|
|
31076
31102
|
return handlers.verifyOtp(req, orderId);
|
|
31077
31103
|
}
|
|
@@ -31519,12 +31545,12 @@ async function refreshOrderFromErp(cms, dataSource, entityMap, submission, order
|
|
|
31519
31545
|
const r1 = await submission.postErpReadAction("get-order-status", {
|
|
31520
31546
|
platformOrderId: refId
|
|
31521
31547
|
});
|
|
31522
|
-
const d1 = r1.ok ?
|
|
31548
|
+
const d1 = r1.ok ? chunkGLD263KW_cjs.unwrapErpReadData(r1.json) : null;
|
|
31523
31549
|
if (d1) {
|
|
31524
31550
|
const mapped = mapErpSaleStatusToOrderStatus(typeof d1.status === "string" ? d1.status : typeof d1.orderStatus === "string" ? d1.orderStatus : typeof d1.state === "string" ? d1.state : void 0);
|
|
31525
31551
|
if (mapped) newStatus = mapped;
|
|
31526
|
-
fulfillment =
|
|
31527
|
-
const refs =
|
|
31552
|
+
fulfillment = chunkGLD263KW_cjs.mapErpPayloadToFulfillment(d1);
|
|
31553
|
+
const refs = chunkGLD263KW_cjs.extractChildOrderRefsFromSalePayload(d1);
|
|
31528
31554
|
if (refs.length) {
|
|
31529
31555
|
await ensureChildOrdersFromRefs(orderRepo, order, refs, order.contactId, String(order.currency || "INR"));
|
|
31530
31556
|
}
|
|
@@ -31532,16 +31558,16 @@ async function refreshOrderFromErp(cms, dataSource, entityMap, submission, order
|
|
|
31532
31558
|
const r2 = await submission.postErpReadAction("get-fulfillment-status", {
|
|
31533
31559
|
platformOrderId: refId
|
|
31534
31560
|
});
|
|
31535
|
-
const d2 = r2.ok ?
|
|
31561
|
+
const d2 = r2.ok ? chunkGLD263KW_cjs.unwrapErpReadData(r2.json) : null;
|
|
31536
31562
|
if (d2) {
|
|
31537
|
-
fulfillment = deepMergeFulfillment(fulfillment,
|
|
31563
|
+
fulfillment = deepMergeFulfillment(fulfillment, chunkGLD263KW_cjs.mapErpPayloadToFulfillment(d2));
|
|
31538
31564
|
}
|
|
31539
31565
|
const r3 = await submission.postErpReadAction("get-invoice", {
|
|
31540
31566
|
platformOrderId: refId
|
|
31541
31567
|
});
|
|
31542
|
-
const d3 = r3.ok ?
|
|
31568
|
+
const d3 = r3.ok ? chunkGLD263KW_cjs.unwrapErpReadData(r3.json) : null;
|
|
31543
31569
|
if (d3) {
|
|
31544
|
-
invoiceNumber =
|
|
31570
|
+
invoiceNumber = chunkGLD263KW_cjs.mapErpPayloadToInvoiceNumber(d3);
|
|
31545
31571
|
invoiceId = pickInvoiceId(d3);
|
|
31546
31572
|
}
|
|
31547
31573
|
const oid = order.id;
|
|
@@ -31577,10 +31603,10 @@ async function refreshOrderFromErp(cms, dataSource, entityMap, submission, order
|
|
|
31577
31603
|
const r = await submission.postErpReadAction("get-return-status", {
|
|
31578
31604
|
platformReturnId
|
|
31579
31605
|
});
|
|
31580
|
-
const d = r.ok ?
|
|
31606
|
+
const d = r.ok ? chunkGLD263KW_cjs.unwrapErpReadData(r.json) : null;
|
|
31581
31607
|
if (!d) return;
|
|
31582
31608
|
const mapped = mapErpSaleStatusToOrderStatus(typeof d.status === "string" ? d.status : typeof d.returnStatus === "string" ? d.returnStatus : void 0);
|
|
31583
|
-
const fulfillment =
|
|
31609
|
+
const fulfillment = chunkGLD263KW_cjs.mapErpPayloadToFulfillment(d);
|
|
31584
31610
|
const patch = {};
|
|
31585
31611
|
if (fulfillment !== void 0) patch.fulfillment = fulfillment;
|
|
31586
31612
|
const nextMeta = Object.keys(patch).length ? mergeOrderMetadataPatch(meta, patch) : meta;
|
|
@@ -31703,20 +31729,26 @@ function createStorefrontApiHandler(config) {
|
|
|
31703
31729
|
const otpPepper = config.otpPepper;
|
|
31704
31730
|
const defaultPhoneCc = config.defaultPhoneCountryCode;
|
|
31705
31731
|
function fireOrderPlacedNotification(orderId, isPaid) {
|
|
31706
|
-
void import('./emit-order-notification-trigger-
|
|
31732
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
31707
31733
|
fireOrderNotificationTrigger("order_placed", orderId, {
|
|
31708
31734
|
dataSource,
|
|
31709
31735
|
entityMap
|
|
31736
|
+
}, {
|
|
31737
|
+
source: "storefront"
|
|
31710
31738
|
});
|
|
31711
31739
|
if (isPaid) {
|
|
31712
31740
|
fireOrderNotificationTrigger("payment_success", orderId, {
|
|
31713
31741
|
dataSource,
|
|
31714
31742
|
entityMap
|
|
31743
|
+
}, {
|
|
31744
|
+
source: "storefront"
|
|
31715
31745
|
});
|
|
31716
31746
|
} else {
|
|
31717
31747
|
fireOrderNotificationTrigger("payment_failed", orderId, {
|
|
31718
31748
|
dataSource,
|
|
31719
31749
|
entityMap
|
|
31750
|
+
}, {
|
|
31751
|
+
source: "storefront"
|
|
31720
31752
|
});
|
|
31721
31753
|
}
|
|
31722
31754
|
}).catch((err) => console.error("[notification-triggers] import failed", err));
|
|
@@ -33396,7 +33428,7 @@ function createStorefrontApiHandler(config) {
|
|
|
33396
33428
|
status: 503
|
|
33397
33429
|
});
|
|
33398
33430
|
const companyDetails = getCompanyDetails ? await getCompanyDetails() : {};
|
|
33399
|
-
await
|
|
33431
|
+
await chunkXFDIIVZB_cjs.queueEmail(cms, {
|
|
33400
33432
|
to: identifier,
|
|
33401
33433
|
templateName: "otp",
|
|
33402
33434
|
ctx: {
|
|
@@ -33621,7 +33653,7 @@ function createStorefrontApiHandler(config) {
|
|
|
33621
33653
|
const companyDetails = getCompanyDetails ? await getCompanyDetails() : {};
|
|
33622
33654
|
const base = (publicSiteUrl || "").replace(/\/$/, "").trim() || "http://localhost:3000";
|
|
33623
33655
|
const verifyEmailUrl = `${base}/verify-email?token=${encodeURIComponent(rawToken)}`;
|
|
33624
|
-
await
|
|
33656
|
+
await chunkXFDIIVZB_cjs.queueEmail(cms, {
|
|
33625
33657
|
to: email,
|
|
33626
33658
|
templateName: "signup",
|
|
33627
33659
|
ctx: {
|
|
@@ -34433,7 +34465,7 @@ function createStorefrontApiHandler(config) {
|
|
|
34433
34465
|
status: 400
|
|
34434
34466
|
});
|
|
34435
34467
|
const cms = await getCms();
|
|
34436
|
-
return
|
|
34468
|
+
return chunkGLD263KW_cjs.streamOrderInvoicePdf(cms, dataSource, entityMap, orderId, {
|
|
34437
34469
|
ownerContactId: contact.id
|
|
34438
34470
|
});
|
|
34439
34471
|
}
|
|
@@ -34640,14 +34672,18 @@ function createStorefrontApiHandler(config) {
|
|
|
34640
34672
|
} catch {
|
|
34641
34673
|
}
|
|
34642
34674
|
try {
|
|
34643
|
-
void import('./emit-order-notification-trigger-
|
|
34675
|
+
void import('./emit-order-notification-trigger-DR74TQXN.cjs').then(({ fireOrderNotificationTrigger }) => {
|
|
34644
34676
|
fireOrderNotificationTrigger("order_cancelled", orderId, {
|
|
34645
34677
|
dataSource,
|
|
34646
34678
|
entityMap
|
|
34679
|
+
}, {
|
|
34680
|
+
source: "storefront"
|
|
34647
34681
|
});
|
|
34648
34682
|
fireOrderNotificationTrigger("payment_failed", orderId, {
|
|
34649
34683
|
dataSource,
|
|
34650
34684
|
entityMap
|
|
34685
|
+
}, {
|
|
34686
|
+
source: "storefront"
|
|
34651
34687
|
});
|
|
34652
34688
|
}).catch(() => {
|
|
34653
34689
|
});
|