@infuro/cms-core 1.0.65 → 1.0.67
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 +97 -24
- package/dist/admin.js +97 -24
- package/dist/api.cjs +38 -38
- package/dist/api.js +5 -5
- package/dist/auth.cjs +51 -51
- package/dist/auth.js +3 -3
- package/dist/{chunk-6DBDJ4VD.js → chunk-2ISSXYBZ.js} +2 -2
- package/dist/{chunk-NIRYYJIJ.cjs → chunk-5MZFQRDW.cjs} +73 -55
- package/dist/{chunk-MVHDC3XF.js → chunk-5NOZSG6J.js} +22 -11
- package/dist/{chunk-YHEITFHR.cjs → chunk-BVLN75LP.cjs} +540 -143
- package/dist/{chunk-YEAXE4U2.js → chunk-FLUF2GZH.js} +5 -11
- package/dist/{chunk-SANKKGB3.js → chunk-GLLCLRCQ.js} +464 -67
- package/dist/{chunk-ACBN6UWZ.js → chunk-NV5IRHI3.js} +26 -8
- package/dist/{chunk-J7FMZK66.cjs → chunk-O4AFPDQ4.cjs} +22 -11
- package/dist/{chunk-4U6DATGZ.cjs → chunk-OV5TRZET.cjs} +7 -7
- package/dist/{chunk-BXAKL2TF.cjs → chunk-PA6YDMFZ.cjs} +5 -11
- package/dist/{chunk-RDEVZMO5.js → chunk-RCE5SJBA.js} +2 -2
- package/dist/{chunk-KM2I6AFP.cjs → chunk-SS3K7OIM.cjs} +9 -9
- package/dist/{chunk-V6EYAC7X.cjs → chunk-WMMZZRDJ.cjs} +15 -15
- package/dist/{chunk-NR44CK5E.js → chunk-ZY64VJMS.js} +1 -1
- package/dist/{emit-order-notification-trigger-UCKJHDQK.js → emit-order-notification-trigger-EJJZ6XTS.js} +2 -2
- package/dist/{emit-order-notification-trigger-DR74TQXN.cjs → emit-order-notification-trigger-ZD5YN3JM.cjs} +4 -4
- package/dist/index.cjs +284 -280
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +10 -10
- package/dist/migrations/1783300000000-CreateOrderAssigneesTable.ts +43 -0
- package/dist/{order-assignees-handlers-NPKD64P6.cjs → order-assignees-handlers-KF7RMTV5.cjs} +77 -8
- package/dist/{order-assignees-handlers-LKMAGLG6.js → order-assignees-handlers-L3RVKUBS.js} +77 -8
- package/dist/{order-completion-otp-handlers-RW5RSXH3.cjs → order-completion-otp-handlers-DZAXK4GQ.cjs} +70 -16
- package/dist/{order-completion-otp-handlers-CH22ZRAI.js → order-completion-otp-handlers-HFGCPC4O.js} +69 -15
- package/dist/{order-notification-dispatcher-3TXUAJ7L.js → order-notification-dispatcher-ECPFI7CD.js} +2 -2
- package/dist/{order-notification-dispatcher-Y7NZAALH.cjs → order-notification-dispatcher-LL7ETKLU.cjs} +7 -7
- package/dist/{rbac-debug-db-5R6XFPSV.js → rbac-debug-db-DFZWZ6GV.js} +1 -1
- package/dist/{rbac-debug-db-JKK2MCWF.cjs → rbac-debug-db-KWV7D5PQ.cjs} +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizePhoneE164, generateNumericOtp, createOtpChallenge, queueSms, verifyAndConsumeOtpChallenge } from './chunk-OVTOP42W.js';
|
|
2
2
|
import { JOB_RUNNER_QUEUE } from './chunk-XJNNOSJR.js';
|
|
3
3
|
import { validateInventoryForConfirmedOrderLines, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, orderInventorySnapshotFromRow, validateInventoryForOrderBecomingConfirmed } from './chunk-3K5AIEIZ.js';
|
|
4
|
-
import { resolveChatEmailToolSettings, CHAT_EMAIL_LOG, detectChatLeadIntent, parseIntentRecipientEmails, sendChatLeadEmail, buildTranscriptForLeadEmail, buildChatbotSystemPromptWithEmailTool, validateFcmCredentials, sendFcmPushNotification, parseEmailRecipientsFromConfig, isWhatsAppPluginEnabled, WhatsAppService, emailPlugin, initWhatsappTriggerDispatcher } from './chunk-
|
|
4
|
+
import { resolveChatEmailToolSettings, CHAT_EMAIL_LOG, detectChatLeadIntent, parseIntentRecipientEmails, sendChatLeadEmail, buildTranscriptForLeadEmail, buildChatbotSystemPromptWithEmailTool, validateFcmCredentials, sendFcmPushNotification, parseEmailRecipientsFromConfig, isWhatsAppPluginEnabled, WhatsAppService, emailPlugin, initWhatsappTriggerDispatcher } from './chunk-NV5IRHI3.js';
|
|
5
5
|
import { registerWhatsAppQueueProcessor } from './chunk-GWDI752Q.js';
|
|
6
6
|
import { inviteStatusForActivation } from './chunk-JXF23MPG.js';
|
|
7
7
|
import { queueEmail, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-TU23GJPJ.js';
|
|
@@ -10,9 +10,9 @@ import { isErpIntegrationEnabled } from './chunk-JC6DLWTE.js';
|
|
|
10
10
|
import { mergeEmailLayoutCompanyDetails } from './chunk-YRCKEGL2.js';
|
|
11
11
|
import { getSmsTemplateDefault, SMS_MESSAGE_TEMPLATE_DEFAULTS } from './chunk-MQBT33IV.js';
|
|
12
12
|
import { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES } from './chunk-AYERBA7I.js';
|
|
13
|
-
import { ensureCustomerRecord, linkUnclaimedContactToUser, ensureCustomerForUser, canManageRoles, sessionHasEntityAccess } from './chunk-
|
|
13
|
+
import { ensureCustomerRecord, linkUnclaimedContactToUser, ensureCustomerForUser, canManageRoles, sessionHasEntityAccess } from './chunk-ZY64VJMS.js';
|
|
14
14
|
import { retireSoftDeletedUniqueValue, activeUniqueValueExists } from './chunk-DBPSJYLZ.js';
|
|
15
|
-
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 { 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-5NOZSG6J.js';
|
|
16
16
|
import { queueErp } from './chunk-SYBOCAWB.js';
|
|
17
17
|
import { __name } from './chunk-SHUYVCID.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';
|
|
@@ -1674,6 +1674,30 @@ function entityHasSoftDelete(repo) {
|
|
|
1674
1674
|
return repo.metadata.columns.some((c) => c.propertyName === "deleted");
|
|
1675
1675
|
}
|
|
1676
1676
|
__name(entityHasSoftDelete, "entityHasSoftDelete");
|
|
1677
|
+
async function recordOrderAssigneeHistory(dataSource, entityMap, orderId, userId, vendorId) {
|
|
1678
|
+
if (!entityMap.order_assignees) return 1;
|
|
1679
|
+
const assigneeRepo = dataSource.getRepository(entityMap.order_assignees);
|
|
1680
|
+
const maxRow = await assigneeRepo.findOne({
|
|
1681
|
+
where: {
|
|
1682
|
+
orderId
|
|
1683
|
+
},
|
|
1684
|
+
order: {
|
|
1685
|
+
sortOrder: "DESC"
|
|
1686
|
+
}
|
|
1687
|
+
});
|
|
1688
|
+
const currentMax = Number(maxRow?.sortOrder ?? 0);
|
|
1689
|
+
const nextSortOrder = currentMax + 1;
|
|
1690
|
+
await assigneeRepo.save({
|
|
1691
|
+
orderId,
|
|
1692
|
+
userId,
|
|
1693
|
+
vendorId,
|
|
1694
|
+
sortOrder: nextSortOrder,
|
|
1695
|
+
assignedAt: /* @__PURE__ */ new Date()
|
|
1696
|
+
});
|
|
1697
|
+
console.log(`[ORDERS-DEBUG][ASSIGNEE_HISTORY] Recorded assignment for order ${orderId}: user ${userId}, vendor ${vendorId}, sortOrder ${nextSortOrder}`);
|
|
1698
|
+
return nextSortOrder;
|
|
1699
|
+
}
|
|
1700
|
+
__name(recordOrderAssigneeHistory, "recordOrderAssigneeHistory");
|
|
1677
1701
|
var LIST_QUERY_RESERVED = /* @__PURE__ */ new Set([
|
|
1678
1702
|
"page",
|
|
1679
1703
|
"limit",
|
|
@@ -3556,10 +3580,38 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
3556
3580
|
});
|
|
3557
3581
|
}
|
|
3558
3582
|
}
|
|
3559
|
-
const qb = repo2.createQueryBuilder("order").leftJoinAndSelect("order.contact", "contact").leftJoinAndSelect("order.items", "items").leftJoinAndSelect("items.product", "product").leftJoinAndSelect("product.collection", "collection").leftJoinAndSelect("order.payments", "payments").leftJoinAndSelect("order.assignedUser", "assignedUser").andWhere("order.deleted = :orderDel", {
|
|
3583
|
+
const qb = repo2.createQueryBuilder("order").leftJoinAndSelect("order.contact", "contact").leftJoinAndSelect("order.items", "items").leftJoinAndSelect("items.product", "product").leftJoinAndSelect("product.collection", "collection").leftJoinAndSelect("order.payments", "payments").leftJoinAndSelect("order.assignedUser", "assignedUser").leftJoinAndSelect("order.vendor", "vendor").andWhere("order.deleted = :orderDel", {
|
|
3560
3584
|
orderDel: false
|
|
3561
3585
|
}).orderBy(`order.${sortField2}`, sortOrderOrders).skip(skip).take(limit);
|
|
3562
|
-
|
|
3586
|
+
const session = await getHydratedSessionUser?.() ?? null;
|
|
3587
|
+
console.log("[ORDERS-DEBUG][LIST] Querying orders. Session:", {
|
|
3588
|
+
id: session?.id,
|
|
3589
|
+
email: session?.email,
|
|
3590
|
+
role: session?.role,
|
|
3591
|
+
isRBACAdmin: session?.isRBACAdmin,
|
|
3592
|
+
isVendorPortal: session?.isVendorPortal,
|
|
3593
|
+
isVendorOwner: session?.isVendorOwner,
|
|
3594
|
+
isVendorRoleOwner: session?.isVendorRoleOwner,
|
|
3595
|
+
vendorIds: session?.vendorIds,
|
|
3596
|
+
activeVendorId: session?.activeVendorId
|
|
3597
|
+
}, "Scope:", scope);
|
|
3598
|
+
if (scope.type === "deny") {
|
|
3599
|
+
qb.andWhere("1 = 0");
|
|
3600
|
+
} else if (scope.type === "vendor") {
|
|
3601
|
+
const isOwner = Boolean(session?.isVendorOwner || session?.isVendorRoleOwner || session?.isRBACAdmin);
|
|
3602
|
+
console.log("[ORDERS-DEBUG][LIST] Vendor scope applied. isOwner:", isOwner, "vendorId:", scope.vendorId);
|
|
3603
|
+
if (isOwner) {
|
|
3604
|
+
qb.andWhere('(order.vendorId = :vendorScopeId OR order.assignedUserId IN (SELECT vu."userId" FROM vendor_users vu WHERE vu."vendorId" = :vendorScopeId))', {
|
|
3605
|
+
vendorScopeId: scope.vendorId
|
|
3606
|
+
});
|
|
3607
|
+
} else {
|
|
3608
|
+
const teamMemberId = Number(session?.id);
|
|
3609
|
+
console.log("[ORDERS-DEBUG][LIST] Team member scoping to teamMemberId:", teamMemberId);
|
|
3610
|
+
qb.andWhere("order.assignedUserId = :teamMemberId", {
|
|
3611
|
+
teamMemberId
|
|
3612
|
+
});
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3563
3615
|
const vendorIdFilter = searchParams.get("vendorId")?.trim();
|
|
3564
3616
|
if (vendorIdFilter) {
|
|
3565
3617
|
const n = Number(vendorIdFilter);
|
|
@@ -3612,7 +3664,15 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
3612
3664
|
});
|
|
3613
3665
|
}
|
|
3614
3666
|
}
|
|
3667
|
+
console.log("[ORDERS-DEBUG][LIST] Executing SQL:", qb.getSql(), "Params:", qb.getParameters());
|
|
3615
3668
|
const [rows, total2] = await qb.getManyAndCount();
|
|
3669
|
+
console.log("[ORDERS-DEBUG][LIST] Query result: total =", total2, "rows length =", rows.length, "Orders:", rows.map((r) => ({
|
|
3670
|
+
id: r.id,
|
|
3671
|
+
orderNumber: r.orderNumber,
|
|
3672
|
+
vendorId: r.vendorId,
|
|
3673
|
+
assignedUserId: r.assignedUserId,
|
|
3674
|
+
status: r.status
|
|
3675
|
+
})));
|
|
3616
3676
|
const data2 = await Promise.all(rows.map(async (order) => {
|
|
3617
3677
|
await autoExpireOrderIfPaymentTimeExceeded(dataSource, entityMap, order);
|
|
3618
3678
|
const contact = order.contact;
|
|
@@ -3656,6 +3716,7 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
3656
3716
|
if (orderStatus === "cancelled" && rawPayStatus !== "paid" && rawPayStatus !== "captured" && rawPayStatus !== "refunded") {
|
|
3657
3717
|
paymentStatus2 = "unpaid";
|
|
3658
3718
|
}
|
|
3719
|
+
const vendorObj = order.vendor;
|
|
3659
3720
|
return {
|
|
3660
3721
|
...orderWithoutPayments,
|
|
3661
3722
|
contact: contact ? {
|
|
@@ -3669,6 +3730,11 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
3669
3730
|
name: assignedUserObj.name || assignedUserObj.email,
|
|
3670
3731
|
email: assignedUserObj.email
|
|
3671
3732
|
} : null,
|
|
3733
|
+
vendor: vendorObj ? {
|
|
3734
|
+
id: vendorObj.id,
|
|
3735
|
+
name: vendorObj.name || vendorObj.slug || `Vendor #${vendorObj.id}`,
|
|
3736
|
+
slug: vendorObj.slug
|
|
3737
|
+
} : null,
|
|
3672
3738
|
itemsSummary,
|
|
3673
3739
|
paymentStatus: paymentStatus2
|
|
3674
3740
|
};
|
|
@@ -4201,6 +4267,18 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
4201
4267
|
isCatalog: true
|
|
4202
4268
|
});
|
|
4203
4269
|
}
|
|
4270
|
+
} else if (resource === "orders" && scope.type === "vendor") {
|
|
4271
|
+
const session = await getHydratedSessionUser?.() ?? null;
|
|
4272
|
+
const isOwner = Boolean(session?.isVendorOwner || session?.isVendorRoleOwner || session?.isRBACAdmin);
|
|
4273
|
+
if (!isOwner) {
|
|
4274
|
+
const teamMemberId = Number(session?.id);
|
|
4275
|
+
where = mergeListWhereAnd(where, {
|
|
4276
|
+
vendorId: scope.vendorId,
|
|
4277
|
+
assignedUserId: teamMemberId
|
|
4278
|
+
});
|
|
4279
|
+
} else {
|
|
4280
|
+
where = mergeVendorScopeIntoWhere(where, scope, resource, catalogFlags);
|
|
4281
|
+
}
|
|
4204
4282
|
} else {
|
|
4205
4283
|
where = mergeVendorScopeIntoWhere(where, scope, resource, catalogFlags);
|
|
4206
4284
|
}
|
|
@@ -5165,6 +5243,12 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
5165
5243
|
shippingAddressId: savedShipping?.id ?? null
|
|
5166
5244
|
});
|
|
5167
5245
|
}
|
|
5246
|
+
if (persistBody.assignedUserId) {
|
|
5247
|
+
const initAssignee = Number(persistBody.assignedUserId);
|
|
5248
|
+
if (Number.isFinite(initAssignee) && initAssignee > 0) {
|
|
5249
|
+
await recordOrderAssigneeHistory(dataSource, entityMap, created.id, initAssignee, Number(created.vendorId) || null);
|
|
5250
|
+
}
|
|
5251
|
+
}
|
|
5168
5252
|
const reloadedOrder = await repo.findOne({
|
|
5169
5253
|
where: {
|
|
5170
5254
|
id: created.id,
|
|
@@ -5229,7 +5313,7 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
5229
5313
|
const orderIdForNotify = created.id;
|
|
5230
5314
|
const finalCreatedStatus = String(created.status ?? createdStatus ?? "pending").toLowerCase();
|
|
5231
5315
|
const initialPayStatus = String(persistBody.paymentStatus ?? body.paymentStatus ?? "unpaid").toLowerCase();
|
|
5232
|
-
void import('./emit-order-notification-trigger-
|
|
5316
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
5233
5317
|
if (finalCreatedStatus === "pending") {
|
|
5234
5318
|
if (initialPayStatus === "failed") {
|
|
5235
5319
|
fireOrderNotificationTrigger("payment_failed", orderIdForNotify, {
|
|
@@ -5484,7 +5568,16 @@ function createCrudHandler(dataSource, entityMap, options) {
|
|
|
5484
5568
|
const scope = await resolveScope();
|
|
5485
5569
|
const flags = await getVendorCatalogCreateFlags(dataSource);
|
|
5486
5570
|
if (scope.type !== "all") {
|
|
5487
|
-
|
|
5571
|
+
const session = await getHydratedSessionUser?.() ?? null;
|
|
5572
|
+
const isOwner = Boolean(session?.isVendorOwner || session?.isVendorRoleOwner || session?.isRBACAdmin);
|
|
5573
|
+
const teamMemberId = Number(session?.id);
|
|
5574
|
+
data = data.filter((row) => {
|
|
5575
|
+
if (vendorScopeRowAccess(row, scope, resource, flags) !== "ok") return false;
|
|
5576
|
+
if (resource === "orders" && scope.type === "vendor" && !isOwner) {
|
|
5577
|
+
return Number(row?.assignedUserId) === teamMemberId;
|
|
5578
|
+
}
|
|
5579
|
+
return true;
|
|
5580
|
+
});
|
|
5488
5581
|
}
|
|
5489
5582
|
const excludeCols = /* @__PURE__ */ new Set([
|
|
5490
5583
|
"deletedAt",
|
|
@@ -5522,6 +5615,51 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
5522
5615
|
type: "all"
|
|
5523
5616
|
}));
|
|
5524
5617
|
async function vendorScopeAccessJson(row, scope, resource) {
|
|
5618
|
+
if (!row) return json({
|
|
5619
|
+
message: "Not found"
|
|
5620
|
+
}, {
|
|
5621
|
+
status: 404
|
|
5622
|
+
});
|
|
5623
|
+
if (resource === "orders" && scope.type === "vendor") {
|
|
5624
|
+
const rowVendorId = Number(row?.vendorId);
|
|
5625
|
+
let orderBelongsToVendorScope = rowVendorId === scope.vendorId;
|
|
5626
|
+
if (!orderBelongsToVendorScope) {
|
|
5627
|
+
const aId = Number(row?.assignedUserId);
|
|
5628
|
+
if (Number.isFinite(aId) && aId > 0 && entityMap["vendor_users"]) {
|
|
5629
|
+
const vuRepo = dataSource.getRepository(entityMap["vendor_users"]);
|
|
5630
|
+
const isTeamMember = await vuRepo.count({
|
|
5631
|
+
where: {
|
|
5632
|
+
vendorId: scope.vendorId,
|
|
5633
|
+
userId: aId
|
|
5634
|
+
}
|
|
5635
|
+
});
|
|
5636
|
+
if (isTeamMember > 0) {
|
|
5637
|
+
orderBelongsToVendorScope = true;
|
|
5638
|
+
}
|
|
5639
|
+
}
|
|
5640
|
+
}
|
|
5641
|
+
if (!orderBelongsToVendorScope) {
|
|
5642
|
+
return json({
|
|
5643
|
+
error: "Forbidden"
|
|
5644
|
+
}, {
|
|
5645
|
+
status: 403
|
|
5646
|
+
});
|
|
5647
|
+
}
|
|
5648
|
+
const session = await getHydratedSessionUser?.() ?? null;
|
|
5649
|
+
const isOwner = Boolean(session?.isVendorOwner || session?.isVendorRoleOwner || session?.isRBACAdmin);
|
|
5650
|
+
if (!isOwner) {
|
|
5651
|
+
const sessionUserId = Number(session?.id);
|
|
5652
|
+
const orderAssignee = Number(row?.assignedUserId);
|
|
5653
|
+
if (!Number.isFinite(orderAssignee) || orderAssignee !== sessionUserId) {
|
|
5654
|
+
return json({
|
|
5655
|
+
error: "Forbidden: You can only access orders assigned directly to you"
|
|
5656
|
+
}, {
|
|
5657
|
+
status: 403
|
|
5658
|
+
});
|
|
5659
|
+
}
|
|
5660
|
+
}
|
|
5661
|
+
return null;
|
|
5662
|
+
}
|
|
5525
5663
|
const flags = await getVendorCatalogCreateFlags(dataSource);
|
|
5526
5664
|
const access = vendorScopeRowAccess(row, scope, resource, flags);
|
|
5527
5665
|
if (access === "ok") return null;
|
|
@@ -5646,6 +5784,17 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
5646
5784
|
}
|
|
5647
5785
|
if (resource === "orders") {
|
|
5648
5786
|
const scope2 = await resolveScopeById();
|
|
5787
|
+
const session = await getHydratedSessionUser?.() ?? null;
|
|
5788
|
+
console.log("[ORDERS-DEBUG][GET_BY_ID] Fetching order id:", id, "Scope:", scope2, "Session:", {
|
|
5789
|
+
id: session?.id,
|
|
5790
|
+
email: session?.email,
|
|
5791
|
+
role: session?.role,
|
|
5792
|
+
isRBACAdmin: session?.isRBACAdmin,
|
|
5793
|
+
isVendorOwner: session?.isVendorOwner,
|
|
5794
|
+
isVendorRoleOwner: session?.isVendorRoleOwner,
|
|
5795
|
+
activeVendorId: session?.activeVendorId,
|
|
5796
|
+
vendorIds: session?.vendorIds
|
|
5797
|
+
});
|
|
5649
5798
|
const order = await repo.findOne({
|
|
5650
5799
|
where: {
|
|
5651
5800
|
id: Number(id)
|
|
@@ -5658,14 +5807,26 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
5658
5807
|
"items.product",
|
|
5659
5808
|
"items.product.collection",
|
|
5660
5809
|
"payments",
|
|
5661
|
-
"assignedUser"
|
|
5810
|
+
"assignedUser",
|
|
5811
|
+
"vendor"
|
|
5662
5812
|
]
|
|
5663
5813
|
});
|
|
5814
|
+
console.log("[ORDERS-DEBUG][GET_BY_ID] Order found in DB:", order ? {
|
|
5815
|
+
id: order.id,
|
|
5816
|
+
orderNumber: order.orderNumber,
|
|
5817
|
+
vendorId: order.vendorId,
|
|
5818
|
+
assignedUserId: order.assignedUserId,
|
|
5819
|
+
status: order.status
|
|
5820
|
+
} : null);
|
|
5664
5821
|
if (order) {
|
|
5665
5822
|
await autoExpireOrderIfPaymentTimeExceeded(dataSource, entityMap, order);
|
|
5666
5823
|
}
|
|
5667
5824
|
const orderDenied = await vendorScopeAccessJson(order, scope2, resource);
|
|
5668
|
-
if (orderDenied)
|
|
5825
|
+
if (orderDenied) {
|
|
5826
|
+
console.log("[ORDERS-DEBUG][GET_BY_ID] Access DENIED for order id:", id);
|
|
5827
|
+
return orderDenied;
|
|
5828
|
+
}
|
|
5829
|
+
console.log("[ORDERS-DEBUG][GET_BY_ID] Access GRANTED for order id:", id);
|
|
5669
5830
|
const relatedOrders = await repo.find({
|
|
5670
5831
|
where: {
|
|
5671
5832
|
parentOrderId: Number(id)
|
|
@@ -6049,21 +6210,67 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6049
6210
|
lines: []
|
|
6050
6211
|
} : await calculateOrderTotalsFromLines(dataSource, entityMap, orderLinesNorm, effectiveCurrency, putDiscountId, Number.isFinite(putOrderVendorId) ? putOrderVendorId : null);
|
|
6051
6212
|
const scalarUpdate = pickColumnUpdates(repo, rawBody);
|
|
6052
|
-
if (rawBody && typeof rawBody === "object"
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6213
|
+
if (rawBody && typeof rawBody === "object") {
|
|
6214
|
+
if (scopePutEarly.type === "all" && "vendorId" in rawBody && rawBody.vendorId !== void 0) {
|
|
6215
|
+
const vId = Number(rawBody.vendorId);
|
|
6216
|
+
if (Number.isFinite(vId) && vId > 0) {
|
|
6217
|
+
scalarUpdate.vendorId = vId;
|
|
6218
|
+
}
|
|
6219
|
+
}
|
|
6220
|
+
if ("assignedUserId" in rawBody && rawBody.assignedUserId !== void 0) {
|
|
6221
|
+
const aId = Number(rawBody.assignedUserId);
|
|
6222
|
+
if (Number.isFinite(aId) && aId > 0) {
|
|
6223
|
+
if (scopePutEarly.type === "vendor" && entityMap.vendor_users) {
|
|
6224
|
+
const vuRepo = dataSource.getRepository(entityMap.vendor_users);
|
|
6225
|
+
const vuLink = await vuRepo.findOne({
|
|
6226
|
+
where: {
|
|
6227
|
+
vendorId: scopePutEarly.vendorId,
|
|
6228
|
+
userId: aId
|
|
6229
|
+
}
|
|
6230
|
+
});
|
|
6231
|
+
if (!vuLink) {
|
|
6232
|
+
return json({
|
|
6233
|
+
error: "Cannot assign order to a user outside your vendor team."
|
|
6234
|
+
}, {
|
|
6235
|
+
status: 403
|
|
6236
|
+
});
|
|
6237
|
+
}
|
|
6238
|
+
scalarUpdate.vendorId = scopePutEarly.vendorId;
|
|
6239
|
+
} else if (scopePutEarly.type === "all" && entityMap.vendor_users) {
|
|
6240
|
+
if (entityMap.vendors) {
|
|
6241
|
+
const activeVu = await dataSource.query(`SELECT vu."vendorId"
|
|
6242
|
+
FROM vendor_users vu
|
|
6243
|
+
JOIN vendors v ON v.id = vu."vendorId"
|
|
6244
|
+
WHERE vu."userId" = $1 AND v.deleted = false
|
|
6245
|
+
ORDER BY vu.id DESC
|
|
6246
|
+
LIMIT 1`, [
|
|
6247
|
+
aId
|
|
6248
|
+
]);
|
|
6249
|
+
if (activeVu.length > 0 && activeVu[0].vendorId) {
|
|
6250
|
+
scalarUpdate.vendorId = Number(activeVu[0].vendorId);
|
|
6251
|
+
}
|
|
6252
|
+
}
|
|
6253
|
+
}
|
|
6254
|
+
const prevAssigned = Number(existingOrderRow?.assignedUserId);
|
|
6255
|
+
const prevVendor = Number(existingOrderRow?.vendorId);
|
|
6256
|
+
const targetVendor = Number.isFinite(Number(scalarUpdate.vendorId)) ? Number(scalarUpdate.vendorId) : Number(existingOrderRow?.vendorId) || null;
|
|
6257
|
+
if (aId !== prevAssigned || targetVendor && targetVendor !== prevVendor) {
|
|
6258
|
+
await recordOrderAssigneeHistory(dataSource, entityMap, numericId, aId, targetVendor);
|
|
6259
|
+
}
|
|
6260
|
+
scalarUpdate.assignedUserId = aId;
|
|
6261
|
+
scalarUpdate.assignedAt = /* @__PURE__ */ new Date();
|
|
6262
|
+
} else {
|
|
6263
|
+
scalarUpdate.assignedUserId = null;
|
|
6264
|
+
scalarUpdate.assignedAt = null;
|
|
6265
|
+
}
|
|
6060
6266
|
}
|
|
6061
6267
|
}
|
|
6062
6268
|
if (scalarUpdate.status === "processing") {
|
|
6063
6269
|
const effectiveAssignee = scalarUpdate.assignedUserId !== void 0 ? scalarUpdate.assignedUserId : existingOrderRow?.assignedUserId ?? null;
|
|
6064
|
-
|
|
6270
|
+
const effectiveVendor = scalarUpdate.vendorId !== void 0 ? Number(scalarUpdate.vendorId) : Number(existingOrderRow?.vendorId);
|
|
6271
|
+
if (!effectiveAssignee && (!Number.isFinite(effectiveVendor) || effectiveVendor <= 0)) {
|
|
6065
6272
|
return json({
|
|
6066
|
-
error: "Cannot start processing without assigning a teammate. Please assign
|
|
6273
|
+
error: "Cannot start processing without assigning a vendor or teammate. Please assign first."
|
|
6067
6274
|
}, {
|
|
6068
6275
|
status: 400
|
|
6069
6276
|
});
|
|
@@ -6309,7 +6516,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6309
6516
|
const paymentUpdated = Boolean(rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null);
|
|
6310
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));
|
|
6311
6518
|
if (assigneeUpdated) {
|
|
6312
|
-
void import('./emit-order-notification-trigger-
|
|
6519
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
6313
6520
|
fireOrderNotificationTrigger("order_assigned", updatedOrder.id, {
|
|
6314
6521
|
dataSource,
|
|
6315
6522
|
entityMap
|
|
@@ -6326,7 +6533,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6326
6533
|
const payments = Array.isArray(updatedOrder.payments) ? updatedOrder.payments : [];
|
|
6327
6534
|
const bodyPayStatus = rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null ? String(rawBody.paymentStatus).toLowerCase() : null;
|
|
6328
6535
|
const curPayStatus = bodyPayStatus || String(payments[0]?.status || "unpaid").toLowerCase();
|
|
6329
|
-
void import('./emit-order-notification-trigger-
|
|
6536
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
6330
6537
|
if (newStatus === "pending") {
|
|
6331
6538
|
if (curPayStatus === "failed") {
|
|
6332
6539
|
fireOrderNotificationTrigger("payment_failed", updatedOrder.id, {
|
|
@@ -6480,7 +6687,9 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6480
6687
|
}
|
|
6481
6688
|
const updatePayload = rawBody && typeof rawBody === "object" ? pickColumnUpdates(repo, rawBody) : {};
|
|
6482
6689
|
if (resourceUsesVendorScope(resource)) {
|
|
6483
|
-
|
|
6690
|
+
if (!(resource === "orders" && scopePut.type === "all")) {
|
|
6691
|
+
delete updatePayload.vendorId;
|
|
6692
|
+
}
|
|
6484
6693
|
}
|
|
6485
6694
|
if (resource === "contacts" && "type" in updatePayload) {
|
|
6486
6695
|
const t = updatePayload.type;
|
|
@@ -6876,9 +7085,59 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6876
7085
|
}
|
|
6877
7086
|
}
|
|
6878
7087
|
if (resource === "orders" && orderInvPrev && rawBody && typeof rawBody === "object") {
|
|
7088
|
+
console.log("[ORDERS-DEBUG][UPDATE] PUT /api/orders/" + numericId, "Scope:", scopePut, "rawBody:", rawBody, "existingOrder:", {
|
|
7089
|
+
id: existingOrderRow?.id,
|
|
7090
|
+
vendorId: existingOrderRow?.vendorId,
|
|
7091
|
+
assignedUserId: existingOrderRow?.assignedUserId,
|
|
7092
|
+
status: existingOrderRow?.status
|
|
7093
|
+
});
|
|
7094
|
+
if (scopePut.type === "all" && "vendorId" in rawBody && rawBody.vendorId !== void 0) {
|
|
7095
|
+
const vId = Number(rawBody.vendorId);
|
|
7096
|
+
if (Number.isFinite(vId) && vId > 0) {
|
|
7097
|
+
updatePayload.vendorId = vId;
|
|
7098
|
+
}
|
|
7099
|
+
}
|
|
6879
7100
|
if ("assignedUserId" in rawBody && rawBody.assignedUserId !== void 0) {
|
|
6880
7101
|
const aId = Number(rawBody.assignedUserId);
|
|
7102
|
+
console.log("[ORDERS-DEBUG][UPDATE] Updating assignedUserId to:", aId);
|
|
6881
7103
|
if (Number.isFinite(aId) && aId > 0) {
|
|
7104
|
+
if (scopePut.type === "vendor" && entityMap.vendor_users) {
|
|
7105
|
+
const vuRepo = dataSource.getRepository(entityMap.vendor_users);
|
|
7106
|
+
const vuLink = await vuRepo.findOne({
|
|
7107
|
+
where: {
|
|
7108
|
+
vendorId: scopePut.vendorId,
|
|
7109
|
+
userId: aId
|
|
7110
|
+
}
|
|
7111
|
+
});
|
|
7112
|
+
if (!vuLink) {
|
|
7113
|
+
return json({
|
|
7114
|
+
error: "Cannot assign order to a user outside your vendor team."
|
|
7115
|
+
}, {
|
|
7116
|
+
status: 403
|
|
7117
|
+
});
|
|
7118
|
+
}
|
|
7119
|
+
updatePayload.vendorId = scopePut.vendorId;
|
|
7120
|
+
} else if (scopePut.type === "all" && entityMap.vendor_users) {
|
|
7121
|
+
if (entityMap.vendors) {
|
|
7122
|
+
const activeVu = await dataSource.query(`SELECT vu."vendorId"
|
|
7123
|
+
FROM vendor_users vu
|
|
7124
|
+
JOIN vendors v ON v.id = vu."vendorId"
|
|
7125
|
+
WHERE vu."userId" = $1 AND v.deleted = false
|
|
7126
|
+
ORDER BY vu.id DESC
|
|
7127
|
+
LIMIT 1`, [
|
|
7128
|
+
aId
|
|
7129
|
+
]);
|
|
7130
|
+
if (activeVu.length > 0 && activeVu[0].vendorId) {
|
|
7131
|
+
updatePayload.vendorId = Number(activeVu[0].vendorId);
|
|
7132
|
+
}
|
|
7133
|
+
}
|
|
7134
|
+
}
|
|
7135
|
+
const prevAssigned = Number(existingOrderRow?.assignedUserId);
|
|
7136
|
+
const prevVendor = Number(existingOrderRow?.vendorId);
|
|
7137
|
+
const targetVendor = Number.isFinite(Number(updatePayload.vendorId)) ? Number(updatePayload.vendorId) : Number(existingOrderRow?.vendorId) || null;
|
|
7138
|
+
if (aId !== prevAssigned || targetVendor && targetVendor !== prevVendor) {
|
|
7139
|
+
await recordOrderAssigneeHistory(dataSource, entityMap, numericId, aId, targetVendor);
|
|
7140
|
+
}
|
|
6882
7141
|
updatePayload.assignedUserId = aId;
|
|
6883
7142
|
updatePayload.assignedAt = /* @__PURE__ */ new Date();
|
|
6884
7143
|
} else {
|
|
@@ -6886,11 +7145,13 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6886
7145
|
updatePayload.assignedAt = null;
|
|
6887
7146
|
}
|
|
6888
7147
|
}
|
|
7148
|
+
console.log("[ORDERS-DEBUG][UPDATE] Final updatePayload for order:", updatePayload);
|
|
6889
7149
|
if (updatePayload.status === "processing") {
|
|
6890
7150
|
const effectiveAssignee = updatePayload.assignedUserId !== void 0 ? updatePayload.assignedUserId : existingOrderRow?.assignedUserId ?? null;
|
|
6891
|
-
|
|
7151
|
+
const effectiveVendor = updatePayload.vendorId !== void 0 ? Number(updatePayload.vendorId) : Number(existingOrderRow?.vendorId);
|
|
7152
|
+
if (!effectiveAssignee && (!Number.isFinite(effectiveVendor) || effectiveVendor <= 0)) {
|
|
6892
7153
|
return json({
|
|
6893
|
-
error: "Cannot start processing without assigning a teammate. Please assign
|
|
7154
|
+
error: "Cannot start processing without assigning a vendor or teammate. Please assign first."
|
|
6894
7155
|
}, {
|
|
6895
7156
|
status: 400
|
|
6896
7157
|
});
|
|
@@ -6980,7 +7241,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6980
7241
|
});
|
|
6981
7242
|
}
|
|
6982
7243
|
if (ordStatus === "pending" || ordStatus === "confirmed") {
|
|
6983
|
-
void import('./emit-order-notification-trigger-
|
|
7244
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
6984
7245
|
fireOrderNotificationTrigger("order_placed", pOrder, {
|
|
6985
7246
|
dataSource,
|
|
6986
7247
|
entityMap
|
|
@@ -6994,7 +7255,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
6994
7255
|
}
|
|
6995
7256
|
}
|
|
6996
7257
|
} else if (newPayStatus === "failed") {
|
|
6997
|
-
void import('./emit-order-notification-trigger-
|
|
7258
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
6998
7259
|
fireOrderNotificationTrigger("payment_failed", pOrder, {
|
|
6999
7260
|
dataSource,
|
|
7000
7261
|
entityMap
|
|
@@ -7002,7 +7263,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7002
7263
|
}).catch(() => {
|
|
7003
7264
|
});
|
|
7004
7265
|
} else if (newPayStatus === "refunded") {
|
|
7005
|
-
void import('./emit-order-notification-trigger-
|
|
7266
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7006
7267
|
fireOrderNotificationTrigger("payment_refund_initiated", pOrder, {
|
|
7007
7268
|
dataSource,
|
|
7008
7269
|
entityMap
|
|
@@ -7129,7 +7390,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7129
7390
|
const paymentUpdated = Boolean(rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null);
|
|
7130
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));
|
|
7131
7392
|
if (assigneeUpdated) {
|
|
7132
|
-
void import('./emit-order-notification-trigger-
|
|
7393
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7133
7394
|
fireOrderNotificationTrigger("order_assigned", ord.id, {
|
|
7134
7395
|
dataSource,
|
|
7135
7396
|
entityMap
|
|
@@ -7146,7 +7407,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
7146
7407
|
const payments = Array.isArray(ord.payments) ? ord.payments : [];
|
|
7147
7408
|
const bodyPayStatus = rawBody && typeof rawBody === "object" && rawBody.paymentStatus != null ? String(rawBody.paymentStatus).toLowerCase() : null;
|
|
7148
7409
|
const curPayStatus = bodyPayStatus || String(payments[0]?.status || "unpaid").toLowerCase();
|
|
7149
|
-
void import('./emit-order-notification-trigger-
|
|
7410
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
7150
7411
|
if (newStatus === "pending") {
|
|
7151
7412
|
if (curPayStatus === "failed") {
|
|
7152
7413
|
fireOrderNotificationTrigger("payment_failed", ord.id, {
|
|
@@ -25135,6 +25396,109 @@ _ts_decorate69([
|
|
|
25135
25396
|
OrderNotificationTrigger = _ts_decorate69([
|
|
25136
25397
|
Entity("order_notification_triggers")
|
|
25137
25398
|
], OrderNotificationTrigger);
|
|
25399
|
+
function _ts_decorate70(decorators, target, key, desc) {
|
|
25400
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
25401
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25402
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
25403
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
25404
|
+
}
|
|
25405
|
+
__name(_ts_decorate70, "_ts_decorate");
|
|
25406
|
+
function _ts_metadata70(k, v) {
|
|
25407
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25408
|
+
}
|
|
25409
|
+
__name(_ts_metadata70, "_ts_metadata");
|
|
25410
|
+
var OrderAssignee = class {
|
|
25411
|
+
static {
|
|
25412
|
+
__name(this, "OrderAssignee");
|
|
25413
|
+
}
|
|
25414
|
+
id;
|
|
25415
|
+
orderId;
|
|
25416
|
+
userId;
|
|
25417
|
+
vendorId;
|
|
25418
|
+
sortOrder;
|
|
25419
|
+
assignedAt;
|
|
25420
|
+
createdAt;
|
|
25421
|
+
order;
|
|
25422
|
+
user;
|
|
25423
|
+
vendor;
|
|
25424
|
+
};
|
|
25425
|
+
_ts_decorate70([
|
|
25426
|
+
PrimaryGeneratedColumn(),
|
|
25427
|
+
_ts_metadata70("design:type", Number)
|
|
25428
|
+
], OrderAssignee.prototype, "id", void 0);
|
|
25429
|
+
_ts_decorate70([
|
|
25430
|
+
Column("int"),
|
|
25431
|
+
_ts_metadata70("design:type", Number)
|
|
25432
|
+
], OrderAssignee.prototype, "orderId", void 0);
|
|
25433
|
+
_ts_decorate70([
|
|
25434
|
+
Column("int"),
|
|
25435
|
+
_ts_metadata70("design:type", Number)
|
|
25436
|
+
], OrderAssignee.prototype, "userId", void 0);
|
|
25437
|
+
_ts_decorate70([
|
|
25438
|
+
Column("int", {
|
|
25439
|
+
nullable: true
|
|
25440
|
+
}),
|
|
25441
|
+
_ts_metadata70("design:type", Object)
|
|
25442
|
+
], OrderAssignee.prototype, "vendorId", void 0);
|
|
25443
|
+
_ts_decorate70([
|
|
25444
|
+
Column("int", {
|
|
25445
|
+
default: 1
|
|
25446
|
+
}),
|
|
25447
|
+
_ts_metadata70("design:type", Number)
|
|
25448
|
+
], OrderAssignee.prototype, "sortOrder", void 0);
|
|
25449
|
+
_ts_decorate70([
|
|
25450
|
+
Column({
|
|
25451
|
+
type: "timestamp with time zone",
|
|
25452
|
+
default: /* @__PURE__ */ __name(() => "CURRENT_TIMESTAMP", "default")
|
|
25453
|
+
}),
|
|
25454
|
+
_ts_metadata70("design:type", typeof Date === "undefined" ? Object : Date)
|
|
25455
|
+
], OrderAssignee.prototype, "assignedAt", void 0);
|
|
25456
|
+
_ts_decorate70([
|
|
25457
|
+
CreateDateColumn({
|
|
25458
|
+
type: "timestamp with time zone"
|
|
25459
|
+
}),
|
|
25460
|
+
_ts_metadata70("design:type", typeof Date === "undefined" ? Object : Date)
|
|
25461
|
+
], OrderAssignee.prototype, "createdAt", void 0);
|
|
25462
|
+
_ts_decorate70([
|
|
25463
|
+
ManyToOne(() => Order, {
|
|
25464
|
+
onDelete: "CASCADE"
|
|
25465
|
+
}),
|
|
25466
|
+
JoinColumn({
|
|
25467
|
+
name: "orderId"
|
|
25468
|
+
}),
|
|
25469
|
+
_ts_metadata70("design:type", typeof Order === "undefined" ? Object : Order)
|
|
25470
|
+
], OrderAssignee.prototype, "order", void 0);
|
|
25471
|
+
_ts_decorate70([
|
|
25472
|
+
ManyToOne(() => User, {
|
|
25473
|
+
onDelete: "CASCADE"
|
|
25474
|
+
}),
|
|
25475
|
+
JoinColumn({
|
|
25476
|
+
name: "userId"
|
|
25477
|
+
}),
|
|
25478
|
+
_ts_metadata70("design:type", typeof User === "undefined" ? Object : User)
|
|
25479
|
+
], OrderAssignee.prototype, "user", void 0);
|
|
25480
|
+
_ts_decorate70([
|
|
25481
|
+
ManyToOne(() => Vendor, {
|
|
25482
|
+
nullable: true,
|
|
25483
|
+
onDelete: "SET NULL"
|
|
25484
|
+
}),
|
|
25485
|
+
JoinColumn({
|
|
25486
|
+
name: "vendorId"
|
|
25487
|
+
}),
|
|
25488
|
+
_ts_metadata70("design:type", Object)
|
|
25489
|
+
], OrderAssignee.prototype, "vendor", void 0);
|
|
25490
|
+
OrderAssignee = _ts_decorate70([
|
|
25491
|
+
Entity("order_assignees"),
|
|
25492
|
+
Index("idx_order_assignees_order", [
|
|
25493
|
+
"orderId"
|
|
25494
|
+
]),
|
|
25495
|
+
Index("idx_order_assignees_user", [
|
|
25496
|
+
"userId"
|
|
25497
|
+
]),
|
|
25498
|
+
Index("idx_order_assignees_vendor", [
|
|
25499
|
+
"vendorId"
|
|
25500
|
+
])
|
|
25501
|
+
], OrderAssignee);
|
|
25138
25502
|
|
|
25139
25503
|
// src/entities/index.ts
|
|
25140
25504
|
var CMS_ENTITY_MAP = {
|
|
@@ -25206,7 +25570,8 @@ var CMS_ENTITY_MAP = {
|
|
|
25206
25570
|
attendees: Attendee,
|
|
25207
25571
|
order_notification_bindings: OrderNotificationBinding,
|
|
25208
25572
|
order_notification_triggers: OrderNotificationTrigger,
|
|
25209
|
-
user_device_tokens: UserDeviceToken
|
|
25573
|
+
user_device_tokens: UserDeviceToken,
|
|
25574
|
+
order_assignees: OrderAssignee
|
|
25210
25575
|
};
|
|
25211
25576
|
|
|
25212
25577
|
// src/plugins/blog-generator/blog-generator-agent-defaults.ts
|
|
@@ -28314,7 +28679,7 @@ function slugify2(input) {
|
|
|
28314
28679
|
return input.toLowerCase().trim().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 64) || "template";
|
|
28315
28680
|
}
|
|
28316
28681
|
__name(slugify2, "slugify");
|
|
28317
|
-
function
|
|
28682
|
+
function createTextMessageTemplatesHandlers(config, channel) {
|
|
28318
28683
|
const { dataSource, entityMap, json, requireAuth, requireEntityPermission } = config;
|
|
28319
28684
|
const templateRepo = /* @__PURE__ */ __name(() => dataSource.getRepository(entityMap.message_templates), "templateRepo");
|
|
28320
28685
|
async function requireRead(req, entity) {
|
|
@@ -28337,6 +28702,10 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28337
28702
|
return null;
|
|
28338
28703
|
}
|
|
28339
28704
|
__name(requireUpdate, "requireUpdate");
|
|
28705
|
+
function isLegacyPushTemplate(row) {
|
|
28706
|
+
return row.channel === "email" && typeof row.name === "string" && row.name.includes("_push_");
|
|
28707
|
+
}
|
|
28708
|
+
__name(isLegacyPushTemplate, "isLegacyPushTemplate");
|
|
28340
28709
|
return {
|
|
28341
28710
|
async listCached(req) {
|
|
28342
28711
|
const err = await requireRead(req, "settings");
|
|
@@ -28344,15 +28713,19 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28344
28713
|
try {
|
|
28345
28714
|
const rows = await templateRepo().find({
|
|
28346
28715
|
where: {
|
|
28347
|
-
channel: "email",
|
|
28348
28716
|
deleted: false
|
|
28349
28717
|
},
|
|
28350
28718
|
order: {
|
|
28351
28719
|
name: "ASC"
|
|
28352
28720
|
}
|
|
28353
28721
|
});
|
|
28722
|
+
const items = rows.filter((row) => {
|
|
28723
|
+
const r = row;
|
|
28724
|
+
if (channel === "email") return r.channel === "email" && !isLegacyPushTemplate(r);
|
|
28725
|
+
return r.channel === "mobile" || isLegacyPushTemplate(r);
|
|
28726
|
+
});
|
|
28354
28727
|
return json({
|
|
28355
|
-
items
|
|
28728
|
+
items
|
|
28356
28729
|
});
|
|
28357
28730
|
} catch {
|
|
28358
28731
|
return json({
|
|
@@ -28393,7 +28766,7 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28393
28766
|
let suffix = 1;
|
|
28394
28767
|
while (await templateRepo().findOne({
|
|
28395
28768
|
where: {
|
|
28396
|
-
channel
|
|
28769
|
+
channel,
|
|
28397
28770
|
templateKey,
|
|
28398
28771
|
deleted: false
|
|
28399
28772
|
}
|
|
@@ -28402,7 +28775,7 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28402
28775
|
templateKey = `${baseKey}_${suffix}`;
|
|
28403
28776
|
}
|
|
28404
28777
|
const row = await templateRepo().save(templateRepo().create({
|
|
28405
|
-
channel
|
|
28778
|
+
channel,
|
|
28406
28779
|
templateKey,
|
|
28407
28780
|
name,
|
|
28408
28781
|
subject,
|
|
@@ -28440,7 +28813,6 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28440
28813
|
const existing = await templateRepo().findOne({
|
|
28441
28814
|
where: {
|
|
28442
28815
|
id: numId,
|
|
28443
|
-
channel: "email",
|
|
28444
28816
|
deleted: false
|
|
28445
28817
|
}
|
|
28446
28818
|
});
|
|
@@ -28449,9 +28821,25 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28449
28821
|
}, {
|
|
28450
28822
|
status: 404
|
|
28451
28823
|
});
|
|
28824
|
+
const row = existing;
|
|
28825
|
+
if (channel === "email" && row.channel !== "email") {
|
|
28826
|
+
return json({
|
|
28827
|
+
error: "Template not found"
|
|
28828
|
+
}, {
|
|
28829
|
+
status: 404
|
|
28830
|
+
});
|
|
28831
|
+
}
|
|
28832
|
+
if (channel === "mobile" && row.channel !== "mobile" && !isLegacyPushTemplate(row)) {
|
|
28833
|
+
return json({
|
|
28834
|
+
error: "Template not found"
|
|
28835
|
+
}, {
|
|
28836
|
+
status: 404
|
|
28837
|
+
});
|
|
28838
|
+
}
|
|
28452
28839
|
const patch = {
|
|
28453
28840
|
updatedAt: /* @__PURE__ */ new Date()
|
|
28454
28841
|
};
|
|
28842
|
+
if (channel === "mobile") patch.channel = "mobile";
|
|
28455
28843
|
if (typeof body.name === "string" && body.name.trim()) patch.name = body.name.trim();
|
|
28456
28844
|
if (typeof body.subject === "string") patch.subject = body.subject;
|
|
28457
28845
|
if (typeof body.body === "string") {
|
|
@@ -28474,7 +28862,15 @@ function createEmailMessageTemplatesHandlers(config) {
|
|
|
28474
28862
|
}
|
|
28475
28863
|
};
|
|
28476
28864
|
}
|
|
28865
|
+
__name(createTextMessageTemplatesHandlers, "createTextMessageTemplatesHandlers");
|
|
28866
|
+
function createEmailMessageTemplatesHandlers(config) {
|
|
28867
|
+
return createTextMessageTemplatesHandlers(config, "email");
|
|
28868
|
+
}
|
|
28477
28869
|
__name(createEmailMessageTemplatesHandlers, "createEmailMessageTemplatesHandlers");
|
|
28870
|
+
function createMobileMessageTemplatesHandlers(config) {
|
|
28871
|
+
return createTextMessageTemplatesHandlers(config, "mobile");
|
|
28872
|
+
}
|
|
28873
|
+
__name(createMobileMessageTemplatesHandlers, "createMobileMessageTemplatesHandlers");
|
|
28478
28874
|
function connectionFromUrl(redisUrl) {
|
|
28479
28875
|
const u = new URL(redisUrl);
|
|
28480
28876
|
return {
|
|
@@ -29234,6 +29630,13 @@ function createCmsApiHandler(config) {
|
|
|
29234
29630
|
requireAuth: config.requireAuth,
|
|
29235
29631
|
requireEntityPermission: requireEntityPermissionEffective
|
|
29236
29632
|
});
|
|
29633
|
+
const mobileMessageTemplatesHandlers = createMobileMessageTemplatesHandlers({
|
|
29634
|
+
dataSource,
|
|
29635
|
+
entityMap,
|
|
29636
|
+
json: config.json,
|
|
29637
|
+
requireAuth: config.requireAuth,
|
|
29638
|
+
requireEntityPermission: requireEntityPermissionEffective
|
|
29639
|
+
});
|
|
29237
29640
|
const deviceTokensHandlers = createDeviceTokensHandlers({
|
|
29238
29641
|
dataSource,
|
|
29239
29642
|
entityMap,
|
|
@@ -30268,9 +30671,16 @@ function createCmsApiHandler(config) {
|
|
|
30268
30671
|
if (m === "GET") return emailMessageTemplatesHandlers.listCached(req);
|
|
30269
30672
|
if (m === "POST") return emailMessageTemplatesHandlers.create(req);
|
|
30270
30673
|
}
|
|
30271
|
-
if (isMsgTemplatesRoute &&
|
|
30674
|
+
if (isMsgTemplatesRoute && path2[1] === "mobile" && path2.length === 2) {
|
|
30675
|
+
if (m === "GET") return mobileMessageTemplatesHandlers.listCached(req);
|
|
30676
|
+
if (m === "POST") return mobileMessageTemplatesHandlers.create(req);
|
|
30677
|
+
}
|
|
30678
|
+
if (isMsgTemplatesRoute && (path2[1] === "email" || path2.length === 2) && path2.length === 3 && path2[1] !== "mobile") {
|
|
30272
30679
|
if (m === "PATCH") return emailMessageTemplatesHandlers.update(req, path2[2]);
|
|
30273
30680
|
}
|
|
30681
|
+
if (isMsgTemplatesRoute && path2[1] === "mobile" && path2.length === 3) {
|
|
30682
|
+
if (m === "PATCH") return mobileMessageTemplatesHandlers.update(req, path2[2]);
|
|
30683
|
+
}
|
|
30274
30684
|
if (path2[0] === "llm_agents") {
|
|
30275
30685
|
if (!entityMap.llm_agents) {
|
|
30276
30686
|
console.error(CMS_API_LOG, "llm_agents route: entity missing after merge", {
|
|
@@ -30713,7 +31123,7 @@ function createCmsApiHandler(config) {
|
|
|
30713
31123
|
status: 400
|
|
30714
31124
|
});
|
|
30715
31125
|
}
|
|
30716
|
-
const { resendOrderNotification } = await import('./order-notification-dispatcher-
|
|
31126
|
+
const { resendOrderNotification } = await import('./order-notification-dispatcher-ECPFI7CD.js');
|
|
30717
31127
|
const result = await resendOrderNotification(triggerKey, orderId, {
|
|
30718
31128
|
dataSource,
|
|
30719
31129
|
entityMap,
|
|
@@ -30812,7 +31222,7 @@ function createCmsApiHandler(config) {
|
|
|
30812
31222
|
status: "cancelled"
|
|
30813
31223
|
});
|
|
30814
31224
|
const fireOrderCancelledNotification = /* @__PURE__ */ __name((refundAmount) => {
|
|
30815
|
-
void import('./emit-order-notification-trigger-
|
|
31225
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
30816
31226
|
fireOrderNotificationTrigger("order_cancelled", orderId, {
|
|
30817
31227
|
dataSource,
|
|
30818
31228
|
entityMap
|
|
@@ -31057,8 +31467,8 @@ function createCmsApiHandler(config) {
|
|
|
31057
31467
|
}, {
|
|
31058
31468
|
status: 400
|
|
31059
31469
|
});
|
|
31060
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31061
|
-
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms);
|
|
31470
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-HFGCPC4O.js');
|
|
31471
|
+
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms, getHydratedSessionUser);
|
|
31062
31472
|
return handlers.getChannels(req, orderId);
|
|
31063
31473
|
}
|
|
31064
31474
|
if (path2[0] === "orders" && path2.length === 4 && path2[2] === "completion-otp" && path2[3] === "send" && m === "POST" && getCms) {
|
|
@@ -31072,8 +31482,8 @@ function createCmsApiHandler(config) {
|
|
|
31072
31482
|
}, {
|
|
31073
31483
|
status: 400
|
|
31074
31484
|
});
|
|
31075
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31076
|
-
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms);
|
|
31485
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-HFGCPC4O.js');
|
|
31486
|
+
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms, getHydratedSessionUser);
|
|
31077
31487
|
return handlers.sendOtp(req, orderId);
|
|
31078
31488
|
}
|
|
31079
31489
|
if (path2[0] === "orders" && path2.length === 4 && path2[2] === "completion-otp" && path2[3] === "verify" && m === "POST" && getCms) {
|
|
@@ -31087,8 +31497,8 @@ function createCmsApiHandler(config) {
|
|
|
31087
31497
|
}, {
|
|
31088
31498
|
status: 400
|
|
31089
31499
|
});
|
|
31090
|
-
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-
|
|
31091
|
-
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms);
|
|
31500
|
+
const { createOrderCompletionOtpHandlers } = await import('./order-completion-otp-handlers-HFGCPC4O.js');
|
|
31501
|
+
const handlers = createOrderCompletionOtpHandlers(dataSource, entityMap, getCms, getHydratedSessionUser);
|
|
31092
31502
|
return handlers.verifyOtp(req, orderId);
|
|
31093
31503
|
}
|
|
31094
31504
|
if (path2[0] === "orders" && path2.length === 3 && path2[2] === "eligible-assignees" && m === "GET") {
|
|
@@ -31102,7 +31512,7 @@ function createCmsApiHandler(config) {
|
|
|
31102
31512
|
}, {
|
|
31103
31513
|
status: 400
|
|
31104
31514
|
});
|
|
31105
|
-
const { createOrderAssigneesHandlers } = await import('./order-assignees-handlers-
|
|
31515
|
+
const { createOrderAssigneesHandlers } = await import('./order-assignees-handlers-L3RVKUBS.js');
|
|
31106
31516
|
const handlers = createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionUser);
|
|
31107
31517
|
return handlers.listEligibleAssignees(req, orderId);
|
|
31108
31518
|
}
|
|
@@ -31718,32 +32128,17 @@ function createStorefrontApiHandler(config) {
|
|
|
31718
32128
|
const otpFlags = config.otpFlags;
|
|
31719
32129
|
const otpPepper = config.otpPepper;
|
|
31720
32130
|
const defaultPhoneCc = config.defaultPhoneCountryCode;
|
|
31721
|
-
function
|
|
31722
|
-
void import('./emit-order-notification-trigger-
|
|
31723
|
-
fireOrderNotificationTrigger("
|
|
32131
|
+
function fireStorefrontCheckoutNotifications(orderId) {
|
|
32132
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
32133
|
+
fireOrderNotificationTrigger("order_pending", orderId, {
|
|
31724
32134
|
dataSource,
|
|
31725
32135
|
entityMap
|
|
31726
32136
|
}, {
|
|
31727
32137
|
source: "storefront"
|
|
31728
32138
|
});
|
|
31729
|
-
if (isPaid) {
|
|
31730
|
-
fireOrderNotificationTrigger("payment_success", orderId, {
|
|
31731
|
-
dataSource,
|
|
31732
|
-
entityMap
|
|
31733
|
-
}, {
|
|
31734
|
-
source: "storefront"
|
|
31735
|
-
});
|
|
31736
|
-
} else {
|
|
31737
|
-
fireOrderNotificationTrigger("payment_failed", orderId, {
|
|
31738
|
-
dataSource,
|
|
31739
|
-
entityMap
|
|
31740
|
-
}, {
|
|
31741
|
-
source: "storefront"
|
|
31742
|
-
});
|
|
31743
|
-
}
|
|
31744
32139
|
}).catch((err) => console.error("[notification-triggers] import failed", err));
|
|
31745
32140
|
}
|
|
31746
|
-
__name(
|
|
32141
|
+
__name(fireStorefrontCheckoutNotifications, "fireStorefrontCheckoutNotifications");
|
|
31747
32142
|
const otpAllowPhoneLogin = config.otpAllowPhoneLogin !== false;
|
|
31748
32143
|
function otpOff(key) {
|
|
31749
32144
|
return !otpFlags || otpFlags[key] !== true;
|
|
@@ -34240,6 +34635,7 @@ function createStorefrontApiHandler(config) {
|
|
|
34240
34635
|
}));
|
|
34241
34636
|
}
|
|
34242
34637
|
await linkOrderContactToVendors(contactId, vendorRes.vendorIds);
|
|
34638
|
+
fireStorefrontCheckoutNotifications(oid);
|
|
34243
34639
|
return json({
|
|
34244
34640
|
orderId: oid,
|
|
34245
34641
|
orderNumber: ord.orderNumber,
|
|
@@ -34320,6 +34716,7 @@ function createStorefrontApiHandler(config) {
|
|
|
34320
34716
|
cartId: cart.id
|
|
34321
34717
|
});
|
|
34322
34718
|
await cartRepo().delete(cart.id);
|
|
34719
|
+
fireStorefrontCheckoutNotifications(oid);
|
|
34323
34720
|
return json({
|
|
34324
34721
|
orderId: oid,
|
|
34325
34722
|
orderNumber: ord.orderNumber,
|
|
@@ -34662,7 +35059,7 @@ function createStorefrontApiHandler(config) {
|
|
|
34662
35059
|
} catch {
|
|
34663
35060
|
}
|
|
34664
35061
|
try {
|
|
34665
|
-
void import('./emit-order-notification-trigger-
|
|
35062
|
+
void import('./emit-order-notification-trigger-EJJZ6XTS.js').then(({ fireOrderNotificationTrigger }) => {
|
|
34666
35063
|
fireOrderNotificationTrigger("order_cancelled", orderId, {
|
|
34667
35064
|
dataSource,
|
|
34668
35065
|
entityMap
|
|
@@ -34703,4 +35100,4 @@ function createStorefrontApiHandler(config) {
|
|
|
34703
35100
|
}
|
|
34704
35101
|
__name(createStorefrontApiHandler, "createStorefrontApiHandler");
|
|
34705
35102
|
|
|
34706
|
-
export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, LlmAgentKnowledgeDocument, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserDeviceToken, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, whatsappPlugin, wrapGetCmsWithMessaging };
|
|
35103
|
+
export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, LlmAgentKnowledgeDocument, Media, MessageTemplate, Order, OrderAddresses, OrderAssignee, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserDeviceToken, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, whatsappPlugin, wrapGetCmsWithMessaging };
|