@kyro-cms/core 0.12.62 → 0.12.64

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.
Files changed (61) hide show
  1. package/README.md +5 -4
  2. package/dist/{WebhookService-DgIx21X-.d.cts → WebhookService-B-jb55_P.d.cts} +1 -1
  3. package/dist/{WebhookService-CZf_na-J.d.ts → WebhookService-Bue85CZq.d.ts} +1 -1
  4. package/dist/api-handler-graphql.cjs +1 -1
  5. package/dist/api-handler-graphql.js +1 -1
  6. package/dist/api-handler-trpc.cjs +1 -1
  7. package/dist/api-handler-trpc.js +1 -1
  8. package/dist/api-handler.cjs +1 -1
  9. package/dist/api-handler.js +1 -1
  10. package/dist/{base-7vJMzr4V.d.ts → base-CTeNj4rw.d.ts} +1 -1
  11. package/dist/{base-DDEmdRqV.d.cts → base-CU2tjpsX.d.cts} +1 -1
  12. package/dist/chunk-4OMQURN7.js +3 -0
  13. package/dist/chunk-AXT3QPVM.js +133 -0
  14. package/dist/chunk-CBP2L6RO.js +121 -0
  15. package/dist/{chunk-4FHWIGHO.cjs → chunk-KTDAS6XO.cjs} +4 -4
  16. package/dist/{chunk-LOP464VR.cjs → chunk-O5754WOC.cjs} +1 -1
  17. package/dist/{chunk-26MOA3HJ.js → chunk-ONDPNSXC.js} +3 -3
  18. package/dist/chunk-QJ2V677Y.cjs +120 -0
  19. package/dist/{chunk-5DWQGEM2.cjs → chunk-QO5ZWQA3.cjs} +13 -13
  20. package/dist/chunk-WBFEX36H.js +2 -0
  21. package/dist/{chunk-75BFTYBS.js → chunk-X473JI7Z.js} +14 -14
  22. package/dist/chunk-YFUH3SST.cjs +132 -0
  23. package/dist/chunk-ZQETJ4T4.cjs +2 -0
  24. package/dist/client.d.cts +1 -1
  25. package/dist/client.d.ts +1 -1
  26. package/dist/drizzle/index.cjs +1 -1
  27. package/dist/drizzle/index.d.cts +2 -2
  28. package/dist/drizzle/index.d.ts +2 -2
  29. package/dist/drizzle/index.js +1 -1
  30. package/dist/graphql/index.cjs +1 -1
  31. package/dist/graphql/index.d.cts +2 -2
  32. package/dist/graphql/index.d.ts +2 -2
  33. package/dist/graphql/index.js +1 -1
  34. package/dist/index-DowyndWK.d.ts +105 -0
  35. package/dist/index-HNBjfQpn.d.cts +105 -0
  36. package/dist/index.cjs +3 -3
  37. package/dist/index.d.cts +8 -7
  38. package/dist/index.d.ts +8 -7
  39. package/dist/index.js +2 -2
  40. package/dist/mongodb/index.d.cts +2 -2
  41. package/dist/mongodb/index.d.ts +2 -2
  42. package/dist/rest/index.cjs +1 -1
  43. package/dist/rest/index.d.cts +3 -3
  44. package/dist/rest/index.d.ts +3 -3
  45. package/dist/rest/index.js +1 -1
  46. package/dist/templates/index.d.cts +1 -1
  47. package/dist/templates/index.d.ts +1 -1
  48. package/dist/trpc/index.d.cts +2 -2
  49. package/dist/trpc/index.d.ts +2 -2
  50. package/dist/{types-CYGXsNcJ.d.ts → types-COokblgr.d.ts} +181 -1
  51. package/dist/{types-DOKMyC3y.d.cts → types-ComJeXGL.d.cts} +181 -1
  52. package/package.json +2 -2
  53. package/dist/chunk-6QWX3DEB.cjs +0 -120
  54. package/dist/chunk-AMGJ5AFH.cjs +0 -1
  55. package/dist/chunk-JU3UAZRY.cjs +0 -132
  56. package/dist/chunk-QDBGBDCT.js +0 -2
  57. package/dist/chunk-RDFGJHEG.js +0 -2
  58. package/dist/chunk-RILJCH6H.js +0 -121
  59. package/dist/chunk-VJODUKKM.js +0 -133
  60. package/dist/index-BJ1rwHxk.d.cts +0 -284
  61. package/dist/index-BTjlptCL.d.ts +0 -284
@@ -1,284 +0,0 @@
1
- import { C as CollectionConfig, G as GlobalConfig, j as KyroPlugin } from './types-CYGXsNcJ.js';
2
- import { F as Field } from './types-euTszc-1.js';
3
- import { ZodTypeAny } from 'zod';
4
-
5
- interface S3CompatibleConfig {
6
- bucket?: string;
7
- region?: string;
8
- accessKeyId?: string;
9
- secretAccessKey?: string;
10
- endpoint?: string;
11
- cdnUrl?: string;
12
- prefix?: string;
13
- }
14
- interface R2Config {
15
- accountId?: string;
16
- accessKeyId?: string;
17
- secretAccessKey?: string;
18
- bucket?: string;
19
- cdnUrl?: string;
20
- prefix?: string;
21
- publicDevUrl?: string;
22
- }
23
- interface GCSConfig {
24
- bucket?: string;
25
- projectId?: string;
26
- clientEmail?: string;
27
- privateKey?: string;
28
- cdnUrl?: string;
29
- prefix?: string;
30
- }
31
- interface BackblazeConfig {
32
- bucket?: string;
33
- accountId?: string;
34
- applicationKeyId?: string;
35
- applicationKey?: string;
36
- cdnUrl?: string;
37
- prefix?: string;
38
- }
39
- interface BunnyConfig {
40
- storageZone?: string;
41
- apiKey?: string;
42
- cdnUrl?: string;
43
- prefix?: string;
44
- }
45
- interface FTPConfig {
46
- host?: string;
47
- port?: number;
48
- user?: string;
49
- password?: string;
50
- secure?: boolean;
51
- baseUrl?: string;
52
- prefix?: string;
53
- }
54
- interface StorageConfig {
55
- type: string;
56
- s3: S3CompatibleConfig;
57
- r2: R2Config;
58
- gcs: GCSConfig;
59
- digitalocean: S3CompatibleConfig;
60
- backblaze: BackblazeConfig;
61
- wasabi: S3CompatibleConfig;
62
- bunny: BunnyConfig;
63
- ftp: FTPConfig;
64
- cloudinary: {
65
- cloudName?: string;
66
- apiKey?: string;
67
- apiSecret?: string;
68
- folder?: string;
69
- };
70
- imgix: {
71
- domain?: string;
72
- signKey?: string;
73
- };
74
- local: {
75
- uploadDir?: string;
76
- baseUrl?: string;
77
- };
78
- }
79
- interface EmailConfig {
80
- provider?: string;
81
- host?: string;
82
- port?: number;
83
- secure?: boolean;
84
- user?: string;
85
- pass?: string;
86
- from?: string;
87
- fromName?: string;
88
- replyTo?: string;
89
- }
90
- declare class ConfigService {
91
- private db;
92
- private cache;
93
- private loaded;
94
- private static readonly SENSITIVE_KEYS;
95
- constructor(db: any);
96
- /**
97
- * Initialize the service by loading all settings from the database
98
- */
99
- load(): Promise<void>;
100
- private ensureSettingsTable;
101
- /**
102
- * Load settings from the _globals_storage-settings table (SQLite fallback)
103
- * Maps nested global structure to flat key-value cache
104
- */
105
- private loadFromGlobals;
106
- /**
107
- * Get a settings value with environment fallback
108
- */
109
- get(key: string, envKey?: string, defaultValue?: string): string | undefined;
110
- /**
111
- * Get storage configuration
112
- */
113
- getStorageConfig(): StorageConfig;
114
- /**
115
- * Get email configuration
116
- */
117
- getEmailConfig(): EmailConfig;
118
- /**
119
- * Mask sensitive values for display
120
- */
121
- maskSensitive(key: string, value: string | undefined): string | undefined;
122
- /**
123
- * Update a setting in the database
124
- */
125
- set(key: string, value: string, description?: string): Promise<void>;
126
- }
127
-
128
- interface UploadOptions {
129
- folder?: string;
130
- filename?: string;
131
- mimeType?: string;
132
- metadata?: Record<string, unknown>;
133
- }
134
- interface UploadedFile {
135
- id: string;
136
- filename: string;
137
- originalName: string;
138
- mimeType: string;
139
- size: number;
140
- url: string;
141
- thumbnailUrl?: string;
142
- width?: number;
143
- height?: number;
144
- folder?: string;
145
- provider: string;
146
- metadata?: Record<string, unknown>;
147
- createdAt: string;
148
- }
149
- interface ImageTransforms {
150
- width?: number;
151
- height?: number;
152
- fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min";
153
- format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif";
154
- quality?: number;
155
- blur?: number;
156
- sharpen?: number;
157
- /** Crop region as percentages (0-100) of the original image */
158
- cropX?: number;
159
- cropY?: number;
160
- cropWidth?: number;
161
- cropHeight?: number;
162
- }
163
- interface StorageProvider {
164
- name: string;
165
- displayName: string;
166
- supportsDynamicResize: boolean;
167
- upload(file: File, options?: UploadOptions): Promise<UploadedFile>;
168
- uploadFromUrl(url: string, options?: UploadOptions): Promise<UploadedFile>;
169
- delete(url: string): Promise<void>;
170
- rename(oldUrl: string, newKey: string): Promise<string>;
171
- getImageUrl(url: string, transforms?: ImageTransforms): string;
172
- generateThumbnail(file: UploadedFile, size: {
173
- width: number;
174
- height: number;
175
- }): Promise<string>;
176
- list(prefix?: string): Promise<UploadedFile[]>;
177
- exists(url: string): Promise<boolean>;
178
- createFolder?(folder: string): Promise<void>;
179
- deleteFolder?(folder: string): Promise<void>;
180
- }
181
-
182
- declare function resolveProvider(configService: ConfigService): Promise<StorageProvider>;
183
-
184
- interface StorageProviderRegistration {
185
- type: string;
186
- displayName: string;
187
- pluginName?: string;
188
- configFields: Field[];
189
- configKey?: string;
190
- extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
191
- extractRawConfig: (config: any) => any;
192
- factory: (config: any) => StorageProvider;
193
- }
194
- declare class StorageProviderRegistry {
195
- private providers;
196
- private providerToPlugin;
197
- private disabledPlugins;
198
- constructor();
199
- private registerLocal;
200
- private registerImgix;
201
- private registerBunny;
202
- private registerCloudflareR2;
203
- private registerCloudflareS3;
204
- register(registration: StorageProviderRegistration): void;
205
- unregister(type: string): void;
206
- get(type: string): StorageProviderRegistration | undefined;
207
- getAll(): StorageProviderRegistration[];
208
- getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
209
- has(type: string): boolean;
210
- resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
211
- resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
212
- getProviderPluginName(type: string): string | undefined;
213
- getAllPluginNames(): string[];
214
- setPluginEnabled(name: string, enabled: boolean): void;
215
- isPluginEnabled(name: string): boolean;
216
- }
217
-
218
- declare class Registry {
219
- storageProviders: StorageProviderRegistry;
220
- private collections;
221
- private globals;
222
- private plugins;
223
- private schemaCache;
224
- private initialized;
225
- addCollection(config: CollectionConfig): void;
226
- addCollections(configs: CollectionConfig[]): void;
227
- getCollection(slug: string): CollectionConfig | undefined;
228
- getCollections(): CollectionConfig[];
229
- getCollectionSlugs(): string[];
230
- hasCollection(slug: string): boolean;
231
- removeCollection(slug: string): boolean;
232
- addGlobal(config: GlobalConfig): void;
233
- /**
234
- * Add a global after the registry is already initialized.
235
- * Only for internal use (e.g. storage settings form built at startup).
236
- */
237
- addGlobalPostInit(config: GlobalConfig): void;
238
- private _addGlobalUnsafe;
239
- addGlobals(configs: GlobalConfig[]): void;
240
- getGlobal(slug: string): GlobalConfig | undefined;
241
- getGlobals(): GlobalConfig[];
242
- getGlobalSlugs(): string[];
243
- hasGlobal(slug: string): boolean;
244
- removeGlobal(slug: string): boolean;
245
- addPlugin(plugin: KyroPlugin): void;
246
- getPlugins(): KyroPlugin[];
247
- getZodSchema(slug: string): ZodTypeAny;
248
- getCreateZodSchema(slug: string): ZodTypeAny;
249
- getUpdateZodSchema(slug: string): ZodTypeAny;
250
- getWhereZodSchema(slug: string): ZodTypeAny;
251
- getFieldZodSchema(field: Field): ZodTypeAny;
252
- private clearSchemaCache;
253
- private applyFieldDefaults;
254
- getFields(slug: string): Field[];
255
- getFieldMap(slug: string): Map<string, Field>;
256
- getVisibleFields(slug: string): Field[];
257
- validate(): void;
258
- init(kyroInstance?: any): Promise<void>;
259
- isInitialized(): boolean;
260
- getPaginationDefaults(slug: string): {
261
- defaultLimit: number;
262
- limits: number[];
263
- };
264
- getDefaultSort(slug: string): string;
265
- getDefaultColumns(slug: string): string[];
266
- getAdminTitle(slug: string): string;
267
- getAdminLabel(slug: string): string;
268
- getAdminGroup(slug: string): string | undefined;
269
- getStats(): {
270
- collections: number;
271
- globals: number;
272
- plugins: number;
273
- fields: number;
274
- };
275
- toJSON(): {
276
- collections: CollectionConfig[];
277
- globals: GlobalConfig[];
278
- };
279
- }
280
- declare function getRegistry(): Registry;
281
- declare function resetRegistry(): void;
282
- declare function createRegistry(): Registry;
283
-
284
- export { ConfigService as C, type EmailConfig as E, Registry as R, type StorageProvider as S, type StorageConfig as a, resolveProvider as b, createRegistry as c, getRegistry as g, resetRegistry as r };