@infuro/cms-core 1.0.36 → 1.0.38
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 +459 -496
- package/dist/admin.js +459 -496
- package/dist/api.cjs +36 -36
- package/dist/api.js +4 -4
- package/dist/auth.cjs +51 -51
- package/dist/auth.js +3 -3
- package/dist/{chunk-COBORIJH.cjs → chunk-22FFHLTO.cjs} +39 -56
- package/dist/{chunk-X6H5VBQ2.cjs → chunk-E6WVP7BK.cjs} +6 -6
- package/dist/{chunk-VMY2S32H.js → chunk-NNQBWDCI.js} +39 -56
- package/dist/{chunk-WO2DW4AU.cjs → chunk-OIGCAGH7.cjs} +7 -7
- package/dist/{chunk-UF3BYUXY.js → chunk-P7QCLE5W.js} +4 -3
- package/dist/{chunk-JS2W7XZ4.js → chunk-PYUXVU75.js} +243 -23
- package/dist/{chunk-FG6I64HP.js → chunk-SBRBR3VO.js} +1 -1
- package/dist/{chunk-LI2IXVAY.js → chunk-UXMDSNIG.js} +1 -1
- package/dist/{chunk-2AEVFOQP.cjs → chunk-VJDUKAJ3.cjs} +310 -90
- package/dist/{chunk-KPKFNLQQ.cjs → chunk-WMXPKKXU.cjs} +4 -3
- package/dist/index.cjs +260 -260
- package/dist/index.d.cts +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +8 -8
- package/dist/migrations/1775500000000-RssFeedsAndArticles.ts +0 -1
- package/dist/migrations/1775700000000-JobSchedules.ts +0 -1
- package/dist/migrations/1781260000000-RenameWhatsappTriggerBindingsToOrderNotificationBindings.ts +92 -0
- package/dist/migrations/1781270000000-ComboVendorId.ts +58 -0
- package/dist/{whatsapp-trigger-dispatcher-ONHXI7UY.cjs → order-notification-dispatcher-RU7BTGGX.cjs} +3 -4
- package/dist/{whatsapp-trigger-dispatcher-PWFI4FKP.js → order-notification-dispatcher-XWIJYDGA.js} +1 -2
- package/dist/{rbac-debug-db-HWP65A4O.cjs → rbac-debug-db-KHG4FJC3.cjs} +2 -2
- package/dist/{rbac-debug-db-QJH3AD34.js → rbac-debug-db-QWHOENBR.js} +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { resolveChatEmailToolSettings, CHAT_EMAIL_LOG, detectChatLeadIntent, parseIntentRecipientEmails, mergeEmailLayoutCompanyDetails, sendChatLeadEmail, buildTranscriptForLeadEmail, buildChatbotSystemPromptWithEmailTool, parseEmailRecipientsFromConfig, isWhatsAppPluginEnabled, mergeWhatsAppConfigLayers, whatsAppConfigured, WhatsAppService, registerWhatsAppQueueProcessor, emailPlugin, initWhatsappTriggerDispatcher } from './chunk-
|
|
1
|
+
import { resolveChatEmailToolSettings, CHAT_EMAIL_LOG, detectChatLeadIntent, parseIntentRecipientEmails, mergeEmailLayoutCompanyDetails, sendChatLeadEmail, buildTranscriptForLeadEmail, buildChatbotSystemPromptWithEmailTool, parseEmailRecipientsFromConfig, isWhatsAppPluginEnabled, mergeWhatsAppConfigLayers, whatsAppConfigured, WhatsAppService, registerWhatsAppQueueProcessor, emailPlugin, initWhatsappTriggerDispatcher } from './chunk-NNQBWDCI.js';
|
|
2
2
|
import { inviteStatusForActivation } from './chunk-JXF23MPG.js';
|
|
3
3
|
import { unwrapErpReadData, mapErpPayloadToFulfillment, extractChildOrderRefsFromSalePayload, mapErpPayloadToInvoiceNumber, streamOrderInvoicePdf } from './chunk-WEMDMVHQ.js';
|
|
4
4
|
import { queueEmail, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-5ELSW2UP.js';
|
|
5
5
|
import { getSmsTemplateDefault, SMS_MESSAGE_TEMPLATE_DEFAULTS } from './chunk-MQBT33IV.js';
|
|
6
6
|
import { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES } from './chunk-KFFB6EMZ.js';
|
|
7
7
|
import { JOB_RUNNER_QUEUE } from './chunk-GO7PPYNU.js';
|
|
8
|
-
import { canManageRoles, sessionHasEntityAccess } from './chunk-
|
|
9
|
-
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_OWNER_GROUP_NAME, resolveVendorScopeFromSessionUser, canManageVendorRoles, isPlatformAdministrator, canManageVendorTeam, resolveDisabledMultiVendorScope, logEntityAccessDecision, explainSessionEntityAccess } from './chunk-
|
|
8
|
+
import { canManageRoles, sessionHasEntityAccess } from './chunk-UXMDSNIG.js';
|
|
9
|
+
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_OWNER_GROUP_NAME, resolveVendorScopeFromSessionUser, canManageVendorRoles, isPlatformAdministrator, canManageVendorTeam, resolveDisabledMultiVendorScope, logEntityAccessDecision, explainSessionEntityAccess } from './chunk-P7QCLE5W.js';
|
|
10
10
|
import { queueErp } from './chunk-SYBOCAWB.js';
|
|
11
11
|
import { isErpIntegrationEnabled } from './chunk-JC6DLWTE.js';
|
|
12
12
|
import { __name } from './chunk-SHUYVCID.js';
|
|
@@ -2607,10 +2607,11 @@ async function calculateOrderTotalsFromLines(dataSource, entityMap, lineInputs,
|
|
|
2607
2607
|
}
|
|
2608
2608
|
});
|
|
2609
2609
|
if (combo) {
|
|
2610
|
-
const
|
|
2610
|
+
const comboVendorId = Number(combo.vendorId);
|
|
2611
|
+
const comboRows = await dataSource.query(`SELECT ci."productId" as "firstProductId"
|
|
2611
2612
|
FROM combo_items ci
|
|
2612
2613
|
JOIN products p ON p.id = ci."productId"
|
|
2613
|
-
WHERE ci."comboId" = $1 AND p.deleted = false
|
|
2614
|
+
WHERE ci."comboId" = $1 AND p.deleted = false
|
|
2614
2615
|
LIMIT 1`, [
|
|
2615
2616
|
productId
|
|
2616
2617
|
]);
|
|
@@ -2627,7 +2628,8 @@ async function calculateOrderTotalsFromLines(dataSource, entityMap, lineInputs,
|
|
|
2627
2628
|
...childProduct,
|
|
2628
2629
|
id: productId,
|
|
2629
2630
|
price: combo.price,
|
|
2630
|
-
name: combo.name
|
|
2631
|
+
name: combo.name,
|
|
2632
|
+
vendorId: Number.isFinite(comboVendorId) && comboVendorId > 0 ? comboVendorId : childProduct.vendorId
|
|
2631
2633
|
};
|
|
2632
2634
|
}
|
|
2633
2635
|
}
|
|
@@ -5183,6 +5185,7 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
5183
5185
|
});
|
|
5184
5186
|
}
|
|
5185
5187
|
if (resource === "combos") {
|
|
5188
|
+
const scope2 = await resolveScopeById();
|
|
5186
5189
|
const combo = await repo.findOne({
|
|
5187
5190
|
where: {
|
|
5188
5191
|
id: Number(id),
|
|
@@ -5193,6 +5196,8 @@ function createCrudByIdHandler(dataSource, entityMap, options) {
|
|
|
5193
5196
|
"items.product"
|
|
5194
5197
|
]
|
|
5195
5198
|
});
|
|
5199
|
+
const comboDenied = vendorScopeAccessJson(combo, scope2, resource);
|
|
5200
|
+
if (comboDenied) return comboDenied;
|
|
5196
5201
|
return combo ? json(combo) : json({
|
|
5197
5202
|
message: "Not found"
|
|
5198
5203
|
}, {
|
|
@@ -20845,6 +20850,8 @@ var Combo = class {
|
|
|
20845
20850
|
__name(this, "Combo");
|
|
20846
20851
|
}
|
|
20847
20852
|
id;
|
|
20853
|
+
vendorId;
|
|
20854
|
+
vendor;
|
|
20848
20855
|
name;
|
|
20849
20856
|
desc;
|
|
20850
20857
|
eventId;
|
|
@@ -20870,6 +20877,19 @@ _ts_decorate63([
|
|
|
20870
20877
|
PrimaryGeneratedColumn(),
|
|
20871
20878
|
_ts_metadata63("design:type", Number)
|
|
20872
20879
|
], Combo.prototype, "id", void 0);
|
|
20880
|
+
_ts_decorate63([
|
|
20881
|
+
Column("int"),
|
|
20882
|
+
_ts_metadata63("design:type", Number)
|
|
20883
|
+
], Combo.prototype, "vendorId", void 0);
|
|
20884
|
+
_ts_decorate63([
|
|
20885
|
+
ManyToOne(() => Vendor, {
|
|
20886
|
+
onDelete: "RESTRICT"
|
|
20887
|
+
}),
|
|
20888
|
+
JoinColumn({
|
|
20889
|
+
name: "vendorId"
|
|
20890
|
+
}),
|
|
20891
|
+
_ts_metadata63("design:type", typeof Vendor === "undefined" ? Object : Vendor)
|
|
20892
|
+
], Combo.prototype, "vendor", void 0);
|
|
20873
20893
|
_ts_decorate63([
|
|
20874
20894
|
Column({
|
|
20875
20895
|
type: "varchar"
|
|
@@ -21214,12 +21234,18 @@ function _ts_metadata66(k, v) {
|
|
|
21214
21234
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
21215
21235
|
}
|
|
21216
21236
|
__name(_ts_metadata66, "_ts_metadata");
|
|
21217
|
-
var
|
|
21237
|
+
var NotificationChannel = /* @__PURE__ */ (function(NotificationChannel2) {
|
|
21238
|
+
NotificationChannel2["WHATSAPP"] = "whatsapp";
|
|
21239
|
+
NotificationChannel2["EMAIL"] = "email";
|
|
21240
|
+
return NotificationChannel2;
|
|
21241
|
+
})({});
|
|
21242
|
+
var OrderNotificationBinding = class {
|
|
21218
21243
|
static {
|
|
21219
|
-
__name(this, "
|
|
21244
|
+
__name(this, "OrderNotificationBinding");
|
|
21220
21245
|
}
|
|
21221
21246
|
id;
|
|
21222
21247
|
triggerKey;
|
|
21248
|
+
channel;
|
|
21223
21249
|
messageTemplateId;
|
|
21224
21250
|
enabled;
|
|
21225
21251
|
createdAt;
|
|
@@ -21228,39 +21254,52 @@ var WhatsappTriggerBinding = class {
|
|
|
21228
21254
|
_ts_decorate66([
|
|
21229
21255
|
PrimaryGeneratedColumn(),
|
|
21230
21256
|
_ts_metadata66("design:type", Number)
|
|
21231
|
-
],
|
|
21257
|
+
], OrderNotificationBinding.prototype, "id", void 0);
|
|
21232
21258
|
_ts_decorate66([
|
|
21233
21259
|
Column({
|
|
21234
|
-
type: "varchar"
|
|
21235
|
-
unique: true
|
|
21260
|
+
type: "varchar"
|
|
21236
21261
|
}),
|
|
21237
21262
|
_ts_metadata66("design:type", String)
|
|
21238
|
-
],
|
|
21263
|
+
], OrderNotificationBinding.prototype, "triggerKey", void 0);
|
|
21264
|
+
_ts_decorate66([
|
|
21265
|
+
Column({
|
|
21266
|
+
type: "enum",
|
|
21267
|
+
enum: NotificationChannel,
|
|
21268
|
+
default: "whatsapp"
|
|
21269
|
+
}),
|
|
21270
|
+
_ts_metadata66("design:type", String)
|
|
21271
|
+
], OrderNotificationBinding.prototype, "channel", void 0);
|
|
21239
21272
|
_ts_decorate66([
|
|
21240
21273
|
Column({
|
|
21241
21274
|
type: "int",
|
|
21242
21275
|
nullable: true
|
|
21243
21276
|
}),
|
|
21244
21277
|
_ts_metadata66("design:type", Object)
|
|
21245
|
-
],
|
|
21278
|
+
], OrderNotificationBinding.prototype, "messageTemplateId", void 0);
|
|
21246
21279
|
_ts_decorate66([
|
|
21247
21280
|
Column({
|
|
21248
21281
|
type: "boolean",
|
|
21249
21282
|
default: true
|
|
21250
21283
|
}),
|
|
21251
21284
|
_ts_metadata66("design:type", Boolean)
|
|
21252
|
-
],
|
|
21285
|
+
], OrderNotificationBinding.prototype, "enabled", void 0);
|
|
21253
21286
|
_ts_decorate66([
|
|
21254
21287
|
CreateDateColumn(),
|
|
21255
21288
|
_ts_metadata66("design:type", typeof Date === "undefined" ? Object : Date)
|
|
21256
|
-
],
|
|
21289
|
+
], OrderNotificationBinding.prototype, "createdAt", void 0);
|
|
21257
21290
|
_ts_decorate66([
|
|
21258
21291
|
UpdateDateColumn(),
|
|
21259
21292
|
_ts_metadata66("design:type", typeof Date === "undefined" ? Object : Date)
|
|
21260
|
-
],
|
|
21261
|
-
|
|
21262
|
-
Entity("
|
|
21263
|
-
|
|
21293
|
+
], OrderNotificationBinding.prototype, "updatedAt", void 0);
|
|
21294
|
+
OrderNotificationBinding = _ts_decorate66([
|
|
21295
|
+
Entity("order_notification_bindings"),
|
|
21296
|
+
Index([
|
|
21297
|
+
"triggerKey",
|
|
21298
|
+
"channel"
|
|
21299
|
+
], {
|
|
21300
|
+
unique: true
|
|
21301
|
+
})
|
|
21302
|
+
], OrderNotificationBinding);
|
|
21264
21303
|
function _ts_decorate67(decorators, target, key, desc) {
|
|
21265
21304
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
21266
21305
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -21410,7 +21449,7 @@ var CMS_ENTITY_MAP = {
|
|
|
21410
21449
|
refund_policies: RefundPolicy,
|
|
21411
21450
|
refund_requests: RefundRequest,
|
|
21412
21451
|
attendees: Attendee,
|
|
21413
|
-
|
|
21452
|
+
order_notification_bindings: OrderNotificationBinding,
|
|
21414
21453
|
order_notification_triggers: OrderNotificationTrigger
|
|
21415
21454
|
};
|
|
21416
21455
|
|
|
@@ -24513,6 +24552,173 @@ function createWhatsappMessageTemplatesHandlers(config) {
|
|
|
24513
24552
|
};
|
|
24514
24553
|
}
|
|
24515
24554
|
__name(createWhatsappMessageTemplatesHandlers, "createWhatsappMessageTemplatesHandlers");
|
|
24555
|
+
|
|
24556
|
+
// src/api/email-message-templates-handlers.ts
|
|
24557
|
+
function slugify2(input) {
|
|
24558
|
+
return input.toLowerCase().trim().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 64) || "template";
|
|
24559
|
+
}
|
|
24560
|
+
__name(slugify2, "slugify");
|
|
24561
|
+
function createEmailMessageTemplatesHandlers(config) {
|
|
24562
|
+
const { dataSource, entityMap, json, requireAuth, requireEntityPermission } = config;
|
|
24563
|
+
const templateRepo = /* @__PURE__ */ __name(() => dataSource.getRepository(entityMap.message_templates), "templateRepo");
|
|
24564
|
+
async function requireRead(req, entity) {
|
|
24565
|
+
const a = await requireAuth(req);
|
|
24566
|
+
if (a) return a;
|
|
24567
|
+
if (requireEntityPermission) {
|
|
24568
|
+
const pe = await requireEntityPermission(req, entity, "read");
|
|
24569
|
+
if (pe) return pe;
|
|
24570
|
+
}
|
|
24571
|
+
return null;
|
|
24572
|
+
}
|
|
24573
|
+
__name(requireRead, "requireRead");
|
|
24574
|
+
async function requireUpdate(req, entity) {
|
|
24575
|
+
const a = await requireAuth(req);
|
|
24576
|
+
if (a) return a;
|
|
24577
|
+
if (requireEntityPermission) {
|
|
24578
|
+
const pe = await requireEntityPermission(req, entity, "update");
|
|
24579
|
+
if (pe) return pe;
|
|
24580
|
+
}
|
|
24581
|
+
return null;
|
|
24582
|
+
}
|
|
24583
|
+
__name(requireUpdate, "requireUpdate");
|
|
24584
|
+
return {
|
|
24585
|
+
async listCached(req) {
|
|
24586
|
+
const err = await requireRead(req, "settings");
|
|
24587
|
+
if (err) return err;
|
|
24588
|
+
try {
|
|
24589
|
+
const rows = await templateRepo().find({
|
|
24590
|
+
where: {
|
|
24591
|
+
channel: "email",
|
|
24592
|
+
deleted: false
|
|
24593
|
+
},
|
|
24594
|
+
order: {
|
|
24595
|
+
name: "ASC"
|
|
24596
|
+
}
|
|
24597
|
+
});
|
|
24598
|
+
return json({
|
|
24599
|
+
items: rows
|
|
24600
|
+
});
|
|
24601
|
+
} catch {
|
|
24602
|
+
return json({
|
|
24603
|
+
error: "Failed to load templates"
|
|
24604
|
+
}, {
|
|
24605
|
+
status: 500
|
|
24606
|
+
});
|
|
24607
|
+
}
|
|
24608
|
+
},
|
|
24609
|
+
async create(req) {
|
|
24610
|
+
const err = await requireUpdate(req, "settings");
|
|
24611
|
+
if (err) return err;
|
|
24612
|
+
let body;
|
|
24613
|
+
try {
|
|
24614
|
+
body = await req.json();
|
|
24615
|
+
} catch {
|
|
24616
|
+
return json({
|
|
24617
|
+
error: "Invalid JSON body"
|
|
24618
|
+
}, {
|
|
24619
|
+
status: 400
|
|
24620
|
+
});
|
|
24621
|
+
}
|
|
24622
|
+
const name = typeof body.name === "string" ? body.name.trim() : "";
|
|
24623
|
+
const subject = typeof body.subject === "string" ? body.subject : "";
|
|
24624
|
+
const bodyText = typeof body.body === "string" ? body.body : "";
|
|
24625
|
+
if (!name) return json({
|
|
24626
|
+
error: "name is required"
|
|
24627
|
+
}, {
|
|
24628
|
+
status: 400
|
|
24629
|
+
});
|
|
24630
|
+
if (!bodyText.trim()) return json({
|
|
24631
|
+
error: "body is required"
|
|
24632
|
+
}, {
|
|
24633
|
+
status: 400
|
|
24634
|
+
});
|
|
24635
|
+
const baseKey = slugify2(name);
|
|
24636
|
+
let templateKey = baseKey;
|
|
24637
|
+
let suffix = 1;
|
|
24638
|
+
while (await templateRepo().findOne({
|
|
24639
|
+
where: {
|
|
24640
|
+
channel: "email",
|
|
24641
|
+
templateKey,
|
|
24642
|
+
deleted: false
|
|
24643
|
+
}
|
|
24644
|
+
})) {
|
|
24645
|
+
suffix += 1;
|
|
24646
|
+
templateKey = `${baseKey}_${suffix}`;
|
|
24647
|
+
}
|
|
24648
|
+
const row = await templateRepo().save(templateRepo().create({
|
|
24649
|
+
channel: "email",
|
|
24650
|
+
templateKey,
|
|
24651
|
+
name,
|
|
24652
|
+
subject,
|
|
24653
|
+
body: bodyText,
|
|
24654
|
+
externalTemplateRef: null,
|
|
24655
|
+
providerMeta: null,
|
|
24656
|
+
enabled: true,
|
|
24657
|
+
deleted: false
|
|
24658
|
+
}));
|
|
24659
|
+
return json({
|
|
24660
|
+
item: row
|
|
24661
|
+
}, {
|
|
24662
|
+
status: 201
|
|
24663
|
+
});
|
|
24664
|
+
},
|
|
24665
|
+
async update(req, id) {
|
|
24666
|
+
const err = await requireUpdate(req, "settings");
|
|
24667
|
+
if (err) return err;
|
|
24668
|
+
const numId = Number(id);
|
|
24669
|
+
if (!Number.isFinite(numId)) return json({
|
|
24670
|
+
error: "Invalid id"
|
|
24671
|
+
}, {
|
|
24672
|
+
status: 400
|
|
24673
|
+
});
|
|
24674
|
+
let body;
|
|
24675
|
+
try {
|
|
24676
|
+
body = await req.json();
|
|
24677
|
+
} catch {
|
|
24678
|
+
return json({
|
|
24679
|
+
error: "Invalid JSON body"
|
|
24680
|
+
}, {
|
|
24681
|
+
status: 400
|
|
24682
|
+
});
|
|
24683
|
+
}
|
|
24684
|
+
const existing = await templateRepo().findOne({
|
|
24685
|
+
where: {
|
|
24686
|
+
id: numId,
|
|
24687
|
+
channel: "email",
|
|
24688
|
+
deleted: false
|
|
24689
|
+
}
|
|
24690
|
+
});
|
|
24691
|
+
if (!existing) return json({
|
|
24692
|
+
error: "Template not found"
|
|
24693
|
+
}, {
|
|
24694
|
+
status: 404
|
|
24695
|
+
});
|
|
24696
|
+
const patch = {
|
|
24697
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
24698
|
+
};
|
|
24699
|
+
if (typeof body.name === "string" && body.name.trim()) patch.name = body.name.trim();
|
|
24700
|
+
if (typeof body.subject === "string") patch.subject = body.subject;
|
|
24701
|
+
if (typeof body.body === "string") {
|
|
24702
|
+
if (!body.body.trim()) return json({
|
|
24703
|
+
error: "body cannot be empty"
|
|
24704
|
+
}, {
|
|
24705
|
+
status: 400
|
|
24706
|
+
});
|
|
24707
|
+
patch.body = body.body;
|
|
24708
|
+
}
|
|
24709
|
+
await templateRepo().update(numId, patch);
|
|
24710
|
+
const updated = await templateRepo().findOne({
|
|
24711
|
+
where: {
|
|
24712
|
+
id: numId
|
|
24713
|
+
}
|
|
24714
|
+
});
|
|
24715
|
+
return json({
|
|
24716
|
+
item: updated
|
|
24717
|
+
});
|
|
24718
|
+
}
|
|
24719
|
+
};
|
|
24720
|
+
}
|
|
24721
|
+
__name(createEmailMessageTemplatesHandlers, "createEmailMessageTemplatesHandlers");
|
|
24516
24722
|
function connectionFromUrl(redisUrl) {
|
|
24517
24723
|
const u = new URL(redisUrl);
|
|
24518
24724
|
return {
|
|
@@ -24870,7 +25076,7 @@ function withLlmKnowledgeEntityFallbacks(base) {
|
|
|
24870
25076
|
"rss_feeds",
|
|
24871
25077
|
"rss_articles",
|
|
24872
25078
|
"order_notification_triggers",
|
|
24873
|
-
"
|
|
25079
|
+
"order_notification_bindings",
|
|
24874
25080
|
"message_templates"
|
|
24875
25081
|
];
|
|
24876
25082
|
const patch = {};
|
|
@@ -25228,6 +25434,13 @@ function createCmsApiHandler(config) {
|
|
|
25228
25434
|
requireEntityPermission: requireEntityPermissionEffective,
|
|
25229
25435
|
settingsEncryptionKey: settingsConfig?.encryptionKey
|
|
25230
25436
|
});
|
|
25437
|
+
const emailMessageTemplatesHandlers = createEmailMessageTemplatesHandlers({
|
|
25438
|
+
dataSource,
|
|
25439
|
+
entityMap,
|
|
25440
|
+
json: config.json,
|
|
25441
|
+
requireAuth: config.requireAuth,
|
|
25442
|
+
requireEntityPermission: requireEntityPermissionEffective
|
|
25443
|
+
});
|
|
25231
25444
|
const chatHandlers = chatConfig ? createChatHandlers(chatConfig) : null;
|
|
25232
25445
|
const llmAgentKnowledgeMerged = llmAgentKnowledgeConfig ?? (chatConfig ? {
|
|
25233
25446
|
dataSource: chatConfig.dataSource,
|
|
@@ -26200,6 +26413,13 @@ function createCmsApiHandler(config) {
|
|
|
26200
26413
|
if (path2[0] === "message-templates" && path2[1] === "whatsapp" && path2.length === 3 && path2[2] !== "sync") {
|
|
26201
26414
|
if (m === "PATCH") return whatsappMessageTemplatesHandlers.setParamOrder(req, path2[2]);
|
|
26202
26415
|
}
|
|
26416
|
+
if (path2[0] === "message-templates" && path2[1] === "email" && path2.length === 2) {
|
|
26417
|
+
if (m === "GET") return emailMessageTemplatesHandlers.listCached(req);
|
|
26418
|
+
if (m === "POST") return emailMessageTemplatesHandlers.create(req);
|
|
26419
|
+
}
|
|
26420
|
+
if (path2[0] === "message-templates" && path2[1] === "email" && path2.length === 3) {
|
|
26421
|
+
if (m === "PATCH") return emailMessageTemplatesHandlers.update(req, path2[2]);
|
|
26422
|
+
}
|
|
26203
26423
|
if (path2[0] === "llm_agents") {
|
|
26204
26424
|
if (!entityMap.llm_agents) {
|
|
26205
26425
|
console.error(CMS_API_LOG, "llm_agents route: entity missing after merge", {
|
|
@@ -26614,7 +26834,7 @@ function createCmsApiHandler(config) {
|
|
|
26614
26834
|
status: 400
|
|
26615
26835
|
});
|
|
26616
26836
|
}
|
|
26617
|
-
const { resendOrderNotification } = await import('./
|
|
26837
|
+
const { resendOrderNotification } = await import('./order-notification-dispatcher-XWIJYDGA.js');
|
|
26618
26838
|
const result = await resendOrderNotification(triggerKey, orderId, {
|
|
26619
26839
|
dataSource,
|
|
26620
26840
|
entityMap,
|
|
@@ -30309,4 +30529,4 @@ function createStorefrontApiHandler(config) {
|
|
|
30309
30529
|
}
|
|
30310
30530
|
__name(createStorefrontApiHandler, "createStorefrontApiHandler");
|
|
30311
30531
|
|
|
30312
|
-
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, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser,
|
|
30532
|
+
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, 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, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, calculateOrderRefundPreview, calculateRefundFromPolicy, checkEventsEnabled, checkMultiVendorEnabled, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, describeEventTierPolicy, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, findActiveRefundPolicyForVendor, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRssArticleSummaryFromItem, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, isCustomerTypeContact, isZipMedia, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPermissionableEntityKeys, ADMIN_GROUP_NAME, isSuperAdmin, permissionRowsToRecord, vendorPortalFlagsFromUser } from './chunk-
|
|
1
|
+
import { getPermissionableEntityKeys, ADMIN_GROUP_NAME, isSuperAdmin, permissionRowsToRecord, vendorPortalFlagsFromUser } from './chunk-P7QCLE5W.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { getToken } from 'next-auth/jwt';
|
|
4
4
|
import _CredentialsProvider from 'next-auth/providers/credentials';
|