@kyro-cms/core 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/dist/WebhookService-CXJ5oz6L.d.ts +112 -0
- package/dist/WebhookService-Dqx9Is7m.d.cts +112 -0
- package/dist/{base-CQkFzqQl.d.ts → base-CciYzoDF.d.ts} +1 -1
- package/dist/{base-DlhVlwnN.d.cts → base-Cfek4fp3.d.cts} +1 -1
- package/dist/bootstrap-BMWVB2T6.cjs +31 -0
- package/dist/{bootstrap-WMWQ4DBX.cjs.map → bootstrap-BMWVB2T6.cjs.map} +1 -1
- package/dist/bootstrap-LL6O7PWO.js +6 -0
- package/dist/{bootstrap-WOVGAKZP.js.map → bootstrap-LL6O7PWO.js.map} +1 -1
- package/dist/{chunk-3VZCX4DF.cjs → chunk-42JPONZU.cjs} +77 -14
- package/dist/chunk-42JPONZU.cjs.map +1 -0
- package/dist/{chunk-3EVLFWH2.cjs → chunk-4M5PHMUE.cjs} +60 -346
- package/dist/chunk-4M5PHMUE.cjs.map +1 -0
- package/dist/chunk-4PWRCMTQ.cjs +15 -0
- package/dist/chunk-4PWRCMTQ.cjs.map +1 -0
- package/dist/chunk-6COM32WF.js +47 -0
- package/dist/chunk-6COM32WF.js.map +1 -0
- package/dist/chunk-6MSSF46R.js +941 -0
- package/dist/chunk-6MSSF46R.js.map +1 -0
- package/dist/{chunk-TZFJMPCH.cjs → chunk-7YITG2US.cjs} +9 -18
- package/dist/chunk-7YITG2US.cjs.map +1 -0
- package/dist/{chunk-A3RQWHKD.cjs → chunk-BLMFBDBG.cjs} +56 -6
- package/dist/chunk-BLMFBDBG.cjs.map +1 -0
- package/dist/{chunk-EINVJPFM.js → chunk-BTOE3VUK.js} +65 -3
- package/dist/chunk-BTOE3VUK.js.map +1 -0
- package/dist/chunk-E5X75WNB.js +497 -0
- package/dist/chunk-E5X75WNB.js.map +1 -0
- package/dist/chunk-E63IF3MD.cjs +951 -0
- package/dist/chunk-E63IF3MD.cjs.map +1 -0
- package/dist/chunk-EWP5AT6A.cjs +268 -0
- package/dist/chunk-EWP5AT6A.cjs.map +1 -0
- package/dist/{chunk-K7QF2QCM.cjs → chunk-FTSSDDZQ.cjs} +7 -3
- package/dist/chunk-FTSSDDZQ.cjs.map +1 -0
- package/dist/chunk-G7VZBCD6.cjs +35 -0
- package/dist/{chunk-5BLDMQED.cjs.map → chunk-G7VZBCD6.cjs.map} +1 -1
- package/dist/{chunk-VMSRTAH7.js → chunk-GLCPGZPM.js} +56 -6
- package/dist/chunk-GLCPGZPM.js.map +1 -0
- package/dist/{chunk-V3B25QOK.cjs → chunk-GVFB5C6O.cjs} +74 -2
- package/dist/chunk-GVFB5C6O.cjs.map +1 -0
- package/dist/chunk-HVSQDZZJ.cjs +765 -0
- package/dist/chunk-HVSQDZZJ.cjs.map +1 -0
- package/dist/chunk-HYC4GNHX.js +758 -0
- package/dist/chunk-HYC4GNHX.js.map +1 -0
- package/dist/chunk-KDVDIZ4Y.cjs +3479 -0
- package/dist/chunk-KDVDIZ4Y.cjs.map +1 -0
- package/dist/{chunk-OG3KX56O.js → chunk-KWGNR4HM.js} +7 -3
- package/dist/chunk-KWGNR4HM.js.map +1 -0
- package/dist/chunk-LIJVWQKU.cjs +256 -0
- package/dist/chunk-LIJVWQKU.cjs.map +1 -0
- package/dist/{chunk-XTZSUDSI.js → chunk-LTRCYJAG.js} +3 -18
- package/dist/chunk-LTRCYJAG.js.map +1 -0
- package/dist/{chunk-UEYC46RL.js → chunk-OUGKLCYF.js} +71 -8
- package/dist/chunk-OUGKLCYF.js.map +1 -0
- package/dist/chunk-QKOFKITP.js +258 -0
- package/dist/chunk-QKOFKITP.js.map +1 -0
- package/dist/chunk-RONAX6UU.js +3456 -0
- package/dist/chunk-RONAX6UU.js.map +1 -0
- package/dist/{chunk-5Y7QGIHD.js → chunk-RRYXQMZG.js} +60 -344
- package/dist/chunk-RRYXQMZG.js.map +1 -0
- package/dist/{chunk-QUJ4OLSC.js → chunk-U74F3YZU.js} +87 -7
- package/dist/chunk-U74F3YZU.js.map +1 -0
- package/dist/chunk-VIONYQ2K.cjs +517 -0
- package/dist/chunk-VIONYQ2K.cjs.map +1 -0
- package/dist/chunk-VSTRLXMQ.cjs +50 -0
- package/dist/chunk-VSTRLXMQ.cjs.map +1 -0
- package/dist/chunk-YT7HXXVN.js +13 -0
- package/dist/chunk-YT7HXXVN.js.map +1 -0
- package/dist/chunk-Z6ZWNWWR.js +30 -0
- package/dist/{chunk-NSBPE2FW.js.map → chunk-Z6ZWNWWR.js.map} +1 -1
- package/dist/cli/index.cjs +11 -7
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +11 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/client.cjs +45 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +11 -0
- package/dist/client.d.ts +11 -0
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -0
- package/dist/drizzle/index.cjs +20 -17
- package/dist/drizzle/index.d.cts +115 -5
- package/dist/drizzle/index.d.ts +115 -5
- package/dist/drizzle/index.js +4 -5
- package/dist/graphql/index.cjs +4 -4
- package/dist/graphql/index.d.cts +3 -2
- package/dist/graphql/index.d.ts +3 -2
- package/dist/graphql/index.js +2 -2
- package/dist/{index-4fJKLFK2.d.ts → index-BvZ1iWm2.d.ts} +1 -1
- package/dist/{index-DI0DRPNv.d.cts → index-CTLPjpMH.d.cts} +1 -1
- package/dist/index.cjs +3391 -649
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +368 -309
- package/dist/index.d.ts +368 -309
- package/dist/index.js +3253 -599
- package/dist/index.js.map +1 -1
- package/dist/media-HOT3O7RW.js +4 -0
- package/dist/media-HOT3O7RW.js.map +1 -0
- package/dist/media-WKP5AOX2.cjs +17 -0
- package/dist/media-WKP5AOX2.cjs.map +1 -0
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +2 -2
- package/dist/mongodb/index.d.ts +2 -2
- package/dist/mongodb/index.js +1 -1
- package/dist/mysql-media-AI6YK767.cjs +48 -0
- package/dist/mysql-media-AI6YK767.cjs.map +1 -0
- package/dist/mysql-media-CDZUS7YX.js +45 -0
- package/dist/mysql-media-CDZUS7YX.js.map +1 -0
- package/dist/postgres-auth-adapter-EVRPO7BQ.cjs +14 -0
- package/dist/{postgres-auth-adapter-VK6GY7LX.cjs.map → postgres-auth-adapter-EVRPO7BQ.cjs.map} +1 -1
- package/dist/postgres-auth-adapter-OTRWSTT5.js +5 -0
- package/dist/{postgres-auth-adapter-REJFUMP7.js.map → postgres-auth-adapter-OTRWSTT5.js.map} +1 -1
- package/dist/rate-limit-BvUAVCzw.d.cts +223 -0
- package/dist/rate-limit-CJnqG1mG.d.ts +223 -0
- package/dist/redis-adapter-2N6VA7BI.cjs +13 -0
- package/dist/{redis-adapter-LBLNKGNS.cjs.map → redis-adapter-2N6VA7BI.cjs.map} +1 -1
- package/dist/redis-adapter-RA24FNCX.js +4 -0
- package/dist/{redis-adapter-4YDY4LWE.js.map → redis-adapter-RA24FNCX.js.map} +1 -1
- package/dist/rest/index.cjs +7 -5
- package/dist/rest/index.d.cts +29 -3
- package/dist/rest/index.d.ts +29 -3
- package/dist/rest/index.js +5 -3
- package/dist/schema-CNB2DDTX.js +6 -0
- package/dist/schema-CNB2DDTX.js.map +1 -0
- package/dist/schema-Y777CQQS.cjs +67 -0
- package/dist/schema-Y777CQQS.cjs.map +1 -0
- package/dist/templates/index.cjs +24 -28
- package/dist/templates/index.d.cts +2 -4
- package/dist/templates/index.d.ts +2 -4
- package/dist/templates/index.js +2 -2
- package/dist/trpc/index.cjs +12 -12
- package/dist/trpc/index.d.cts +19 -14
- package/dist/trpc/index.d.ts +19 -14
- package/dist/trpc/index.js +3 -3
- package/dist/types-BSR91JFN.d.cts +159 -0
- package/dist/types-BSR91JFN.d.ts +159 -0
- package/dist/{types-BGM5MV_K.d.ts → types-Bt1OEk0S.d.cts} +78 -38
- package/dist/{types-BGM5MV_K.d.cts → types-Bt1OEk0S.d.ts} +78 -38
- package/dist/ws/index.cjs +1 -1
- package/dist/ws/index.js +1 -1
- package/package.json +19 -2
- package/dist/bootstrap-WMWQ4DBX.cjs +0 -29
- package/dist/bootstrap-WOVGAKZP.js +0 -4
- package/dist/chunk-3EVLFWH2.cjs.map +0 -1
- package/dist/chunk-3QX6KG2S.js +0 -2125
- package/dist/chunk-3QX6KG2S.js.map +0 -1
- package/dist/chunk-3VZCX4DF.cjs.map +0 -1
- package/dist/chunk-5BLDMQED.cjs +0 -18
- package/dist/chunk-5Y7QGIHD.js.map +0 -1
- package/dist/chunk-7G6EVYCU.cjs +0 -94
- package/dist/chunk-7G6EVYCU.cjs.map +0 -1
- package/dist/chunk-A3RQWHKD.cjs.map +0 -1
- package/dist/chunk-EINVJPFM.js.map +0 -1
- package/dist/chunk-F5B64H5S.cjs +0 -2149
- package/dist/chunk-F5B64H5S.cjs.map +0 -1
- package/dist/chunk-K7QF2QCM.cjs.map +0 -1
- package/dist/chunk-LRTZJJPD.js +0 -86
- package/dist/chunk-LRTZJJPD.js.map +0 -1
- package/dist/chunk-NSBPE2FW.js +0 -15
- package/dist/chunk-OG3KX56O.js.map +0 -1
- package/dist/chunk-QUJ4OLSC.js.map +0 -1
- package/dist/chunk-R3XIBBAW.cjs +0 -34
- package/dist/chunk-R3XIBBAW.cjs.map +0 -1
- package/dist/chunk-SDMNUYVU.js +0 -30
- package/dist/chunk-SDMNUYVU.js.map +0 -1
- package/dist/chunk-TZFJMPCH.cjs.map +0 -1
- package/dist/chunk-UEG7KMKC.cjs +0 -228
- package/dist/chunk-UEG7KMKC.cjs.map +0 -1
- package/dist/chunk-UEYC46RL.js.map +0 -1
- package/dist/chunk-V3B25QOK.cjs.map +0 -1
- package/dist/chunk-VMSRTAH7.js.map +0 -1
- package/dist/chunk-XTZSUDSI.js.map +0 -1
- package/dist/chunk-YD7Y25W7.cjs +0 -176
- package/dist/chunk-YD7Y25W7.cjs.map +0 -1
- package/dist/chunk-YPAFJ7EV.js +0 -225
- package/dist/chunk-YPAFJ7EV.js.map +0 -1
- package/dist/database-7CJOXEZR.js +0 -5
- package/dist/database-7CJOXEZR.js.map +0 -1
- package/dist/database-QOIV44GT.cjs +0 -22
- package/dist/database-QOIV44GT.cjs.map +0 -1
- package/dist/index-BMySjW6o.d.cts +0 -198
- package/dist/index-CMUNCIWQ.d.ts +0 -198
- package/dist/postgres-auth-adapter-REJFUMP7.js +0 -5
- package/dist/postgres-auth-adapter-VK6GY7LX.cjs +0 -14
- package/dist/redis-adapter-4YDY4LWE.js +0 -4
- package/dist/redis-adapter-LBLNKGNS.cjs +0 -13
package/dist/index.d.ts
CHANGED
|
@@ -3,36 +3,87 @@ export { createContext, createCountProcedure, createCreateProcedure, createDelet
|
|
|
3
3
|
import * as graphql from 'graphql';
|
|
4
4
|
import * as hono from 'hono';
|
|
5
5
|
import * as hono_types from 'hono/types';
|
|
6
|
-
import { R as Registry } from './index-
|
|
7
|
-
export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
6
|
+
import { R as Registry } from './index-BvZ1iWm2.js';
|
|
7
|
+
export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-BvZ1iWm2.js';
|
|
8
|
+
import { w as BaseAdapter, K as KyroConfig, Q as User, W as Request$1, i as CollectionConfig, G as GlobalConfig, F as Field, x as FindArgs, y as FindResult, z as FindByIDArgs, H as CreateArgs, L as UpdateArgs, O as DeleteArgs, X as Hook } from './types-Bt1OEk0S.js';
|
|
9
|
+
export { Y as ALL_FIELD_TYPES, Z as AccessArgs, _ as AccessControl, $ as AdapterConfig, A as AdminConfig, a as ArrayField, b as AuthConfig, B as BaseField, c as Block, f as BlocksField, a0 as COMPLEX_FIELD_TYPES, C as CheckboxField, g as CodeField, h as CollapsibleField, a1 as CollectionAccess, a2 as CollectionHooks, j as ColorField, a3 as CreateResult, D as DateField, E as EmailField, a4 as FieldAccess, k as FieldAdmin, a5 as FieldHooks, l as FieldType, a6 as GlobalAccess, a7 as GlobalHooks, m as GroupField, a8 as HookArgs, I as ImageField, n as ImageSize, J as JSONField, a9 as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, aa as PRIMITIVE_FIELD_TYPES, P as PasswordField, v as PluginConfig, ab as RELATIONAL_FIELD_TYPES, R as RadioField, o as RelationshipField, p as RichTextBlock, q as RichTextField, r as RowField, S as SelectField, T as TabsField, s as TextField, t as TextareaField, U as UploadConfig, u as UploadField, ac as ValidateOptions, V as VersionConfig, ad as WhereClause, ae as evaluateAccess, af as getWhereClause, ag as isArrayField, ah as isBlocksField, ai as isGroupField, aj as isImageField, ak as isLayoutField, al as isNumberField, am as isRelationshipField, an as isRichTextField, ao as isSelectField, ap as isTextField, aq as isUploadField, ar as mergeWhereClauses, as as runFieldHooks, at as runHooks } from './types-Bt1OEk0S.js';
|
|
10
10
|
import { KyroPubSub, KyroWSServer } from './ws/index.js';
|
|
11
11
|
export { PubSub, createWSServer } from './ws/index.js';
|
|
12
12
|
import { ZodTypeAny } from 'zod';
|
|
13
13
|
export { z } from 'zod';
|
|
14
|
-
import { A as AbstractBaseAdapter } from './base-
|
|
15
|
-
import {
|
|
16
|
-
export {
|
|
14
|
+
import { A as AbstractBaseAdapter } from './base-CciYzoDF.js';
|
|
15
|
+
import { Dialect } from './drizzle/index.js';
|
|
16
|
+
export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.js';
|
|
17
17
|
export { MongoDBAdapter, createMongoDBAdapter } from './mongodb/index.js';
|
|
18
18
|
export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.js';
|
|
19
19
|
export { createHonoApp, createRESTAPI } from './rest/index.js';
|
|
20
|
+
import { R as RateLimitConfig, b as RateLimitResult, L as LockoutConfig, a as LockoutStatus } from './rate-limit-CJnqG1mG.js';
|
|
21
|
+
export { q as AccountLockout, A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, r as RateLimiter, s as RedisAuthAdapter, S as StylingConfig, d as StylingMode, T as ThemeBorderRadius, e as ThemeColors, f as ThemeConfig, g as ThemeFonts, h as ThemeShadows, i as ThemeSpacing, j as createAdminStyling, k as defaultDarkTheme, l as defaultFieldStyling, m as defaultLightTheme, n as ecommerce2026Theme, o as generateCSSVariables, p as generateTailwindConfig } from './rate-limit-CJnqG1mG.js';
|
|
22
|
+
import { f as AuthUser, c as AuthAdapter, a as AuditLog, b as AuditLogFilter, U as UserRole, S as Session, e as AuthTokenConfig, R as RegisterData, d as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-BSR91JFN.js';
|
|
23
|
+
export { A as AuditAction, g as AuditLogger, h as createAuditContext } from './types-BSR91JFN.js';
|
|
20
24
|
import Database from 'better-sqlite3';
|
|
25
|
+
import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-CXJ5oz6L.js';
|
|
26
|
+
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-CXJ5oz6L.js';
|
|
21
27
|
export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.js';
|
|
22
|
-
import Redis from 'ioredis';
|
|
23
|
-
import { SentMessageInfo } from 'nodemailer';
|
|
24
28
|
import 'ws';
|
|
25
29
|
import 'drizzle-orm/postgres-js';
|
|
26
|
-
import '
|
|
30
|
+
import 'ioredis';
|
|
31
|
+
|
|
32
|
+
interface DeliveryResult {
|
|
33
|
+
success: boolean;
|
|
34
|
+
status: number;
|
|
35
|
+
statusText?: string;
|
|
36
|
+
body?: string;
|
|
37
|
+
duration: number;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
interface DeliveryOptions {
|
|
41
|
+
timeout?: number;
|
|
42
|
+
maxRetries?: number;
|
|
43
|
+
retryDelay?: number;
|
|
44
|
+
onRetry?: (attempt: number, error: string) => void;
|
|
45
|
+
onSuccess?: (result: DeliveryResult) => void;
|
|
46
|
+
onFailure?: (error: string) => void;
|
|
47
|
+
}
|
|
48
|
+
declare function signPayload(payload: string, secret: string): string;
|
|
49
|
+
declare function generateWebhookSecret(): string;
|
|
50
|
+
declare function deliverWebhook(webhook: WebhookConfig, payload: WebhookPayload, options?: DeliveryOptions): Promise<DeliveryResult>;
|
|
51
|
+
declare function deliverWithRetry(webhook: WebhookConfig, payload: WebhookPayload, deliveryId: string, options?: DeliveryOptions): Promise<DeliveryResult>;
|
|
52
|
+
declare function buildDeliveryRecord(deliveryId: string, webhookId: string, event: string, payload: WebhookPayload, attempt: number, result: DeliveryResult): WebhookDelivery;
|
|
53
|
+
declare function createTestPayload(): WebhookPayload;
|
|
54
|
+
|
|
55
|
+
interface RichTextMark {
|
|
56
|
+
type: string;
|
|
57
|
+
attrs?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
interface RichTextNode {
|
|
60
|
+
type?: string;
|
|
61
|
+
attrs?: Record<string, unknown>;
|
|
62
|
+
content?: RichTextNode[];
|
|
63
|
+
text?: string;
|
|
64
|
+
marks?: RichTextMark[];
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
}
|
|
67
|
+
interface RichTextDocument extends RichTextNode {
|
|
68
|
+
type: "doc";
|
|
69
|
+
content: RichTextNode[];
|
|
70
|
+
}
|
|
71
|
+
declare const richTextStyles: string;
|
|
72
|
+
declare function createColumnsNode(columns?: number): RichTextNode;
|
|
73
|
+
declare function normalizeRichTextDocument(value: unknown): RichTextDocument;
|
|
74
|
+
declare function normalizeRichTextValue<T>(value: T): T;
|
|
75
|
+
declare function renderRichText(value: unknown): string;
|
|
27
76
|
|
|
28
77
|
declare class Kyro {
|
|
29
78
|
registry: Registry;
|
|
30
79
|
db: BaseAdapter;
|
|
31
80
|
pubsub: KyroPubSub;
|
|
81
|
+
settings?: Record<string, any>;
|
|
32
82
|
private wsServer?;
|
|
33
83
|
private config;
|
|
34
84
|
constructor(config: KyroConfig);
|
|
35
85
|
init(): Promise<void>;
|
|
86
|
+
loadSettings(): Promise<Record<string, any>>;
|
|
36
87
|
getREST(options?: {
|
|
37
88
|
user?: User;
|
|
38
89
|
req?: Request$1;
|
|
@@ -52,7 +103,7 @@ declare class Kyro {
|
|
|
52
103
|
port?: number;
|
|
53
104
|
requireAuth?: boolean;
|
|
54
105
|
verifyToken?: (token: string) => Promise<any>;
|
|
55
|
-
}): Promise<KyroWSServer>;
|
|
106
|
+
}): Promise<KyroWSServer | null>;
|
|
56
107
|
shutdown(): Promise<void>;
|
|
57
108
|
}
|
|
58
109
|
declare function createKyro(config: KyroConfig): Kyro;
|
|
@@ -255,159 +306,43 @@ declare const presetPlugins: {
|
|
|
255
306
|
Wishlist: typeof WishlistPlugin;
|
|
256
307
|
};
|
|
257
308
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
mode: StylingMode;
|
|
261
|
-
theme?: ThemeConfig;
|
|
262
|
-
customProperties?: Record<string, string>;
|
|
263
|
-
}
|
|
264
|
-
interface ThemeConfig {
|
|
265
|
-
colors?: ThemeColors;
|
|
266
|
-
fonts?: ThemeFonts;
|
|
267
|
-
spacing?: ThemeSpacing;
|
|
268
|
-
borderRadius?: ThemeBorderRadius;
|
|
269
|
-
shadows?: ThemeShadows;
|
|
270
|
-
breakpoints?: Record<string, string>;
|
|
271
|
-
}
|
|
272
|
-
interface ThemeColors {
|
|
273
|
-
primary?: string;
|
|
274
|
-
secondary?: string;
|
|
275
|
-
accent?: string;
|
|
276
|
-
background?: string;
|
|
277
|
-
surface?: string;
|
|
278
|
-
text?: string;
|
|
279
|
-
textMuted?: string;
|
|
280
|
-
border?: string;
|
|
281
|
-
error?: string;
|
|
282
|
-
warning?: string;
|
|
283
|
-
success?: string;
|
|
284
|
-
info?: string;
|
|
285
|
-
}
|
|
286
|
-
interface ThemeFonts {
|
|
287
|
-
sans?: string;
|
|
288
|
-
serif?: string;
|
|
289
|
-
mono?: string;
|
|
290
|
-
}
|
|
291
|
-
interface ThemeSpacing {
|
|
292
|
-
xs?: string;
|
|
293
|
-
sm?: string;
|
|
294
|
-
md?: string;
|
|
295
|
-
lg?: string;
|
|
296
|
-
xl?: string;
|
|
297
|
-
'2xl'?: string;
|
|
298
|
-
'3xl'?: string;
|
|
299
|
-
'4xl'?: string;
|
|
300
|
-
}
|
|
301
|
-
interface ThemeBorderRadius {
|
|
302
|
-
sm?: string;
|
|
303
|
-
md?: string;
|
|
304
|
-
lg?: string;
|
|
305
|
-
xl?: string;
|
|
306
|
-
full?: string;
|
|
307
|
-
}
|
|
308
|
-
interface ThemeShadows {
|
|
309
|
-
sm?: string;
|
|
310
|
-
md?: string;
|
|
311
|
-
lg?: string;
|
|
312
|
-
xl?: string;
|
|
313
|
-
}
|
|
314
|
-
declare class CSSGenerator {
|
|
315
|
-
private config;
|
|
316
|
-
private css;
|
|
317
|
-
constructor(config: StylingConfig);
|
|
318
|
-
addRule(selector: string, properties: Record<string, string>): this;
|
|
319
|
-
addMediaQuery(breakpoint: string, rules: string[]): this;
|
|
320
|
-
generate(): string;
|
|
321
|
-
}
|
|
322
|
-
declare function generateTailwindConfig(theme: ThemeConfig): Record<string, any>;
|
|
323
|
-
declare const defaultLightTheme: ThemeConfig;
|
|
324
|
-
declare const defaultDarkTheme: ThemeConfig;
|
|
325
|
-
declare const ecommerce2026Theme: ThemeConfig;
|
|
326
|
-
declare function generateCSSVariables(theme: ThemeConfig): string;
|
|
327
|
-
interface AdminStylingConfig {
|
|
328
|
-
mode: StylingMode;
|
|
329
|
-
theme?: ThemeConfig;
|
|
330
|
-
customStyles?: string;
|
|
331
|
-
componentOverrides?: Record<string, Record<string, string>>;
|
|
332
|
-
}
|
|
333
|
-
declare function createAdminStyling(config: AdminStylingConfig): string;
|
|
334
|
-
interface FieldStyling {
|
|
335
|
-
wrapper?: Record<string, string>;
|
|
336
|
-
label?: Record<string, string>;
|
|
337
|
-
input?: Record<string, string>;
|
|
338
|
-
error?: Record<string, string>;
|
|
339
|
-
description?: Record<string, string>;
|
|
340
|
-
}
|
|
341
|
-
declare const defaultFieldStyling: Record<string, FieldStyling>;
|
|
342
|
-
|
|
343
|
-
interface RedisAuthAdapterOptions {
|
|
344
|
-
url?: string;
|
|
345
|
-
host?: string;
|
|
346
|
-
port?: number;
|
|
347
|
-
password?: string;
|
|
348
|
-
db?: number;
|
|
349
|
-
keyPrefix?: string;
|
|
350
|
-
tokenExpiration?: number;
|
|
351
|
-
refreshTokenExpiration?: number;
|
|
352
|
-
tls?: boolean;
|
|
353
|
-
}
|
|
354
|
-
declare class RedisAuthAdapter implements AuthAdapter {
|
|
355
|
-
private redis;
|
|
356
|
-
private prefix;
|
|
357
|
-
private tokenExpiration;
|
|
358
|
-
private refreshExpiration;
|
|
359
|
-
constructor(options?: RedisAuthAdapterOptions);
|
|
360
|
-
connect(): Promise<void>;
|
|
361
|
-
disconnect(): Promise<void>;
|
|
362
|
-
private userKey;
|
|
363
|
-
private sessionKey;
|
|
364
|
-
private refreshKey;
|
|
365
|
-
private userByEmailKey;
|
|
366
|
-
private passwordHistoryKey;
|
|
367
|
-
createUser(data: {
|
|
368
|
-
email: string;
|
|
369
|
-
passwordHash: string;
|
|
370
|
-
role?: UserRole;
|
|
371
|
-
tenantId?: string;
|
|
372
|
-
}): Promise<AuthUser>;
|
|
373
|
-
findUserByEmail(email: string): Promise<AuthUser | null>;
|
|
374
|
-
findUserById(userId: string): Promise<AuthUser | null>;
|
|
375
|
-
updateUser(userId: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
|
|
376
|
-
deleteUser(userId: string): Promise<boolean>;
|
|
377
|
-
hashPassword(password: string): Promise<string>;
|
|
378
|
-
verifyPassword(password: string, hash: string): Promise<boolean>;
|
|
379
|
-
createSession(userId: string, data?: {
|
|
380
|
-
ipAddress?: string;
|
|
381
|
-
userAgent?: string;
|
|
382
|
-
}): Promise<Session>;
|
|
383
|
-
findSessionByToken(token: string): Promise<Session | null>;
|
|
384
|
-
deleteSession(sessionId: string): Promise<boolean>;
|
|
385
|
-
deleteUserSessions(userId: string): Promise<number>;
|
|
386
|
-
addPasswordToHistory(userId: string, passwordHash: string): Promise<void>;
|
|
387
|
-
getPasswordHistory(userId: string, count?: number): Promise<string[]>;
|
|
388
|
-
isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
389
|
-
private userToHash;
|
|
390
|
-
private hashToUser;
|
|
391
|
-
private sessionToHash;
|
|
392
|
-
private hashToSession;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
interface EmailConfig {
|
|
396
|
-
host: string;
|
|
397
|
-
port: number;
|
|
398
|
-
secure: boolean;
|
|
399
|
-
auth: {
|
|
400
|
-
user: string;
|
|
401
|
-
pass: string;
|
|
402
|
-
};
|
|
309
|
+
interface EmailConfig$1 {
|
|
310
|
+
provider: "smtp" | "resend" | "sendgrid" | "mailgun" | "ses";
|
|
403
311
|
from: string;
|
|
404
312
|
fromName?: string;
|
|
313
|
+
replyTo?: string;
|
|
314
|
+
smtp?: {
|
|
315
|
+
host: string;
|
|
316
|
+
port: number;
|
|
317
|
+
secure: boolean;
|
|
318
|
+
auth: {
|
|
319
|
+
user: string;
|
|
320
|
+
pass: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
resend?: {
|
|
324
|
+
apiKey: string;
|
|
325
|
+
};
|
|
326
|
+
sendgrid?: {
|
|
327
|
+
apiKey: string;
|
|
328
|
+
};
|
|
329
|
+
mailgun?: {
|
|
330
|
+
apiKey: string;
|
|
331
|
+
domain: string;
|
|
332
|
+
region?: "us" | "eu";
|
|
333
|
+
};
|
|
334
|
+
ses?: {
|
|
335
|
+
accessKeyId: string;
|
|
336
|
+
secretAccessKey: string;
|
|
337
|
+
region: string;
|
|
338
|
+
};
|
|
405
339
|
}
|
|
406
340
|
interface EmailOptions {
|
|
407
341
|
to: string | string[];
|
|
408
342
|
subject: string;
|
|
409
343
|
html: string;
|
|
410
344
|
text?: string;
|
|
345
|
+
replyTo?: string;
|
|
411
346
|
}
|
|
412
347
|
interface EmailTemplates {
|
|
413
348
|
verifyEmail: (link: string, userName?: string) => {
|
|
@@ -442,14 +377,17 @@ interface EmailTemplates {
|
|
|
442
377
|
};
|
|
443
378
|
}
|
|
444
379
|
declare class EmailTransport {
|
|
445
|
-
private transporter
|
|
446
|
-
private
|
|
447
|
-
private fromName;
|
|
380
|
+
private transporter?;
|
|
381
|
+
private config;
|
|
448
382
|
private templates;
|
|
449
|
-
constructor(config: EmailConfig, templates?: Partial<EmailTemplates>);
|
|
450
|
-
send(options: EmailOptions): Promise<
|
|
383
|
+
constructor(config: EmailConfig$1, templates?: Partial<EmailTemplates>);
|
|
384
|
+
send(options: EmailOptions): Promise<any>;
|
|
385
|
+
private sendViaResend;
|
|
386
|
+
private sendViaSendGrid;
|
|
387
|
+
private sendViaMailgun;
|
|
451
388
|
getTemplates(): EmailTemplates;
|
|
452
389
|
verifyConnection(): Promise<boolean>;
|
|
390
|
+
static fromConfig(db: any): Promise<EmailTransport | null>;
|
|
453
391
|
static fromEnv(): EmailTransport | null;
|
|
454
392
|
}
|
|
455
393
|
|
|
@@ -460,17 +398,7 @@ interface BootstrapConfig {
|
|
|
460
398
|
adminPassword: string;
|
|
461
399
|
adminRole?: string;
|
|
462
400
|
tenantId?: string;
|
|
463
|
-
emailConfig?:
|
|
464
|
-
host: string;
|
|
465
|
-
port: number;
|
|
466
|
-
secure: boolean;
|
|
467
|
-
auth: {
|
|
468
|
-
user: string;
|
|
469
|
-
pass: string;
|
|
470
|
-
};
|
|
471
|
-
from: string;
|
|
472
|
-
fromName?: string;
|
|
473
|
-
};
|
|
401
|
+
emailConfig?: EmailConfig$1;
|
|
474
402
|
sendWelcomeEmail?: boolean;
|
|
475
403
|
}
|
|
476
404
|
interface BootstrapResult {
|
|
@@ -511,138 +439,6 @@ declare class PasswordPolicy {
|
|
|
511
439
|
getConfig(): PasswordPolicyConfig;
|
|
512
440
|
}
|
|
513
441
|
|
|
514
|
-
interface LockoutConfig {
|
|
515
|
-
maxAttempts: number;
|
|
516
|
-
lockDuration: number;
|
|
517
|
-
notifyUser: boolean;
|
|
518
|
-
notifyAdmin: boolean;
|
|
519
|
-
adminNotifyAfter: number;
|
|
520
|
-
}
|
|
521
|
-
interface LockoutStatus {
|
|
522
|
-
locked: boolean;
|
|
523
|
-
attemptsRemaining: number;
|
|
524
|
-
lockedUntil?: Date;
|
|
525
|
-
totalAttempts: number;
|
|
526
|
-
}
|
|
527
|
-
declare class AccountLockout {
|
|
528
|
-
private redis;
|
|
529
|
-
private prefix;
|
|
530
|
-
private config;
|
|
531
|
-
constructor(redis: Redis, config?: Partial<LockoutConfig>, prefix?: string);
|
|
532
|
-
private lockKey;
|
|
533
|
-
private historyKey;
|
|
534
|
-
checkLockout(userId: string): Promise<LockoutStatus>;
|
|
535
|
-
recordFailedAttempt(userId: string): Promise<LockoutStatus>;
|
|
536
|
-
lockAccount(userId: string, duration?: number): Promise<void>;
|
|
537
|
-
unlockAccount(userId: string): Promise<void>;
|
|
538
|
-
resetAttempts(userId: string): Promise<void>;
|
|
539
|
-
getLockoutHistory(userId: string, limit?: number): Promise<Date[]>;
|
|
540
|
-
getLockoutStats(userId: string): Promise<{
|
|
541
|
-
totalFailedAttempts: number;
|
|
542
|
-
lockoutCount: number;
|
|
543
|
-
lastLockout: Date | null;
|
|
544
|
-
averageAttemptsBeforeLockout: number;
|
|
545
|
-
}>;
|
|
546
|
-
shouldNotifyAdmin(currentAttempts: number): boolean;
|
|
547
|
-
getConfig(): LockoutConfig;
|
|
548
|
-
setConfig(config: Partial<LockoutConfig>): void;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
interface RateLimitConfig {
|
|
552
|
-
window: number;
|
|
553
|
-
max: number;
|
|
554
|
-
}
|
|
555
|
-
interface RateLimitResult {
|
|
556
|
-
allowed: boolean;
|
|
557
|
-
remaining: number;
|
|
558
|
-
resetAt: number;
|
|
559
|
-
retryAfter?: number;
|
|
560
|
-
}
|
|
561
|
-
declare class RateLimiter {
|
|
562
|
-
private redis;
|
|
563
|
-
private prefix;
|
|
564
|
-
private limits;
|
|
565
|
-
private userLimits;
|
|
566
|
-
constructor(redis: Redis, limits?: Record<string, RateLimitConfig>, userLimits?: Record<string, RateLimitConfig>, prefix?: string);
|
|
567
|
-
private getKey;
|
|
568
|
-
check(type: string, identifier: string): Promise<RateLimitResult>;
|
|
569
|
-
checkUser(type: string, userId: string, identifier: string): Promise<RateLimitResult>;
|
|
570
|
-
reset(type: string, identifier: string): Promise<void>;
|
|
571
|
-
resetUser(type: string, userId: string, identifier: string): Promise<void>;
|
|
572
|
-
getStatus(type: string, identifier: string): Promise<{
|
|
573
|
-
count: number;
|
|
574
|
-
limit: number;
|
|
575
|
-
remaining: number;
|
|
576
|
-
resetAt: number;
|
|
577
|
-
}>;
|
|
578
|
-
setLimit(type: string, config: RateLimitConfig): void;
|
|
579
|
-
setUserLimit(type: string, config: RateLimitConfig): void;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
type AuditAction = "login" | "logout" | "login_failed" | "register" | "verify_email" | "password_change" | "password_reset" | "password_reset_request" | "role_change" | "permission_change" | "document_create" | "document_update" | "document_delete" | "settings_change" | "user_lockout" | "user_unlock" | "user_create" | "user_update" | "user_delete" | "api_request" | "api_key_create" | "api_key_delete" | "tenant_create" | "tenant_delete";
|
|
583
|
-
interface AuditLog {
|
|
584
|
-
id: string;
|
|
585
|
-
timestamp: Date;
|
|
586
|
-
action: AuditAction;
|
|
587
|
-
userId?: string;
|
|
588
|
-
userEmail?: string;
|
|
589
|
-
role?: string;
|
|
590
|
-
resource: string;
|
|
591
|
-
resourceId?: string;
|
|
592
|
-
changes?: {
|
|
593
|
-
field: string;
|
|
594
|
-
old: any;
|
|
595
|
-
new: any;
|
|
596
|
-
}[];
|
|
597
|
-
ipAddress?: string;
|
|
598
|
-
userAgent?: string;
|
|
599
|
-
success: boolean;
|
|
600
|
-
error?: string;
|
|
601
|
-
metadata?: Record<string, any>;
|
|
602
|
-
}
|
|
603
|
-
interface AuditLogFilter {
|
|
604
|
-
userId?: string;
|
|
605
|
-
action?: AuditAction | AuditAction[];
|
|
606
|
-
resource?: string;
|
|
607
|
-
resourceId?: string;
|
|
608
|
-
success?: boolean;
|
|
609
|
-
startDate?: Date;
|
|
610
|
-
endDate?: Date;
|
|
611
|
-
limit?: number;
|
|
612
|
-
offset?: number;
|
|
613
|
-
}
|
|
614
|
-
declare class AuditLogger {
|
|
615
|
-
private redis;
|
|
616
|
-
private prefix;
|
|
617
|
-
private retentionDays;
|
|
618
|
-
constructor(redis: Redis, retentionDays?: number, prefix?: string);
|
|
619
|
-
log(data: Omit<AuditLog, "id" | "timestamp">): Promise<string>;
|
|
620
|
-
get(id: string): Promise<AuditLog | null>;
|
|
621
|
-
query(filter?: AuditLogFilter): Promise<{
|
|
622
|
-
logs: AuditLog[];
|
|
623
|
-
total: number;
|
|
624
|
-
}>;
|
|
625
|
-
getRecent(limit?: number): Promise<AuditLog[]>;
|
|
626
|
-
getUserActivity(userId: string, limit?: number): Promise<AuditLog[]>;
|
|
627
|
-
getStats(startDate?: Date, endDate?: Date): Promise<{
|
|
628
|
-
totalEvents: number;
|
|
629
|
-
byAction: Record<string, number>;
|
|
630
|
-
successRate: number;
|
|
631
|
-
failedLogins: number;
|
|
632
|
-
uniqueUsers: Set<string>;
|
|
633
|
-
}>;
|
|
634
|
-
cleanup(): Promise<number>;
|
|
635
|
-
private getKeyForDate;
|
|
636
|
-
private getKeysForDateRange;
|
|
637
|
-
private matchesFilter;
|
|
638
|
-
private serializeLog;
|
|
639
|
-
private deserializeLog;
|
|
640
|
-
}
|
|
641
|
-
declare function createAuditContext(req: Request): {
|
|
642
|
-
ipAddress: string;
|
|
643
|
-
userAgent: string;
|
|
644
|
-
};
|
|
645
|
-
|
|
646
442
|
declare class InMemoryRateLimiter {
|
|
647
443
|
private storage;
|
|
648
444
|
private userStorage;
|
|
@@ -774,13 +570,14 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
774
570
|
private refreshTokens;
|
|
775
571
|
private emailToUserId;
|
|
776
572
|
private passwordHistory;
|
|
573
|
+
private auditLogs;
|
|
777
574
|
private externalDb;
|
|
778
575
|
constructor();
|
|
779
576
|
connect(): Promise<void>;
|
|
780
577
|
disconnect(): Promise<void>;
|
|
781
578
|
createUser(data: {
|
|
782
579
|
email: string;
|
|
783
|
-
|
|
580
|
+
password: string;
|
|
784
581
|
role?: UserRole;
|
|
785
582
|
tenantId?: string;
|
|
786
583
|
}): Promise<AuthUser>;
|
|
@@ -789,7 +586,7 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
789
586
|
updateUser(userId: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
|
|
790
587
|
deleteUser(userId: string): Promise<boolean>;
|
|
791
588
|
hashPassword(password: string): Promise<string>;
|
|
792
|
-
verifyPassword(
|
|
589
|
+
verifyPassword(email: string, password: string): Promise<AuthUser | null>;
|
|
793
590
|
createSession(userId: string, data?: {
|
|
794
591
|
ipAddress?: string;
|
|
795
592
|
userAgent?: string;
|
|
@@ -801,6 +598,18 @@ declare class InMemoryAuthAdapter implements AuthAdapter {
|
|
|
801
598
|
getPasswordHistory(userId: string, count?: number): Promise<string[]>;
|
|
802
599
|
isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
803
600
|
hasAnyUsers(): Promise<boolean>;
|
|
601
|
+
findAuditLogs(filter: {
|
|
602
|
+
userId?: string;
|
|
603
|
+
action?: string | string[];
|
|
604
|
+
resource?: string;
|
|
605
|
+
success?: boolean;
|
|
606
|
+
limit?: number;
|
|
607
|
+
offset?: number;
|
|
608
|
+
}): Promise<{
|
|
609
|
+
logs: any[];
|
|
610
|
+
total: number;
|
|
611
|
+
}>;
|
|
612
|
+
createAuditLog(data: any): Promise<any>;
|
|
804
613
|
}
|
|
805
614
|
|
|
806
615
|
declare class Auth {
|
|
@@ -857,7 +666,7 @@ declare class SQLiteAuthAdapter implements AuthAdapter {
|
|
|
857
666
|
}>;
|
|
858
667
|
createUser(data: {
|
|
859
668
|
email: string;
|
|
860
|
-
|
|
669
|
+
password: string;
|
|
861
670
|
role?: UserRole;
|
|
862
671
|
tenantId?: string;
|
|
863
672
|
}): Promise<AuthUser>;
|
|
@@ -866,7 +675,7 @@ declare class SQLiteAuthAdapter implements AuthAdapter {
|
|
|
866
675
|
updateUser(userId: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
|
|
867
676
|
deleteUser(userId: string): Promise<boolean>;
|
|
868
677
|
hashPassword(password: string): Promise<string>;
|
|
869
|
-
verifyPassword(
|
|
678
|
+
verifyPassword(email: string, password: string): Promise<AuthUser | null>;
|
|
870
679
|
createSession(userId: string, data?: {
|
|
871
680
|
ipAddress?: string;
|
|
872
681
|
userAgent?: string;
|
|
@@ -928,6 +737,11 @@ declare class SQLiteAuthAdapter implements AuthAdapter {
|
|
|
928
737
|
}>;
|
|
929
738
|
private rowToUser;
|
|
930
739
|
private rowToSession;
|
|
740
|
+
findAuditLogs(filter: AuditLogFilter): Promise<{
|
|
741
|
+
logs: AuditLog[];
|
|
742
|
+
total: number;
|
|
743
|
+
}>;
|
|
744
|
+
createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
|
|
931
745
|
}
|
|
932
746
|
|
|
933
747
|
type VersionStatus = 'draft' | 'published' | 'archived';
|
|
@@ -1029,6 +843,251 @@ declare function isPublished(status: VersionStatus): boolean;
|
|
|
1029
843
|
declare function isDraft(status: VersionStatus): boolean;
|
|
1030
844
|
declare function isArchived(status: VersionStatus): boolean;
|
|
1031
845
|
|
|
846
|
+
interface S3CompatibleConfig {
|
|
847
|
+
bucket?: string;
|
|
848
|
+
region?: string;
|
|
849
|
+
accessKeyId?: string;
|
|
850
|
+
secretAccessKey?: string;
|
|
851
|
+
endpoint?: string;
|
|
852
|
+
cdnUrl?: string;
|
|
853
|
+
prefix?: string;
|
|
854
|
+
}
|
|
855
|
+
interface R2Config {
|
|
856
|
+
accountId?: string;
|
|
857
|
+
accessKeyId?: string;
|
|
858
|
+
secretAccessKey?: string;
|
|
859
|
+
bucket?: string;
|
|
860
|
+
cdnUrl?: string;
|
|
861
|
+
prefix?: string;
|
|
862
|
+
publicDevUrl?: string;
|
|
863
|
+
}
|
|
864
|
+
interface GCSConfig {
|
|
865
|
+
bucket?: string;
|
|
866
|
+
projectId?: string;
|
|
867
|
+
clientEmail?: string;
|
|
868
|
+
privateKey?: string;
|
|
869
|
+
cdnUrl?: string;
|
|
870
|
+
prefix?: string;
|
|
871
|
+
}
|
|
872
|
+
interface BackblazeConfig {
|
|
873
|
+
bucket?: string;
|
|
874
|
+
accountId?: string;
|
|
875
|
+
applicationKeyId?: string;
|
|
876
|
+
applicationKey?: string;
|
|
877
|
+
cdnUrl?: string;
|
|
878
|
+
prefix?: string;
|
|
879
|
+
}
|
|
880
|
+
interface BunnyConfig {
|
|
881
|
+
storageZone?: string;
|
|
882
|
+
apiKey?: string;
|
|
883
|
+
cdnUrl?: string;
|
|
884
|
+
prefix?: string;
|
|
885
|
+
}
|
|
886
|
+
interface FTPConfig {
|
|
887
|
+
host?: string;
|
|
888
|
+
port?: number;
|
|
889
|
+
user?: string;
|
|
890
|
+
password?: string;
|
|
891
|
+
secure?: boolean;
|
|
892
|
+
baseUrl?: string;
|
|
893
|
+
prefix?: string;
|
|
894
|
+
}
|
|
895
|
+
interface StorageConfig {
|
|
896
|
+
type: string;
|
|
897
|
+
s3: S3CompatibleConfig;
|
|
898
|
+
r2: R2Config;
|
|
899
|
+
gcs: GCSConfig;
|
|
900
|
+
digitalocean: S3CompatibleConfig;
|
|
901
|
+
backblaze: BackblazeConfig;
|
|
902
|
+
wasabi: S3CompatibleConfig;
|
|
903
|
+
bunny: BunnyConfig;
|
|
904
|
+
ftp: FTPConfig;
|
|
905
|
+
cloudinary: {
|
|
906
|
+
cloudName?: string;
|
|
907
|
+
apiKey?: string;
|
|
908
|
+
apiSecret?: string;
|
|
909
|
+
folder?: string;
|
|
910
|
+
};
|
|
911
|
+
imgix: {
|
|
912
|
+
domain?: string;
|
|
913
|
+
signKey?: string;
|
|
914
|
+
};
|
|
915
|
+
local: {
|
|
916
|
+
uploadDir?: string;
|
|
917
|
+
baseUrl?: string;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
interface EmailConfig {
|
|
921
|
+
provider?: string;
|
|
922
|
+
host?: string;
|
|
923
|
+
port?: number;
|
|
924
|
+
secure?: boolean;
|
|
925
|
+
user?: string;
|
|
926
|
+
pass?: string;
|
|
927
|
+
from?: string;
|
|
928
|
+
fromName?: string;
|
|
929
|
+
replyTo?: string;
|
|
930
|
+
}
|
|
931
|
+
declare class ConfigService {
|
|
932
|
+
private db;
|
|
933
|
+
private cache;
|
|
934
|
+
private static readonly SENSITIVE_KEYS;
|
|
935
|
+
constructor(db: any);
|
|
936
|
+
/**
|
|
937
|
+
* Initialize the service by loading all settings from the database
|
|
938
|
+
*/
|
|
939
|
+
load(): Promise<void>;
|
|
940
|
+
/**
|
|
941
|
+
* Get a settings value with environment fallback
|
|
942
|
+
*/
|
|
943
|
+
get(key: string, envKey?: string, defaultValue?: string): string | undefined;
|
|
944
|
+
/**
|
|
945
|
+
* Get storage configuration
|
|
946
|
+
*/
|
|
947
|
+
getStorageConfig(): StorageConfig;
|
|
948
|
+
/**
|
|
949
|
+
* Get email configuration
|
|
950
|
+
*/
|
|
951
|
+
getEmailConfig(): EmailConfig;
|
|
952
|
+
/**
|
|
953
|
+
* Mask sensitive values for display
|
|
954
|
+
*/
|
|
955
|
+
maskSensitive(key: string, value: string | undefined): string | undefined;
|
|
956
|
+
/**
|
|
957
|
+
* Update a setting in the database
|
|
958
|
+
*/
|
|
959
|
+
set(key: string, value: string, description?: string): Promise<void>;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
interface LocalStorageConfig {
|
|
963
|
+
uploadDir: string;
|
|
964
|
+
baseUrl?: string;
|
|
965
|
+
}
|
|
966
|
+
declare function createLocalStorage(config: LocalStorageConfig): StorageProvider;
|
|
967
|
+
|
|
968
|
+
interface UploadOptions {
|
|
969
|
+
folder?: string;
|
|
970
|
+
filename?: string;
|
|
971
|
+
mimeType?: string;
|
|
972
|
+
metadata?: Record<string, unknown>;
|
|
973
|
+
}
|
|
974
|
+
interface UploadedFile {
|
|
975
|
+
id: string;
|
|
976
|
+
filename: string;
|
|
977
|
+
originalName: string;
|
|
978
|
+
mimeType: string;
|
|
979
|
+
size: number;
|
|
980
|
+
url: string;
|
|
981
|
+
thumbnailUrl?: string;
|
|
982
|
+
width?: number;
|
|
983
|
+
height?: number;
|
|
984
|
+
folder?: string;
|
|
985
|
+
provider: string;
|
|
986
|
+
metadata?: Record<string, unknown>;
|
|
987
|
+
createdAt: string;
|
|
988
|
+
}
|
|
989
|
+
interface ImageTransforms {
|
|
990
|
+
width?: number;
|
|
991
|
+
height?: number;
|
|
992
|
+
fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min";
|
|
993
|
+
format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif";
|
|
994
|
+
quality?: number;
|
|
995
|
+
blur?: number;
|
|
996
|
+
sharpen?: number;
|
|
997
|
+
}
|
|
998
|
+
interface StorageProvider {
|
|
999
|
+
name: string;
|
|
1000
|
+
displayName: string;
|
|
1001
|
+
supportsDynamicResize: boolean;
|
|
1002
|
+
upload(file: File, options?: UploadOptions): Promise<UploadedFile>;
|
|
1003
|
+
uploadFromUrl(url: string, options?: UploadOptions): Promise<UploadedFile>;
|
|
1004
|
+
delete(url: string): Promise<void>;
|
|
1005
|
+
rename(oldUrl: string, newKey: string): Promise<string>;
|
|
1006
|
+
getImageUrl(url: string, transforms?: ImageTransforms): string;
|
|
1007
|
+
generateThumbnail(file: UploadedFile, size: {
|
|
1008
|
+
width: number;
|
|
1009
|
+
height: number;
|
|
1010
|
+
}): Promise<string>;
|
|
1011
|
+
list(prefix?: string): Promise<UploadedFile[]>;
|
|
1012
|
+
exists(url: string): Promise<boolean>;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
declare function resolveProvider(configService: ConfigService): Promise<StorageProvider>;
|
|
1016
|
+
|
|
1017
|
+
interface MediaSearchParams {
|
|
1018
|
+
page?: number;
|
|
1019
|
+
limit?: number;
|
|
1020
|
+
search?: string;
|
|
1021
|
+
type?: string;
|
|
1022
|
+
folder?: string;
|
|
1023
|
+
sortBy?: string;
|
|
1024
|
+
sortDir?: "asc" | "desc";
|
|
1025
|
+
}
|
|
1026
|
+
interface MediaRow {
|
|
1027
|
+
id: string;
|
|
1028
|
+
filename: string;
|
|
1029
|
+
title: string | null;
|
|
1030
|
+
originalName: string;
|
|
1031
|
+
mimeType: string;
|
|
1032
|
+
fileSize: number;
|
|
1033
|
+
width: number | null;
|
|
1034
|
+
height: number | null;
|
|
1035
|
+
url: string;
|
|
1036
|
+
thumbnailUrl: string | null;
|
|
1037
|
+
folder: string | null;
|
|
1038
|
+
provider: string;
|
|
1039
|
+
alt: string | null;
|
|
1040
|
+
caption: string | null;
|
|
1041
|
+
metadata: string | null;
|
|
1042
|
+
createdAt: string;
|
|
1043
|
+
updatedAt: string;
|
|
1044
|
+
}
|
|
1045
|
+
declare class MediaService {
|
|
1046
|
+
private db;
|
|
1047
|
+
private storage;
|
|
1048
|
+
private dialect;
|
|
1049
|
+
private genId;
|
|
1050
|
+
private mediaTable;
|
|
1051
|
+
private foldersTable;
|
|
1052
|
+
constructor(db: any, storage: StorageProvider, options?: {
|
|
1053
|
+
dialect?: Dialect;
|
|
1054
|
+
genId?: () => string;
|
|
1055
|
+
});
|
|
1056
|
+
static init(db: any, options?: {
|
|
1057
|
+
dialect?: Dialect;
|
|
1058
|
+
genId?: () => string;
|
|
1059
|
+
storageConfig?: any;
|
|
1060
|
+
}): Promise<MediaService>;
|
|
1061
|
+
private now;
|
|
1062
|
+
private buildFindConditions;
|
|
1063
|
+
private rowToMedia;
|
|
1064
|
+
private sqliteRun;
|
|
1065
|
+
private sqliteGet;
|
|
1066
|
+
upload(file: File, folder?: string): Promise<MediaRow>;
|
|
1067
|
+
delete(id: string): Promise<void>;
|
|
1068
|
+
deleteFile(url: string): Promise<void>;
|
|
1069
|
+
rename(id: string, newKey: string): Promise<MediaRow | null>;
|
|
1070
|
+
find(params?: MediaSearchParams): Promise<{
|
|
1071
|
+
docs: MediaRow[];
|
|
1072
|
+
totalDocs: number;
|
|
1073
|
+
page: number;
|
|
1074
|
+
limit: number;
|
|
1075
|
+
totalPages: number;
|
|
1076
|
+
}>;
|
|
1077
|
+
update(id: string, data: {
|
|
1078
|
+
title?: string;
|
|
1079
|
+
alt?: string;
|
|
1080
|
+
caption?: string;
|
|
1081
|
+
folder?: string;
|
|
1082
|
+
}): Promise<MediaRow | null>;
|
|
1083
|
+
updateMany(ids: string[], data: {
|
|
1084
|
+
folder?: string;
|
|
1085
|
+
}): Promise<void>;
|
|
1086
|
+
listFolders(): Promise<string[]>;
|
|
1087
|
+
createFolder(name: string, parentPath?: string): Promise<void>;
|
|
1088
|
+
deleteFolder(folder: string): Promise<void>;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1032
1091
|
declare function defineConfig(config: {
|
|
1033
1092
|
collections?: CollectionConfig[] | Record<string, CollectionConfig>;
|
|
1034
1093
|
globals?: GlobalConfig[] | Record<string, GlobalConfig>;
|
|
@@ -1045,4 +1104,4 @@ declare function defineConfig(config: {
|
|
|
1045
1104
|
debug?: KyroConfig["debug"];
|
|
1046
1105
|
}): KyroConfig;
|
|
1047
1106
|
|
|
1048
|
-
export { AbstractBaseAdapter,
|
|
1107
|
+
export { AbstractBaseAdapter, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, 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, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, Session, type StorageConfig, 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, createAuth, createAuthConfig, createColumnsNode, createKyro, createLocalAdapter, createLocalStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateWebhookSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, globalToZod, isArchived, isDraft, isPublished, normalizeRichTextDocument, normalizeRichTextValue, presetPlugins, renderRichText, resolveProvider, richTextStyles, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
|