@infuro/cms-core 1.0.12 → 1.0.14
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 +1095 -541
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +939 -385
- package/dist/admin.js.map +1 -1
- package/dist/api.cjs +1111 -55
- 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 +1110 -54
- package/dist/api.js.map +1 -1
- package/dist/auth.cjs +62 -19
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +12 -1
- package/dist/auth.d.ts +12 -1
- package/dist/auth.js +62 -19
- package/dist/auth.js.map +1 -1
- package/dist/{index-JrST6EIC.d.cts → index-Be8NLxu-.d.cts} +28 -4
- package/dist/{index-C4Yl7js9.d.ts → index-CjBf9dAb.d.ts} +28 -4
- package/dist/index.cjs +2983 -914
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -54
- package/dist/index.d.ts +345 -54
- package/dist/index.js +2783 -737
- package/dist/index.js.map +1 -1
- package/dist/migrations/1774600000000-OrderKindParentOrderNumber.ts +36 -0
- package/dist/migrations/1774800000000-OtpChallengesUserPhone.ts +41 -0
- package/dist/migrations/1774900000000-MessageTemplates.ts +39 -0
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ interface EmailTemplateResult {
|
|
|
37
37
|
type TemplateContext<T = unknown> = T & {
|
|
38
38
|
companyDetails: CompanyDetails;
|
|
39
39
|
};
|
|
40
|
-
declare const EMAIL_TEMPLATE_NAMES: readonly ["signup", "passwordReset", "passwordChange", "orderPlaced", "returnInitiated", "shippingUpdate", "invite", "formSubmission"];
|
|
40
|
+
declare const EMAIL_TEMPLATE_NAMES: readonly ["signup", "passwordReset", "passwordChange", "orderPlaced", "returnInitiated", "shippingUpdate", "invite", "formSubmission", "otp"];
|
|
41
41
|
type EmailTemplateName = (typeof EMAIL_TEMPLATE_NAMES)[number];
|
|
42
42
|
declare function getCompanyDetailsFromSettings(settingsGroup: Record<string, string>): CompanyDetails;
|
|
43
43
|
|
|
@@ -55,6 +55,10 @@ interface CrudHandlerOptions {
|
|
|
55
55
|
status?: number;
|
|
56
56
|
}) => Response;
|
|
57
57
|
requireEntityPermission?: (req: Request, entity: string, action: EntityCrudAction) => Promise<Response | null>;
|
|
58
|
+
/** When set, contact create/update enqueues ERP `create-contact` (non-fatal). */
|
|
59
|
+
getCms?: () => Promise<{
|
|
60
|
+
getPlugin: (name: string) => unknown;
|
|
61
|
+
}>;
|
|
58
62
|
}
|
|
59
63
|
declare function createCrudHandler(dataSource: DataSource, entityMap: EntityMap, options: CrudHandlerOptions): {
|
|
60
64
|
GET(req: Request, resource: string): Promise<Response>;
|
|
@@ -265,9 +269,17 @@ interface SettingsApiConfig extends CmsHandlersBase {
|
|
|
265
269
|
/** Groups in this list are readable without auth (GET returns all keys for the group). */
|
|
266
270
|
publicGetGroups?: string[];
|
|
267
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Structural types so apps with their own `typeorm` install (e.g. npm link) typecheck without duplicate-package errors.
|
|
274
|
+
*/
|
|
275
|
+
type GetPublicSettingsGroupDataSource = {
|
|
276
|
+
getRepository(entity: unknown): {
|
|
277
|
+
find(options: object): Promise<unknown[]>;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
268
280
|
interface GetPublicSettingsGroupConfig {
|
|
269
|
-
dataSource:
|
|
270
|
-
entityMap:
|
|
281
|
+
dataSource: GetPublicSettingsGroupDataSource;
|
|
282
|
+
entityMap: Record<string, unknown>;
|
|
271
283
|
encryptionKey?: string;
|
|
272
284
|
}
|
|
273
285
|
/** Same rows as unauthenticated GET /api/settings/:group when the group is in publicGetGroups. */
|
|
@@ -343,6 +355,11 @@ declare function createCmsApiHandler(config: CmsApiHandlerConfig): {
|
|
|
343
355
|
handle(method: string, path: string[], req: Request): Promise<Response>;
|
|
344
356
|
};
|
|
345
357
|
|
|
358
|
+
interface StorefrontOtpFlags {
|
|
359
|
+
login?: boolean;
|
|
360
|
+
verifyEmail?: boolean;
|
|
361
|
+
verifyPhone?: boolean;
|
|
362
|
+
}
|
|
346
363
|
interface StorefrontApiConfig {
|
|
347
364
|
dataSource: DataSource;
|
|
348
365
|
entityMap: EntityMap;
|
|
@@ -361,9 +378,16 @@ interface StorefrontApiConfig {
|
|
|
361
378
|
getCompanyDetails?: () => Promise<CompanyDetails>;
|
|
362
379
|
/** Origin for verify links (e.g. process.env.NEXTAUTH_URL). Required with getCms for verification URLs. */
|
|
363
380
|
publicSiteUrl?: string;
|
|
381
|
+
/** When a flag is true, the corresponding OTP storefront route is enabled. */
|
|
382
|
+
otpFlags?: StorefrontOtpFlags;
|
|
383
|
+
/** Defaults to OTP_PEPPER or NEXTAUTH_SECRET. */
|
|
384
|
+
otpPepper?: string;
|
|
385
|
+
defaultPhoneCountryCode?: string;
|
|
386
|
+
/** When false, login OTP send accepts email only (no phone). Default true. */
|
|
387
|
+
otpAllowPhoneLogin?: boolean;
|
|
364
388
|
}
|
|
365
389
|
declare function createStorefrontApiHandler(config: StorefrontApiConfig): {
|
|
366
390
|
handle(method: string, path: string[], req: Request): Promise<Response>;
|
|
367
391
|
};
|
|
368
392
|
|
|
369
|
-
export { type AnalyticsHandlerConfig as A, type BlogBySlugConfig as B, type CompanyDetails as C, type DashboardStatsConfig as D, type EmailTemplateResult as E, type ForgotPasswordConfig as F, type GetPublicSettingsGroupConfig as G,
|
|
393
|
+
export { type AnalyticsHandlerConfig as A, type BlogBySlugConfig as B, type CompanyDetails as C, type DashboardStatsConfig as D, type EmailTemplateResult as E, type ForgotPasswordConfig as F, type GetPublicSettingsGroupConfig as G, createFormBySlugHandler as H, type InviteAcceptConfig as I, createInviteAcceptHandler as J, createSetPasswordHandler as K, createSettingsApiHandlers as L, createStorefrontApiHandler as M, createUploadHandler as N, type OrderPlacedLineItem as O, createUserAuthApiRouter as P, createUserAvatarHandler as Q, createUserProfileHandler as R, type StorageService as S, type TemplateContext as T, type UploadHandlerConfig as U, createUsersApiHandlers as V, getCompanyDetailsFromSettings as W, getPublicSettingsGroup as X, mergeEmailLayoutCompanyDetails as Y, type EmailTemplateName as a, type EntityMap as b, type AuthHandlersConfig as c, type ChangePasswordConfig as d, type CmsApiHandlerConfig as e, type CmsGetter as f, type CrudHandlerOptions as g, type FormBySlugConfig as h, type GetPublicSettingsGroupDataSource as i, type SetPasswordConfig as j, type SettingsApiConfig as k, type SocialLinkItem as l, type StorefrontApiConfig as m, type StorefrontOtpFlags as n, type UserAuthApiConfig as o, type UserAvatarConfig as p, type UserProfileConfig as q, type UsersApiConfig as r, createAnalyticsHandlers as s, createBlogBySlugHandler as t, createChangePasswordHandler as u, createCmsApiHandler as v, createCrudByIdHandler as w, createCrudHandler as x, createDashboardStatsHandler as y, createForgotPasswordHandler as z };
|