@infuro/cms-core 1.0.11 → 1.0.12
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 +14 -7
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +17 -10
- package/dist/admin.js.map +1 -1
- package/dist/api.cjs +29 -2
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +27 -1
- package/dist/api.js.map +1 -1
- package/dist/{index-DeO4AnAj.d.ts → index-C4Yl7js9.d.ts} +8 -1
- package/dist/{index-C_CZLmHD.d.cts → index-JrST6EIC.d.cts} +8 -1
- package/dist/index.cjs +27 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService } from './index-
|
|
2
|
-
export { A as AnalyticsHandlerConfig, b as AuthHandlersConfig, B as BlogBySlugConfig, c as ChangePasswordConfig, d as CmsApiHandlerConfig, e as CmsGetter, f as CrudHandlerOptions, D as DashboardStatsConfig, g as EntityMap, F as ForgotPasswordConfig, h as FormBySlugConfig, I as InviteAcceptConfig, i as SetPasswordConfig, j as SettingsApiConfig, k as SocialLinkItem, l as StorefrontApiConfig, U as UploadHandlerConfig, m as UserAuthApiConfig, n as UserAvatarConfig, o as UserProfileConfig, p as UsersApiConfig, q as createAnalyticsHandlers, r as createBlogBySlugHandler, s as createChangePasswordHandler, t as createCmsApiHandler, u as createCrudByIdHandler, v as createCrudHandler, w as createDashboardStatsHandler, x as createForgotPasswordHandler, y as createFormBySlugHandler, z as createInviteAcceptHandler,
|
|
1
|
+
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService } from './index-JrST6EIC.cjs';
|
|
2
|
+
export { A as AnalyticsHandlerConfig, b as AuthHandlersConfig, B as BlogBySlugConfig, c as ChangePasswordConfig, d as CmsApiHandlerConfig, e as CmsGetter, f as CrudHandlerOptions, D as DashboardStatsConfig, g as EntityMap, F as ForgotPasswordConfig, h as FormBySlugConfig, G as GetPublicSettingsGroupConfig, I as InviteAcceptConfig, i as SetPasswordConfig, j as SettingsApiConfig, k as SocialLinkItem, l as StorefrontApiConfig, U as UploadHandlerConfig, m as UserAuthApiConfig, n as UserAvatarConfig, o as UserProfileConfig, p as UsersApiConfig, q as createAnalyticsHandlers, r as createBlogBySlugHandler, s as createChangePasswordHandler, t as createCmsApiHandler, u as createCrudByIdHandler, v as createCrudHandler, w as createDashboardStatsHandler, x as createForgotPasswordHandler, y as createFormBySlugHandler, z as createInviteAcceptHandler, H as createSetPasswordHandler, J as createSettingsApiHandlers, K as createStorefrontApiHandler, L as createUploadHandler, M as createUserAuthApiRouter, N as createUserAvatarHandler, P as createUserProfileHandler, Q as createUsersApiHandlers, R as getCompanyDetailsFromSettings, V as getPublicSettingsGroup, W as mergeEmailLayoutCompanyDetails } from './index-JrST6EIC.cjs';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import * as typeorm from 'typeorm';
|
|
5
5
|
import { DataSource, EntityTarget, ObjectLiteral } from 'typeorm';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService } from './index-
|
|
2
|
-
export { A as AnalyticsHandlerConfig, b as AuthHandlersConfig, B as BlogBySlugConfig, c as ChangePasswordConfig, d as CmsApiHandlerConfig, e as CmsGetter, f as CrudHandlerOptions, D as DashboardStatsConfig, g as EntityMap, F as ForgotPasswordConfig, h as FormBySlugConfig, I as InviteAcceptConfig, i as SetPasswordConfig, j as SettingsApiConfig, k as SocialLinkItem, l as StorefrontApiConfig, U as UploadHandlerConfig, m as UserAuthApiConfig, n as UserAvatarConfig, o as UserProfileConfig, p as UsersApiConfig, q as createAnalyticsHandlers, r as createBlogBySlugHandler, s as createChangePasswordHandler, t as createCmsApiHandler, u as createCrudByIdHandler, v as createCrudHandler, w as createDashboardStatsHandler, x as createForgotPasswordHandler, y as createFormBySlugHandler, z as createInviteAcceptHandler,
|
|
1
|
+
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService } from './index-C4Yl7js9.js';
|
|
2
|
+
export { A as AnalyticsHandlerConfig, b as AuthHandlersConfig, B as BlogBySlugConfig, c as ChangePasswordConfig, d as CmsApiHandlerConfig, e as CmsGetter, f as CrudHandlerOptions, D as DashboardStatsConfig, g as EntityMap, F as ForgotPasswordConfig, h as FormBySlugConfig, G as GetPublicSettingsGroupConfig, I as InviteAcceptConfig, i as SetPasswordConfig, j as SettingsApiConfig, k as SocialLinkItem, l as StorefrontApiConfig, U as UploadHandlerConfig, m as UserAuthApiConfig, n as UserAvatarConfig, o as UserProfileConfig, p as UsersApiConfig, q as createAnalyticsHandlers, r as createBlogBySlugHandler, s as createChangePasswordHandler, t as createCmsApiHandler, u as createCrudByIdHandler, v as createCrudHandler, w as createDashboardStatsHandler, x as createForgotPasswordHandler, y as createFormBySlugHandler, z as createInviteAcceptHandler, H as createSetPasswordHandler, J as createSettingsApiHandlers, K as createStorefrontApiHandler, L as createUploadHandler, M as createUserAuthApiRouter, N as createUserAvatarHandler, P as createUserProfileHandler, Q as createUsersApiHandlers, R as getCompanyDetailsFromSettings, V as getPublicSettingsGroup, W as mergeEmailLayoutCompanyDetails } from './index-C4Yl7js9.js';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import * as typeorm from 'typeorm';
|
|
5
5
|
import { DataSource, EntityTarget, ObjectLiteral } from 'typeorm';
|
package/dist/index.js
CHANGED
|
@@ -5675,6 +5675,24 @@ function simpleDecrypt(encoded, key) {
|
|
|
5675
5675
|
for (let i = 0; i < buf.length; i++) out[i] = buf[i] ^ keyBuf[i % keyBuf.length];
|
|
5676
5676
|
return out.toString("utf8");
|
|
5677
5677
|
}
|
|
5678
|
+
async function getPublicSettingsGroup(config, group) {
|
|
5679
|
+
const { dataSource, entityMap, encryptionKey } = config;
|
|
5680
|
+
const repo = dataSource.getRepository(entityMap.configs);
|
|
5681
|
+
const rows = await repo.find({ where: { settings: group, deleted: false } });
|
|
5682
|
+
const result = {};
|
|
5683
|
+
for (const row of rows) {
|
|
5684
|
+
const r = row;
|
|
5685
|
+
let val = r.value;
|
|
5686
|
+
if (r.encrypted && encryptionKey) {
|
|
5687
|
+
try {
|
|
5688
|
+
val = simpleDecrypt(val, encryptionKey);
|
|
5689
|
+
} catch {
|
|
5690
|
+
}
|
|
5691
|
+
}
|
|
5692
|
+
result[r.key] = val;
|
|
5693
|
+
}
|
|
5694
|
+
return result;
|
|
5695
|
+
}
|
|
5678
5696
|
function createSettingsApiHandlers(config) {
|
|
5679
5697
|
const { dataSource, entityMap, json, requireAuth, encryptionKey, publicGetGroups } = config;
|
|
5680
5698
|
const configRepo = () => dataSource.getRepository(entityMap.configs);
|
|
@@ -5684,6 +5702,13 @@ function createSettingsApiHandlers(config) {
|
|
|
5684
5702
|
const authErr = isPublicGroup ? null : await requireAuth(req);
|
|
5685
5703
|
const isAuthed = !authErr;
|
|
5686
5704
|
try {
|
|
5705
|
+
if (isPublicGroup) {
|
|
5706
|
+
const result2 = await getPublicSettingsGroup(
|
|
5707
|
+
{ dataSource, entityMap, encryptionKey },
|
|
5708
|
+
group
|
|
5709
|
+
);
|
|
5710
|
+
return json(result2);
|
|
5711
|
+
}
|
|
5687
5712
|
const where = { settings: group, deleted: false };
|
|
5688
5713
|
if (!isAuthed && !isPublicGroup) where.type = "public";
|
|
5689
5714
|
const rows = await configRepo().find({ where });
|
|
@@ -7340,6 +7365,7 @@ export {
|
|
|
7340
7365
|
getCompanyDetailsFromSettings,
|
|
7341
7366
|
getNextAuthOptions,
|
|
7342
7367
|
getPermissionableEntityKeys,
|
|
7368
|
+
getPublicSettingsGroup,
|
|
7343
7369
|
getRequiredPermission,
|
|
7344
7370
|
hasEntityPermission,
|
|
7345
7371
|
isOpenEndpoint,
|