@kyro-cms/core 0.3.4 → 0.3.5
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/{WebhookService-BCpW2dyL.d.ts → WebhookService-118ZTFis.d.ts} +1 -1
- package/dist/{WebhookService-DxYSFvNg.d.cts → WebhookService-AefJfqX0.d.cts} +1 -1
- package/dist/api-handler.cjs +5 -5
- package/dist/api-handler.js +4 -4
- package/dist/{chunk-VEI5KQVC.cjs → chunk-2UOI5MUC.cjs} +45 -15
- package/dist/chunk-2UOI5MUC.cjs.map +1 -0
- package/dist/{chunk-2SJATAN4.js → chunk-4UD44U4Z.js} +320 -16
- package/dist/chunk-4UD44U4Z.js.map +1 -0
- package/dist/{chunk-XIXGJGQW.js → chunk-5FTY2DLG.js} +44 -14
- package/dist/chunk-5FTY2DLG.js.map +1 -0
- package/dist/{chunk-MMYAIYHJ.cjs → chunk-DE7OQOMD.cjs} +319 -15
- package/dist/chunk-DE7OQOMD.cjs.map +1 -0
- package/dist/{chunk-CZ3HWX2X.cjs → chunk-R4C4O4SE.cjs} +8 -8
- package/dist/chunk-R4C4O4SE.cjs.map +1 -0
- package/dist/{chunk-B76I67F3.js → chunk-WSCJQI2B.js} +61 -13
- package/dist/chunk-WSCJQI2B.js.map +1 -0
- package/dist/{chunk-6LPNEC6D.js → chunk-Y3TM7WH7.js} +9 -9
- package/dist/chunk-Y3TM7WH7.js.map +1 -0
- package/dist/{chunk-DAIBBBOL.cjs → chunk-Z2OVHWHB.cjs} +61 -13
- package/dist/chunk-Z2OVHWHB.cjs.map +1 -0
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/drizzle/index.cjs +5 -5
- package/dist/drizzle/index.d.cts +1 -1
- package/dist/drizzle/index.d.ts +1 -1
- package/dist/drizzle/index.js +1 -1
- package/dist/index.cjs +133 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +75 -35
- package/dist/index.js.map +1 -1
- package/dist/rest/index.cjs +4 -3
- package/dist/rest/index.d.cts +1 -1
- package/dist/rest/index.d.ts +1 -1
- package/dist/rest/index.js +2 -1
- package/dist/templates/index.cjs +24 -24
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.d.cts +1 -1
- package/dist/trpc/index.d.ts +1 -1
- package/dist/{types-Da83JLDk.d.cts → types-BnTm7oJG.d.cts} +1 -1
- package/dist/{types-Da83JLDk.d.ts → types-BnTm7oJG.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2SJATAN4.js.map +0 -1
- package/dist/chunk-6LPNEC6D.js.map +0 -1
- package/dist/chunk-B76I67F3.js.map +0 -1
- package/dist/chunk-CZ3HWX2X.cjs.map +0 -1
- package/dist/chunk-DAIBBBOL.cjs.map +0 -1
- package/dist/chunk-MMYAIYHJ.cjs.map +0 -1
- package/dist/chunk-VEI5KQVC.cjs.map +0 -1
- package/dist/chunk-XIXGJGQW.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -9,6 +9,8 @@ import { B as BaseAdapter, K as KyroConfig, m as User, R as Request$1, C as Coll
|
|
|
9
9
|
export { n as AccessArgs, o as AccessControl, p as AdapterConfig, A as AdminConfig, a as AuthConfig, q as CollectionAccess, r as CollectionHooks, s as CreateResult, t as FieldAccess, u as FieldHooks, v as GlobalAccess, w as GlobalHooks, x as HookArgs, I as ImageSize, P as PluginConfig, U as UploadConfig, V as VersionConfig, W as WhereClause, y as evaluateAccess, z as getWhereClause, E as mergeWhereClauses, J as runFieldHooks, L as runHooks } from './types-J3R9nVsZ.cjs';
|
|
10
10
|
import { KyroPubSub, KyroWSServer } from './ws/index.cjs';
|
|
11
11
|
export { PubSub, createWSServer } from './ws/index.cjs';
|
|
12
|
+
import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig, c as WebhookService } from './WebhookService-AefJfqX0.cjs';
|
|
13
|
+
export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, d as WEBHOOK_COLLECTION, e as WEBHOOK_DELIVERY_COLLECTION, f as WEBHOOK_EVENTS, g as WebhookEvent, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-AefJfqX0.cjs';
|
|
12
14
|
import { F as Field } from './types-VtjUxIMp.cjs';
|
|
13
15
|
export { p as ALL_FIELD_TYPES, A as ArrayField, B as BaseField, a as Block, d as BlocksField, q as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, E as EmailField, h as FieldAdmin, i as FieldType, G as GroupField, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, r as PRIMITIVE_FIELD_TYPES, P as PasswordField, s as RELATIONAL_FIELD_TYPES, R as RadioField, j as RelationshipField, k as RichTextBlock, l as RichTextField, m as RowField, S as SelectField, T as TabsField, n as TextField, o as TextareaField, U as UploadField, V as ValidateOptions, t as isArrayField, u as isBlocksField, v as isGroupField, w as isImageField, x as isLayoutField, y as isNumberField, z as isRelationshipField, H as isRichTextField, K as isSelectField, O as isTextField, Q as isUploadField } from './types-VtjUxIMp.cjs';
|
|
14
16
|
import { ZodTypeAny } from 'zod';
|
|
@@ -21,10 +23,8 @@ export { MongoDBAdapter, createMongoDBAdapter } from './mongodb/index.cjs';
|
|
|
21
23
|
export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.cjs';
|
|
22
24
|
export { createHonoApp, createRESTAPI } from './rest/index.cjs';
|
|
23
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';
|
|
24
|
-
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-
|
|
25
|
-
export { f as AuditAction } from './types-
|
|
26
|
-
import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-DxYSFvNg.cjs';
|
|
27
|
-
export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, c as WEBHOOK_COLLECTION, d as WEBHOOK_DELIVERY_COLLECTION, e as WEBHOOK_EVENTS, f as WebhookEvent, g as WebhookService, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-DxYSFvNg.cjs';
|
|
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-BnTm7oJG.cjs';
|
|
27
|
+
export { f as AuditAction } from './types-BnTm7oJG.cjs';
|
|
28
28
|
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.cjs';
|
|
29
29
|
import { Redis } from 'ioredis';
|
|
30
30
|
import 'ws';
|
|
@@ -89,6 +89,7 @@ declare class Kyro {
|
|
|
89
89
|
registry: Registry;
|
|
90
90
|
db: BaseAdapter;
|
|
91
91
|
pubsub: KyroPubSub;
|
|
92
|
+
webhookService: WebhookService;
|
|
92
93
|
settings?: Record<string, any>;
|
|
93
94
|
private wsServer?;
|
|
94
95
|
private config;
|
|
@@ -177,6 +178,7 @@ declare class LocalAdapter extends AbstractBaseAdapter {
|
|
|
177
178
|
private ensureTable;
|
|
178
179
|
private ensureVersionsTable;
|
|
179
180
|
private ensureDraftsTable;
|
|
181
|
+
private col;
|
|
180
182
|
private fieldToSQL;
|
|
181
183
|
private parseGlobalsSlug;
|
|
182
184
|
find<T>(args: FindArgs): Promise<FindResult<T>>;
|
|
@@ -1358,4 +1360,4 @@ declare function getSessionConfig(): {
|
|
|
1358
1360
|
maxSessionsPerUser: number;
|
|
1359
1361
|
};
|
|
1360
1362
|
|
|
1361
|
-
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, 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 };
|
|
1363
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { B as BaseAdapter, K as KyroConfig, m as User, R as Request$1, C as Coll
|
|
|
9
9
|
export { n as AccessArgs, o as AccessControl, p as AdapterConfig, A as AdminConfig, a as AuthConfig, q as CollectionAccess, r as CollectionHooks, s as CreateResult, t as FieldAccess, u as FieldHooks, v as GlobalAccess, w as GlobalHooks, x as HookArgs, I as ImageSize, P as PluginConfig, U as UploadConfig, V as VersionConfig, W as WhereClause, y as evaluateAccess, z as getWhereClause, E as mergeWhereClauses, J as runFieldHooks, L as runHooks } from './types-Bs1up4yP.js';
|
|
10
10
|
import { KyroPubSub, KyroWSServer } from './ws/index.js';
|
|
11
11
|
export { PubSub, createWSServer } from './ws/index.js';
|
|
12
|
+
import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig, c as WebhookService } from './WebhookService-118ZTFis.js';
|
|
13
|
+
export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, d as WEBHOOK_COLLECTION, e as WEBHOOK_DELIVERY_COLLECTION, f as WEBHOOK_EVENTS, g as WebhookEvent, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-118ZTFis.js';
|
|
12
14
|
import { F as Field } from './types-VtjUxIMp.js';
|
|
13
15
|
export { p as ALL_FIELD_TYPES, A as ArrayField, B as BaseField, a as Block, d as BlocksField, q as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, E as EmailField, h as FieldAdmin, i as FieldType, G as GroupField, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, r as PRIMITIVE_FIELD_TYPES, P as PasswordField, s as RELATIONAL_FIELD_TYPES, R as RadioField, j as RelationshipField, k as RichTextBlock, l as RichTextField, m as RowField, S as SelectField, T as TabsField, n as TextField, o as TextareaField, U as UploadField, V as ValidateOptions, t as isArrayField, u as isBlocksField, v as isGroupField, w as isImageField, x as isLayoutField, y as isNumberField, z as isRelationshipField, H as isRichTextField, K as isSelectField, O as isTextField, Q as isUploadField } from './types-VtjUxIMp.js';
|
|
14
16
|
import { ZodTypeAny } from 'zod';
|
|
@@ -21,10 +23,8 @@ export { MongoDBAdapter, createMongoDBAdapter } from './mongodb/index.js';
|
|
|
21
23
|
export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.js';
|
|
22
24
|
export { createHonoApp, createRESTAPI } from './rest/index.js';
|
|
23
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';
|
|
24
|
-
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-
|
|
25
|
-
export { f as AuditAction } from './types-
|
|
26
|
-
import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-BCpW2dyL.js';
|
|
27
|
-
export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, c as WEBHOOK_COLLECTION, d as WEBHOOK_DELIVERY_COLLECTION, e as WEBHOOK_EVENTS, f as WebhookEvent, g as WebhookService, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-BCpW2dyL.js';
|
|
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-BnTm7oJG.js';
|
|
27
|
+
export { f as AuditAction } from './types-BnTm7oJG.js';
|
|
28
28
|
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.js';
|
|
29
29
|
import { Redis } from 'ioredis';
|
|
30
30
|
import 'ws';
|
|
@@ -89,6 +89,7 @@ declare class Kyro {
|
|
|
89
89
|
registry: Registry;
|
|
90
90
|
db: BaseAdapter;
|
|
91
91
|
pubsub: KyroPubSub;
|
|
92
|
+
webhookService: WebhookService;
|
|
92
93
|
settings?: Record<string, any>;
|
|
93
94
|
private wsServer?;
|
|
94
95
|
private config;
|
|
@@ -177,6 +178,7 @@ declare class LocalAdapter extends AbstractBaseAdapter {
|
|
|
177
178
|
private ensureTable;
|
|
178
179
|
private ensureVersionsTable;
|
|
179
180
|
private ensureDraftsTable;
|
|
181
|
+
private col;
|
|
180
182
|
private fieldToSQL;
|
|
181
183
|
private parseGlobalsSlug;
|
|
182
184
|
find<T>(args: FindArgs): Promise<FindResult<T>>;
|
|
@@ -1358,4 +1360,4 @@ declare function getSessionConfig(): {
|
|
|
1358
1360
|
maxSessionsPerUser: number;
|
|
1359
1361
|
};
|
|
1360
1362
|
|
|
1361
|
-
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, 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 };
|
|
1363
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export { RedisAuthAdapter } from './chunk-E3BZLMX6.js';
|
|
2
2
|
export { autoBootstrap, bootstrapAdmin, getBootstrapFromEnv } from './chunk-BQ2T4WRS.js';
|
|
3
|
-
export { allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './chunk-
|
|
4
|
-
export { ConfigValidationError, Kyro, Registry, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createKyro, createRegistry, fieldToZod, getRegistry, globalToZod, resetRegistry, validateCollection, validateConfig, validateFields, validateGlobal } from './chunk-
|
|
3
|
+
export { allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './chunk-WSCJQI2B.js';
|
|
4
|
+
export { ConfigValidationError, Kyro, Registry, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createKyro, createRegistry, fieldToZod, getRegistry, globalToZod, resetRegistry, validateCollection, validateConfig, validateFields, validateGlobal } from './chunk-5FTY2DLG.js';
|
|
5
5
|
export { CSSGenerator, createAdminStyling, defaultDarkTheme, defaultFieldStyling, defaultLightTheme, ecommerce2026Theme, generateCSSVariables, generateTailwindConfig } from './chunk-2HFJUUFZ.js';
|
|
6
6
|
export { ALL_FIELD_TYPES, COMPLEX_FIELD_TYPES, LAYOUT_FIELD_TYPES, PRIMITIVE_FIELD_TYPES, RELATIONAL_FIELD_TYPES, createColumnsNode, isArrayField, isBlocksField, isGroupField, isImageField, isLayoutField, isNumberField, isRelationshipField, isRichTextField, isSelectField, isTextField, isUploadField, normalizeRichTextDocument, normalizeRichTextValue, renderRichText, richTextStyles } from './chunk-Q23JB3KL.js';
|
|
7
7
|
export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from './chunk-3AJE4SEG.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { AuditLogger, InMemoryAuditLogger, InMemoryRateLimiter, MediaService, createAuditContext, createHonoApp, createLocalStorage, createRESTAPI, getAppSecret, getEncryptionKey, getSessionConfig, loadSecrets, resolveProvider, setDbAdapter } from './chunk-2SJATAN4.js';
|
|
8
|
+
import { init_secret, AuditLogger, InMemoryRateLimiter, InMemoryAuditLogger, AuthRoutes } from './chunk-4UD44U4Z.js';
|
|
9
|
+
export { AuditLogger, InMemoryAuditLogger, InMemoryRateLimiter, MediaService, createAuditContext, createHonoApp, createLocalStorage, createRESTAPI, getAppSecret, getEncryptionKey, getSessionConfig, loadSecrets, resolveProvider, setDbAdapter } from './chunk-4UD44U4Z.js';
|
|
11
10
|
import { EmailTransport, PasswordPolicy, SQLiteAuthAdapter } from './chunk-RYDGMBIG.js';
|
|
12
11
|
export { ConfigService, EmailTransport, PasswordPolicy, SQLiteAuthAdapter } from './chunk-RYDGMBIG.js';
|
|
13
12
|
import './chunk-YT7HXXVN.js';
|
|
14
13
|
import './chunk-P2YW545G.js';
|
|
15
14
|
export { ALL_WEBHOOK_EVENTS, WEBHOOK_COLLECTION, WEBHOOK_DELIVERY_COLLECTION, WEBHOOK_EVENTS, WebhookService, buildDeliveryRecord, createTestPayload, createWebhookService, deliverWebhook, deliverWithRetry, generateWebhookSecret, signPayload } from './chunk-QXIQWPAP.js';
|
|
15
|
+
export { buildGraphQLSchema, createGraphQLSchema } from './chunk-REK7AYOC.js';
|
|
16
16
|
export { evaluateAccess, getWhereClause, mergeWhereClauses } from './chunk-SDMNUYVU.js';
|
|
17
17
|
export { KyroPubSub, KyroWSServer, PubSub, createWSServer } from './chunk-3TPQ2BU6.js';
|
|
18
|
-
export { DrizzleAdapter, collectionToDrizzleSchema, createDrizzleAdapter, fieldToDrizzleType } from './chunk-
|
|
18
|
+
export { DrizzleAdapter, collectionToDrizzleSchema, createDrizzleAdapter, fieldToDrizzleType } from './chunk-Y3TM7WH7.js';
|
|
19
19
|
export { PostgresAuthAdapter } from './chunk-DBUYB32X.js';
|
|
20
20
|
import './chunk-WOWUL7ZY.js';
|
|
21
21
|
export { createDatabase, runMigrations, seedDefaultRoles } from './chunk-RGIQKTZ7.js';
|
|
@@ -78,7 +78,16 @@ function processFieldValue(row, field) {
|
|
|
78
78
|
value = Boolean(value);
|
|
79
79
|
}
|
|
80
80
|
if (f.type === "date" && value) {
|
|
81
|
-
|
|
81
|
+
try {
|
|
82
|
+
const d = new Date(value);
|
|
83
|
+
if (isNaN(d.getTime())) {
|
|
84
|
+
value = null;
|
|
85
|
+
} else {
|
|
86
|
+
value = d.toISOString();
|
|
87
|
+
}
|
|
88
|
+
} catch {
|
|
89
|
+
value = null;
|
|
90
|
+
}
|
|
82
91
|
}
|
|
83
92
|
if ((f.type === "upload" || f.type === "image") && value) {
|
|
84
93
|
try {
|
|
@@ -180,8 +189,8 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
180
189
|
const colDef = this.fieldToSQL(field);
|
|
181
190
|
if (colDef) columns.push(colDef);
|
|
182
191
|
}
|
|
183
|
-
columns.push(
|
|
184
|
-
columns.push(
|
|
192
|
+
columns.push(`${this.col("createdAt")} TEXT DEFAULT (datetime('now'))`);
|
|
193
|
+
columns.push(`${this.col("updatedAt")} TEXT DEFAULT (datetime('now'))`);
|
|
185
194
|
columns.push(`_status TEXT DEFAULT 'published'`);
|
|
186
195
|
columns.push(`_has_draft INTEGER DEFAULT 0`);
|
|
187
196
|
if (config.tenantScoped) {
|
|
@@ -195,27 +204,27 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
195
204
|
for (const field of flattenFields(config.fields)) {
|
|
196
205
|
if (field.name && field.indexed) {
|
|
197
206
|
this.db.exec(
|
|
198
|
-
`CREATE INDEX IF NOT EXISTS idx_${name}_${field.name} ON ${name}(${field.name})`
|
|
207
|
+
`CREATE INDEX IF NOT EXISTS idx_${name}_${field.name} ON ${name}(${this.col(field.name)})`
|
|
199
208
|
);
|
|
200
209
|
}
|
|
201
210
|
if (field.name && field.unique) {
|
|
202
211
|
this.db.exec(
|
|
203
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS idx_${name}_${field.name}_unique ON ${name}(${field.name})`
|
|
212
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS idx_${name}_${field.name}_unique ON ${name}(${this.col(field.name)})`
|
|
204
213
|
);
|
|
205
214
|
}
|
|
206
215
|
}
|
|
207
216
|
} else {
|
|
208
217
|
const existingSet = new Set(existingColumns);
|
|
209
|
-
for (const
|
|
210
|
-
const colName =
|
|
218
|
+
for (const colDef of columns) {
|
|
219
|
+
const colName = colDef.split(" ")[0].replace(/^"/, "").replace(/"$/, "");
|
|
211
220
|
if (!existingSet.has(colName) && colName !== "id") {
|
|
212
221
|
try {
|
|
213
222
|
if (colName === "_status") {
|
|
214
|
-
this.db.exec(`ALTER TABLE ${name} ADD COLUMN ${colName} TEXT DEFAULT 'published'`);
|
|
223
|
+
this.db.exec(`ALTER TABLE ${name} ADD COLUMN ${this.col(colName)} TEXT DEFAULT 'published'`);
|
|
215
224
|
} else if (colName === "_has_draft") {
|
|
216
|
-
this.db.exec(`ALTER TABLE ${name} ADD COLUMN ${colName} INTEGER DEFAULT 0`);
|
|
225
|
+
this.db.exec(`ALTER TABLE ${name} ADD COLUMN ${this.col(colName)} INTEGER DEFAULT 0`);
|
|
217
226
|
} else {
|
|
218
|
-
this.db.exec(`ALTER TABLE ${name} ADD COLUMN ${colName} TEXT`);
|
|
227
|
+
this.db.exec(`ALTER TABLE ${name} ADD COLUMN ${this.col(colName)} TEXT`);
|
|
219
228
|
}
|
|
220
229
|
} catch {
|
|
221
230
|
}
|
|
@@ -266,6 +275,12 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
266
275
|
`CREATE UNIQUE INDEX IF NOT EXISTS idx_${this.draftsTableName}_document ON ${this.draftsTableName}(collection_slug, document_id, tenant_id)`
|
|
267
276
|
);
|
|
268
277
|
}
|
|
278
|
+
// ========================================================================
|
|
279
|
+
// SQL Quoting
|
|
280
|
+
// ========================================================================
|
|
281
|
+
col(name) {
|
|
282
|
+
return `"${name}"`;
|
|
283
|
+
}
|
|
269
284
|
fieldToSQL(field) {
|
|
270
285
|
switch (field.type) {
|
|
271
286
|
case "text":
|
|
@@ -276,25 +291,25 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
276
291
|
case "code":
|
|
277
292
|
case "markdown":
|
|
278
293
|
case "url":
|
|
279
|
-
return
|
|
294
|
+
return this.col(field.name) + " TEXT";
|
|
280
295
|
case "number":
|
|
281
|
-
return
|
|
296
|
+
return this.col(field.name) + " REAL";
|
|
282
297
|
case "checkbox":
|
|
283
|
-
return
|
|
298
|
+
return this.col(field.name) + " INTEGER DEFAULT 0";
|
|
284
299
|
case "date":
|
|
285
|
-
return
|
|
300
|
+
return this.col(field.name) + " TEXT";
|
|
286
301
|
case "select":
|
|
287
302
|
case "radio":
|
|
288
|
-
return
|
|
303
|
+
return this.col(field.name) + " TEXT";
|
|
289
304
|
case "relationship":
|
|
290
305
|
case "upload":
|
|
291
|
-
return
|
|
306
|
+
return this.col(field.name) + " TEXT";
|
|
292
307
|
case "json":
|
|
293
308
|
case "richtext":
|
|
294
309
|
case "array":
|
|
295
310
|
case "group":
|
|
296
311
|
case "blocks":
|
|
297
|
-
return
|
|
312
|
+
return this.col(field.name) + " TEXT";
|
|
298
313
|
default:
|
|
299
314
|
return null;
|
|
300
315
|
}
|
|
@@ -346,26 +361,26 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
346
361
|
if (key === "AND" || key === "OR") continue;
|
|
347
362
|
if (typeof value === "object" && value !== null) {
|
|
348
363
|
if (value.equals !== void 0) {
|
|
349
|
-
conditions.push(`${key} = ?`);
|
|
364
|
+
conditions.push(`${this.col(key)} = ?`);
|
|
350
365
|
params.push(value.equals);
|
|
351
366
|
}
|
|
352
367
|
if (value.in !== void 0) {
|
|
353
|
-
conditions.push(`${key} IN (${value.in.map(() => "?").join(", ")})`);
|
|
368
|
+
conditions.push(`${this.col(key)} IN (${value.in.map(() => "?").join(", ")})`);
|
|
354
369
|
params.push(...value.in);
|
|
355
370
|
}
|
|
356
371
|
if (value.not_equals !== void 0) {
|
|
357
|
-
conditions.push(`${key} != ?`);
|
|
372
|
+
conditions.push(`${this.col(key)} != ?`);
|
|
358
373
|
params.push(value.not_equals);
|
|
359
374
|
}
|
|
360
375
|
} else {
|
|
361
|
-
conditions.push(`${key} = ?`);
|
|
376
|
+
conditions.push(`${this.col(key)} = ?`);
|
|
362
377
|
params.push(value);
|
|
363
378
|
}
|
|
364
379
|
}
|
|
365
380
|
if (conditions.length > 0) {
|
|
366
381
|
sql += ` WHERE ${conditions.join(" AND ")}`;
|
|
367
382
|
}
|
|
368
|
-
const sortField = sort?.replace("-", "") || "
|
|
383
|
+
const sortField = this.col(sort?.replace("-", "") || "createdAt");
|
|
369
384
|
const sortDir = sort?.startsWith("-") ? "DESC" : "ASC";
|
|
370
385
|
sql += ` ORDER BY ${sortField} ${sortDir}`;
|
|
371
386
|
const countSql = sql.replace("SELECT *", "SELECT COUNT(*) as count");
|
|
@@ -459,12 +474,13 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
459
474
|
}
|
|
460
475
|
}
|
|
461
476
|
const filteredColumns = Object.keys(filteredData);
|
|
477
|
+
const quotedColumns = filteredColumns.map((c) => this.col(c));
|
|
462
478
|
const placeholders = filteredColumns.map(() => "?").join(", ");
|
|
463
479
|
const values = Object.values(filteredData).map(
|
|
464
480
|
(v) => typeof v === "object" ? JSON.stringify(v) : v
|
|
465
481
|
);
|
|
466
482
|
this.db.prepare(
|
|
467
|
-
`INSERT OR REPLACE INTO ${tableName} (${
|
|
483
|
+
`INSERT OR REPLACE INTO ${tableName} (${quotedColumns.join(", ")}) VALUES (${placeholders})`
|
|
468
484
|
).run(...values);
|
|
469
485
|
return this.findByID({ collection: slug, id, tenantID });
|
|
470
486
|
}
|
|
@@ -484,9 +500,9 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
484
500
|
}
|
|
485
501
|
}
|
|
486
502
|
const columns = Object.keys(filteredData);
|
|
487
|
-
const setClause = columns.map((c) => `${c} = ?`).join(", ");
|
|
503
|
+
const setClause = columns.map((c) => `${this.col(c)} = ?`).join(", ");
|
|
488
504
|
const values = Object.values(filteredData).map(
|
|
489
|
-
(v) => typeof v === "object" ? JSON.stringify(v) : v
|
|
505
|
+
(v) => v !== null && typeof v === "object" ? JSON.stringify(v) : v
|
|
490
506
|
);
|
|
491
507
|
let sql = `UPDATE ${tableName} SET ${setClause} WHERE id = ?`;
|
|
492
508
|
const params = [...values, id];
|
|
@@ -496,7 +512,7 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
496
512
|
params.push(tenantID);
|
|
497
513
|
}
|
|
498
514
|
this.db.prepare(sql).run(...params);
|
|
499
|
-
return this.findByID({ collection: slug, id, tenantID });
|
|
515
|
+
return this.findByID({ collection: slug, id, tenantID, draft: true });
|
|
500
516
|
}
|
|
501
517
|
async delete(args) {
|
|
502
518
|
const { collection: slug, id, tenantID } = args;
|
|
@@ -829,7 +845,17 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
829
845
|
value = Boolean(value);
|
|
830
846
|
}
|
|
831
847
|
if (field.type === "date" && value) {
|
|
832
|
-
|
|
848
|
+
try {
|
|
849
|
+
const d = new Date(value);
|
|
850
|
+
if (isNaN(d.getTime())) {
|
|
851
|
+
console.warn(`[LocalAdapter] Invalid date value for field "${field.name}":`, value);
|
|
852
|
+
value = null;
|
|
853
|
+
} else {
|
|
854
|
+
value = d.toISOString();
|
|
855
|
+
}
|
|
856
|
+
} catch {
|
|
857
|
+
value = null;
|
|
858
|
+
}
|
|
833
859
|
}
|
|
834
860
|
if ((field.type === "upload" || field.type === "image") && value) {
|
|
835
861
|
try {
|
|
@@ -877,8 +903,22 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
877
903
|
}
|
|
878
904
|
}
|
|
879
905
|
if (config.timestamps) {
|
|
880
|
-
|
|
881
|
-
|
|
906
|
+
const cAt = row.createdAt || row.created_at;
|
|
907
|
+
const uAt = row.updatedAt || row.updated_at;
|
|
908
|
+
if (cAt) {
|
|
909
|
+
try {
|
|
910
|
+
const d = new Date(cAt);
|
|
911
|
+
if (!isNaN(d.getTime())) doc.createdAt = d.toISOString();
|
|
912
|
+
} catch {
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (uAt) {
|
|
916
|
+
try {
|
|
917
|
+
const d = new Date(uAt);
|
|
918
|
+
if (!isNaN(d.getTime())) doc.updatedAt = d.toISOString();
|
|
919
|
+
} catch {
|
|
920
|
+
}
|
|
921
|
+
}
|
|
882
922
|
}
|
|
883
923
|
if (config.tenantScoped) {
|
|
884
924
|
doc.tenantID = row.tenant_id;
|