@kyro-cms/core 0.12.16 → 0.12.17
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-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{chunk-IQYP3DDJ.cjs → chunk-BIJHVTNO.cjs} +2 -2
- package/dist/{chunk-NI7S5JMH.js → chunk-CIA3BVH3.js} +5 -5
- package/dist/{chunk-ZZIGN5PZ.js → chunk-I4ZACL66.js} +1 -1
- package/dist/{chunk-M5JUPA7G.cjs → chunk-LMIBASPC.cjs} +5 -5
- package/dist/{chunk-RY3BG3AN.cjs → chunk-RL36RMMG.cjs} +1 -1
- package/dist/{chunk-DTSYK7KK.js → chunk-YFRLT77I.js} +2 -2
- package/dist/index.cjs +26 -19
- package/dist/index.d.cts +202 -2
- package/dist/index.d.ts +202 -2
- package/dist/index.js +26 -19
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.js +1 -1
- package/package.json +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -10,7 +10,7 @@ import { W as WebhookPayload, D as DeliveryResult, a as WebhookDelivery, b as We
|
|
|
10
10
|
export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, e as WEBHOOK_COLLECTION, f as WEBHOOK_DELIVERY_COLLECTION, g as WEBHOOK_EVENTS, h as WebhookEvent, i as WebhookTriggerResult, j as createWebhookService } from './WebhookService-i-Kl3dvf.cjs';
|
|
11
11
|
import { F as Field } from './types-euTszc-1.cjs';
|
|
12
12
|
export { A as ALL_FIELD_TYPES, a as ArrayField, B as BaseField, b as Block, e as BlocksField, v as COMPLEX_FIELD_TYPES, C as CheckboxField, f as CodeField, g as CollapsibleField, h as ColorField, D as DateField, E as EmailField, j as FieldAdmin, k as FieldType, G as GroupField, l as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, m as RelationshipField, n as RichTextBlock, o as RichTextField, p as RowField, q as SelectField, T as TabsField, r as TextField, s as TextareaField, U as UploadField, V as ValidateOptions, O as isArrayField, Q as isBlocksField, W as isGroupField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from './types-euTszc-1.cjs';
|
|
13
|
-
import { ZodTypeAny } from 'zod';
|
|
13
|
+
import { ZodTypeAny, z } from 'zod';
|
|
14
14
|
export { z } from 'zod';
|
|
15
15
|
export { n as normalizeRichTextValue, r as renderRichText, a as richTextStyles } from './richtext-DrhORshE.cjs';
|
|
16
16
|
import { A as AbstractBaseAdapter } from './base-iyJTfH-3.cjs';
|
|
@@ -25,6 +25,7 @@ import { d as AuditLog, e as AuditLogFilter, A as AuthAdapter, U as UserRole, c
|
|
|
25
25
|
export { f as AuditAction } from './types-CpjuXbe7.cjs';
|
|
26
26
|
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, kitchenSinkCollections, mediaCollections, minimalCollections, templateCollections } from './templates/index.cjs';
|
|
27
27
|
export { default as kyro } from './integration.cjs';
|
|
28
|
+
import { Loader } from 'astro/loaders';
|
|
28
29
|
import { Redis } from 'ioredis';
|
|
29
30
|
import 'ws';
|
|
30
31
|
import 'drizzle-orm/postgres-js';
|
|
@@ -230,6 +231,100 @@ declare function createLocalAdapter(options?: {
|
|
|
230
231
|
path?: string;
|
|
231
232
|
}): LocalAdapter;
|
|
232
233
|
|
|
234
|
+
interface NeonAdapterOptions {
|
|
235
|
+
connectionString: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Edge-Native Neon HTTP PostgreSQL Database Adapter for Kyro CMS.
|
|
239
|
+
* Uses Web-standard `fetch` HTTP requests to execute SQL queries on V8 Edge Isolates.
|
|
240
|
+
*/
|
|
241
|
+
declare class NeonAdapter extends AbstractBaseAdapter {
|
|
242
|
+
private connectionString;
|
|
243
|
+
constructor(options: NeonAdapterOptions);
|
|
244
|
+
connect(): Promise<void>;
|
|
245
|
+
disconnect(): Promise<void>;
|
|
246
|
+
query<T = any>(sql: string, params?: any[]): Promise<T[]>;
|
|
247
|
+
find(args: any): Promise<any>;
|
|
248
|
+
findByID(args: any): Promise<any>;
|
|
249
|
+
create(args: any): Promise<any>;
|
|
250
|
+
update(args: any): Promise<any>;
|
|
251
|
+
delete(args: any): Promise<any>;
|
|
252
|
+
count(args: {
|
|
253
|
+
collection: string;
|
|
254
|
+
where?: Record<string, any>;
|
|
255
|
+
tenantId?: string;
|
|
256
|
+
}): Promise<number>;
|
|
257
|
+
findOne(args: {
|
|
258
|
+
collection: string;
|
|
259
|
+
where: Record<string, any>;
|
|
260
|
+
tenantId?: string;
|
|
261
|
+
draft?: boolean;
|
|
262
|
+
}): Promise<any>;
|
|
263
|
+
findVersions(args: any): Promise<any>;
|
|
264
|
+
findVersionByID(args: {
|
|
265
|
+
collection: string;
|
|
266
|
+
versionId: string;
|
|
267
|
+
tenantId?: string;
|
|
268
|
+
}): Promise<any>;
|
|
269
|
+
createVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
270
|
+
updateLatestVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
271
|
+
deleteVersions(args: {
|
|
272
|
+
collection: string;
|
|
273
|
+
documentId: string;
|
|
274
|
+
keepLatest?: number;
|
|
275
|
+
tenantId?: string;
|
|
276
|
+
}): Promise<void>;
|
|
277
|
+
}
|
|
278
|
+
declare function createNeonAdapter(options: NeonAdapterOptions): NeonAdapter;
|
|
279
|
+
|
|
280
|
+
interface TursoAdapterOptions {
|
|
281
|
+
url: string;
|
|
282
|
+
authToken?: string;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Edge-Native Turso / libSQL HTTP Database Adapter for Kyro CMS.
|
|
286
|
+
* Executes SQL queries over Web-standard `fetch` HTTP requests on V8 Edge Isolates.
|
|
287
|
+
*/
|
|
288
|
+
declare class TursoAdapter extends AbstractBaseAdapter {
|
|
289
|
+
private url;
|
|
290
|
+
private authToken?;
|
|
291
|
+
constructor(options: TursoAdapterOptions);
|
|
292
|
+
connect(): Promise<void>;
|
|
293
|
+
disconnect(): Promise<void>;
|
|
294
|
+
query<T = any>(sql: string, params?: any[]): Promise<T[]>;
|
|
295
|
+
find(args: any): Promise<any>;
|
|
296
|
+
findByID(args: any): Promise<any>;
|
|
297
|
+
create(args: any): Promise<any>;
|
|
298
|
+
update(args: any): Promise<any>;
|
|
299
|
+
delete(args: any): Promise<any>;
|
|
300
|
+
count(args: {
|
|
301
|
+
collection: string;
|
|
302
|
+
where?: Record<string, any>;
|
|
303
|
+
tenantId?: string;
|
|
304
|
+
}): Promise<number>;
|
|
305
|
+
findOne(args: {
|
|
306
|
+
collection: string;
|
|
307
|
+
where: Record<string, any>;
|
|
308
|
+
tenantId?: string;
|
|
309
|
+
draft?: boolean;
|
|
310
|
+
}): Promise<any>;
|
|
311
|
+
findVersions(args: any): Promise<any>;
|
|
312
|
+
findVersionByID(args: {
|
|
313
|
+
collection: string;
|
|
314
|
+
versionId: string;
|
|
315
|
+
tenantId?: string;
|
|
316
|
+
}): Promise<any>;
|
|
317
|
+
createVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
318
|
+
updateLatestVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
319
|
+
deleteVersions(args: {
|
|
320
|
+
collection: string;
|
|
321
|
+
documentId: string;
|
|
322
|
+
keepLatest?: number;
|
|
323
|
+
tenantId?: string;
|
|
324
|
+
}): Promise<void>;
|
|
325
|
+
}
|
|
326
|
+
declare function createTursoAdapter(options: TursoAdapterOptions): TursoAdapter;
|
|
327
|
+
|
|
233
328
|
interface RedisAuthAdapterOptions {
|
|
234
329
|
url?: string;
|
|
235
330
|
host?: string;
|
|
@@ -1243,4 +1338,109 @@ declare function getSessionConfig(): {
|
|
|
1243
1338
|
maxSessionsPerUser: number;
|
|
1244
1339
|
};
|
|
1245
1340
|
|
|
1246
|
-
|
|
1341
|
+
interface KyroLoaderOptions {
|
|
1342
|
+
collection: string;
|
|
1343
|
+
drafts?: boolean;
|
|
1344
|
+
limit?: number;
|
|
1345
|
+
configPath?: string;
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Native Astro 5+ Content Layer Loader for Kyro CMS.
|
|
1349
|
+
* Feeds Kyro CMS collection documents directly into Astro's `getCollection()` store.
|
|
1350
|
+
*/
|
|
1351
|
+
declare function kyroLoader(options: KyroLoaderOptions): Loader;
|
|
1352
|
+
|
|
1353
|
+
interface KyroActionOptions<TInput extends z.ZodTypeAny> {
|
|
1354
|
+
collection: string;
|
|
1355
|
+
action: 'create' | 'update' | 'delete' | 'find';
|
|
1356
|
+
schema?: TInput;
|
|
1357
|
+
access?: 'public' | 'authenticated' | 'admin';
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Type-safe Astro Actions handler for Kyro CMS collections.
|
|
1361
|
+
* Automatically validates incoming form submissions or RPC inputs against collection schemas.
|
|
1362
|
+
*/
|
|
1363
|
+
declare function kyroAction<TInput extends z.ZodTypeAny = z.ZodObject<any>>(options: KyroActionOptions<TInput>): {
|
|
1364
|
+
input: TInput | z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
1365
|
+
handler: (input: z.infer<TInput>, context: any) => Promise<{
|
|
1366
|
+
success: boolean;
|
|
1367
|
+
collection: string;
|
|
1368
|
+
action: "create" | "update" | "delete" | "find";
|
|
1369
|
+
data: z.TypeOf<TInput>;
|
|
1370
|
+
timestamp: string;
|
|
1371
|
+
error?: undefined;
|
|
1372
|
+
} | {
|
|
1373
|
+
success: boolean;
|
|
1374
|
+
error: any;
|
|
1375
|
+
collection?: undefined;
|
|
1376
|
+
action?: undefined;
|
|
1377
|
+
data?: undefined;
|
|
1378
|
+
timestamp?: undefined;
|
|
1379
|
+
}>;
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
interface KyroAuthMiddlewareOptions {
|
|
1383
|
+
protectedRoutes?: string[];
|
|
1384
|
+
loginPath?: string;
|
|
1385
|
+
cookieName?: string;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Native Astro Middleware for Kyro CMS authentication & session management.
|
|
1389
|
+
* Populates `Astro.locals.kyroUser` and handles protected route authorization.
|
|
1390
|
+
*/
|
|
1391
|
+
declare function kyroAuthMiddleware(options?: KyroAuthMiddlewareOptions): (context: any, next: () => Promise<Response>) => Promise<any>;
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Helper to generate TypeScript declarations for Kyro CMS collections.
|
|
1395
|
+
* Can be invoked automatically during `npx astro sync` or dev server startup.
|
|
1396
|
+
*/
|
|
1397
|
+
declare function generateKyroAstroTypes(config: Record<string, any>): string;
|
|
1398
|
+
|
|
1399
|
+
interface KyroEnvSchemaOptions {
|
|
1400
|
+
requireDatabase?: boolean;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Type-safe environment variable schema helper for Astro 5 (`astro:env`).
|
|
1404
|
+
*/
|
|
1405
|
+
declare function kyroEnvSchema(options?: KyroEnvSchemaOptions): {
|
|
1406
|
+
APP_SECRET: {
|
|
1407
|
+
context: "server";
|
|
1408
|
+
access: "secret";
|
|
1409
|
+
type: "string";
|
|
1410
|
+
optional: boolean;
|
|
1411
|
+
};
|
|
1412
|
+
DATABASE_URL: {
|
|
1413
|
+
context: "server";
|
|
1414
|
+
access: "secret";
|
|
1415
|
+
type: "string";
|
|
1416
|
+
optional: boolean;
|
|
1417
|
+
};
|
|
1418
|
+
PUBLIC_KYRO_URL: {
|
|
1419
|
+
context: "client";
|
|
1420
|
+
access: "public";
|
|
1421
|
+
type: "string";
|
|
1422
|
+
optional: boolean;
|
|
1423
|
+
default: string;
|
|
1424
|
+
};
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
interface KyroDevToolbarOptions {
|
|
1428
|
+
enabled?: boolean;
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Astro Integration Hook helper to register the Kyro CMS Dev Toolbar widget.
|
|
1432
|
+
*/
|
|
1433
|
+
declare function kyroDevToolbarIntegration(options?: KyroDevToolbarOptions): {
|
|
1434
|
+
name: string;
|
|
1435
|
+
hooks: {
|
|
1436
|
+
'astro:config:setup': ({ addDevToolbarApp }: any) => void;
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Edge Runtime detection utility for Kyro CMS.
|
|
1442
|
+
* Detects V8 Isolate runtimes (Vercel Edge, Cloudflare Workers, Deno Deploy, Netlify Edge).
|
|
1443
|
+
*/
|
|
1444
|
+
declare function isEdgeRuntime(): boolean;
|
|
1445
|
+
|
|
1446
|
+
export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, type CompareVersionsOptions, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, DeliveryOptions, DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroActionOptions, type KyroAuthConfig, type KyroAuthMiddlewareOptions, KyroConfig, type KyroDevToolbarOptions, type KyroEnvSchemaOptions, type KyroLoaderOptions, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, NeonAdapter, type NeonAdapterOptions, PasswordPolicy, type PaymentConfig, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, SQLiteAuthAdapter, type SeoTagsOptions, Session, type SocialLink, type StorageAdapter, type StorageOptions, type StoreConfig, TursoAdapter, type TursoAdapterOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, applyCollectionOverrides, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createNeonAdapter, createStorage, createTestPayload, createTursoAdapter, createVersionManager, defineConfig, defineKyroConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateKyroAstroTypes, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getPaymentConfig, getPaymentConfigFromSettings, getSessionConfig, getSocialLinks, getSocialLinksFromSettings, getStoreConfig, getStoreConfigFromSettings, globalToZod, isArchived, isDraft, isEdgeRuntime, isPublished, kyroAction, kyroAuthMiddleware, kyroDevToolbarIntegration, kyroEnvSchema, kyroLoader, loadSecrets, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { W as WebhookPayload, D as DeliveryResult, a as WebhookDelivery, b as We
|
|
|
10
10
|
export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, e as WEBHOOK_COLLECTION, f as WEBHOOK_DELIVERY_COLLECTION, g as WEBHOOK_EVENTS, h as WebhookEvent, i as WebhookTriggerResult, j as createWebhookService } from './WebhookService-ByrpAI4d.js';
|
|
11
11
|
import { F as Field } from './types-euTszc-1.js';
|
|
12
12
|
export { A as ALL_FIELD_TYPES, a as ArrayField, B as BaseField, b as Block, e as BlocksField, v as COMPLEX_FIELD_TYPES, C as CheckboxField, f as CodeField, g as CollapsibleField, h as ColorField, D as DateField, E as EmailField, j as FieldAdmin, k as FieldType, G as GroupField, l as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, m as RelationshipField, n as RichTextBlock, o as RichTextField, p as RowField, q as SelectField, T as TabsField, r as TextField, s as TextareaField, U as UploadField, V as ValidateOptions, O as isArrayField, Q as isBlocksField, W as isGroupField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from './types-euTszc-1.js';
|
|
13
|
-
import { ZodTypeAny } from 'zod';
|
|
13
|
+
import { ZodTypeAny, z } from 'zod';
|
|
14
14
|
export { z } from 'zod';
|
|
15
15
|
export { n as normalizeRichTextValue, r as renderRichText, a as richTextStyles } from './richtext-DrhORshE.js';
|
|
16
16
|
import { A as AbstractBaseAdapter } from './base-oUSURe4_.js';
|
|
@@ -25,6 +25,7 @@ import { d as AuditLog, e as AuditLogFilter, A as AuthAdapter, U as UserRole, c
|
|
|
25
25
|
export { f as AuditAction } from './types-CpjuXbe7.js';
|
|
26
26
|
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, kitchenSinkCollections, mediaCollections, minimalCollections, templateCollections } from './templates/index.js';
|
|
27
27
|
export { default as kyro } from './integration.js';
|
|
28
|
+
import { Loader } from 'astro/loaders';
|
|
28
29
|
import { Redis } from 'ioredis';
|
|
29
30
|
import 'ws';
|
|
30
31
|
import 'drizzle-orm/postgres-js';
|
|
@@ -230,6 +231,100 @@ declare function createLocalAdapter(options?: {
|
|
|
230
231
|
path?: string;
|
|
231
232
|
}): LocalAdapter;
|
|
232
233
|
|
|
234
|
+
interface NeonAdapterOptions {
|
|
235
|
+
connectionString: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Edge-Native Neon HTTP PostgreSQL Database Adapter for Kyro CMS.
|
|
239
|
+
* Uses Web-standard `fetch` HTTP requests to execute SQL queries on V8 Edge Isolates.
|
|
240
|
+
*/
|
|
241
|
+
declare class NeonAdapter extends AbstractBaseAdapter {
|
|
242
|
+
private connectionString;
|
|
243
|
+
constructor(options: NeonAdapterOptions);
|
|
244
|
+
connect(): Promise<void>;
|
|
245
|
+
disconnect(): Promise<void>;
|
|
246
|
+
query<T = any>(sql: string, params?: any[]): Promise<T[]>;
|
|
247
|
+
find(args: any): Promise<any>;
|
|
248
|
+
findByID(args: any): Promise<any>;
|
|
249
|
+
create(args: any): Promise<any>;
|
|
250
|
+
update(args: any): Promise<any>;
|
|
251
|
+
delete(args: any): Promise<any>;
|
|
252
|
+
count(args: {
|
|
253
|
+
collection: string;
|
|
254
|
+
where?: Record<string, any>;
|
|
255
|
+
tenantId?: string;
|
|
256
|
+
}): Promise<number>;
|
|
257
|
+
findOne(args: {
|
|
258
|
+
collection: string;
|
|
259
|
+
where: Record<string, any>;
|
|
260
|
+
tenantId?: string;
|
|
261
|
+
draft?: boolean;
|
|
262
|
+
}): Promise<any>;
|
|
263
|
+
findVersions(args: any): Promise<any>;
|
|
264
|
+
findVersionByID(args: {
|
|
265
|
+
collection: string;
|
|
266
|
+
versionId: string;
|
|
267
|
+
tenantId?: string;
|
|
268
|
+
}): Promise<any>;
|
|
269
|
+
createVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
270
|
+
updateLatestVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
271
|
+
deleteVersions(args: {
|
|
272
|
+
collection: string;
|
|
273
|
+
documentId: string;
|
|
274
|
+
keepLatest?: number;
|
|
275
|
+
tenantId?: string;
|
|
276
|
+
}): Promise<void>;
|
|
277
|
+
}
|
|
278
|
+
declare function createNeonAdapter(options: NeonAdapterOptions): NeonAdapter;
|
|
279
|
+
|
|
280
|
+
interface TursoAdapterOptions {
|
|
281
|
+
url: string;
|
|
282
|
+
authToken?: string;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Edge-Native Turso / libSQL HTTP Database Adapter for Kyro CMS.
|
|
286
|
+
* Executes SQL queries over Web-standard `fetch` HTTP requests on V8 Edge Isolates.
|
|
287
|
+
*/
|
|
288
|
+
declare class TursoAdapter extends AbstractBaseAdapter {
|
|
289
|
+
private url;
|
|
290
|
+
private authToken?;
|
|
291
|
+
constructor(options: TursoAdapterOptions);
|
|
292
|
+
connect(): Promise<void>;
|
|
293
|
+
disconnect(): Promise<void>;
|
|
294
|
+
query<T = any>(sql: string, params?: any[]): Promise<T[]>;
|
|
295
|
+
find(args: any): Promise<any>;
|
|
296
|
+
findByID(args: any): Promise<any>;
|
|
297
|
+
create(args: any): Promise<any>;
|
|
298
|
+
update(args: any): Promise<any>;
|
|
299
|
+
delete(args: any): Promise<any>;
|
|
300
|
+
count(args: {
|
|
301
|
+
collection: string;
|
|
302
|
+
where?: Record<string, any>;
|
|
303
|
+
tenantId?: string;
|
|
304
|
+
}): Promise<number>;
|
|
305
|
+
findOne(args: {
|
|
306
|
+
collection: string;
|
|
307
|
+
where: Record<string, any>;
|
|
308
|
+
tenantId?: string;
|
|
309
|
+
draft?: boolean;
|
|
310
|
+
}): Promise<any>;
|
|
311
|
+
findVersions(args: any): Promise<any>;
|
|
312
|
+
findVersionByID(args: {
|
|
313
|
+
collection: string;
|
|
314
|
+
versionId: string;
|
|
315
|
+
tenantId?: string;
|
|
316
|
+
}): Promise<any>;
|
|
317
|
+
createVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
318
|
+
updateLatestVersion<T = Record<string, any>>(args: any): Promise<any>;
|
|
319
|
+
deleteVersions(args: {
|
|
320
|
+
collection: string;
|
|
321
|
+
documentId: string;
|
|
322
|
+
keepLatest?: number;
|
|
323
|
+
tenantId?: string;
|
|
324
|
+
}): Promise<void>;
|
|
325
|
+
}
|
|
326
|
+
declare function createTursoAdapter(options: TursoAdapterOptions): TursoAdapter;
|
|
327
|
+
|
|
233
328
|
interface RedisAuthAdapterOptions {
|
|
234
329
|
url?: string;
|
|
235
330
|
host?: string;
|
|
@@ -1243,4 +1338,109 @@ declare function getSessionConfig(): {
|
|
|
1243
1338
|
maxSessionsPerUser: number;
|
|
1244
1339
|
};
|
|
1245
1340
|
|
|
1246
|
-
|
|
1341
|
+
interface KyroLoaderOptions {
|
|
1342
|
+
collection: string;
|
|
1343
|
+
drafts?: boolean;
|
|
1344
|
+
limit?: number;
|
|
1345
|
+
configPath?: string;
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Native Astro 5+ Content Layer Loader for Kyro CMS.
|
|
1349
|
+
* Feeds Kyro CMS collection documents directly into Astro's `getCollection()` store.
|
|
1350
|
+
*/
|
|
1351
|
+
declare function kyroLoader(options: KyroLoaderOptions): Loader;
|
|
1352
|
+
|
|
1353
|
+
interface KyroActionOptions<TInput extends z.ZodTypeAny> {
|
|
1354
|
+
collection: string;
|
|
1355
|
+
action: 'create' | 'update' | 'delete' | 'find';
|
|
1356
|
+
schema?: TInput;
|
|
1357
|
+
access?: 'public' | 'authenticated' | 'admin';
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Type-safe Astro Actions handler for Kyro CMS collections.
|
|
1361
|
+
* Automatically validates incoming form submissions or RPC inputs against collection schemas.
|
|
1362
|
+
*/
|
|
1363
|
+
declare function kyroAction<TInput extends z.ZodTypeAny = z.ZodObject<any>>(options: KyroActionOptions<TInput>): {
|
|
1364
|
+
input: TInput | z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
1365
|
+
handler: (input: z.infer<TInput>, context: any) => Promise<{
|
|
1366
|
+
success: boolean;
|
|
1367
|
+
collection: string;
|
|
1368
|
+
action: "create" | "update" | "delete" | "find";
|
|
1369
|
+
data: z.TypeOf<TInput>;
|
|
1370
|
+
timestamp: string;
|
|
1371
|
+
error?: undefined;
|
|
1372
|
+
} | {
|
|
1373
|
+
success: boolean;
|
|
1374
|
+
error: any;
|
|
1375
|
+
collection?: undefined;
|
|
1376
|
+
action?: undefined;
|
|
1377
|
+
data?: undefined;
|
|
1378
|
+
timestamp?: undefined;
|
|
1379
|
+
}>;
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
interface KyroAuthMiddlewareOptions {
|
|
1383
|
+
protectedRoutes?: string[];
|
|
1384
|
+
loginPath?: string;
|
|
1385
|
+
cookieName?: string;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Native Astro Middleware for Kyro CMS authentication & session management.
|
|
1389
|
+
* Populates `Astro.locals.kyroUser` and handles protected route authorization.
|
|
1390
|
+
*/
|
|
1391
|
+
declare function kyroAuthMiddleware(options?: KyroAuthMiddlewareOptions): (context: any, next: () => Promise<Response>) => Promise<any>;
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Helper to generate TypeScript declarations for Kyro CMS collections.
|
|
1395
|
+
* Can be invoked automatically during `npx astro sync` or dev server startup.
|
|
1396
|
+
*/
|
|
1397
|
+
declare function generateKyroAstroTypes(config: Record<string, any>): string;
|
|
1398
|
+
|
|
1399
|
+
interface KyroEnvSchemaOptions {
|
|
1400
|
+
requireDatabase?: boolean;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Type-safe environment variable schema helper for Astro 5 (`astro:env`).
|
|
1404
|
+
*/
|
|
1405
|
+
declare function kyroEnvSchema(options?: KyroEnvSchemaOptions): {
|
|
1406
|
+
APP_SECRET: {
|
|
1407
|
+
context: "server";
|
|
1408
|
+
access: "secret";
|
|
1409
|
+
type: "string";
|
|
1410
|
+
optional: boolean;
|
|
1411
|
+
};
|
|
1412
|
+
DATABASE_URL: {
|
|
1413
|
+
context: "server";
|
|
1414
|
+
access: "secret";
|
|
1415
|
+
type: "string";
|
|
1416
|
+
optional: boolean;
|
|
1417
|
+
};
|
|
1418
|
+
PUBLIC_KYRO_URL: {
|
|
1419
|
+
context: "client";
|
|
1420
|
+
access: "public";
|
|
1421
|
+
type: "string";
|
|
1422
|
+
optional: boolean;
|
|
1423
|
+
default: string;
|
|
1424
|
+
};
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
interface KyroDevToolbarOptions {
|
|
1428
|
+
enabled?: boolean;
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Astro Integration Hook helper to register the Kyro CMS Dev Toolbar widget.
|
|
1432
|
+
*/
|
|
1433
|
+
declare function kyroDevToolbarIntegration(options?: KyroDevToolbarOptions): {
|
|
1434
|
+
name: string;
|
|
1435
|
+
hooks: {
|
|
1436
|
+
'astro:config:setup': ({ addDevToolbarApp }: any) => void;
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Edge Runtime detection utility for Kyro CMS.
|
|
1442
|
+
* Detects V8 Isolate runtimes (Vercel Edge, Cloudflare Workers, Deno Deploy, Netlify Edge).
|
|
1443
|
+
*/
|
|
1444
|
+
declare function isEdgeRuntime(): boolean;
|
|
1445
|
+
|
|
1446
|
+
export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, type CompareVersionsOptions, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, DeliveryOptions, DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroActionOptions, type KyroAuthConfig, type KyroAuthMiddlewareOptions, KyroConfig, type KyroDevToolbarOptions, type KyroEnvSchemaOptions, type KyroLoaderOptions, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, NeonAdapter, type NeonAdapterOptions, PasswordPolicy, type PaymentConfig, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, SQLiteAuthAdapter, type SeoTagsOptions, Session, type SocialLink, type StorageAdapter, type StorageOptions, type StoreConfig, TursoAdapter, type TursoAdapterOptions, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, applyCollectionOverrides, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createNeonAdapter, createStorage, createTestPayload, createTursoAdapter, createVersionManager, defineConfig, defineKyroConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateKyroAstroTypes, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getPaymentConfig, getPaymentConfigFromSettings, getSessionConfig, getSocialLinks, getSocialLinksFromSettings, getStoreConfig, getStoreConfigFromSettings, globalToZod, isArchived, isDraft, isEdgeRuntime, isPublished, kyroAction, kyroAuthMiddleware, kyroDevToolbarIntegration, kyroEnvSchema, kyroLoader, loadSecrets, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|