@kyro-cms/core 0.5.5 → 0.7.0
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/api-handler.cjs +75 -35
- package/dist/api-handler.cjs.map +1 -1
- package/dist/api-handler.d.cts +2 -5
- package/dist/api-handler.d.ts +2 -5
- package/dist/api-handler.js +75 -36
- package/dist/api-handler.js.map +1 -1
- package/dist/bootstrap-AKAUP6F6.cjs +32 -0
- package/dist/{bootstrap-EE6BJZWL.cjs.map → bootstrap-AKAUP6F6.cjs.map} +1 -1
- package/dist/bootstrap-JCML6NFO.js +7 -0
- package/dist/{bootstrap-4MH44YKG.js.map → bootstrap-JCML6NFO.js.map} +1 -1
- package/dist/{chunk-WVPOPOEQ.cjs → chunk-2KVHZE6O.cjs} +286 -126
- package/dist/chunk-2KVHZE6O.cjs.map +1 -0
- package/dist/{chunk-RALQO47U.cjs → chunk-2OL4O2TH.cjs} +55 -2
- package/dist/chunk-2OL4O2TH.cjs.map +1 -0
- package/dist/{chunk-XU7AFF6V.js → chunk-35U3FROB.js} +982 -4
- package/dist/chunk-35U3FROB.js.map +1 -0
- package/dist/{chunk-WSCJQI2B.js → chunk-3J4MFTI3.js} +27 -11
- package/dist/chunk-3J4MFTI3.js.map +1 -0
- package/dist/chunk-3ZFYL34R.js +391 -0
- package/dist/chunk-3ZFYL34R.js.map +1 -0
- package/dist/chunk-4DA7QPLA.cjs +356 -0
- package/dist/chunk-4DA7QPLA.cjs.map +1 -0
- package/dist/{chunk-TP5YQFIX.js → chunk-57P6MJKC.js} +3 -715
- package/dist/chunk-57P6MJKC.js.map +1 -0
- package/dist/{chunk-R2YHJN6W.cjs → chunk-5KVM3WEY.cjs} +34 -208
- package/dist/chunk-5KVM3WEY.cjs.map +1 -0
- package/dist/{chunk-Z2OVHWHB.cjs → chunk-6IMPH6WV.cjs} +28 -11
- package/dist/chunk-6IMPH6WV.cjs.map +1 -0
- package/dist/{chunk-QKVA2SOG.js → chunk-DXHRBMGB.js} +27 -284
- package/dist/chunk-DXHRBMGB.js.map +1 -0
- package/dist/{chunk-E3BZLMX6.js → chunk-ES5HNFFT.js} +43 -2
- package/dist/chunk-ES5HNFFT.js.map +1 -0
- package/dist/{chunk-QYZKIPSD.js → chunk-FXYP2HA6.js} +34 -3
- package/dist/chunk-FXYP2HA6.js.map +1 -0
- package/dist/chunk-H727JIG7.js +809 -0
- package/dist/chunk-H727JIG7.js.map +1 -0
- package/dist/{chunk-AM4JKIPP.js → chunk-HXRD4B37.js} +9 -183
- package/dist/chunk-HXRD4B37.js.map +1 -0
- package/dist/chunk-I7HHI6QV.cjs +816 -0
- package/dist/chunk-I7HHI6QV.cjs.map +1 -0
- package/dist/{chunk-RDRJVCL5.cjs → chunk-IA6AU5PI.cjs} +2 -720
- package/dist/chunk-IA6AU5PI.cjs.map +1 -0
- package/dist/{chunk-55BNRTLW.cjs → chunk-LINKCEG4.cjs} +985 -4
- package/dist/chunk-LINKCEG4.cjs.map +1 -0
- package/dist/{chunk-TVVYZ2TH.js → chunk-OHVB4AJ7.js} +56 -3
- package/dist/chunk-OHVB4AJ7.js.map +1 -0
- package/dist/{chunk-XAEBVZTI.cjs → chunk-PDYFVNUX.cjs} +26 -289
- package/dist/chunk-PDYFVNUX.cjs.map +1 -0
- package/dist/{chunk-6WXQRYTW.js → chunk-QPPDLRNR.js} +286 -126
- package/dist/chunk-QPPDLRNR.js.map +1 -0
- package/dist/{chunk-WBCIEYHC.cjs → chunk-QUW2RZTM.cjs} +35 -4
- package/dist/chunk-QUW2RZTM.cjs.map +1 -0
- package/dist/chunk-SA7NSSIQ.cjs +397 -0
- package/dist/chunk-SA7NSSIQ.cjs.map +1 -0
- package/dist/{chunk-H4XCAPA6.cjs → chunk-V3LKPM3O.cjs} +43 -2
- package/dist/chunk-V3LKPM3O.cjs.map +1 -0
- package/dist/chunk-Y3N7UUDO.js +349 -0
- package/dist/chunk-Y3N7UUDO.js.map +1 -0
- package/dist/{chunk-S3FG2NY7.js → chunk-Y3QQN7PN.js} +4 -3
- package/dist/chunk-Y3QQN7PN.js.map +1 -0
- package/dist/{chunk-5HA5OMFH.cjs → chunk-YVUJBEXE.cjs} +7 -6
- package/dist/chunk-YVUJBEXE.cjs.map +1 -0
- package/dist/cli/index.cjs +103 -20
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +103 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/drizzle/index.cjs +12 -12
- package/dist/drizzle/index.d.cts +23 -2
- package/dist/drizzle/index.d.ts +23 -2
- package/dist/drizzle/index.js +3 -3
- package/dist/index.cjs +174 -1054
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -7
- package/dist/index.d.ts +85 -7
- package/dist/index.js +91 -980
- package/dist/index.js.map +1 -1
- package/dist/integration.cjs +2 -2
- package/dist/integration.d.cts +3 -16
- package/dist/integration.d.ts +3 -16
- package/dist/integration.js +1 -1
- package/dist/mongo-auth-adapter-NHHUJHVH.cjs +17 -0
- package/dist/mongo-auth-adapter-NHHUJHVH.cjs.map +1 -0
- package/dist/mongo-auth-adapter-NJQUUCTP.js +4 -0
- package/dist/mongo-auth-adapter-NJQUUCTP.js.map +1 -0
- package/dist/mongodb/index.cjs +9 -8
- package/dist/mongodb/index.d.cts +86 -5
- package/dist/mongodb/index.d.ts +86 -5
- package/dist/mongodb/index.js +3 -2
- package/dist/postgres-auth-adapter-3T2NKTSE.js +5 -0
- package/dist/{postgres-auth-adapter-B65BULNS.js.map → postgres-auth-adapter-3T2NKTSE.js.map} +1 -1
- package/dist/postgres-auth-adapter-7IEENCKQ.cjs +14 -0
- package/dist/{postgres-auth-adapter-6742WDCF.cjs.map → postgres-auth-adapter-7IEENCKQ.cjs.map} +1 -1
- package/dist/redis-adapter-D2E2S3GB.cjs +13 -0
- package/dist/{redis-adapter-LPUWLE4Y.cjs.map → redis-adapter-D2E2S3GB.cjs.map} +1 -1
- package/dist/redis-adapter-VQXD7ESY.js +4 -0
- package/dist/{redis-adapter-THYDCGQR.js.map → redis-adapter-VQXD7ESY.js.map} +1 -1
- package/dist/rest/index.cjs +10 -8
- package/dist/rest/index.js +8 -6
- package/dist/sqlite-adapter-LVK5PS4T.cjs +13 -0
- package/dist/sqlite-adapter-LVK5PS4T.cjs.map +1 -0
- package/dist/sqlite-adapter-TR3U3W6Q.js +4 -0
- package/dist/sqlite-adapter-TR3U3W6Q.js.map +1 -0
- package/dist/templates/index.cjs +31 -27
- package/dist/templates/index.d.cts +8 -5
- package/dist/templates/index.d.ts +8 -5
- package/dist/templates/index.js +1 -1
- package/dist/{base-eVegJ_Pr.d.ts → tenant-B1YB0Jy8.d.ts} +10 -1
- package/dist/{base-DvvNqnM-.d.cts → tenant-Cpeveji6.d.cts} +10 -1
- package/dist/{types-DqN4ckOC.d.cts → types-D6ZLRGbH.d.cts} +19 -1
- package/dist/{types-DqN4ckOC.d.ts → types-D6ZLRGbH.d.ts} +19 -1
- package/package.json +56 -9
- package/dist/adapter-BSvBudTG.d.cts +0 -65
- package/dist/adapter-CXGB2Elb.d.ts +0 -65
- package/dist/bootstrap-4MH44YKG.js +0 -6
- package/dist/bootstrap-EE6BJZWL.cjs +0 -31
- package/dist/chunk-55BNRTLW.cjs.map +0 -1
- package/dist/chunk-5HA5OMFH.cjs.map +0 -1
- package/dist/chunk-6WXQRYTW.js.map +0 -1
- package/dist/chunk-A4USRVTQ.js +0 -115
- package/dist/chunk-A4USRVTQ.js.map +0 -1
- package/dist/chunk-AM4JKIPP.js.map +0 -1
- package/dist/chunk-E3BZLMX6.js.map +0 -1
- package/dist/chunk-H4XCAPA6.cjs.map +0 -1
- package/dist/chunk-KOCTZKPV.cjs +0 -117
- package/dist/chunk-KOCTZKPV.cjs.map +0 -1
- package/dist/chunk-QKVA2SOG.js.map +0 -1
- package/dist/chunk-QYZKIPSD.js.map +0 -1
- package/dist/chunk-R2YHJN6W.cjs.map +0 -1
- package/dist/chunk-RALQO47U.cjs.map +0 -1
- package/dist/chunk-RDRJVCL5.cjs.map +0 -1
- package/dist/chunk-S3FG2NY7.js.map +0 -1
- package/dist/chunk-TP5YQFIX.js.map +0 -1
- package/dist/chunk-TVVYZ2TH.js.map +0 -1
- package/dist/chunk-WBCIEYHC.cjs.map +0 -1
- package/dist/chunk-WSCJQI2B.js.map +0 -1
- package/dist/chunk-WVPOPOEQ.cjs.map +0 -1
- package/dist/chunk-XAEBVZTI.cjs.map +0 -1
- package/dist/chunk-XU7AFF6V.js.map +0 -1
- package/dist/chunk-Z2OVHWHB.cjs.map +0 -1
- package/dist/postgres-auth-adapter-6742WDCF.cjs +0 -14
- package/dist/postgres-auth-adapter-B65BULNS.js +0 -5
- package/dist/redis-adapter-LPUWLE4Y.cjs +0 -13
- package/dist/redis-adapter-THYDCGQR.js +0 -4
package/dist/index.d.cts
CHANGED
|
@@ -16,18 +16,18 @@ export { p as ALL_FIELD_TYPES, A as ArrayField, B as BaseField, a as Block, d as
|
|
|
16
16
|
import { ZodTypeAny } from 'zod';
|
|
17
17
|
export { z } from 'zod';
|
|
18
18
|
export { createColumnsNode, normalizeRichTextDocument, normalizeRichTextValue, renderRichText, richTextStyles } from './fields/index.cjs';
|
|
19
|
-
import { A as AbstractBaseAdapter } from './
|
|
19
|
+
import { A as AbstractBaseAdapter, T as TenantContext } from './tenant-Cpeveji6.cjs';
|
|
20
20
|
import { Dialect } from './drizzle/index.cjs';
|
|
21
21
|
export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.cjs';
|
|
22
|
-
export {
|
|
23
|
-
import { e as AuditLog, d as AuditLogFilter, A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, b as AuthTokenConfig, R as RegisterData, a as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-DqN4ckOC.cjs';
|
|
24
|
-
export { f as AuditAction } from './types-DqN4ckOC.cjs';
|
|
25
|
-
import { Redis } from 'ioredis';
|
|
22
|
+
export { MongoDBAdapter, MongoDBAuthAdapter, createMongoDBAdapter } from './mongodb/index.cjs';
|
|
26
23
|
export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.cjs';
|
|
27
24
|
export { createHonoApp, createRESTAPI } from './rest/index.cjs';
|
|
28
25
|
export { A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, S as StylingConfig, a as StylingMode, T as ThemeBorderRadius, b as ThemeColors, c as ThemeConfig, d as ThemeFonts, e as ThemeShadows, f as ThemeSpacing, g as createAdminStyling, h as defaultDarkTheme, i as defaultFieldStyling, j as defaultLightTheme, k as ecommerce2026Theme, l as generateCSSVariables, m as generateTailwindConfig } from './index-Bz9JqRGI.cjs';
|
|
29
|
-
|
|
26
|
+
import { d as AuditLog, e as AuditLogFilter, A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, b as AuthTokenConfig, R as RegisterData, a as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-D6ZLRGbH.cjs';
|
|
27
|
+
export { f as AuditAction } from './types-D6ZLRGbH.cjs';
|
|
28
|
+
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.cjs';
|
|
30
29
|
export { default as kyro } from './integration.cjs';
|
|
30
|
+
import { Redis } from 'ioredis';
|
|
31
31
|
import 'ws';
|
|
32
32
|
import 'drizzle-orm/postgres-js';
|
|
33
33
|
import 'astro';
|
|
@@ -173,6 +173,9 @@ declare class LocalAdapter extends AbstractBaseAdapter {
|
|
|
173
173
|
private migrations;
|
|
174
174
|
private readonly draftsTableName;
|
|
175
175
|
private readonly versionsTableName;
|
|
176
|
+
private tenantContext?;
|
|
177
|
+
setTenantContext(context: TenantContext | undefined): void;
|
|
178
|
+
getTenantContext(): TenantContext | undefined;
|
|
176
179
|
constructor(options: {
|
|
177
180
|
db?: any;
|
|
178
181
|
path?: string;
|
|
@@ -398,6 +401,25 @@ declare class RedisAuthAdapter implements AuthAdapter {
|
|
|
398
401
|
private hashToUser;
|
|
399
402
|
private sessionToHash;
|
|
400
403
|
private hashToSession;
|
|
404
|
+
private tokenKey;
|
|
405
|
+
createEmailVerificationToken(userId: string): Promise<{
|
|
406
|
+
token: string;
|
|
407
|
+
expiresAt: Date;
|
|
408
|
+
}>;
|
|
409
|
+
verifyEmailToken(token: string): Promise<{
|
|
410
|
+
success: boolean;
|
|
411
|
+
userId?: string;
|
|
412
|
+
error?: string;
|
|
413
|
+
}>;
|
|
414
|
+
createPasswordResetToken(email: string): Promise<{
|
|
415
|
+
token: string;
|
|
416
|
+
expiresAt: Date;
|
|
417
|
+
error?: string;
|
|
418
|
+
}>;
|
|
419
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
420
|
+
success: boolean;
|
|
421
|
+
error?: string;
|
|
422
|
+
}>;
|
|
401
423
|
private auditLogKey;
|
|
402
424
|
private auditLogIndexKey;
|
|
403
425
|
findAuditLogs(filter: {
|
|
@@ -519,6 +541,7 @@ interface BootstrapResult {
|
|
|
519
541
|
declare function bootstrapAdmin(config: BootstrapConfig): Promise<BootstrapResult>;
|
|
520
542
|
declare function getBootstrapFromEnv(): BootstrapConfig | null;
|
|
521
543
|
declare function autoBootstrap(authAdapter?: AuthAdapter): Promise<BootstrapResult | null>;
|
|
544
|
+
declare function bootstrapWithRetry(config: BootstrapConfig, maxRetries?: number, retryDelayMs?: number): Promise<BootstrapResult>;
|
|
522
545
|
|
|
523
546
|
interface PasswordPolicyConfig {
|
|
524
547
|
minLength: number;
|
|
@@ -749,6 +772,8 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
749
772
|
private refreshTokens;
|
|
750
773
|
private emailToUserId;
|
|
751
774
|
private passwordHistory;
|
|
775
|
+
private emailVerificationTokens;
|
|
776
|
+
private passwordResetTokens;
|
|
752
777
|
private auditLogs;
|
|
753
778
|
private externalDb;
|
|
754
779
|
constructor();
|
|
@@ -777,6 +802,24 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
777
802
|
addPasswordToHistory(userId: string, passwordHash: string): Promise<void>;
|
|
778
803
|
getPasswordHistory(userId: string, count?: number): Promise<string[]>;
|
|
779
804
|
isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
805
|
+
createEmailVerificationToken(userId: string): Promise<{
|
|
806
|
+
token: string;
|
|
807
|
+
expiresAt: Date;
|
|
808
|
+
}>;
|
|
809
|
+
verifyEmailToken(token: string): Promise<{
|
|
810
|
+
success: boolean;
|
|
811
|
+
userId?: string;
|
|
812
|
+
error?: string;
|
|
813
|
+
}>;
|
|
814
|
+
createPasswordResetToken(email: string): Promise<{
|
|
815
|
+
token: string;
|
|
816
|
+
expiresAt: Date;
|
|
817
|
+
error?: string;
|
|
818
|
+
}>;
|
|
819
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
820
|
+
success: boolean;
|
|
821
|
+
error?: string;
|
|
822
|
+
}>;
|
|
780
823
|
hasAnyUsers(): Promise<boolean>;
|
|
781
824
|
findAuditLogs(filter: {
|
|
782
825
|
userId?: string;
|
|
@@ -804,6 +847,23 @@ declare class Auth {
|
|
|
804
847
|
getUserFromToken(token: string): Promise<AuthUser | null>;
|
|
805
848
|
changePassword(userId: string, currentPassword: string, newPassword: string): Promise<AuthResult>;
|
|
806
849
|
resetPassword(email: string, newPassword: string): Promise<AuthResult>;
|
|
850
|
+
sendEmailVerification(userId: string): Promise<{
|
|
851
|
+
success: boolean;
|
|
852
|
+
error?: string;
|
|
853
|
+
}>;
|
|
854
|
+
verifyEmail(token: string): Promise<{
|
|
855
|
+
success: boolean;
|
|
856
|
+
userId?: string;
|
|
857
|
+
error?: string;
|
|
858
|
+
}>;
|
|
859
|
+
requestPasswordReset(email: string): Promise<{
|
|
860
|
+
success: boolean;
|
|
861
|
+
error?: string;
|
|
862
|
+
}>;
|
|
863
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
864
|
+
success: boolean;
|
|
865
|
+
error?: string;
|
|
866
|
+
}>;
|
|
807
867
|
deleteAccount(userId: string): Promise<AuthResult>;
|
|
808
868
|
private createSessionForUser;
|
|
809
869
|
private generateToken;
|
|
@@ -932,6 +992,24 @@ declare class SQLiteAuthAdapter implements AuthAdapter {
|
|
|
932
992
|
total: number;
|
|
933
993
|
}>;
|
|
934
994
|
createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
|
|
995
|
+
createEmailVerificationToken(userId: string): Promise<{
|
|
996
|
+
token: string;
|
|
997
|
+
expiresAt: Date;
|
|
998
|
+
}>;
|
|
999
|
+
verifyEmailToken(token: string): Promise<{
|
|
1000
|
+
success: boolean;
|
|
1001
|
+
userId?: string;
|
|
1002
|
+
error?: string;
|
|
1003
|
+
}>;
|
|
1004
|
+
createPasswordResetToken(email: string): Promise<{
|
|
1005
|
+
token: string;
|
|
1006
|
+
expiresAt: Date;
|
|
1007
|
+
error?: string;
|
|
1008
|
+
}>;
|
|
1009
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
1010
|
+
success: boolean;
|
|
1011
|
+
error?: string;
|
|
1012
|
+
}>;
|
|
935
1013
|
}
|
|
936
1014
|
|
|
937
1015
|
type VersionStatus = 'draft' | 'published' | 'archived';
|
|
@@ -1365,4 +1443,4 @@ declare function getSessionConfig(): {
|
|
|
1365
1443
|
maxSessionsPerUser: number;
|
|
1366
1444
|
};
|
|
1367
1445
|
|
|
1368
|
-
export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, type SeoTagsOptions, Session, type StorageAdapter, type StorageConfig$1 as StorageConfig, type StorageOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getSessionConfig, globalToZod, isArchived, isDraft, isPublished, loadSecrets, presetPlugins, resolveProvider, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|
|
1446
|
+
export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, type SeoTagsOptions, Session, type StorageAdapter, type StorageConfig$1 as StorageConfig, type StorageOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getSessionConfig, globalToZod, isArchived, isDraft, isPublished, loadSecrets, presetPlugins, resolveProvider, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,18 +16,18 @@ export { p as ALL_FIELD_TYPES, A as ArrayField, B as BaseField, a as Block, d as
|
|
|
16
16
|
import { ZodTypeAny } from 'zod';
|
|
17
17
|
export { z } from 'zod';
|
|
18
18
|
export { createColumnsNode, normalizeRichTextDocument, normalizeRichTextValue, renderRichText, richTextStyles } from './fields/index.js';
|
|
19
|
-
import { A as AbstractBaseAdapter } from './
|
|
19
|
+
import { A as AbstractBaseAdapter, T as TenantContext } from './tenant-B1YB0Jy8.js';
|
|
20
20
|
import { Dialect } from './drizzle/index.js';
|
|
21
21
|
export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.js';
|
|
22
|
-
export {
|
|
23
|
-
import { e as AuditLog, d as AuditLogFilter, A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, b as AuthTokenConfig, R as RegisterData, a as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-DqN4ckOC.js';
|
|
24
|
-
export { f as AuditAction } from './types-DqN4ckOC.js';
|
|
25
|
-
import { Redis } from 'ioredis';
|
|
22
|
+
export { MongoDBAdapter, MongoDBAuthAdapter, createMongoDBAdapter } from './mongodb/index.js';
|
|
26
23
|
export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.js';
|
|
27
24
|
export { createHonoApp, createRESTAPI } from './rest/index.js';
|
|
28
25
|
export { A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, S as StylingConfig, a as StylingMode, T as ThemeBorderRadius, b as ThemeColors, c as ThemeConfig, d as ThemeFonts, e as ThemeShadows, f as ThemeSpacing, g as createAdminStyling, h as defaultDarkTheme, i as defaultFieldStyling, j as defaultLightTheme, k as ecommerce2026Theme, l as generateCSSVariables, m as generateTailwindConfig } from './index-Bz9JqRGI.js';
|
|
29
|
-
|
|
26
|
+
import { d as AuditLog, e as AuditLogFilter, A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, b as AuthTokenConfig, R as RegisterData, a as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-D6ZLRGbH.js';
|
|
27
|
+
export { f as AuditAction } from './types-D6ZLRGbH.js';
|
|
28
|
+
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.js';
|
|
30
29
|
export { default as kyro } from './integration.js';
|
|
30
|
+
import { Redis } from 'ioredis';
|
|
31
31
|
import 'ws';
|
|
32
32
|
import 'drizzle-orm/postgres-js';
|
|
33
33
|
import 'astro';
|
|
@@ -173,6 +173,9 @@ declare class LocalAdapter extends AbstractBaseAdapter {
|
|
|
173
173
|
private migrations;
|
|
174
174
|
private readonly draftsTableName;
|
|
175
175
|
private readonly versionsTableName;
|
|
176
|
+
private tenantContext?;
|
|
177
|
+
setTenantContext(context: TenantContext | undefined): void;
|
|
178
|
+
getTenantContext(): TenantContext | undefined;
|
|
176
179
|
constructor(options: {
|
|
177
180
|
db?: any;
|
|
178
181
|
path?: string;
|
|
@@ -398,6 +401,25 @@ declare class RedisAuthAdapter implements AuthAdapter {
|
|
|
398
401
|
private hashToUser;
|
|
399
402
|
private sessionToHash;
|
|
400
403
|
private hashToSession;
|
|
404
|
+
private tokenKey;
|
|
405
|
+
createEmailVerificationToken(userId: string): Promise<{
|
|
406
|
+
token: string;
|
|
407
|
+
expiresAt: Date;
|
|
408
|
+
}>;
|
|
409
|
+
verifyEmailToken(token: string): Promise<{
|
|
410
|
+
success: boolean;
|
|
411
|
+
userId?: string;
|
|
412
|
+
error?: string;
|
|
413
|
+
}>;
|
|
414
|
+
createPasswordResetToken(email: string): Promise<{
|
|
415
|
+
token: string;
|
|
416
|
+
expiresAt: Date;
|
|
417
|
+
error?: string;
|
|
418
|
+
}>;
|
|
419
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
420
|
+
success: boolean;
|
|
421
|
+
error?: string;
|
|
422
|
+
}>;
|
|
401
423
|
private auditLogKey;
|
|
402
424
|
private auditLogIndexKey;
|
|
403
425
|
findAuditLogs(filter: {
|
|
@@ -519,6 +541,7 @@ interface BootstrapResult {
|
|
|
519
541
|
declare function bootstrapAdmin(config: BootstrapConfig): Promise<BootstrapResult>;
|
|
520
542
|
declare function getBootstrapFromEnv(): BootstrapConfig | null;
|
|
521
543
|
declare function autoBootstrap(authAdapter?: AuthAdapter): Promise<BootstrapResult | null>;
|
|
544
|
+
declare function bootstrapWithRetry(config: BootstrapConfig, maxRetries?: number, retryDelayMs?: number): Promise<BootstrapResult>;
|
|
522
545
|
|
|
523
546
|
interface PasswordPolicyConfig {
|
|
524
547
|
minLength: number;
|
|
@@ -749,6 +772,8 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
749
772
|
private refreshTokens;
|
|
750
773
|
private emailToUserId;
|
|
751
774
|
private passwordHistory;
|
|
775
|
+
private emailVerificationTokens;
|
|
776
|
+
private passwordResetTokens;
|
|
752
777
|
private auditLogs;
|
|
753
778
|
private externalDb;
|
|
754
779
|
constructor();
|
|
@@ -777,6 +802,24 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
777
802
|
addPasswordToHistory(userId: string, passwordHash: string): Promise<void>;
|
|
778
803
|
getPasswordHistory(userId: string, count?: number): Promise<string[]>;
|
|
779
804
|
isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
805
|
+
createEmailVerificationToken(userId: string): Promise<{
|
|
806
|
+
token: string;
|
|
807
|
+
expiresAt: Date;
|
|
808
|
+
}>;
|
|
809
|
+
verifyEmailToken(token: string): Promise<{
|
|
810
|
+
success: boolean;
|
|
811
|
+
userId?: string;
|
|
812
|
+
error?: string;
|
|
813
|
+
}>;
|
|
814
|
+
createPasswordResetToken(email: string): Promise<{
|
|
815
|
+
token: string;
|
|
816
|
+
expiresAt: Date;
|
|
817
|
+
error?: string;
|
|
818
|
+
}>;
|
|
819
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
820
|
+
success: boolean;
|
|
821
|
+
error?: string;
|
|
822
|
+
}>;
|
|
780
823
|
hasAnyUsers(): Promise<boolean>;
|
|
781
824
|
findAuditLogs(filter: {
|
|
782
825
|
userId?: string;
|
|
@@ -804,6 +847,23 @@ declare class Auth {
|
|
|
804
847
|
getUserFromToken(token: string): Promise<AuthUser | null>;
|
|
805
848
|
changePassword(userId: string, currentPassword: string, newPassword: string): Promise<AuthResult>;
|
|
806
849
|
resetPassword(email: string, newPassword: string): Promise<AuthResult>;
|
|
850
|
+
sendEmailVerification(userId: string): Promise<{
|
|
851
|
+
success: boolean;
|
|
852
|
+
error?: string;
|
|
853
|
+
}>;
|
|
854
|
+
verifyEmail(token: string): Promise<{
|
|
855
|
+
success: boolean;
|
|
856
|
+
userId?: string;
|
|
857
|
+
error?: string;
|
|
858
|
+
}>;
|
|
859
|
+
requestPasswordReset(email: string): Promise<{
|
|
860
|
+
success: boolean;
|
|
861
|
+
error?: string;
|
|
862
|
+
}>;
|
|
863
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
864
|
+
success: boolean;
|
|
865
|
+
error?: string;
|
|
866
|
+
}>;
|
|
807
867
|
deleteAccount(userId: string): Promise<AuthResult>;
|
|
808
868
|
private createSessionForUser;
|
|
809
869
|
private generateToken;
|
|
@@ -932,6 +992,24 @@ declare class SQLiteAuthAdapter implements AuthAdapter {
|
|
|
932
992
|
total: number;
|
|
933
993
|
}>;
|
|
934
994
|
createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
|
|
995
|
+
createEmailVerificationToken(userId: string): Promise<{
|
|
996
|
+
token: string;
|
|
997
|
+
expiresAt: Date;
|
|
998
|
+
}>;
|
|
999
|
+
verifyEmailToken(token: string): Promise<{
|
|
1000
|
+
success: boolean;
|
|
1001
|
+
userId?: string;
|
|
1002
|
+
error?: string;
|
|
1003
|
+
}>;
|
|
1004
|
+
createPasswordResetToken(email: string): Promise<{
|
|
1005
|
+
token: string;
|
|
1006
|
+
expiresAt: Date;
|
|
1007
|
+
error?: string;
|
|
1008
|
+
}>;
|
|
1009
|
+
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
1010
|
+
success: boolean;
|
|
1011
|
+
error?: string;
|
|
1012
|
+
}>;
|
|
935
1013
|
}
|
|
936
1014
|
|
|
937
1015
|
type VersionStatus = 'draft' | 'published' | 'archived';
|
|
@@ -1365,4 +1443,4 @@ declare function getSessionConfig(): {
|
|
|
1365
1443
|
maxSessionsPerUser: number;
|
|
1366
1444
|
};
|
|
1367
1445
|
|
|
1368
|
-
export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, type SeoTagsOptions, Session, type StorageAdapter, type StorageConfig$1 as StorageConfig, type StorageOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getSessionConfig, globalToZod, isArchived, isDraft, isPublished, loadSecrets, presetPlugins, resolveProvider, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|
|
1446
|
+
export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, type SeoTagsOptions, Session, type StorageAdapter, type StorageConfig$1 as StorageConfig, type StorageOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getSessionConfig, globalToZod, isArchived, isDraft, isPublished, loadSecrets, presetPlugins, resolveProvider, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|