@infuro/cms-core 1.0.46 → 1.0.50
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/README.md +30 -16
- package/dist/admin.cjs +4568 -2716
- package/dist/admin.d.cts +18 -4
- package/dist/admin.d.ts +18 -4
- package/dist/admin.js +3475 -1625
- package/dist/api.cjs +38 -39
- package/dist/api.d.cts +9 -3
- package/dist/api.d.ts +9 -3
- package/dist/api.js +6 -7
- package/dist/auth.cjs +84 -51
- package/dist/auth.d.cts +105 -4
- package/dist/auth.d.ts +105 -4
- package/dist/auth.js +4 -3
- package/dist/chunk-2IAXTKQN.cjs +19 -0
- package/dist/chunk-3EOM4V2M.cjs +452 -0
- package/dist/{chunk-X6UQFV4X.cjs → chunk-77NUXO6A.cjs} +14 -12
- package/dist/{chunk-KFFB6EMZ.js → chunk-AYERBA7I.js} +3 -7
- package/dist/chunk-EIZKW2PF.js +13 -0
- package/dist/{chunk-CRYKVJTO.js → chunk-IPDHT2UV.js} +1420 -3
- package/dist/{chunk-UDVLFVEC.cjs → chunk-JCMOOPNX.cjs} +3820 -2907
- package/dist/{chunk-X47PBV4I.js → chunk-JE22VP6S.js} +1 -0
- package/dist/{chunk-DN65KDIA.js → chunk-JIWUVQ6B.js} +14 -13
- package/dist/{chunk-HT5DI3XW.cjs → chunk-KOTXDSQB.cjs} +1 -0
- package/dist/{chunk-UKC3HYXI.js → chunk-LT2WOPKA.js} +3733 -2813
- package/dist/chunk-RK5ETF2I.js +434 -0
- package/dist/{chunk-SPQFNIYJ.cjs → chunk-TJ2MIQUT.cjs} +3 -7
- package/dist/{chunk-TCSGFAWB.cjs → chunk-UUWAUHUW.cjs} +1451 -3
- package/dist/{chunk-57O3HZPG.js → chunk-WRKV6MHB.js} +415 -3
- package/dist/{chunk-FBKDMRQL.cjs → chunk-YV5PK4JW.cjs} +427 -7
- package/dist/cli.cjs +13 -22
- package/dist/cli.js +13 -22
- package/dist/{emit-order-notification-trigger-IVLWKKJL.js → emit-order-notification-trigger-6XX7LSC4.js} +1 -1
- package/dist/{emit-order-notification-trigger-D2N3KFHL.cjs → emit-order-notification-trigger-NASG7ZEO.cjs} +3 -3
- package/dist/{event-order-defaults-EMWBIGL3.cjs → event-order-defaults-DU7V3YND.cjs} +9 -9
- package/dist/{event-order-defaults-SDRNAZHC.js → event-order-defaults-H4RT7NMR.js} +1 -1
- package/dist/hooks.cjs +43 -0
- package/dist/hooks.d.cts +10 -1
- package/dist/hooks.d.ts +10 -1
- package/dist/hooks.js +39 -1
- package/dist/index.cjs +479 -339
- package/dist/index.d.cts +181 -20
- package/dist/index.d.ts +181 -20
- package/dist/index.js +115 -13
- package/dist/migrations/1782200000000-VendorTeamProfiles.ts +233 -0
- package/dist/migrations/1782300000000-AddTypeToOrderNotificationBindings.ts +75 -0
- package/dist/migrations/1782400000000-CreateUserDeviceTokens.ts +36 -0
- package/dist/migrations/1782500000000-AddPushToOrderNotificationBindingsChannelEnum.ts +15 -0
- package/dist/{order-notification-dispatcher-ZJZB2HUN.js → order-notification-dispatcher-3TA4ETYJ.js} +1 -2
- package/dist/{order-notification-dispatcher-SBQAMM5V.cjs → order-notification-dispatcher-ZEAZ5SHV.cjs} +7 -4
- package/dist/{rbac-debug-db-2SGNLANF.js → rbac-debug-db-6EMIVMGF.js} +1 -1
- package/dist/{rbac-debug-db-4Z6A425H.cjs → rbac-debug-db-6PWTLBEL.cjs} +2 -2
- package/dist/theme.cjs +6 -1
- package/dist/theme.d.cts +4 -1
- package/dist/theme.d.ts +4 -1
- package/dist/theme.js +3 -1
- package/package.json +1 -1
- package/src/admin/admin.css +7 -0
- package/dist/chunk-7PMHZRF3.cjs +0 -872
- package/dist/chunk-CQHXW4TR.js +0 -107
- package/dist/chunk-GUSHM5HN.js +0 -862
- package/dist/chunk-NBY4NVTY.cjs +0 -182
- package/dist/chunk-SF2XKMCI.js +0 -171
- package/dist/chunk-XMRMZ6NQ.cjs +0 -109
- package/dist/send-order-placed-emails-B5ZVJT7T.cjs +0 -15
- package/dist/send-order-placed-emails-WPI37KRZ.js +0 -6
package/dist/auth.d.cts
CHANGED
|
@@ -46,7 +46,7 @@ interface SessionUser {
|
|
|
46
46
|
vendorIds?: number[];
|
|
47
47
|
/** Active vendor for scoped CRUD (vendor staff). */
|
|
48
48
|
activeVendorId?: number | null;
|
|
49
|
-
/**
|
|
49
|
+
/** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
|
|
50
50
|
vendorRole?: 'owner' | 'staff' | null;
|
|
51
51
|
/** Active vendor-scoped role id (`vendor_users.vendorRoleId`). */
|
|
52
52
|
vendorRoleId?: number | null;
|
|
@@ -140,7 +140,9 @@ type VendorScope = {
|
|
|
140
140
|
} | {
|
|
141
141
|
type: 'deny';
|
|
142
142
|
};
|
|
143
|
-
declare const
|
|
143
|
+
declare const VENDOR_GROUP_NAME = "Vendor";
|
|
144
|
+
/** @deprecated Use VENDOR_GROUP_NAME */
|
|
145
|
+
declare const VENDOR_OWNER_GROUP_NAME = "Vendor";
|
|
144
146
|
/** User groups treated as vendor store staff (sidebar + scoped admin). */
|
|
145
147
|
declare function isVendorGroupName(name: string | null | undefined): boolean;
|
|
146
148
|
declare function isPlatformAdministrator(user: SessionUser | null | undefined): boolean;
|
|
@@ -231,8 +233,43 @@ declare function logAuthClient(message: string, data?: Record<string, unknown>):
|
|
|
231
233
|
declare function summarizeSessionUserForLog(user: unknown): Record<string, unknown>;
|
|
232
234
|
declare function nextAuthCookieDebugInfo(): Record<string, unknown>;
|
|
233
235
|
|
|
236
|
+
declare const AUTH_PROVIDERS_SETTINGS_GROUP = "auth_providers";
|
|
237
|
+
interface GoogleAuthConfig {
|
|
238
|
+
enabled: boolean;
|
|
239
|
+
clientId: string;
|
|
240
|
+
clientSecret: string;
|
|
241
|
+
}
|
|
242
|
+
/** Minimal TypeORM DataSource surface needed to read `configs` settings. */
|
|
243
|
+
type AuthProvidersDataSource = {
|
|
244
|
+
getRepository(entity: unknown): {
|
|
245
|
+
find(options: object): Promise<unknown[]>;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
type AuthProvidersEntityMap = {
|
|
249
|
+
configs?: unknown;
|
|
250
|
+
};
|
|
251
|
+
type ResolveGoogleAuthConfigInput = {
|
|
252
|
+
/** Prefer loading secrets from DB (authenticated server path). */
|
|
253
|
+
dataSource?: AuthProvidersDataSource;
|
|
254
|
+
entityMap?: AuthProvidersEntityMap;
|
|
255
|
+
encryptionKey?: string;
|
|
256
|
+
/** Optional preloaded settings map (e.g. from host). */
|
|
257
|
+
settings?: Record<string, string>;
|
|
258
|
+
/** When true, skip env fallback. Default false. */
|
|
259
|
+
skipEnvFallback?: boolean;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Resolve Google web OAuth config for registering NextAuth GoogleProvider.
|
|
263
|
+
* Order: explicit `settings` → DB `auth_providers` group → env (`GOOGLE_*`).
|
|
264
|
+
*/
|
|
265
|
+
declare function resolveGoogleAuthConfig(input?: ResolveGoogleAuthConfigInput): Promise<GoogleAuthConfig | null>;
|
|
266
|
+
/** Public redirect URI for Google Web OAuth (NextAuth callback). */
|
|
267
|
+
declare function googleOAuthRedirectUri(baseUrl?: string): string;
|
|
268
|
+
/** Whether the public `googleEnabled` flag is on (for SignInPage; secrets not required). */
|
|
269
|
+
declare function isGoogleAuthPubliclyEnabled(settings: Record<string, unknown> | null | undefined): boolean;
|
|
270
|
+
|
|
234
271
|
/**
|
|
235
|
-
* Build NextAuth options for credentials auth. App can extend/override via extend().
|
|
272
|
+
* Build NextAuth options for credentials auth (+ optional Google OAuth). App can extend/override via extend().
|
|
236
273
|
*/
|
|
237
274
|
|
|
238
275
|
interface NextAuthUser {
|
|
@@ -291,11 +328,75 @@ interface NextAuthOptionsConfig {
|
|
|
291
328
|
* - `true` — always allow (dedicated storefront auth)
|
|
292
329
|
* - `false` — always block
|
|
293
330
|
* - omitted — auto: allow unless `callbackUrl` targets `/admin` (storefront `/signin` works unchanged)
|
|
331
|
+
*
|
|
332
|
+
* For Google OAuth: customers are allowed only when this is `true`.
|
|
333
|
+
* When `true` and the Google email is new, {@link createCustomerUserFromGoogle} may create a Customer.
|
|
294
334
|
*/
|
|
295
335
|
allowCustomerLogin?: boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Static Google web OAuth config. When set and enabled, registers GoogleProvider.
|
|
338
|
+
* Prefer {@link buildNextAuthOptions} to load from Plugins settings + env.
|
|
339
|
+
*/
|
|
340
|
+
google?: GoogleAuthConfig | null;
|
|
341
|
+
/**
|
|
342
|
+
* Storefront only: when Google email has no user and {@link allowCustomerLogin} is true,
|
|
343
|
+
* create a Customer-group user. Wired automatically by {@link buildNextAuthOptions} when
|
|
344
|
+
* `dataSource` + `entityMap` are provided.
|
|
345
|
+
*/
|
|
346
|
+
createCustomerUserFromGoogle?: (input: {
|
|
347
|
+
email: string;
|
|
348
|
+
name: string | null;
|
|
349
|
+
}) => Promise<NextAuthUser | null>;
|
|
296
350
|
}
|
|
351
|
+
type BuildNextAuthOptionsConfig = NextAuthOptionsConfig & {
|
|
352
|
+
/** Load Google settings from DB / env when `google` is not passed explicitly. */
|
|
353
|
+
dataSource?: AuthProvidersDataSource;
|
|
354
|
+
entityMap?: AuthProvidersEntityMap;
|
|
355
|
+
settingsEncryptionKey?: string;
|
|
356
|
+
/** Extra input for {@link resolveGoogleAuthConfig}. */
|
|
357
|
+
googleResolve?: Omit<ResolveGoogleAuthConfigInput, 'dataSource' | 'entityMap' | 'encryptionKey'>;
|
|
358
|
+
};
|
|
297
359
|
declare function getNextAuthOptions(config: NextAuthOptionsConfig): NextAuthOptions;
|
|
360
|
+
/**
|
|
361
|
+
* Async builder: loads Google OAuth from Plugins `auth_providers` settings (and env fallback),
|
|
362
|
+
* then returns the same options as {@link getNextAuthOptions}.
|
|
363
|
+
*/
|
|
364
|
+
declare function buildNextAuthOptions(config: BuildNextAuthOptionsConfig): Promise<NextAuthOptions>;
|
|
298
365
|
/** Storefront sign-in: allows Customer group; use with signInPage `/signin`. */
|
|
299
366
|
declare function getStorefrontNextAuthOptions(config: Omit<NextAuthOptionsConfig, 'allowCustomerLogin'>): NextAuthOptions;
|
|
367
|
+
/** Storefront + optional Google from settings/env. */
|
|
368
|
+
declare function buildStorefrontNextAuthOptions(config: Omit<BuildNextAuthOptionsConfig, 'allowCustomerLogin'>): Promise<NextAuthOptions>;
|
|
369
|
+
|
|
370
|
+
type CreateGoogleCustomerDataSource = {
|
|
371
|
+
getRepository(entity: unknown): {
|
|
372
|
+
findOne(options: object): Promise<unknown | null>;
|
|
373
|
+
create(entityLike: object): unknown;
|
|
374
|
+
save(entity: unknown): Promise<unknown>;
|
|
375
|
+
metadata?: {
|
|
376
|
+
columns: Array<{
|
|
377
|
+
propertyName: string;
|
|
378
|
+
}>;
|
|
379
|
+
};
|
|
380
|
+
find?(options: object): Promise<unknown[]>;
|
|
381
|
+
update?(id: number, partial: object): Promise<unknown>;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
type CreateGoogleCustomerEntityMap = {
|
|
385
|
+
users?: unknown;
|
|
386
|
+
user_groups?: unknown;
|
|
387
|
+
customer?: unknown;
|
|
388
|
+
contacts?: unknown;
|
|
389
|
+
};
|
|
390
|
+
type CreateGoogleCustomerInput = {
|
|
391
|
+
dataSource: CreateGoogleCustomerDataSource;
|
|
392
|
+
entityMap: CreateGoogleCustomerEntityMap;
|
|
393
|
+
email: string;
|
|
394
|
+
name?: string | null;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Creates an active Customer user for a verified Google email.
|
|
398
|
+
* Returns the user with `group.permissions` loaded (same shape as password login).
|
|
399
|
+
*/
|
|
400
|
+
declare function createCustomerUserFromGoogleOAuth(input: CreateGoogleCustomerInput): Promise<NextAuthUser | null>;
|
|
300
401
|
|
|
301
|
-
export { ADMIN_GROUP_NAME, type AuthHelpers, type AuthorizeOtpInput, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type EntityCrudAction, type EntityPermissionFlags, type GetSession, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, SUPER_ADMIN_GROUP_ID, type SessionUser, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, createAuthHelpers, createCmsAuthBundle, createCmsMiddleware, defaultPublicApiMethods, explainSessionEntityAccess, getNextAuthOptions, getPermissionableEntityKeys, getRequiredPermission, getStorefrontNextAuthOptions, hasEntityPermission, isAuthDebugClientEnabled, isAuthDebugEnabled, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logAuth, logAuthClient, logEntityAccessDecision, logRbac, nextAuthCookieDebugInfo, permissionRowsToRecord, resolveVendorScopeFromSessionUser, seedAdministratorPermissions, sessionHasEntityAccess, summarizeEntityPerms, summarizeSessionUserForLog, vendorPortalFlagsFromUser };
|
|
402
|
+
export { ADMIN_GROUP_NAME, AUTH_PROVIDERS_SETTINGS_GROUP, type AuthHelpers, type AuthProvidersDataSource, type AuthProvidersEntityMap, type AuthorizeOtpInput, type BuildNextAuthOptionsConfig, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CreateGoogleCustomerDataSource, type CreateGoogleCustomerEntityMap, type CreateGoogleCustomerInput, type EntityCrudAction, type EntityPermissionFlags, type GetSession, type GoogleAuthConfig, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, type ResolveGoogleAuthConfigInput, SUPER_ADMIN_GROUP_ID, type SessionUser, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, buildNextAuthOptions, buildStorefrontNextAuthOptions, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, createAuthHelpers, createCmsAuthBundle, createCmsMiddleware, createCustomerUserFromGoogleOAuth, defaultPublicApiMethods, explainSessionEntityAccess, getNextAuthOptions, getPermissionableEntityKeys, getRequiredPermission, getStorefrontNextAuthOptions, googleOAuthRedirectUri, hasEntityPermission, isAuthDebugClientEnabled, isAuthDebugEnabled, isGoogleAuthPubliclyEnabled, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logAuth, logAuthClient, logEntityAccessDecision, logRbac, nextAuthCookieDebugInfo, permissionRowsToRecord, resolveGoogleAuthConfig, resolveVendorScopeFromSessionUser, seedAdministratorPermissions, sessionHasEntityAccess, summarizeEntityPerms, summarizeSessionUserForLog, vendorPortalFlagsFromUser };
|
package/dist/auth.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ interface SessionUser {
|
|
|
46
46
|
vendorIds?: number[];
|
|
47
47
|
/** Active vendor for scoped CRUD (vendor staff). */
|
|
48
48
|
activeVendorId?: number | null;
|
|
49
|
-
/**
|
|
49
|
+
/** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
|
|
50
50
|
vendorRole?: 'owner' | 'staff' | null;
|
|
51
51
|
/** Active vendor-scoped role id (`vendor_users.vendorRoleId`). */
|
|
52
52
|
vendorRoleId?: number | null;
|
|
@@ -140,7 +140,9 @@ type VendorScope = {
|
|
|
140
140
|
} | {
|
|
141
141
|
type: 'deny';
|
|
142
142
|
};
|
|
143
|
-
declare const
|
|
143
|
+
declare const VENDOR_GROUP_NAME = "Vendor";
|
|
144
|
+
/** @deprecated Use VENDOR_GROUP_NAME */
|
|
145
|
+
declare const VENDOR_OWNER_GROUP_NAME = "Vendor";
|
|
144
146
|
/** User groups treated as vendor store staff (sidebar + scoped admin). */
|
|
145
147
|
declare function isVendorGroupName(name: string | null | undefined): boolean;
|
|
146
148
|
declare function isPlatformAdministrator(user: SessionUser | null | undefined): boolean;
|
|
@@ -231,8 +233,43 @@ declare function logAuthClient(message: string, data?: Record<string, unknown>):
|
|
|
231
233
|
declare function summarizeSessionUserForLog(user: unknown): Record<string, unknown>;
|
|
232
234
|
declare function nextAuthCookieDebugInfo(): Record<string, unknown>;
|
|
233
235
|
|
|
236
|
+
declare const AUTH_PROVIDERS_SETTINGS_GROUP = "auth_providers";
|
|
237
|
+
interface GoogleAuthConfig {
|
|
238
|
+
enabled: boolean;
|
|
239
|
+
clientId: string;
|
|
240
|
+
clientSecret: string;
|
|
241
|
+
}
|
|
242
|
+
/** Minimal TypeORM DataSource surface needed to read `configs` settings. */
|
|
243
|
+
type AuthProvidersDataSource = {
|
|
244
|
+
getRepository(entity: unknown): {
|
|
245
|
+
find(options: object): Promise<unknown[]>;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
type AuthProvidersEntityMap = {
|
|
249
|
+
configs?: unknown;
|
|
250
|
+
};
|
|
251
|
+
type ResolveGoogleAuthConfigInput = {
|
|
252
|
+
/** Prefer loading secrets from DB (authenticated server path). */
|
|
253
|
+
dataSource?: AuthProvidersDataSource;
|
|
254
|
+
entityMap?: AuthProvidersEntityMap;
|
|
255
|
+
encryptionKey?: string;
|
|
256
|
+
/** Optional preloaded settings map (e.g. from host). */
|
|
257
|
+
settings?: Record<string, string>;
|
|
258
|
+
/** When true, skip env fallback. Default false. */
|
|
259
|
+
skipEnvFallback?: boolean;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Resolve Google web OAuth config for registering NextAuth GoogleProvider.
|
|
263
|
+
* Order: explicit `settings` → DB `auth_providers` group → env (`GOOGLE_*`).
|
|
264
|
+
*/
|
|
265
|
+
declare function resolveGoogleAuthConfig(input?: ResolveGoogleAuthConfigInput): Promise<GoogleAuthConfig | null>;
|
|
266
|
+
/** Public redirect URI for Google Web OAuth (NextAuth callback). */
|
|
267
|
+
declare function googleOAuthRedirectUri(baseUrl?: string): string;
|
|
268
|
+
/** Whether the public `googleEnabled` flag is on (for SignInPage; secrets not required). */
|
|
269
|
+
declare function isGoogleAuthPubliclyEnabled(settings: Record<string, unknown> | null | undefined): boolean;
|
|
270
|
+
|
|
234
271
|
/**
|
|
235
|
-
* Build NextAuth options for credentials auth. App can extend/override via extend().
|
|
272
|
+
* Build NextAuth options for credentials auth (+ optional Google OAuth). App can extend/override via extend().
|
|
236
273
|
*/
|
|
237
274
|
|
|
238
275
|
interface NextAuthUser {
|
|
@@ -291,11 +328,75 @@ interface NextAuthOptionsConfig {
|
|
|
291
328
|
* - `true` — always allow (dedicated storefront auth)
|
|
292
329
|
* - `false` — always block
|
|
293
330
|
* - omitted — auto: allow unless `callbackUrl` targets `/admin` (storefront `/signin` works unchanged)
|
|
331
|
+
*
|
|
332
|
+
* For Google OAuth: customers are allowed only when this is `true`.
|
|
333
|
+
* When `true` and the Google email is new, {@link createCustomerUserFromGoogle} may create a Customer.
|
|
294
334
|
*/
|
|
295
335
|
allowCustomerLogin?: boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Static Google web OAuth config. When set and enabled, registers GoogleProvider.
|
|
338
|
+
* Prefer {@link buildNextAuthOptions} to load from Plugins settings + env.
|
|
339
|
+
*/
|
|
340
|
+
google?: GoogleAuthConfig | null;
|
|
341
|
+
/**
|
|
342
|
+
* Storefront only: when Google email has no user and {@link allowCustomerLogin} is true,
|
|
343
|
+
* create a Customer-group user. Wired automatically by {@link buildNextAuthOptions} when
|
|
344
|
+
* `dataSource` + `entityMap` are provided.
|
|
345
|
+
*/
|
|
346
|
+
createCustomerUserFromGoogle?: (input: {
|
|
347
|
+
email: string;
|
|
348
|
+
name: string | null;
|
|
349
|
+
}) => Promise<NextAuthUser | null>;
|
|
296
350
|
}
|
|
351
|
+
type BuildNextAuthOptionsConfig = NextAuthOptionsConfig & {
|
|
352
|
+
/** Load Google settings from DB / env when `google` is not passed explicitly. */
|
|
353
|
+
dataSource?: AuthProvidersDataSource;
|
|
354
|
+
entityMap?: AuthProvidersEntityMap;
|
|
355
|
+
settingsEncryptionKey?: string;
|
|
356
|
+
/** Extra input for {@link resolveGoogleAuthConfig}. */
|
|
357
|
+
googleResolve?: Omit<ResolveGoogleAuthConfigInput, 'dataSource' | 'entityMap' | 'encryptionKey'>;
|
|
358
|
+
};
|
|
297
359
|
declare function getNextAuthOptions(config: NextAuthOptionsConfig): NextAuthOptions;
|
|
360
|
+
/**
|
|
361
|
+
* Async builder: loads Google OAuth from Plugins `auth_providers` settings (and env fallback),
|
|
362
|
+
* then returns the same options as {@link getNextAuthOptions}.
|
|
363
|
+
*/
|
|
364
|
+
declare function buildNextAuthOptions(config: BuildNextAuthOptionsConfig): Promise<NextAuthOptions>;
|
|
298
365
|
/** Storefront sign-in: allows Customer group; use with signInPage `/signin`. */
|
|
299
366
|
declare function getStorefrontNextAuthOptions(config: Omit<NextAuthOptionsConfig, 'allowCustomerLogin'>): NextAuthOptions;
|
|
367
|
+
/** Storefront + optional Google from settings/env. */
|
|
368
|
+
declare function buildStorefrontNextAuthOptions(config: Omit<BuildNextAuthOptionsConfig, 'allowCustomerLogin'>): Promise<NextAuthOptions>;
|
|
369
|
+
|
|
370
|
+
type CreateGoogleCustomerDataSource = {
|
|
371
|
+
getRepository(entity: unknown): {
|
|
372
|
+
findOne(options: object): Promise<unknown | null>;
|
|
373
|
+
create(entityLike: object): unknown;
|
|
374
|
+
save(entity: unknown): Promise<unknown>;
|
|
375
|
+
metadata?: {
|
|
376
|
+
columns: Array<{
|
|
377
|
+
propertyName: string;
|
|
378
|
+
}>;
|
|
379
|
+
};
|
|
380
|
+
find?(options: object): Promise<unknown[]>;
|
|
381
|
+
update?(id: number, partial: object): Promise<unknown>;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
type CreateGoogleCustomerEntityMap = {
|
|
385
|
+
users?: unknown;
|
|
386
|
+
user_groups?: unknown;
|
|
387
|
+
customer?: unknown;
|
|
388
|
+
contacts?: unknown;
|
|
389
|
+
};
|
|
390
|
+
type CreateGoogleCustomerInput = {
|
|
391
|
+
dataSource: CreateGoogleCustomerDataSource;
|
|
392
|
+
entityMap: CreateGoogleCustomerEntityMap;
|
|
393
|
+
email: string;
|
|
394
|
+
name?: string | null;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Creates an active Customer user for a verified Google email.
|
|
398
|
+
* Returns the user with `group.permissions` loaded (same shape as password login).
|
|
399
|
+
*/
|
|
400
|
+
declare function createCustomerUserFromGoogleOAuth(input: CreateGoogleCustomerInput): Promise<NextAuthUser | null>;
|
|
300
401
|
|
|
301
|
-
export { ADMIN_GROUP_NAME, type AuthHelpers, type AuthorizeOtpInput, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type EntityCrudAction, type EntityPermissionFlags, type GetSession, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, SUPER_ADMIN_GROUP_ID, type SessionUser, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, createAuthHelpers, createCmsAuthBundle, createCmsMiddleware, defaultPublicApiMethods, explainSessionEntityAccess, getNextAuthOptions, getPermissionableEntityKeys, getRequiredPermission, getStorefrontNextAuthOptions, hasEntityPermission, isAuthDebugClientEnabled, isAuthDebugEnabled, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logAuth, logAuthClient, logEntityAccessDecision, logRbac, nextAuthCookieDebugInfo, permissionRowsToRecord, resolveVendorScopeFromSessionUser, seedAdministratorPermissions, sessionHasEntityAccess, summarizeEntityPerms, summarizeSessionUserForLog, vendorPortalFlagsFromUser };
|
|
402
|
+
export { ADMIN_GROUP_NAME, AUTH_PROVIDERS_SETTINGS_GROUP, type AuthHelpers, type AuthProvidersDataSource, type AuthProvidersEntityMap, type AuthorizeOtpInput, type BuildNextAuthOptionsConfig, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CreateGoogleCustomerDataSource, type CreateGoogleCustomerEntityMap, type CreateGoogleCustomerInput, type EntityCrudAction, type EntityPermissionFlags, type GetSession, type GoogleAuthConfig, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, type ResolveGoogleAuthConfigInput, SUPER_ADMIN_GROUP_ID, type SessionUser, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, buildNextAuthOptions, buildStorefrontNextAuthOptions, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, createAuthHelpers, createCmsAuthBundle, createCmsMiddleware, createCustomerUserFromGoogleOAuth, defaultPublicApiMethods, explainSessionEntityAccess, getNextAuthOptions, getPermissionableEntityKeys, getRequiredPermission, getStorefrontNextAuthOptions, googleOAuthRedirectUri, hasEntityPermission, isAuthDebugClientEnabled, isAuthDebugEnabled, isGoogleAuthPubliclyEnabled, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logAuth, logAuthClient, logEntityAccessDecision, logRbac, nextAuthCookieDebugInfo, permissionRowsToRecord, resolveGoogleAuthConfig, resolveVendorScopeFromSessionUser, seedAdministratorPermissions, sessionHasEntityAccess, summarizeEntityPerms, summarizeSessionUserForLog, vendorPortalFlagsFromUser };
|
package/dist/auth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { createCmsMiddleware, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-
|
|
2
|
-
export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-
|
|
3
|
-
|
|
1
|
+
export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCmsMiddleware, createCustomerUserFromGoogleOAuth, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isAuthDebugClientEnabled, isAuthDebugEnabled, isGoogleAuthPubliclyEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, resolveGoogleAuthConfig, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-WRKV6MHB.js';
|
|
2
|
+
export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-RK5ETF2I.js';
|
|
3
|
+
import './chunk-DBPSJYLZ.js';
|
|
4
|
+
export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, explainSessionEntityAccess, getPermissionableEntityKeys, hasEntityPermission, isPlatformAdministrator, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logEntityAccessDecision, logRbac, permissionRowsToRecord, resolveVendorScopeFromSessionUser, summarizeEntityPerms, vendorPortalFlagsFromUser } from './chunk-JIWUVQ6B.js';
|
|
4
5
|
import './chunk-SHUYVCID.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
9
|
+
|
|
10
|
+
function ForceLightMode() {
|
|
11
|
+
return React__default.default.createElement("script", {
|
|
12
|
+
dangerouslySetInnerHTML: {
|
|
13
|
+
__html: `(function(){try{var r=document.documentElement,b=document.body;if(r){r.classList.remove('dark');r.style.colorScheme='light';}if(b){b.classList.remove('dark');b.style.colorScheme='light';}}catch(e){}})();`
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
chunkUSNT2KNT_cjs.__name(ForceLightMode, "ForceLightMode");
|
|
18
|
+
|
|
19
|
+
exports.ForceLightMode = ForceLightMode;
|