@infuro/cms-core 1.0.68 → 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 +1 -1
- package/dist/admin.js +1 -1
- package/dist/api.cjs +57 -57
- package/dist/api.js +24 -24
- 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-P6S4XFZO.cjs → chunk-47G65M5Q.cjs} +2 -2
- package/dist/{chunk-UMC7W5G3.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-IKTBZJHT.js → chunk-5DSY3GQI.js} +1 -1
- 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-SMHQV3WL.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-SUUD7OUG.cjs → chunk-BQQMTQ4C.cjs} +27 -27
- 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-MYUGQHU4.js → chunk-DBBYLSQP.js} +47 -47
- package/dist/{chunk-5NOZSG6J.js → chunk-DWNQTFJ5.js} +2 -2
- package/dist/{chunk-2IAXTKQN.cjs → chunk-DZNWS2MM.cjs} +2 -2
- package/dist/{chunk-M5GPOPGX.cjs → chunk-E62LKM6Z.cjs} +2 -2
- package/dist/{chunk-CRFV5WJK.js → chunk-ECNYZG6T.js} +1 -1
- package/dist/{chunk-TZEMLHSP.cjs → chunk-EYUBL7YH.cjs} +7 -7
- package/dist/{chunk-GN4LKG4V.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-WKDBMDUX.js → chunk-K6RXCLD5.js} +1 -1
- package/dist/{chunk-7JCCPQEF.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-Z5G54EGD.js → chunk-MJDNS324.js} +5 -5
- package/dist/{chunk-H3IVLIPR.cjs → chunk-OXFC3DAM.cjs} +4 -4
- package/dist/{chunk-ZIT4IP6N.js → chunk-PQJIJ4ZX.js} +6 -6
- package/dist/{chunk-HY3AXLOI.cjs → chunk-PRXVSSIF.cjs} +13 -13
- package/dist/{chunk-TDV6EJHV.js → chunk-PRZOLCFW.js} +2 -2
- package/dist/{chunk-22XKONB5.cjs → chunk-QL44NCZC.cjs} +1089 -1089
- package/dist/{chunk-VM6OVUUM.cjs → chunk-QN6PZLAP.cjs} +40 -40
- package/dist/{chunk-OV5TRZET.cjs → chunk-QXAQ3V7R.cjs} +27 -27
- package/dist/{chunk-N4LBZXBG.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-HBUV73RB.cjs → chunk-SWSTGV4F.cjs} +81 -81
- package/dist/{chunk-SKJH7PX4.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 +470 -470
- package/dist/index.js +39 -39
- package/dist/interpolate-KD37IRF2.js +2 -0
- package/dist/interpolate-WP6OSJHN.cjs +11 -0
- package/dist/{invoice-templates-RB462AQN.cjs → invoice-templates-2ESQ7K4N.cjs} +5 -5
- 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-NROWBGXN.js → order-completion-otp-handlers-FIW7PZ6W.js} +12 -12
- package/dist/{order-completion-otp-handlers-DDQREULW.cjs → order-completion-otp-handlers-LNAZTMTS.cjs} +25 -25
- 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-SHUYVCID.js +0 -4
- package/dist/chunk-USNT2KNT.cjs +0 -6
- package/dist/chunk-Z5OB5QGN.js +0 -465
- package/dist/chunk-ZX5U3VCB.cjs +0 -471
- package/dist/email-queue-3QBQ63F7.js +0 -8
- package/dist/email-queue-K4E4OFI7.cjs +0 -29
- package/dist/email-service-5O24BSFR.cjs +0 -28
- package/dist/email-service-ADDF52PJ.js +0 -3
- package/dist/emit-order-notification-trigger-ROASTYQP.cjs +0 -16
- package/dist/emit-order-notification-trigger-YUQTPELC.js +0 -3
- package/dist/erp-config-enabled-CUMQ6N2V.cjs +0 -11
- package/dist/erp-config-enabled-T37X7T34.js +0 -2
- package/dist/erp-order-invoice-AZ5MX2JB.cjs +0 -28
- package/dist/erp-order-invoice-XSYHAMBS.js +0 -7
- package/dist/generate-local-invoice-pdf-BQTCL5MW.cjs +0 -12
- package/dist/generate-local-invoice-pdf-OCFG47SE.js +0 -3
- package/dist/interpolate-WAKPN56R.cjs +0 -11
- package/dist/interpolate-WDUWDF3I.js +0 -2
- package/dist/invoice-templates-GZ33OENC.js +0 -2
- package/dist/order-notification-dispatcher-6HCJ6Q75.cjs +0 -38
- package/dist/order-notification-dispatcher-KM2SY7TX.js +0 -13
- 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/resolve-invoice-asset-url-JEZRENJW.cjs +0 -11
- package/dist/resolve-invoice-asset-url-QZ2FRDHI.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,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
3
|
+
var chunkRQCXRCYM_cjs = require('./chunk-RQCXRCYM.cjs');
|
|
4
|
+
var chunk2JHGIWH7_cjs = require('./chunk-2JHGIWH7.cjs');
|
|
5
|
+
var chunkE62LKM6Z_cjs = require('./chunk-E62LKM6Z.cjs');
|
|
6
|
+
var chunk47G65M5Q_cjs = require('./chunk-47G65M5Q.cjs');
|
|
7
|
+
var chunkEYUBL7YH_cjs = require('./chunk-EYUBL7YH.cjs');
|
|
8
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
9
9
|
|
|
10
10
|
// src/plugins/erp/erp-response-map.ts
|
|
11
11
|
function pickString(o, keys) {
|
|
@@ -15,7 +15,7 @@ function pickString(o, keys) {
|
|
|
15
15
|
}
|
|
16
16
|
return void 0;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
chunkXHPRD45G_cjs.__name(pickString, "pickString");
|
|
19
19
|
function unwrapErpReadData(json) {
|
|
20
20
|
if (!json || typeof json !== "object") return null;
|
|
21
21
|
const o = json;
|
|
@@ -23,7 +23,7 @@ function unwrapErpReadData(json) {
|
|
|
23
23
|
if (d && typeof d === "object" && !Array.isArray(d)) return d;
|
|
24
24
|
return o;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
chunkXHPRD45G_cjs.__name(unwrapErpReadData, "unwrapErpReadData");
|
|
27
27
|
function firstObject(data, keys) {
|
|
28
28
|
for (const k of keys) {
|
|
29
29
|
const v = data[k];
|
|
@@ -31,7 +31,7 @@ function firstObject(data, keys) {
|
|
|
31
31
|
}
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
chunkXHPRD45G_cjs.__name(firstObject, "firstObject");
|
|
35
35
|
function extractEvents(src) {
|
|
36
36
|
const timeline = src.timeline ?? src.events ?? src.history ?? src.trackingEvents;
|
|
37
37
|
if (!Array.isArray(timeline) || !timeline.length) return void 0;
|
|
@@ -65,7 +65,7 @@ function extractEvents(src) {
|
|
|
65
65
|
}
|
|
66
66
|
return events.length ? events : void 0;
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
chunkXHPRD45G_cjs.__name(extractEvents, "extractEvents");
|
|
69
69
|
function mapErpPayloadToFulfillment(data) {
|
|
70
70
|
const nested = firstObject(data, [
|
|
71
71
|
"fulfillment",
|
|
@@ -97,7 +97,7 @@ function mapErpPayloadToFulfillment(data) {
|
|
|
97
97
|
events
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
chunkXHPRD45G_cjs.__name(mapErpPayloadToFulfillment, "mapErpPayloadToFulfillment");
|
|
101
101
|
function mapErpPayloadToInvoiceNumber(data) {
|
|
102
102
|
const nested = firstObject(data, [
|
|
103
103
|
"invoice",
|
|
@@ -113,7 +113,7 @@ function mapErpPayloadToInvoiceNumber(data) {
|
|
|
113
113
|
"id"
|
|
114
114
|
]);
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
chunkXHPRD45G_cjs.__name(mapErpPayloadToInvoiceNumber, "mapErpPayloadToInvoiceNumber");
|
|
117
117
|
function extractChildOrderRefsFromSalePayload(data) {
|
|
118
118
|
const lists = [
|
|
119
119
|
data.returns,
|
|
@@ -151,7 +151,7 @@ function extractChildOrderRefsFromSalePayload(data) {
|
|
|
151
151
|
}
|
|
152
152
|
return out;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
chunkXHPRD45G_cjs.__name(extractChildOrderRefsFromSalePayload, "extractChildOrderRefsFromSalePayload");
|
|
155
155
|
|
|
156
156
|
// src/lib/invoice/build-local-invoice-for-order.ts
|
|
157
157
|
async function loadSettingsGroup(ds, entityMap, group) {
|
|
@@ -167,7 +167,7 @@ async function loadSettingsGroup(ds, entityMap, group) {
|
|
|
167
167
|
String(r.value ?? "")
|
|
168
168
|
]));
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
chunkXHPRD45G_cjs.__name(loadSettingsGroup, "loadSettingsGroup");
|
|
171
171
|
function addrFromRow(row) {
|
|
172
172
|
if (!row || typeof row !== "object") return null;
|
|
173
173
|
const a = row;
|
|
@@ -180,7 +180,7 @@ function addrFromRow(row) {
|
|
|
180
180
|
country: String(a.country ?? "").trim() || void 0
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
chunkXHPRD45G_cjs.__name(addrFromRow, "addrFromRow");
|
|
184
184
|
async function buildLocalInvoicePdfForOrder(ds, entityMap, orderId) {
|
|
185
185
|
if (!entityMap.orders || !entityMap.order_items) {
|
|
186
186
|
return {
|
|
@@ -250,10 +250,10 @@ async function buildLocalInvoicePdfForOrder(ds, entityMap, orderId) {
|
|
|
250
250
|
loadSettingsGroup(ds, entityMap, "branding"),
|
|
251
251
|
loadSettingsGroup(ds, entityMap, "email")
|
|
252
252
|
]);
|
|
253
|
-
const companyDetails =
|
|
254
|
-
const fromBranding =
|
|
253
|
+
const companyDetails = chunkEYUBL7YH_cjs.mergeEmailLayoutCompanyDetails(branding, email, store);
|
|
254
|
+
const fromBranding = chunkEYUBL7YH_cjs.getCompanyDetailsFromSettings(branding);
|
|
255
255
|
const rawLogo = store.invoiceLogoUrl || store.companyLogo || store.logo || companyDetails.logoUrl || fromBranding.logoUrl || null;
|
|
256
|
-
const logoUrl =
|
|
256
|
+
const logoUrl = chunk47G65M5Q_cjs.resolveInvoiceAssetUrl(rawLogo);
|
|
257
257
|
const companyName = store.companyName || store.invoiceCompanyName || store.name || companyDetails.companyName || fromBranding.companyName || "Store";
|
|
258
258
|
const supportEmail = store.companyEmail || store.invoiceEmail || store.email || companyDetails.supportEmail || fromBranding.supportEmail;
|
|
259
259
|
const supportPhone = store.companyPhone || store.invoicePhone || store.phone || companyDetails.supportPhone;
|
|
@@ -277,8 +277,8 @@ async function buildLocalInvoicePdfForOrder(ds, entityMap, orderId) {
|
|
|
277
277
|
const baseUrl = process.env.NEXTAUTH_URL || process.env.PUBLIC_APP_URL || "";
|
|
278
278
|
const qrData = qrToken ? baseUrl ? `${baseUrl.replace(/\/$/, "")}/track/${qrToken}` : `/track/${qrToken}` : String(o.orderNumber || orderId);
|
|
279
279
|
const includeQrCode = store.invoice_include_qr === "true" || store.invoiceIncludeQr === "true";
|
|
280
|
-
const bytes = await
|
|
281
|
-
templateId:
|
|
280
|
+
const bytes = await chunk2JHGIWH7_cjs.generateLocalInvoicePdf({
|
|
281
|
+
templateId: chunkE62LKM6Z_cjs.normalizeInvoiceTemplateId(store.invoiceTemplate),
|
|
282
282
|
orderNumber: String(o.orderNumber || orderId),
|
|
283
283
|
orderDate: o.createdAt || /* @__PURE__ */ new Date(),
|
|
284
284
|
serviceDate,
|
|
@@ -311,7 +311,7 @@ async function buildLocalInvoicePdfForOrder(ds, entityMap, orderId) {
|
|
|
311
311
|
filename: `invoice-${String(o.orderNumber || orderId).replace(/[^\w.-]+/g, "_")}.pdf`
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
chunkXHPRD45G_cjs.__name(buildLocalInvoicePdfForOrder, "buildLocalInvoicePdfForOrder");
|
|
315
315
|
|
|
316
316
|
// src/plugins/erp/erp-order-invoice.ts
|
|
317
317
|
function pickInvoiceId(data) {
|
|
@@ -327,7 +327,7 @@ function pickInvoiceId(data) {
|
|
|
327
327
|
}
|
|
328
328
|
return void 0;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
chunkXHPRD45G_cjs.__name(pickInvoiceId, "pickInvoiceId");
|
|
331
331
|
function jsonErr(msg, status) {
|
|
332
332
|
return new Response(JSON.stringify({
|
|
333
333
|
error: msg
|
|
@@ -338,7 +338,7 @@ function jsonErr(msg, status) {
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
chunkXHPRD45G_cjs.__name(jsonErr, "jsonErr");
|
|
342
342
|
var ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES = /* @__PURE__ */ new Set([
|
|
343
343
|
"pending",
|
|
344
344
|
"placed",
|
|
@@ -351,7 +351,7 @@ function isOrderEligibleForInvoiceEmail(status, orderKind) {
|
|
|
351
351
|
if (kind !== "sale") return false;
|
|
352
352
|
return ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES.has(String(status ?? "").trim().toLowerCase());
|
|
353
353
|
}
|
|
354
|
-
|
|
354
|
+
chunkXHPRD45G_cjs.__name(isOrderEligibleForInvoiceEmail, "isOrderEligibleForInvoiceEmail");
|
|
355
355
|
async function resolveOrderInvoicePdfBytes(cms, dataSource, entityMap, orderId, options = {}) {
|
|
356
356
|
try {
|
|
357
357
|
const orderRepo = dataSource.getRepository(entityMap.orders);
|
|
@@ -376,7 +376,7 @@ async function resolveOrderInvoicePdfBytes(cms, dataSource, entityMap, orderId,
|
|
|
376
376
|
status: 404
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
|
-
const on = await
|
|
379
|
+
const on = await chunkRQCXRCYM_cjs.isErpIntegrationEnabled(cms, dataSource, entityMap);
|
|
380
380
|
const erp = cms.getPlugin("erp");
|
|
381
381
|
if (on && erp?.submission) {
|
|
382
382
|
const meta = order.metadata && typeof order.metadata === "object" && !Array.isArray(order.metadata) ? order.metadata : {};
|
|
@@ -429,7 +429,7 @@ async function resolveOrderInvoicePdfBytes(cms, dataSource, entityMap, orderId,
|
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
|
|
432
|
+
chunkXHPRD45G_cjs.__name(resolveOrderInvoicePdfBytes, "resolveOrderInvoicePdfBytes");
|
|
433
433
|
async function streamOrderInvoicePdf(cms, dataSource, entityMap, orderId, options) {
|
|
434
434
|
const resolved = await resolveOrderInvoicePdfBytes(cms, dataSource, entityMap, orderId, options);
|
|
435
435
|
if ("error" in resolved) return jsonErr(resolved.error, resolved.status);
|
|
@@ -442,7 +442,7 @@ async function streamOrderInvoicePdf(cms, dataSource, entityMap, orderId, option
|
|
|
442
442
|
}
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
chunkXHPRD45G_cjs.__name(streamOrderInvoicePdf, "streamOrderInvoicePdf");
|
|
446
446
|
|
|
447
447
|
exports.ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES = ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES;
|
|
448
448
|
exports.buildLocalInvoicePdfForOrder = buildLocalInvoicePdfForOrder;
|
|
@@ -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/interpolate.ts
|
|
6
6
|
function applyTemplateVars(template, variables) {
|
|
@@ -13,6 +13,6 @@ function applyTemplateVars(template, variables) {
|
|
|
13
13
|
}
|
|
14
14
|
return out;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
chunkXHPRD45G_cjs.__name(applyTemplateVars, "applyTemplateVars");
|
|
17
17
|
|
|
18
18
|
exports.applyTemplateVars = applyTemplateVars;
|
|
@@ -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/auth/auth-debug.ts
|
|
6
6
|
var LOG_PREFIX = "[cms-auth]";
|
|
@@ -8,25 +8,25 @@ function isAuthDebugEnabled() {
|
|
|
8
8
|
const v = process.env.CMS_AUTH_DEBUG?.trim().toLowerCase();
|
|
9
9
|
return v === "1" || v === "true" || v === "yes";
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
chunkXHPRD45G_cjs.__name(isAuthDebugEnabled, "isAuthDebugEnabled");
|
|
12
12
|
function isAuthDebugClientEnabled() {
|
|
13
13
|
if (typeof window === "undefined") return false;
|
|
14
14
|
const v = process.env.NEXT_PUBLIC_CMS_AUTH_DEBUG?.trim().toLowerCase();
|
|
15
15
|
return v === "1" || v === "true" || v === "yes";
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
chunkXHPRD45G_cjs.__name(isAuthDebugClientEnabled, "isAuthDebugClientEnabled");
|
|
18
18
|
function logAuth(message, data) {
|
|
19
19
|
if (!isAuthDebugEnabled()) return;
|
|
20
20
|
if (data) console.info(LOG_PREFIX, message, data);
|
|
21
21
|
else console.info(LOG_PREFIX, message);
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
chunkXHPRD45G_cjs.__name(logAuth, "logAuth");
|
|
24
24
|
function logAuthClient(message, data) {
|
|
25
25
|
if (!isAuthDebugClientEnabled()) return;
|
|
26
26
|
if (data) console.info(LOG_PREFIX, message, data);
|
|
27
27
|
else console.info(LOG_PREFIX, message);
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
chunkXHPRD45G_cjs.__name(logAuthClient, "logAuthClient");
|
|
30
30
|
function summarizeSessionUserForLog(user) {
|
|
31
31
|
if (!user || typeof user !== "object") return {
|
|
32
32
|
present: false
|
|
@@ -42,7 +42,7 @@ function summarizeSessionUserForLog(user) {
|
|
|
42
42
|
groupName: u.groupName ?? null
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
chunkXHPRD45G_cjs.__name(summarizeSessionUserForLog, "summarizeSessionUserForLog");
|
|
46
46
|
function nextAuthCookieDebugInfo() {
|
|
47
47
|
const nextAuthUrl = process.env.NEXTAUTH_URL ?? "(unset)";
|
|
48
48
|
const isHttps = nextAuthUrl.startsWith("https");
|
|
@@ -54,7 +54,7 @@ function nextAuthCookieDebugInfo() {
|
|
|
54
54
|
nodeEnv: process.env.NODE_ENV ?? "(unset)"
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
chunkXHPRD45G_cjs.__name(nextAuthCookieDebugInfo, "nextAuthCookieDebugInfo");
|
|
58
58
|
|
|
59
59
|
// src/auth/middleware.ts
|
|
60
60
|
var defaultPublicApiMethods = {
|
|
@@ -97,7 +97,7 @@ function legacyGetSessionToken(request) {
|
|
|
97
97
|
const regular = request.cookies.get("next-auth.session-token")?.value;
|
|
98
98
|
return secure ?? regular;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
chunkXHPRD45G_cjs.__name(legacyGetSessionToken, "legacyGetSessionToken");
|
|
101
101
|
function sessionCookiePresence(request) {
|
|
102
102
|
const secure = request.cookies.get("__Secure-next-auth.session-token")?.value;
|
|
103
103
|
const regular = request.cookies.get("next-auth.session-token")?.value;
|
|
@@ -109,14 +109,14 @@ function sessionCookiePresence(request) {
|
|
|
109
109
|
resolved: Boolean(secure ?? regular ?? hasChunked)
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
chunkXHPRD45G_cjs.__name(sessionCookiePresence, "sessionCookiePresence");
|
|
113
113
|
function isPublicMethod(pathname, method, publicApiMethods) {
|
|
114
114
|
for (const [endpoint, methods] of Object.entries(publicApiMethods)) {
|
|
115
115
|
if (pathname.startsWith(endpoint) && methods.includes(method)) return true;
|
|
116
116
|
}
|
|
117
117
|
return false;
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
chunkXHPRD45G_cjs.__name(isPublicMethod, "isPublicMethod");
|
|
120
120
|
async function hasValidSession(request, secret, legacyGetToken) {
|
|
121
121
|
const presence = sessionCookiePresence(request);
|
|
122
122
|
if (presence.resolved || presence.hasChunkedToken) return true;
|
|
@@ -133,7 +133,7 @@ async function hasValidSession(request, secret, legacyGetToken) {
|
|
|
133
133
|
}
|
|
134
134
|
return Boolean(legacyGetToken(request));
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
chunkXHPRD45G_cjs.__name(hasValidSession, "hasValidSession");
|
|
137
137
|
function createCmsMiddleware(config = {}) {
|
|
138
138
|
const { publicAdminPaths = [
|
|
139
139
|
"/admin/signin",
|
|
@@ -141,7 +141,7 @@ function createCmsMiddleware(config = {}) {
|
|
|
141
141
|
"/admin/reset-password",
|
|
142
142
|
"/admin/invite"
|
|
143
143
|
], publicApiMethods = defaultPublicApiMethods, signInPath = "/admin/signin", getSessionToken = legacyGetSessionToken, secret = process.env.NEXTAUTH_SECRET } = config;
|
|
144
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ chunkXHPRD45G_cjs.__name(async function cmsMiddleware(request) {
|
|
145
145
|
const pathname = request.nextUrl.pathname;
|
|
146
146
|
const method = request.method;
|
|
147
147
|
if (publicAdminPaths.some((p) => pathname === p || pathname.startsWith(p + "/"))) {
|
|
@@ -200,7 +200,7 @@ function createCmsMiddleware(config = {}) {
|
|
|
200
200
|
};
|
|
201
201
|
}, "cmsMiddleware");
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
chunkXHPRD45G_cjs.__name(createCmsMiddleware, "createCmsMiddleware");
|
|
204
204
|
|
|
205
205
|
exports.createCmsMiddleware = createCmsMiddleware;
|
|
206
206
|
exports.defaultPublicApiMethods = defaultPublicApiMethods;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { explainSessionEntityAccess, isVendorPortalUser, logRbac } from './chunk-
|
|
2
|
-
import { __name } from './chunk-
|
|
1
|
+
import { explainSessionEntityAccess, isVendorPortalUser, logRbac } from './chunk-DWNQTFJ5.js';
|
|
2
|
+
import { __name } from './chunk-5BKT4CS5.js';
|
|
3
3
|
import { IsNull } from 'typeorm';
|
|
4
4
|
|
|
5
5
|
async function linkUnclaimedContactToUser(dataSource, contactsEntity, userId, email) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { inviteStatusForActivation } from './chunk-
|
|
2
|
-
import { normalizePhoneE164, generateNumericOtp, createOtpChallenge, queueSms, verifyAndConsumeOtpChallenge } from './chunk-
|
|
3
|
-
import { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES } from './chunk-
|
|
4
|
-
import { JOB_RUNNER_QUEUE } from './chunk-
|
|
5
|
-
import { validateInventoryForConfirmedOrderLines, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, orderInventorySnapshotFromRow, validateInventoryForOrderBecomingConfirmed } from './chunk-
|
|
6
|
-
import { resolveChatEmailToolSettings, CHAT_EMAIL_LOG, detectChatLeadIntent, parseIntentRecipientEmails, sendChatLeadEmail, buildTranscriptForLeadEmail, buildChatbotSystemPromptWithEmailTool, validateFcmCredentials, sendFcmPushNotification, parseEmailRecipientsFromConfig, isWhatsAppPluginEnabled, WhatsAppService, emailPlugin, initWhatsappTriggerDispatcher } from './chunk-
|
|
7
|
-
import { registerWhatsAppQueueProcessor } from './chunk-
|
|
8
|
-
import { queueEmail, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-
|
|
9
|
-
import { unwrapErpReadData, mapErpPayloadToFulfillment, extractChildOrderRefsFromSalePayload, mapErpPayloadToInvoiceNumber, streamOrderInvoicePdf } from './chunk-
|
|
10
|
-
import { isErpIntegrationEnabled } from './chunk-
|
|
11
|
-
import { mergeEmailLayoutCompanyDetails } from './chunk-
|
|
12
|
-
import { getSmsTemplateDefault, SMS_MESSAGE_TEMPLATE_DEFAULTS } from './chunk-
|
|
13
|
-
import { ensureCustomerRecord, linkUnclaimedContactToUser, ensureCustomerForUser, canManageRoles, sessionHasEntityAccess } from './chunk-
|
|
14
|
-
import { permissionRowsToRecord, logRbac, isSuperAdmin, vendorPortalFlagsFromUser, VENDOR_SCOPED_STORE_ENTITIES, isVendorPortalUser, getPermissionableEntityKeys, VENDOR_STORE_RBAC_ENTITIES, isSuperAdminGroupName, VENDOR_RBAC_ENTITIES, VENDOR_VIEWER_ROLE_NAME, DEFAULT_VENDOR_ROLE_DEFS, VENDOR_GROUP_NAME, resolveVendorScopeFromSessionUser, canManageVendorRoles, isPlatformAdministrator, canManageVendorTeam, resolveDisabledMultiVendorScope, logEntityAccessDecision, explainSessionEntityAccess } from './chunk-
|
|
15
|
-
import { retireSoftDeletedUniqueValue, activeUniqueValueExists } from './chunk-
|
|
16
|
-
import { queueErp } from './chunk-
|
|
17
|
-
import { __name } from './chunk-
|
|
1
|
+
import { inviteStatusForActivation } from './chunk-ZMIMKNSQ.js';
|
|
2
|
+
import { normalizePhoneE164, generateNumericOtp, createOtpChallenge, queueSms, verifyAndConsumeOtpChallenge } from './chunk-53AMBXMM.js';
|
|
3
|
+
import { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES } from './chunk-5NVGWJSY.js';
|
|
4
|
+
import { JOB_RUNNER_QUEUE } from './chunk-2BNVRFUQ.js';
|
|
5
|
+
import { validateInventoryForConfirmedOrderLines, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, orderInventorySnapshotFromRow, validateInventoryForOrderBecomingConfirmed } from './chunk-JYRFSFXH.js';
|
|
6
|
+
import { resolveChatEmailToolSettings, CHAT_EMAIL_LOG, detectChatLeadIntent, parseIntentRecipientEmails, sendChatLeadEmail, buildTranscriptForLeadEmail, buildChatbotSystemPromptWithEmailTool, validateFcmCredentials, sendFcmPushNotification, parseEmailRecipientsFromConfig, isWhatsAppPluginEnabled, WhatsAppService, emailPlugin, initWhatsappTriggerDispatcher } from './chunk-RBKVMHBH.js';
|
|
7
|
+
import { registerWhatsAppQueueProcessor } from './chunk-3XCTGADT.js';
|
|
8
|
+
import { queueEmail, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-LJ5C4RBF.js';
|
|
9
|
+
import { unwrapErpReadData, mapErpPayloadToFulfillment, extractChildOrderRefsFromSalePayload, mapErpPayloadToInvoiceNumber, streamOrderInvoicePdf } from './chunk-PQJIJ4ZX.js';
|
|
10
|
+
import { isErpIntegrationEnabled } from './chunk-WQZ4AH2P.js';
|
|
11
|
+
import { mergeEmailLayoutCompanyDetails } from './chunk-YDMHG6BA.js';
|
|
12
|
+
import { getSmsTemplateDefault, SMS_MESSAGE_TEMPLATE_DEFAULTS } from './chunk-MGT4DJ2D.js';
|
|
13
|
+
import { ensureCustomerRecord, linkUnclaimedContactToUser, ensureCustomerForUser, canManageRoles, sessionHasEntityAccess } from './chunk-D4LR3S77.js';
|
|
14
|
+
import { permissionRowsToRecord, logRbac, isSuperAdmin, vendorPortalFlagsFromUser, VENDOR_SCOPED_STORE_ENTITIES, isVendorPortalUser, getPermissionableEntityKeys, VENDOR_STORE_RBAC_ENTITIES, isSuperAdminGroupName, VENDOR_RBAC_ENTITIES, VENDOR_VIEWER_ROLE_NAME, DEFAULT_VENDOR_ROLE_DEFS, VENDOR_GROUP_NAME, resolveVendorScopeFromSessionUser, canManageVendorRoles, isPlatformAdministrator, canManageVendorTeam, resolveDisabledMultiVendorScope, logEntityAccessDecision, explainSessionEntityAccess } from './chunk-DWNQTFJ5.js';
|
|
15
|
+
import { retireSoftDeletedUniqueValue, activeUniqueValueExists } from './chunk-BK5XW5XH.js';
|
|
16
|
+
import { queueErp } from './chunk-7QJI56OL.js';
|
|
17
|
+
import { __name } from './chunk-5BKT4CS5.js';
|
|
18
18
|
import { PrimaryGeneratedColumn, Column, Entity, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn, Unique, OneToMany, Index, ManyToMany, JoinTable, In, ILike, Between, MoreThanOrEqual, LessThanOrEqual, Not, MoreThan, IsNull } from 'typeorm';
|
|
19
19
|
import { Country, State, City } from 'country-state-city';
|
|
20
20
|
import crypto2, { randomBytes, randomUUID } from 'crypto';
|
|
@@ -5313,7 +5313,7 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
5313
5313
|
const orderIdForNotify = created.id;
|
|
5314
5314
|
const finalCreatedStatus = String(created.status ?? createdStatus ?? "pending").toLowerCase();
|
|
5315
5315
|
const initialPayStatus = String(persistBody.paymentStatus ?? body.paymentStatus ?? "unpaid").toLowerCase();
|
|
5316
|
-
void import('./emit-order-notification-trigger-
|
|
5316
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
5317
5317
|
if (finalCreatedStatus === "pending") {
|
|
5318
5318
|
if (initialPayStatus === "failed") {
|
|
5319
5319
|
fireOrderNotificationTrigger("payment_failed", orderIdForNotify, {
|
|
@@ -6516,7 +6516,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6516
6516
|
const paymentUpdated = Boolean(rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null);
|
|
6517
6517
|
const assigneeUpdated = Boolean(rawBody && typeof rawBody === "object" && "assignedUserId" in rawBody && rawBody.assignedUserId !== void 0 && Number(rawBody.assignedUserId) > 0 && Number(rawBody.assignedUserId) !== Number(existingOrderRow?.assignedUserId));
|
|
6518
6518
|
if (assigneeUpdated) {
|
|
6519
|
-
void import('./emit-order-notification-trigger-
|
|
6519
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
6520
6520
|
fireOrderNotificationTrigger("order_assigned", updatedOrder.id, {
|
|
6521
6521
|
dataSource,
|
|
6522
6522
|
entityMap
|
|
@@ -6533,7 +6533,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6533
6533
|
const payments = Array.isArray(updatedOrder.payments) ? updatedOrder.payments : [];
|
|
6534
6534
|
const bodyPayStatus = rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null ? String(rawBody.paymentStatus).toLowerCase() : null;
|
|
6535
6535
|
const curPayStatus = bodyPayStatus || String(payments[0]?.status || "unpaid").toLowerCase();
|
|
6536
|
-
void import('./emit-order-notification-trigger-
|
|
6536
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
6537
6537
|
if (newStatus === "pending") {
|
|
6538
6538
|
if (curPayStatus === "failed") {
|
|
6539
6539
|
fireOrderNotificationTrigger("payment_failed", updatedOrder.id, {
|
|
@@ -7241,7 +7241,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7241
7241
|
});
|
|
7242
7242
|
}
|
|
7243
7243
|
if (ordStatus === "pending" || ordStatus === "confirmed") {
|
|
7244
|
-
void import('./emit-order-notification-trigger-
|
|
7244
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7245
7245
|
fireOrderNotificationTrigger("order_placed", pOrder, {
|
|
7246
7246
|
dataSource,
|
|
7247
7247
|
entityMap
|
|
@@ -7255,7 +7255,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7255
7255
|
}
|
|
7256
7256
|
}
|
|
7257
7257
|
} else if (newPayStatus === "failed") {
|
|
7258
|
-
void import('./emit-order-notification-trigger-
|
|
7258
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7259
7259
|
fireOrderNotificationTrigger("payment_failed", pOrder, {
|
|
7260
7260
|
dataSource,
|
|
7261
7261
|
entityMap
|
|
@@ -7263,7 +7263,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7263
7263
|
}).catch(() => {
|
|
7264
7264
|
});
|
|
7265
7265
|
} else if (newPayStatus === "refunded") {
|
|
7266
|
-
void import('./emit-order-notification-trigger-
|
|
7266
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7267
7267
|
fireOrderNotificationTrigger("payment_refund_initiated", pOrder, {
|
|
7268
7268
|
dataSource,
|
|
7269
7269
|
entityMap
|
|
@@ -7390,7 +7390,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7390
7390
|
const paymentUpdated = Boolean(rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null);
|
|
7391
7391
|
const assigneeUpdated = Boolean(rawBody && typeof rawBody === "object" && "assignedUserId" in rawBody && rawBody.assignedUserId !== void 0 && Number(rawBody.assignedUserId) > 0 && Number(rawBody.assignedUserId) !== Number(existingOrderRow?.assignedUserId));
|
|
7392
7392
|
if (assigneeUpdated) {
|
|
7393
|
-
void import('./emit-order-notification-trigger-
|
|
7393
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7394
7394
|
fireOrderNotificationTrigger("order_assigned", ord.id, {
|
|
7395
7395
|
dataSource,
|
|
7396
7396
|
entityMap
|
|
@@ -7407,7 +7407,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7407
7407
|
const payments = Array.isArray(ord.payments) ? ord.payments : [];
|
|
7408
7408
|
const bodyPayStatus = rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null ? String(rawBody.paymentStatus).toLowerCase() : null;
|
|
7409
7409
|
const curPayStatus = bodyPayStatus || String(payments[0]?.status || "unpaid").toLowerCase();
|
|
7410
|
-
void import('./emit-order-notification-trigger-
|
|
7410
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7411
7411
|
if (newStatus === "pending") {
|
|
7412
7412
|
if (curPayStatus === "failed") {
|
|
7413
7413
|
fireOrderNotificationTrigger("payment_failed", ord.id, {
|
|
@@ -11061,7 +11061,7 @@ function createUsersApiHandlers(config) {
|
|
|
11061
11061
|
if (token) {
|
|
11062
11062
|
inviteLink = buildVendorInviteLink(baseUrl, token);
|
|
11063
11063
|
}
|
|
11064
|
-
const { markVendorInvitePendingForUser } = await import('./vendor-invite-status-
|
|
11064
|
+
const { markVendorInvitePendingForUser } = await import('./vendor-invite-status-45ZCWKCX.js');
|
|
11065
11065
|
await markVendorInvitePendingForUser(dataSource, entityMap.vendors, u.id);
|
|
11066
11066
|
}
|
|
11067
11067
|
}
|
|
@@ -27861,7 +27861,7 @@ async function queueJobScheduleNow(cms, scheduleId) {
|
|
|
27861
27861
|
if (!boss) {
|
|
27862
27862
|
throw new Error("pg-boss is not configured (DATABASE_URL required)");
|
|
27863
27863
|
}
|
|
27864
|
-
const { JOB_RUNNER_QUEUE: JOB_RUNNER_QUEUE2 } = await import('./pg-boss-service-
|
|
27864
|
+
const { JOB_RUNNER_QUEUE: JOB_RUNNER_QUEUE2 } = await import('./pg-boss-service-CMW3KQJM.js');
|
|
27865
27865
|
await boss.send(JOB_RUNNER_QUEUE2, {
|
|
27866
27866
|
scheduleId,
|
|
27867
27867
|
triggeredBy: "manual"
|
|
@@ -29438,7 +29438,7 @@ function createCmsApiHandler(config) {
|
|
|
29438
29438
|
companyDetails
|
|
29439
29439
|
};
|
|
29440
29440
|
if (queue) {
|
|
29441
|
-
const { queueEmail: queueEmail2 } = await import('./email-queue-
|
|
29441
|
+
const { queueEmail: queueEmail2 } = await import('./email-queue-MWP4R67H.js');
|
|
29442
29442
|
await queueEmail2(cms, {
|
|
29443
29443
|
to: opts.to,
|
|
29444
29444
|
templateName: "passwordReset",
|
|
@@ -29463,7 +29463,7 @@ function createCmsApiHandler(config) {
|
|
|
29463
29463
|
const prevActivate = userAuth.beforeActivate;
|
|
29464
29464
|
userAuth.beforeActivate = async (email, userId) => {
|
|
29465
29465
|
if (prevActivate) await prevActivate(email, userId);
|
|
29466
|
-
const { markVendorInviteAcceptedForUser } = await import('./vendor-invite-status-
|
|
29466
|
+
const { markVendorInviteAcceptedForUser } = await import('./vendor-invite-status-45ZCWKCX.js');
|
|
29467
29467
|
await markVendorInviteAcceptedForUser(ds, vendorEntity, userId);
|
|
29468
29468
|
};
|
|
29469
29469
|
}
|
|
@@ -30467,9 +30467,9 @@ function createCmsApiHandler(config) {
|
|
|
30467
30467
|
for (const r of rows) {
|
|
30468
30468
|
storeMap[r.key] = r.value;
|
|
30469
30469
|
}
|
|
30470
|
-
const { normalizeInvoiceTemplateId } = await import('./invoice-templates-
|
|
30471
|
-
const { generateLocalInvoicePdf } = await import('./generate-local-invoice-pdf-
|
|
30472
|
-
const { resolveInvoiceAssetUrl } = await import('./resolve-invoice-asset-url-
|
|
30470
|
+
const { normalizeInvoiceTemplateId } = await import('./invoice-templates-3AXTXERZ.js');
|
|
30471
|
+
const { generateLocalInvoicePdf } = await import('./generate-local-invoice-pdf-XUH6GYEJ.js');
|
|
30472
|
+
const { resolveInvoiceAssetUrl } = await import('./resolve-invoice-asset-url-64QQUVC3.js');
|
|
30473
30473
|
const templateId = normalizeInvoiceTemplateId(templateParam);
|
|
30474
30474
|
const includeQr = qrParam != null ? qrParam === "1" || qrParam === "true" : storeMap.invoice_include_qr === "true";
|
|
30475
30475
|
const sampleInput = {
|
|
@@ -30856,7 +30856,7 @@ function createCmsApiHandler(config) {
|
|
|
30856
30856
|
const pe = await requireEntityPermissionEffective(req, "orders", "read");
|
|
30857
30857
|
if (pe) return pe;
|
|
30858
30858
|
const cms = await getCms();
|
|
30859
|
-
const { streamOrderInvoicePdf: streamOrderInvoicePdf2 } = await import('./erp-order-invoice-
|
|
30859
|
+
const { streamOrderInvoicePdf: streamOrderInvoicePdf2 } = await import('./erp-order-invoice-JEQKFXG4.js');
|
|
30860
30860
|
const oid = Number(path2[1]);
|
|
30861
30861
|
if (!Number.isFinite(oid)) return config.json({
|
|
30862
30862
|
error: "Invalid id"
|
|
@@ -30890,7 +30890,7 @@ function createCmsApiHandler(config) {
|
|
|
30890
30890
|
status: 400
|
|
30891
30891
|
});
|
|
30892
30892
|
const cms = await getCms();
|
|
30893
|
-
const { isErpIntegrationEnabled: isErpIntegrationEnabled3 } = await import('./erp-config-enabled-
|
|
30893
|
+
const { isErpIntegrationEnabled: isErpIntegrationEnabled3 } = await import('./erp-config-enabled-CASE5YVI.js');
|
|
30894
30894
|
const enabled = await isErpIntegrationEnabled3(cms, dataSource, entityMap);
|
|
30895
30895
|
if (m === "GET") {
|
|
30896
30896
|
return config.json({
|
|
@@ -30903,7 +30903,7 @@ function createCmsApiHandler(config) {
|
|
|
30903
30903
|
}, {
|
|
30904
30904
|
status: 409
|
|
30905
30905
|
});
|
|
30906
|
-
const { queueErpPaidOrderForOrderId } = await import('./paid-order-erp-
|
|
30906
|
+
const { queueErpPaidOrderForOrderId } = await import('./paid-order-erp-GRXR2OG6.js');
|
|
30907
30907
|
await queueErpPaidOrderForOrderId(cms, dataSource, entityMap, oid);
|
|
30908
30908
|
return config.json({
|
|
30909
30909
|
ok: true
|
|
@@ -31006,7 +31006,7 @@ function createCmsApiHandler(config) {
|
|
|
31006
31006
|
}
|
|
31007
31007
|
}
|
|
31008
31008
|
if (path2[0] === "sms-notification-templates" && path2.length === 1 && m === "GET") {
|
|
31009
|
-
const { createSmsNotificationTemplatesHandlers } = await import('./sms-notification-templates-handlers-
|
|
31009
|
+
const { createSmsNotificationTemplatesHandlers } = await import('./sms-notification-templates-handlers-ZGDCVS5Z.js');
|
|
31010
31010
|
const handlers = createSmsNotificationTemplatesHandlers(dataSource, entityMap);
|
|
31011
31011
|
return handlers.GET(req);
|
|
31012
31012
|
}
|
|
@@ -31081,7 +31081,7 @@ function createCmsApiHandler(config) {
|
|
|
31081
31081
|
"Content-Type": "text/html; charset=utf-8"
|
|
31082
31082
|
}
|
|
31083
31083
|
});
|
|
31084
|
-
const { renderOrderTrackingPage } = await import('./OrderTrackPage-
|
|
31084
|
+
const { renderOrderTrackingPage } = await import('./OrderTrackPage-VBZUVZOU.js');
|
|
31085
31085
|
const html = renderOrderTrackingPage(order);
|
|
31086
31086
|
return new Response(html, {
|
|
31087
31087
|
status: 200,
|
|
@@ -31238,7 +31238,7 @@ function createCmsApiHandler(config) {
|
|
|
31238
31238
|
status: 400
|
|
31239
31239
|
});
|
|
31240
31240
|
}
|
|
31241
|
-
const { resendOrderNotification } = await import('./order-notification-dispatcher-
|
|
31241
|
+
const { resendOrderNotification } = await import('./order-notification-dispatcher-FS54ANAV.js');
|
|
31242
31242
|
const result = await resendOrderNotification(triggerKey, orderId, {
|
|
31243
31243
|
dataSource,
|
|
31244
31244
|
entityMap,
|
|
@@ -31319,7 +31319,7 @@ function createCmsApiHandler(config) {
|
|
|
31319
31319
|
]
|
|
31320
31320
|
});
|
|
31321
31321
|
if (orderWithItems) {
|
|
31322
|
-
const { reconcileOrderInventoryBetweenSnapshots: reconcileOrderInventoryBetweenSnapshots2, orderInventorySnapshotFromRow: orderInventorySnapshotFromRow2 } = await import('./order-inventory-
|
|
31322
|
+
const { reconcileOrderInventoryBetweenSnapshots: reconcileOrderInventoryBetweenSnapshots2, orderInventorySnapshotFromRow: orderInventorySnapshotFromRow2 } = await import('./order-inventory-R3AU6N4V.js');
|
|
31323
31323
|
const prevSnap = orderInventorySnapshotFromRow2(orderWithItems);
|
|
31324
31324
|
const invErr = await reconcileOrderInventoryBetweenSnapshots2(dataSource, entityMap, prevSnap, {
|
|
31325
31325
|
status: "cancelled",
|
|
@@ -31337,7 +31337,7 @@ function createCmsApiHandler(config) {
|
|
|
31337
31337
|
status: "cancelled"
|
|
31338
31338
|
});
|
|
31339
31339
|
const fireOrderCancelledNotification = /* @__PURE__ */ __name((refundAmount) => {
|
|
31340
|
-
void import('./emit-order-notification-trigger-
|
|
31340
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
31341
31341
|
fireOrderNotificationTrigger("order_cancelled", orderId, {
|
|
31342
31342
|
dataSource,
|
|
31343
31343
|
entityMap
|
|
@@ -31582,7 +31582,7 @@ function createCmsApiHandler(config) {
|
|
|
31582
31582
|
}, {
|
|
31583
31583
|
status: 400
|
|
31584
31584
|
});
|
|
31585
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31585
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-FIW7PZ6W.js');
|
|
31586
31586
|
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms, getHydratedSessionUser);
|
|
31587
31587
|
return handlers.getChannels(req, orderId);
|
|
31588
31588
|
}
|
|
@@ -31597,7 +31597,7 @@ function createCmsApiHandler(config) {
|
|
|
31597
31597
|
}, {
|
|
31598
31598
|
status: 400
|
|
31599
31599
|
});
|
|
31600
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31600
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-FIW7PZ6W.js');
|
|
31601
31601
|
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms, getHydratedSessionUser);
|
|
31602
31602
|
return handlers.sendOtp(req, orderId);
|
|
31603
31603
|
}
|
|
@@ -31612,7 +31612,7 @@ function createCmsApiHandler(config) {
|
|
|
31612
31612
|
}, {
|
|
31613
31613
|
status: 400
|
|
31614
31614
|
});
|
|
31615
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31615
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-FIW7PZ6W.js');
|
|
31616
31616
|
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms, getHydratedSessionUser);
|
|
31617
31617
|
return handlers.verifyOtp(req, orderId);
|
|
31618
31618
|
}
|
|
@@ -31627,7 +31627,7 @@ function createCmsApiHandler(config) {
|
|
|
31627
31627
|
}, {
|
|
31628
31628
|
status: 400
|
|
31629
31629
|
});
|
|
31630
|
-
const { createOrderAssigneesHandlers } = await import('./order-assignees-handlers-
|
|
31630
|
+
const { createOrderAssigneesHandlers } = await import('./order-assignees-handlers-F7WOZHOG.js');
|
|
31631
31631
|
const handlers = createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionUser);
|
|
31632
31632
|
return handlers.listEligibleAssignees(req, orderId);
|
|
31633
31633
|
}
|
|
@@ -32244,7 +32244,7 @@ function createStorefrontApiHandler(config) {
|
|
|
32244
32244
|
const otpPepper = config.otpPepper;
|
|
32245
32245
|
const defaultPhoneCc = config.defaultPhoneCountryCode;
|
|
32246
32246
|
function fireStorefrontCheckoutNotifications(orderId) {
|
|
32247
|
-
void import('./emit-order-notification-trigger-
|
|
32247
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
32248
32248
|
fireOrderNotificationTrigger("order_pending", orderId, {
|
|
32249
32249
|
dataSource,
|
|
32250
32250
|
entityMap
|
|
@@ -34095,7 +34095,7 @@ function createStorefrontApiHandler(config) {
|
|
|
34095
34095
|
}, {
|
|
34096
34096
|
status: 400
|
|
34097
34097
|
});
|
|
34098
|
-
const { retireSoftDeletedUniqueValue: retireSoftDeletedUniqueValue2 } = await import('./retire-soft-deleted-unique-
|
|
34098
|
+
const { retireSoftDeletedUniqueValue: retireSoftDeletedUniqueValue2 } = await import('./retire-soft-deleted-unique-F25KZBZK.js');
|
|
34099
34099
|
await retireSoftDeletedUniqueValue2(userRepo(), "email", email);
|
|
34100
34100
|
const existing = await userRepo().findOne({
|
|
34101
34101
|
where: {
|
|
@@ -35189,7 +35189,7 @@ function createStorefrontApiHandler(config) {
|
|
|
35189
35189
|
} catch {
|
|
35190
35190
|
}
|
|
35191
35191
|
try {
|
|
35192
|
-
void import('./emit-order-notification-trigger-
|
|
35192
|
+
void import('./emit-order-notification-trigger-XKN2TWVF.js').then(({ fireOrderNotificationTrigger }) => {
|
|
35193
35193
|
fireOrderNotificationTrigger("order_cancelled", orderId, {
|
|
35194
35194
|
dataSource,
|
|
35195
35195
|
entityMap
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __name } from './chunk-
|
|
1
|
+
import { __name } from './chunk-5BKT4CS5.js';
|
|
2
2
|
|
|
3
3
|
// src/auth/permission-entities.ts
|
|
4
4
|
var PERMISSION_ENTITY_INTERNAL_EXCLUDE = /* @__PURE__ */ new Set([
|
|
@@ -623,7 +623,7 @@ async function logEntityAccessDecision(dataSource, context, user, entity, action
|
|
|
623
623
|
const id = Number(user.id);
|
|
624
624
|
if (Number.isFinite(id)) {
|
|
625
625
|
try {
|
|
626
|
-
const { loadDbPermissionsForUser } = await import('./rbac-debug-db-
|
|
626
|
+
const { loadDbPermissionsForUser } = await import('./rbac-debug-db-IRKT6G62.js');
|
|
627
627
|
dbPermissions = await loadDbPermissionsForUser(dataSource, id);
|
|
628
628
|
} catch (e) {
|
|
629
629
|
dbPermissions = {
|