@infuro/cms-core 1.0.54 → 1.0.55
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 +1 -1
- package/dist/admin.js +1 -1
- package/dist/api.cjs +32 -32
- package/dist/api.js +1 -1
- package/dist/{chunk-CJ2YAVCO.cjs → chunk-JGR4ZUON.cjs} +63 -8
- package/dist/{chunk-PDA4L2LS.js → chunk-LI3CUI54.js} +63 -8
- package/dist/index.cjs +264 -226
- package/dist/index.js +53 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-MXIWUFBP.js';
|
|
2
|
-
import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-
|
|
3
|
-
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, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, 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, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-
|
|
2
|
+
import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-LI3CUI54.js';
|
|
3
|
+
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, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, 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, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-LI3CUI54.js';
|
|
4
4
|
import { PgBossService } from './chunk-GO7PPYNU.js';
|
|
5
5
|
export { JOB_RUNNER_QUEUE, PgBossService } from './chunk-GO7PPYNU.js';
|
|
6
6
|
export { deductInventoryForConfirmedOrder, mergeInventoryLines, orderInventorySnapshotFromRow, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, restoreInventoryForCancelledOrder, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed } from './chunk-3K5AIEIZ.js';
|
|
@@ -1072,6 +1072,25 @@ function publicObjectUrl(config, fullKey) {
|
|
|
1072
1072
|
return `https://s3.${config.region}.amazonaws.com/${config.bucket}/${fullKey}`;
|
|
1073
1073
|
}
|
|
1074
1074
|
__name(publicObjectUrl, "publicObjectUrl");
|
|
1075
|
+
function describeS3Config(config) {
|
|
1076
|
+
const base = config.baseUrl ? new URL(config.baseUrl).host : null;
|
|
1077
|
+
return {
|
|
1078
|
+
bucket: config.bucket,
|
|
1079
|
+
region: config.region,
|
|
1080
|
+
prefix: config.prefix ?? "uploads",
|
|
1081
|
+
hasBaseUrl: Boolean(config.baseUrl),
|
|
1082
|
+
baseUrlHost: base,
|
|
1083
|
+
accessKeyIdLast4: config.accessKeyId.slice(-4),
|
|
1084
|
+
envSummary: {
|
|
1085
|
+
AWS_BUCKET_NAME: Boolean(config.bucket),
|
|
1086
|
+
AWS_REGION: Boolean(config.region),
|
|
1087
|
+
AWS_ACCESS_KEY_ID: Boolean(config.accessKeyId),
|
|
1088
|
+
AWS_SECRET_ACCESS_KEY: Boolean(config.secretAccessKey),
|
|
1089
|
+
S3_MEDIA_URL: Boolean(config.baseUrl)
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
__name(describeS3Config, "describeS3Config");
|
|
1075
1094
|
async function probePublicUrl(url) {
|
|
1076
1095
|
try {
|
|
1077
1096
|
const head = await fetch(url, {
|
|
@@ -1129,8 +1148,18 @@ function getS3Storage(config) {
|
|
|
1129
1148
|
secretAccessKey: config.secretAccessKey
|
|
1130
1149
|
}
|
|
1131
1150
|
});
|
|
1132
|
-
const
|
|
1151
|
+
const rawKey = key.replace(/^\/+/, "");
|
|
1152
|
+
const fullKey = keyPrefix + rawKey;
|
|
1153
|
+
const publicUrl = publicObjectUrl(config, fullKey);
|
|
1133
1154
|
const started = Date.now();
|
|
1155
|
+
console.info(LOG, "upload start", {
|
|
1156
|
+
...describeS3Config(config),
|
|
1157
|
+
key: rawKey,
|
|
1158
|
+
fullKey,
|
|
1159
|
+
publicUrl,
|
|
1160
|
+
contentType,
|
|
1161
|
+
bytes: buffer.length
|
|
1162
|
+
});
|
|
1134
1163
|
try {
|
|
1135
1164
|
await client.send(new PutObjectCommand({
|
|
1136
1165
|
Bucket: config.bucket,
|
|
@@ -1139,29 +1168,31 @@ function getS3Storage(config) {
|
|
|
1139
1168
|
ContentType: contentType
|
|
1140
1169
|
}));
|
|
1141
1170
|
} catch (err) {
|
|
1171
|
+
const errorDump = serializeS3Error(err);
|
|
1142
1172
|
console.error(LOG, "PutObject failed", {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1173
|
+
...describeS3Config(config),
|
|
1174
|
+
key: rawKey,
|
|
1175
|
+
fullKey,
|
|
1176
|
+
publicUrl,
|
|
1146
1177
|
contentType,
|
|
1147
1178
|
bytes: buffer.length,
|
|
1148
|
-
...
|
|
1179
|
+
...errorDump,
|
|
1180
|
+
rawError: err instanceof Error ? err.message : String(err)
|
|
1149
1181
|
});
|
|
1150
1182
|
throw err;
|
|
1151
1183
|
}
|
|
1152
|
-
const url = publicObjectUrl(config, fullKey);
|
|
1153
1184
|
console.info(LOG, "PutObject ok", {
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1185
|
+
...describeS3Config(config),
|
|
1186
|
+
key: rawKey,
|
|
1187
|
+
fullKey,
|
|
1188
|
+
publicUrl,
|
|
1157
1189
|
contentType,
|
|
1158
1190
|
bytes: buffer.length,
|
|
1159
1191
|
ms: Date.now() - started,
|
|
1160
|
-
url,
|
|
1161
1192
|
hasCustomBaseUrl: Boolean(config.baseUrl)
|
|
1162
1193
|
});
|
|
1163
|
-
void probePublicUrl(
|
|
1164
|
-
return
|
|
1194
|
+
void probePublicUrl(publicUrl);
|
|
1195
|
+
return publicUrl;
|
|
1165
1196
|
}
|
|
1166
1197
|
};
|
|
1167
1198
|
}
|
|
@@ -1199,7 +1230,14 @@ function s3StoragePlugin(config) {
|
|
|
1199
1230
|
prefix: config.prefix ?? "uploads",
|
|
1200
1231
|
hasBaseUrl: Boolean(resolvedBaseUrl),
|
|
1201
1232
|
baseUrlHost,
|
|
1202
|
-
accessKeyIdLast4: accessKeyId.slice(-4)
|
|
1233
|
+
accessKeyIdLast4: accessKeyId.slice(-4),
|
|
1234
|
+
envSummary: {
|
|
1235
|
+
AWS_BUCKET_NAME: Boolean(bucket),
|
|
1236
|
+
AWS_REGION: Boolean(region),
|
|
1237
|
+
AWS_ACCESS_KEY_ID: Boolean(accessKeyId),
|
|
1238
|
+
AWS_SECRET_ACCESS_KEY: Boolean(secretAccessKey),
|
|
1239
|
+
S3_MEDIA_URL: Boolean(resolvedBaseUrl)
|
|
1240
|
+
}
|
|
1203
1241
|
});
|
|
1204
1242
|
return getS3Storage({
|
|
1205
1243
|
region,
|