nextly 0.0.1 → 0.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +122 -0
  3. package/dist/_dts-chunks/collections-handler.d-DjgO74Wt.d.ts +20540 -0
  4. package/dist/_dts-chunks/config.d-DNwsDnjs.d.ts +2589 -0
  5. package/dist/_dts-chunks/define-component.d-BUgTHmt3.d.ts +1149 -0
  6. package/dist/_dts-chunks/image-processor.d-OO1PmMrv.d.ts +335 -0
  7. package/dist/_dts-chunks/index.d-axCAzZ7m.d.ts +17842 -0
  8. package/dist/_dts-chunks/media.d-DjDOZo4B.d.ts +117 -0
  9. package/dist/_dts-chunks/on-error.d-CHIKWNxd.d.ts +38 -0
  10. package/dist/_dts-chunks/storage.d-BUhQ2we_.d.ts +404 -0
  11. package/dist/actions/index.d.ts +239 -0
  12. package/dist/actions/index.mjs +281 -0
  13. package/dist/api/auth-state.d.ts +5 -0
  14. package/dist/api/auth-state.mjs +131 -0
  15. package/dist/api/collections-schema-detail.d.ts +56 -0
  16. package/dist/api/collections-schema-detail.mjs +244 -0
  17. package/dist/api/collections-schema-export.d.ts +56 -0
  18. package/dist/api/collections-schema-export.mjs +129 -0
  19. package/dist/api/collections-schema.d.ts +59 -0
  20. package/dist/api/collections-schema.mjs +207 -0
  21. package/dist/api/components-detail.d.ts +50 -0
  22. package/dist/api/components-detail.mjs +132 -0
  23. package/dist/api/components.d.ts +69 -0
  24. package/dist/api/components.mjs +144 -0
  25. package/dist/api/email-providers-default.d.ts +40 -0
  26. package/dist/api/email-providers-default.mjs +75 -0
  27. package/dist/api/email-providers-detail.d.ts +81 -0
  28. package/dist/api/email-providers-detail.mjs +109 -0
  29. package/dist/api/email-providers-test.d.ts +43 -0
  30. package/dist/api/email-providers-test.mjs +114 -0
  31. package/dist/api/email-providers.d.ts +69 -0
  32. package/dist/api/email-providers.mjs +110 -0
  33. package/dist/api/email-send-template.d.ts +41 -0
  34. package/dist/api/email-send-template.mjs +58 -0
  35. package/dist/api/email-send.d.ts +42 -0
  36. package/dist/api/email-send.mjs +58 -0
  37. package/dist/api/email-templates-detail.d.ts +74 -0
  38. package/dist/api/email-templates-detail.mjs +112 -0
  39. package/dist/api/email-templates-layout.d.ts +55 -0
  40. package/dist/api/email-templates-layout.mjs +92 -0
  41. package/dist/api/email-templates-preview.d.ts +48 -0
  42. package/dist/api/email-templates-preview.mjs +93 -0
  43. package/dist/api/email-templates.d.ts +61 -0
  44. package/dist/api/email-templates.mjs +118 -0
  45. package/dist/api/health.d.ts +68 -0
  46. package/dist/api/health.mjs +67 -0
  47. package/dist/api/index.d.ts +54 -0
  48. package/dist/api/index.mjs +16 -0
  49. package/dist/api/media-bulk.d.ts +74 -0
  50. package/dist/api/media-bulk.mjs +196 -0
  51. package/dist/api/media-folders.d.ts +112 -0
  52. package/dist/api/media-folders.mjs +187 -0
  53. package/dist/api/media-handlers.d.ts +102 -0
  54. package/dist/api/media-handlers.mjs +437 -0
  55. package/dist/api/media.d.ts +117 -0
  56. package/dist/api/media.mjs +242 -0
  57. package/dist/api/singles-detail.d.ts +87 -0
  58. package/dist/api/singles-detail.mjs +170 -0
  59. package/dist/api/singles-schema-detail.d.ts +54 -0
  60. package/dist/api/singles-schema-detail.mjs +182 -0
  61. package/dist/api/singles.d.ts +34 -0
  62. package/dist/api/singles.mjs +94 -0
  63. package/dist/api/storage-upload-url.d.ts +48 -0
  64. package/dist/api/storage-upload-url.mjs +202 -0
  65. package/dist/api/uploads.d.ts +109 -0
  66. package/dist/api/uploads.mjs +359 -0
  67. package/dist/auth/index.d.ts +425 -0
  68. package/dist/auth/index.mjs +199 -0
  69. package/dist/boot-apply-PQSYLDIN.mjs +7 -0
  70. package/dist/chunk-2OALJTK6.mjs +489 -0
  71. package/dist/chunk-2Q2SX2CS.mjs +365 -0
  72. package/dist/chunk-2TFX4ND3.mjs +13 -0
  73. package/dist/chunk-2TWPDSYD.mjs +87 -0
  74. package/dist/chunk-2W3DVD7S.mjs +647 -0
  75. package/dist/chunk-2ZFKXPQM.mjs +88 -0
  76. package/dist/chunk-3FA7FKAV.mjs +832 -0
  77. package/dist/chunk-3NZ2KMBL.mjs +58 -0
  78. package/dist/chunk-4MJLT6PZ.mjs +0 -0
  79. package/dist/chunk-56WO4WX7.mjs +0 -0
  80. package/dist/chunk-5APFUGAD.mjs +89 -0
  81. package/dist/chunk-5HMZ644B.mjs +108 -0
  82. package/dist/chunk-67GXH6PR.mjs +32 -0
  83. package/dist/chunk-6JNEPWRW.mjs +14368 -0
  84. package/dist/chunk-6NFHQIJD.mjs +45 -0
  85. package/dist/chunk-7P6ASYW6.mjs +9 -0
  86. package/dist/chunk-A3WPLSDT.mjs +1364 -0
  87. package/dist/chunk-AGJ6F2T3.mjs +144 -0
  88. package/dist/chunk-AK6Z23OX.mjs +1464 -0
  89. package/dist/chunk-APKKRD2G.mjs +102 -0
  90. package/dist/chunk-B2GV2BWH.mjs +73 -0
  91. package/dist/chunk-D5HQBNUB.mjs +74 -0
  92. package/dist/chunk-DNNG377Z.mjs +204 -0
  93. package/dist/chunk-DP3G27G5.mjs +135 -0
  94. package/dist/chunk-DV6WVX2Q.mjs +0 -0
  95. package/dist/chunk-DXGGXIUZ.mjs +57 -0
  96. package/dist/chunk-EGXBZCGC.mjs +943 -0
  97. package/dist/chunk-ERCNLX3V.mjs +176 -0
  98. package/dist/chunk-FQULBZ53.mjs +850 -0
  99. package/dist/chunk-G2AA4QLC.mjs +262 -0
  100. package/dist/chunk-GDBJ5JCU.mjs +488 -0
  101. package/dist/chunk-GJNSJU4S.mjs +19 -0
  102. package/dist/chunk-GZ6DCQKC.mjs +69 -0
  103. package/dist/chunk-H26B4FYG.mjs +167 -0
  104. package/dist/chunk-I4JMR3UR.mjs +21 -0
  105. package/dist/chunk-INV7QKLG.mjs +508 -0
  106. package/dist/chunk-IUDOC7N7.mjs +46 -0
  107. package/dist/chunk-IZWPRDC3.mjs +206 -0
  108. package/dist/chunk-KIMNCZGV.mjs +15 -0
  109. package/dist/chunk-L6HW2DA7.mjs +15 -0
  110. package/dist/chunk-LAZXX4HR.mjs +100 -0
  111. package/dist/chunk-LDKCUMHK.mjs +95 -0
  112. package/dist/chunk-LRXMECUA.mjs +0 -0
  113. package/dist/chunk-M52VMPGA.mjs +119 -0
  114. package/dist/chunk-MGUWEEI6.mjs +160 -0
  115. package/dist/chunk-NRUWQ5Z7.mjs +419 -0
  116. package/dist/chunk-NSEFNNU4.mjs +25360 -0
  117. package/dist/chunk-NTHVDFGO.mjs +138 -0
  118. package/dist/chunk-O3QHXMOX.mjs +3166 -0
  119. package/dist/chunk-P7NH2OSC.mjs +2605 -0
  120. package/dist/chunk-PKMABBB5.mjs +184 -0
  121. package/dist/chunk-PWS6XGJK.mjs +76 -0
  122. package/dist/chunk-R6JJQHFC.mjs +20 -0
  123. package/dist/chunk-RJLLGGPG.mjs +0 -0
  124. package/dist/chunk-SBACDPNX.mjs +689 -0
  125. package/dist/chunk-TO5AFLVQ.mjs +124 -0
  126. package/dist/chunk-TS7GHTG2.mjs +5436 -0
  127. package/dist/chunk-UJ2IMJ4W.mjs +133 -0
  128. package/dist/chunk-UOP63Q54.mjs +102 -0
  129. package/dist/chunk-UUOFWCM6.mjs +78 -0
  130. package/dist/chunk-V4EQTOA4.mjs +893 -0
  131. package/dist/chunk-VJ66NCL4.mjs +193 -0
  132. package/dist/chunk-VQJQHVEV.mjs +29 -0
  133. package/dist/chunk-VTJADRO3.mjs +141 -0
  134. package/dist/chunk-VWF3JO32.mjs +0 -0
  135. package/dist/chunk-W4MGXIRR.mjs +27 -0
  136. package/dist/chunk-W5KKPZT5.mjs +1204 -0
  137. package/dist/chunk-WD34YQ6T.mjs +381 -0
  138. package/dist/chunk-WZBYMYVW.mjs +14 -0
  139. package/dist/chunk-X23WKS3Z.mjs +50 -0
  140. package/dist/chunk-X7TXCYYN.mjs +6496 -0
  141. package/dist/chunk-XGI4EMS3.mjs +140 -0
  142. package/dist/chunk-XZKLBMN6.mjs +1153 -0
  143. package/dist/chunk-YB7INWPY.mjs +0 -0
  144. package/dist/chunk-YV4Y7SDL.mjs +83 -0
  145. package/dist/chunk-YZNBLFIW.mjs +1688 -0
  146. package/dist/chunk-YZZCTONM.mjs +263 -0
  147. package/dist/chunk-ZE6A3FYH.mjs +289 -0
  148. package/dist/cli/nextly.mjs +68 -0
  149. package/dist/cli/utils/index.d.ts +449 -0
  150. package/dist/cli/utils/index.mjs +49 -0
  151. package/dist/component-schema-service-5577KVW6.mjs +11 -0
  152. package/dist/config-loader-23YEMC3Z.mjs +23 -0
  153. package/dist/config.d.ts +44 -0
  154. package/dist/config.mjs +109 -0
  155. package/dist/container-ORGFGYSZ.mjs +9 -0
  156. package/dist/database/index.d.ts +12 -0
  157. package/dist/database/index.mjs +40 -0
  158. package/dist/database/seeders/index.d.ts +93 -0
  159. package/dist/database/seeders/index.mjs +47 -0
  160. package/dist/db-sync-demote-LJGKLB3S.mjs +117 -0
  161. package/dist/db-sync-promote-B26VSYQF.mjs +113 -0
  162. package/dist/dev-reload-broadcaster-B73IQ53V.mjs +25 -0
  163. package/dist/dist-M2NOU37V.mjs +19 -0
  164. package/dist/drizzle-kit-lazy-D2M2PXR2.mjs +13 -0
  165. package/dist/dynamic-collection-schema-service-IEXTPIZ7.mjs +8 -0
  166. package/dist/errors/index.d.ts +159 -0
  167. package/dist/errors/index.mjs +10 -0
  168. package/dist/factory-IWMBKUJM.mjs +15 -0
  169. package/dist/first-run-QIVKWJIF.mjs +63 -0
  170. package/dist/fresh-push-NR67DC3R.mjs +8 -0
  171. package/dist/index.d.ts +4175 -0
  172. package/dist/index.mjs +1336 -0
  173. package/dist/local-plugin-PTET4NAT.mjs +7 -0
  174. package/dist/logger-NU46DXNY.mjs +15 -0
  175. package/dist/logger-YE4TC7ZN.mjs +9 -0
  176. package/dist/migration-journal-EP532Y4L.mjs +139 -0
  177. package/dist/migrations/mysql/0000_eager_sentry.sql +174 -0
  178. package/dist/migrations/mysql/0001_soft_giant_girl.sql +27 -0
  179. package/dist/migrations/mysql/0002_media_table.sql +24 -0
  180. package/dist/migrations/mysql/0003_dynamic_singles.sql +37 -0
  181. package/dist/migrations/mysql/0004_dynamic_components.sql +35 -0
  182. package/dist/migrations/mysql/0005_user_management_tables.sql +92 -0
  183. package/dist/migrations/mysql/0006_api_keys.sql +36 -0
  184. package/dist/migrations/mysql/0007_general_settings.sql +20 -0
  185. package/dist/migrations/mysql/0008_site_settings_logo_url.sql +9 -0
  186. package/dist/migrations/mysql/0009_activity_log.sql +30 -0
  187. package/dist/migrations/mysql/0010_site_settings_sidebar.sql +13 -0
  188. package/dist/migrations/mysql/0011_missing_tables_and_columns.sql +54 -0
  189. package/dist/migrations/mysql/0012_image_sizes_and_focal_point.sql +30 -0
  190. package/dist/migrations/mysql/0012_media_folders.sql +43 -0
  191. package/dist/migrations/mysql/0013_user_brute_force_protection.sql +31 -0
  192. package/dist/migrations/mysql/0014_email_template_attachments.sql +12 -0
  193. package/dist/migrations/mysql/0015_media_uploaded_by_nullable.sql +15 -0
  194. package/dist/migrations/mysql/20260429_000000_000_initial_journal.sql +22 -0
  195. package/dist/migrations/mysql/20260501_000000_journal_batch.sql +17 -0
  196. package/dist/migrations/mysql/20260501_000001_audit_log.sql +24 -0
  197. package/dist/migrations/mysql/20260504_000000_nextly_meta.sql +21 -0
  198. package/dist/migrations/mysql/meta/0000_snapshot.json +1005 -0
  199. package/dist/migrations/mysql/meta/0001_snapshot.json +1099 -0
  200. package/dist/migrations/mysql/meta/_journal.json +41 -0
  201. package/dist/migrations/postgresql/0000_misty_king_bedlam.sql +169 -0
  202. package/dist/migrations/postgresql/0001_perpetual_captain_marvel.sql +8 -0
  203. package/dist/migrations/postgresql/0002_sad_spectrum.sql +16 -0
  204. package/dist/migrations/postgresql/0003_hesitant_ultron.sql +17 -0
  205. package/dist/migrations/postgresql/0004_media_table.sql +24 -0
  206. package/dist/migrations/postgresql/0005_media_folders.sql +36 -0
  207. package/dist/migrations/postgresql/0006_dynamic_collections_update.sql +50 -0
  208. package/dist/migrations/postgresql/0007_dynamic_singles.sql +38 -0
  209. package/dist/migrations/postgresql/0008_dynamic_components.sql +37 -0
  210. package/dist/migrations/postgresql/0009_user_management_tables.sql +95 -0
  211. package/dist/migrations/postgresql/0010_api_keys.sql +34 -0
  212. package/dist/migrations/postgresql/0011_general_settings.sql +20 -0
  213. package/dist/migrations/postgresql/0012_site_settings_logo_url.sql +9 -0
  214. package/dist/migrations/postgresql/0013_activity_log.sql +29 -0
  215. package/dist/migrations/postgresql/0014_image_sizes_and_focal_point.sql +33 -0
  216. package/dist/migrations/postgresql/0014_site_settings_sidebar.sql +13 -0
  217. package/dist/migrations/postgresql/0015_user_brute_force_protection.sql +29 -0
  218. package/dist/migrations/postgresql/0016_email_template_attachments.sql +12 -0
  219. package/dist/migrations/postgresql/0017_media_uploaded_by_nullable.sql +15 -0
  220. package/dist/migrations/postgresql/20260429_000000_000_initial_journal.sql +24 -0
  221. package/dist/migrations/postgresql/20260501_000000_journal_batch.sql +17 -0
  222. package/dist/migrations/postgresql/20260501_000001_audit_log.sql +24 -0
  223. package/dist/migrations/postgresql/20260504_000000_nextly_meta.sql +22 -0
  224. package/dist/migrations/postgresql/meta/0000_snapshot.json +1286 -0
  225. package/dist/migrations/postgresql/meta/0001_snapshot.json +1407 -0
  226. package/dist/migrations/postgresql/meta/0002_snapshot.json +1552 -0
  227. package/dist/migrations/postgresql/meta/0003_snapshot.json +1695 -0
  228. package/dist/migrations/postgresql/meta/0010_snapshot.json +2345 -0
  229. package/dist/migrations/postgresql/meta/_journal.json +90 -0
  230. package/dist/migrations/sqlite/0000_api_keys.sql +34 -0
  231. package/dist/migrations/sqlite/0001_general_settings.sql +20 -0
  232. package/dist/migrations/sqlite/0002_site_settings_logo_url.sql +9 -0
  233. package/dist/migrations/sqlite/0003_activity_log.sql +29 -0
  234. package/dist/migrations/sqlite/0004_image_sizes_and_focal_point.sql +29 -0
  235. package/dist/migrations/sqlite/0004_site_settings_sidebar.sql +11 -0
  236. package/dist/migrations/sqlite/0005_user_brute_force_protection.sql +29 -0
  237. package/dist/migrations/sqlite/0006_email_template_attachments.sql +12 -0
  238. package/dist/migrations/sqlite/0007_media_uploaded_by_nullable.sql +111 -0
  239. package/dist/migrations/sqlite/20260429_000000_000_initial_journal.sql +24 -0
  240. package/dist/migrations/sqlite/20260501_000000_journal_batch.sql +19 -0
  241. package/dist/migrations/sqlite/20260501_000001_audit_log.sql +24 -0
  242. package/dist/migrations/sqlite/20260504_000000_nextly_meta.sql +21 -0
  243. package/dist/migrations/sqlite/20260505_000000_user_management_tables.sql +77 -0
  244. package/dist/next.d.ts +57 -0
  245. package/dist/next.mjs +55 -0
  246. package/dist/observability/index.d.ts +87 -0
  247. package/dist/observability/index.mjs +57 -0
  248. package/dist/permissions-3DZZQZMI.mjs +39 -0
  249. package/dist/pipeline-YOML7SWF.mjs +29 -0
  250. package/dist/preview-ZZTR3QGS.mjs +9 -0
  251. package/dist/program-PW6UB2ZC.mjs +5934 -0
  252. package/dist/reconcile-single-tables-7ENVXJGB.mjs +7 -0
  253. package/dist/register-SF6E6FVU.mjs +49 -0
  254. package/dist/reload-config-HWQ4G5MM.mjs +23 -0
  255. package/dist/resolve-single-table-name-JSOMUB3R.mjs +7 -0
  256. package/dist/routeHandler-UNMMJIBM.mjs +77 -0
  257. package/dist/runtime-schema-generator-NRA6A6Z6.mjs +8 -0
  258. package/dist/runtime.d.ts +120 -0
  259. package/dist/runtime.mjs +73 -0
  260. package/dist/schema-hash-FMMG6VPJ.mjs +13 -0
  261. package/dist/schema-registry-EQ36FZDP.mjs +7 -0
  262. package/dist/scripts/load-env.mjs +42 -0
  263. package/dist/storage/index.d.ts +566 -0
  264. package/dist/storage/index.mjs +45 -0
  265. package/dist/super-admin-G5ZK5F4T.mjs +39 -0
  266. package/dist/system-table-service-WGSRVEGT.mjs +17 -0
  267. package/dist/users-7KELGRYJ.mjs +38 -0
  268. package/package.json +308 -9
@@ -0,0 +1,449 @@
1
+ import { S as SanitizedNextlyConfig } from '../../_dts-chunks/config.d-DNwsDnjs.d.ts';
2
+ import '../../_dts-chunks/collections-handler.d-DjgO74Wt.d.ts';
3
+ import '@nextlyhq/adapter-drizzle';
4
+ import '@nextlyhq/adapter-drizzle/types';
5
+ import 'drizzle-orm/pg-core';
6
+ import 'react';
7
+ import '../../_dts-chunks/media.d-DjDOZo4B.d.ts';
8
+ import 'zod';
9
+ import '../../_dts-chunks/image-processor.d-OO1PmMrv.d.ts';
10
+ import 'drizzle-orm';
11
+ import '../../_dts-chunks/storage.d-BUhQ2we_.d.ts';
12
+
13
+ /**
14
+ * Config Loader
15
+ *
16
+ * Loads and parses nextly.config.ts at runtime using esbuild.
17
+ * Supports TypeScript, ESM, and CommonJS config files.
18
+ *
19
+ * @module cli/utils/config-loader
20
+ * @since 1.0.0
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { loadConfig, watchConfig } from 'nextly/cli/utils/config-loader';
25
+ *
26
+ * // Load config once
27
+ * const config = await loadConfig();
28
+ *
29
+ * // Watch for changes (dev mode)
30
+ * const config = await loadConfig({ watch: true });
31
+ * watchConfig((newConfig) => {
32
+ * console.log('Config updated:', newConfig);
33
+ * });
34
+ * ```
35
+ */
36
+
37
+ /**
38
+ * Options for loading the config file.
39
+ */
40
+ interface LoadConfigOptions {
41
+ /**
42
+ * Custom path to the config file.
43
+ * If not provided, searches default locations.
44
+ */
45
+ configPath?: string;
46
+ /**
47
+ * Working directory for resolving relative paths.
48
+ * Defaults to `process.cwd()`.
49
+ */
50
+ cwd?: string;
51
+ /**
52
+ * Enable watch mode for file changes.
53
+ * When enabled, the config will be reloaded on changes.
54
+ * @default false
55
+ */
56
+ watch?: boolean;
57
+ /**
58
+ * Enable verbose logging for debugging.
59
+ * @default false
60
+ */
61
+ debug?: boolean;
62
+ }
63
+ /**
64
+ * Result of loading the config file.
65
+ */
66
+ interface LoadConfigResult {
67
+ /**
68
+ * The loaded and sanitized config.
69
+ */
70
+ config: SanitizedNextlyConfig;
71
+ /**
72
+ * Path to the config file that was loaded.
73
+ * Undefined if using default config (no file found).
74
+ */
75
+ configPath?: string;
76
+ /**
77
+ * List of files that the config depends on.
78
+ * Useful for watch mode to know what files to watch.
79
+ */
80
+ dependencies: string[];
81
+ }
82
+ /**
83
+ * Callback for config change events.
84
+ */
85
+ type ConfigChangeCallback = (result: LoadConfigResult) => void;
86
+ /**
87
+ * Load the Nextly configuration from file.
88
+ *
89
+ * Searches for config files in the following locations (in order):
90
+ * 1. `./nextly.config.ts`
91
+ * 2. `./nextly.config.mts`
92
+ * 3. `./nextly.config.js`
93
+ * 4. `./nextly.config.mjs`
94
+ * 5. `./src/nextly.config.ts` (and other extensions)
95
+ * 6. `./config/nextly.config.ts` (and other extensions)
96
+ *
97
+ * If no config file is found, returns a default configuration.
98
+ *
99
+ * @param options - Load options
100
+ * @returns Promise resolving to the loaded config result
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * // Basic usage
105
+ * const { config } = await loadConfig();
106
+ * console.log(config.collections);
107
+ *
108
+ * // With custom path
109
+ * const { config } = await loadConfig({
110
+ * configPath: './custom/nextly.config.ts'
111
+ * });
112
+ *
113
+ * // With watch mode
114
+ * const { config } = await loadConfig({ watch: true });
115
+ * watchConfig((result) => {
116
+ * console.log('Config changed:', result.config);
117
+ * });
118
+ * ```
119
+ */
120
+ declare function loadConfig(options?: LoadConfigOptions): Promise<LoadConfigResult>;
121
+ /**
122
+ * Register a callback to be called when the config file changes.
123
+ * Only works when config was loaded with `watch: true`.
124
+ *
125
+ * @param callback - Function to call when config changes
126
+ * @returns Unsubscribe function
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * // Load with watch mode
131
+ * await loadConfig({ watch: true });
132
+ *
133
+ * // Register callback
134
+ * const unsubscribe = watchConfig((result) => {
135
+ * console.log('Config updated:', result.config);
136
+ * });
137
+ *
138
+ * // Later, unsubscribe
139
+ * unsubscribe();
140
+ * ```
141
+ */
142
+ declare function watchConfig(callback: ConfigChangeCallback): () => void;
143
+ /**
144
+ * Clear the cached config and stop watching.
145
+ * Useful for testing or when you need to force a reload.
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * // Clear cache and reload
150
+ * clearConfigCache();
151
+ * const { config } = await loadConfig();
152
+ * ```
153
+ */
154
+ declare function clearConfigCache(): void;
155
+ /**
156
+ * Get the currently cached config without loading.
157
+ * Returns null if no config is cached.
158
+ *
159
+ * @returns Cached config result or null
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * const cached = getCachedConfig();
164
+ * if (cached) {
165
+ * console.log('Using cached config');
166
+ * } else {
167
+ * const { config } = await loadConfig();
168
+ * }
169
+ * ```
170
+ */
171
+ declare function getCachedConfig(): LoadConfigResult | null;
172
+ /**
173
+ * Check if a config file exists in the default locations.
174
+ *
175
+ * @param cwd - Working directory to search from
176
+ * @returns Path to config file if found, undefined otherwise
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * const configPath = findNextlyConfig();
181
+ * if (configPath) {
182
+ * console.log('Found config at:', configPath);
183
+ * } else {
184
+ * console.log('No config file found');
185
+ * }
186
+ * ```
187
+ */
188
+ declare function findNextlyConfig(cwd?: string): string | undefined;
189
+ /**
190
+ * Supported config file extensions.
191
+ */
192
+ declare const SUPPORTED_EXTENSIONS: string[];
193
+ /**
194
+ * Default search directories for config files.
195
+ */
196
+ declare const SEARCH_DIRECTORIES: string[];
197
+
198
+ /**
199
+ * CLI Logger Utility
200
+ *
201
+ * Provides colored output for CLI commands with support for
202
+ * verbose, quiet, and normal modes.
203
+ *
204
+ * @module cli/utils/logger
205
+ * @since 1.0.0
206
+ */
207
+ /**
208
+ * Log level for CLI output
209
+ */
210
+ type LogLevel = "debug" | "info" | "warn" | "error" | "success";
211
+ /**
212
+ * Logger options for customizing output behavior
213
+ */
214
+ interface LoggerOptions {
215
+ /**
216
+ * Enable verbose output (shows debug messages)
217
+ * @default false
218
+ */
219
+ verbose?: boolean;
220
+ /**
221
+ * Enable quiet mode (only shows errors)
222
+ * @default false
223
+ */
224
+ quiet?: boolean;
225
+ /**
226
+ * Disable colors in output
227
+ * @default false
228
+ */
229
+ noColor?: boolean;
230
+ }
231
+ /**
232
+ * Logger instance interface
233
+ */
234
+ interface Logger {
235
+ /** Log debug message (only shown in verbose mode) */
236
+ debug: (message: string, ...args: unknown[]) => void;
237
+ /** Log info message */
238
+ info: (message: string, ...args: unknown[]) => void;
239
+ /** Log warning message */
240
+ warn: (message: string, ...args: unknown[]) => void;
241
+ /** Log error message */
242
+ error: (message: string, ...args: unknown[]) => void;
243
+ /** Log success message */
244
+ success: (message: string, ...args: unknown[]) => void;
245
+ /** Log a blank line */
246
+ newline: () => void;
247
+ /** Log a divider line */
248
+ divider: (char?: string) => void;
249
+ /** Log a header with emphasis */
250
+ header: (message: string) => void;
251
+ /** Log a list item */
252
+ item: (message: string, indent?: number) => void;
253
+ /** Log a key-value pair */
254
+ keyValue: (key: string, value: string | number | boolean) => void;
255
+ /** Log a table (simple format) */
256
+ table: (headers: string[], rows: (string | number | boolean)[][]) => void;
257
+ /** Create a spinner (returns stop function) */
258
+ spinner: (message: string) => {
259
+ stop: (success?: boolean) => void;
260
+ };
261
+ /** Update logger options */
262
+ setOptions: (options: LoggerOptions) => void;
263
+ /** Get current options */
264
+ getOptions: () => LoggerOptions;
265
+ }
266
+ /**
267
+ * Create a new logger instance
268
+ *
269
+ * @param options - Logger configuration options
270
+ * @returns Logger instance
271
+ *
272
+ * @example
273
+ * ```typescript
274
+ * const logger = createLogger({ verbose: true });
275
+ * logger.info('Starting process...');
276
+ * logger.success('Done!');
277
+ * ```
278
+ */
279
+ declare function createLogger(options?: LoggerOptions): Logger;
280
+ /**
281
+ * Default logger instance with default options
282
+ */
283
+ declare const logger: Logger;
284
+ /**
285
+ * Format a duration in milliseconds to a human-readable string
286
+ *
287
+ * @param ms - Duration in milliseconds
288
+ * @returns Formatted duration string
289
+ *
290
+ * @example
291
+ * ```typescript
292
+ * formatDuration(1500) // "1.5s"
293
+ * formatDuration(100) // "100ms"
294
+ * formatDuration(65000) // "1m 5s"
295
+ * ```
296
+ */
297
+ declare function formatDuration(ms: number): string;
298
+ /**
299
+ * Format a file size in bytes to a human-readable string
300
+ *
301
+ * @param bytes - Size in bytes
302
+ * @returns Formatted size string
303
+ *
304
+ * @example
305
+ * ```typescript
306
+ * formatBytes(1024) // "1.00 KB"
307
+ * formatBytes(1048576) // "1.00 MB"
308
+ * ```
309
+ */
310
+ declare function formatBytes(bytes: number): string;
311
+ /**
312
+ * Format a count with proper pluralization
313
+ *
314
+ * @param count - The count
315
+ * @param singular - Singular form of the word
316
+ * @param plural - Plural form of the word (defaults to singular + 's')
317
+ * @returns Formatted string
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * formatCount(1, 'file') // "1 file"
322
+ * formatCount(5, 'file') // "5 files"
323
+ * formatCount(0, 'migration') // "0 migrations"
324
+ * ```
325
+ */
326
+ declare function formatCount(count: number, singular: string, plural?: string): string;
327
+
328
+ /**
329
+ * CLI Database Adapter Utilities
330
+ *
331
+ * Helper functions for creating and managing database adapters
332
+ * in CLI commands.
333
+ *
334
+ * @module cli/utils/adapter
335
+ * @since 1.0.0
336
+ */
337
+
338
+ /**
339
+ * Supported database dialects
340
+ */
341
+ type SupportedDialect = "postgresql" | "mysql" | "sqlite";
342
+ /**
343
+ * Options for creating a database adapter
344
+ */
345
+ interface CreateAdapterOptions {
346
+ /**
347
+ * Database dialect (postgresql, mysql, sqlite)
348
+ * If not provided, will be detected from DATABASE_URL or DB_DIALECT env var
349
+ */
350
+ dialect?: SupportedDialect;
351
+ /**
352
+ * Database connection URL
353
+ * If not provided, will use DATABASE_URL env var
354
+ */
355
+ databaseUrl?: string;
356
+ /**
357
+ * Logger instance for output
358
+ */
359
+ logger?: Logger;
360
+ }
361
+ /**
362
+ * Result of database environment validation
363
+ */
364
+ interface DatabaseEnvValidation {
365
+ /** Whether the environment is valid */
366
+ valid: boolean;
367
+ /** Error messages if invalid */
368
+ errors: string[];
369
+ /** Detected dialect */
370
+ dialect?: SupportedDialect;
371
+ /** Database URL */
372
+ databaseUrl?: string;
373
+ }
374
+ /**
375
+ * Detect database dialect from connection URL
376
+ *
377
+ * @param url - Database connection URL
378
+ * @returns Detected dialect or undefined
379
+ */
380
+ declare function detectDialectFromUrl(url: string): SupportedDialect | undefined;
381
+ /**
382
+ * Validate database environment variables
383
+ *
384
+ * @returns Validation result with errors if any
385
+ */
386
+ declare function validateDatabaseEnv(): DatabaseEnvValidation;
387
+ /**
388
+ * Database adapter interface (minimal for CLI use)
389
+ */
390
+ interface CLIDatabaseAdapter {
391
+ dialect: SupportedDialect;
392
+ connect(): Promise<void>;
393
+ disconnect(): Promise<void>;
394
+ isConnected(): boolean;
395
+ getCapabilities(): {
396
+ dialect: SupportedDialect;
397
+ };
398
+ }
399
+ /**
400
+ * Create a database adapter from environment or options
401
+ *
402
+ * @param options - Adapter creation options
403
+ * @returns Database adapter instance
404
+ * @throws Error if environment is invalid or adapter creation fails
405
+ *
406
+ * @example
407
+ * ```typescript
408
+ * const adapter = await createAdapter({ logger });
409
+ * try {
410
+ * // Use adapter...
411
+ * } finally {
412
+ * await adapter.disconnect();
413
+ * }
414
+ * ```
415
+ */
416
+ declare function createAdapter(options?: CreateAdapterOptions): Promise<CLIDatabaseAdapter>;
417
+ /**
418
+ * Execute a function with a database adapter, ensuring cleanup
419
+ *
420
+ * @param fn - Function to execute with the adapter
421
+ * @param options - Adapter creation options
422
+ * @returns Result of the function
423
+ *
424
+ * @example
425
+ * ```typescript
426
+ * const result = await withAdapter(async (adapter) => {
427
+ * return await someOperation(adapter);
428
+ * }, { logger });
429
+ * ```
430
+ */
431
+ declare function withAdapter<T>(fn: (adapter: CLIDatabaseAdapter) => Promise<T>, options?: CreateAdapterOptions): Promise<T>;
432
+ /**
433
+ * Get a human-readable name for a dialect
434
+ *
435
+ * @param dialect - Database dialect
436
+ * @returns Human-readable name
437
+ */
438
+ declare function getDialectDisplayName(dialect: SupportedDialect): string;
439
+ /**
440
+ * Check if a dialect supports a specific feature
441
+ *
442
+ * @param dialect - Database dialect
443
+ * @param feature - Feature to check
444
+ * @returns Whether the feature is supported
445
+ */
446
+ declare function dialectSupports(dialect: SupportedDialect, feature: "transactions" | "jsonb" | "arrays" | "uuids"): boolean;
447
+
448
+ export { SEARCH_DIRECTORIES, SUPPORTED_EXTENSIONS, clearConfigCache, createAdapter, createLogger, detectDialectFromUrl, dialectSupports, findNextlyConfig, formatBytes, formatCount, formatDuration, getCachedConfig, getDialectDisplayName, loadConfig, logger, validateDatabaseEnv, watchConfig, withAdapter };
449
+ export type { CLIDatabaseAdapter, ConfigChangeCallback, CreateAdapterOptions, DatabaseEnvValidation, LoadConfigOptions, LoadConfigResult, LogLevel, Logger, LoggerOptions, SupportedDialect };
@@ -0,0 +1,49 @@
1
+ import {
2
+ createLogger,
3
+ formatBytes,
4
+ formatCount,
5
+ formatDuration,
6
+ logger
7
+ } from "../../chunk-MGUWEEI6.mjs";
8
+ import {
9
+ createAdapter,
10
+ detectDialectFromUrl,
11
+ dialectSupports,
12
+ getDialectDisplayName,
13
+ validateDatabaseEnv,
14
+ withAdapter
15
+ } from "../../chunk-M52VMPGA.mjs";
16
+ import {
17
+ SEARCH_DIRECTORIES,
18
+ SUPPORTED_EXTENSIONS,
19
+ clearConfigCache,
20
+ findNextlyConfig,
21
+ getCachedConfig,
22
+ loadConfig,
23
+ watchConfig
24
+ } from "../../chunk-ZE6A3FYH.mjs";
25
+ import "../../chunk-GDBJ5JCU.mjs";
26
+ import "../../chunk-FQULBZ53.mjs";
27
+ import "../../chunk-4MJLT6PZ.mjs";
28
+ import "../../chunk-NRUWQ5Z7.mjs";
29
+ import "../../chunk-7P6ASYW6.mjs";
30
+ export {
31
+ SEARCH_DIRECTORIES,
32
+ SUPPORTED_EXTENSIONS,
33
+ clearConfigCache,
34
+ createAdapter,
35
+ createLogger,
36
+ detectDialectFromUrl,
37
+ dialectSupports,
38
+ findNextlyConfig,
39
+ formatBytes,
40
+ formatCount,
41
+ formatDuration,
42
+ getCachedConfig,
43
+ getDialectDisplayName,
44
+ loadConfig,
45
+ logger,
46
+ validateDatabaseEnv,
47
+ watchConfig,
48
+ withAdapter
49
+ };
@@ -0,0 +1,11 @@
1
+ import "./chunk-RJLLGGPG.mjs";
2
+ import {
3
+ ComponentSchemaService
4
+ } from "./chunk-V4EQTOA4.mjs";
5
+ import "./chunk-DV6WVX2Q.mjs";
6
+ import "./chunk-UJ2IMJ4W.mjs";
7
+ import "./chunk-5APFUGAD.mjs";
8
+ import "./chunk-7P6ASYW6.mjs";
9
+ export {
10
+ ComponentSchemaService
11
+ };
@@ -0,0 +1,23 @@
1
+ import {
2
+ SEARCH_DIRECTORIES,
3
+ SUPPORTED_EXTENSIONS,
4
+ clearConfigCache,
5
+ findNextlyConfig,
6
+ getCachedConfig,
7
+ loadConfig,
8
+ watchConfig
9
+ } from "./chunk-ZE6A3FYH.mjs";
10
+ import "./chunk-GDBJ5JCU.mjs";
11
+ import "./chunk-FQULBZ53.mjs";
12
+ import "./chunk-4MJLT6PZ.mjs";
13
+ import "./chunk-NRUWQ5Z7.mjs";
14
+ import "./chunk-7P6ASYW6.mjs";
15
+ export {
16
+ SEARCH_DIRECTORIES,
17
+ SUPPORTED_EXTENSIONS,
18
+ clearConfigCache,
19
+ findNextlyConfig,
20
+ getCachedConfig,
21
+ loadConfig,
22
+ watchConfig
23
+ };
@@ -0,0 +1,44 @@
1
+ export { A as ALL_FIELD_TYPES, a as AccessFunction, B as BaseFieldConfig, C as CellComponentProps, b as CheckboxFieldAdminOptions, c as CheckboxFieldConfig, d as CheckboxFieldValue, e as ChipsFieldAdminOptions, f as ChipsFieldConfig, g as ChipsFieldValue, h as CodeEditorOptions, i as CodeFieldAdminOptions, j as CodeFieldConfig, k as CodeFieldValue, l as CodeLanguage, m as CollectionAccessControl, n as CollectionAdminOptions, o as CollectionConfig, p as CollectionHooks, q as CollectionLabels, r as CollectionPagination, s as ComponentAdminOptions, t as ComponentConfig, u as ComponentFieldConfig, v as ComponentLabel, w as CustomEndpoint, D as DATA_FIELD_TYPES, x as DataFieldConfig, y as DataFieldType, z as DateFieldAdminOptions, E as DateFieldConfig, F as DateFieldValue, G as DatePickerAppearance, H as DatePickerOptions, I as EmailFieldAdminOptions, J as EmailFieldConfig, K as EmailFieldValue, L as FieldAccess, M as FieldAdminOptions, N as FieldComponentProps, O as FieldCondition, P as FieldConfig, Q as FieldHooks, R as FieldType, S as FieldValidation, T as FilterComponentProps, U as FilterOptionsArgs, V as FilterOptionsFunction, W as GroupFieldAdminOptions, X as GroupFieldConfig, Y as GroupFieldConfig_FieldConfig, Z as GroupFieldValue, _ as HookContext, $ as HookHandler, a0 as HttpMethod, a1 as JSONEditorOptions, a2 as JSONFieldAdminOptions, a3 as JSONFieldConfig, a4 as JSONFieldValue, a5 as JSONSchemaDefinition, a6 as JSONSchemaProperty, a7 as JSONSchemaType, a8 as JoinFieldAdminOptions, a9 as JoinFieldConfig, aa as JoinFieldWhere, ab as NumberFieldAdminOptions, ac as NumberFieldConfig, ad as NumberFieldValue, ae as NumberFilterOperator, af as PasswordFieldAdminOptions, ag as PasswordFieldConfig, ah as PasswordFieldValue, ai as RadioFieldAdminOptions, aj as RadioFieldConfig, ak as RadioFieldValue, al as RadioLayout, am as RelationshipAppearance, an as RelationshipFieldAdminOptions, ao as RelationshipFieldConfig, ap as RelationshipFieldValue, aq as RelationshipFilterOptions, ar as RelationshipFilterOptionsArgs, as as RelationshipFilterOptionsFunction, at as RelationshipFilterQuery, au as RelationshipPolymorphicValue, av as RelationshipSingleValue, aw as RelationshipSortOptions, ax as RepeaterFieldAdminOptions, ay as RepeaterFieldConfig, az as RepeaterFieldLabels, aA as RepeaterFieldValue, aB as RepeaterRowLabelProps, aC as RepeaterRowValue, aD as RequestContext, aE as RichTextFeature, aF as RichTextFieldAdminOptions, aG as RichTextFieldConfig, aH as RichTextFieldValue, aI as RichTextNode, aJ as RichTextValue, aK as SelectFieldAdminOptions, aL as SelectFieldConfig, aM as SelectFieldValue, aN as SelectOption, aO as SingleAccessControl, aP as SingleAdminOptions, aQ as SingleConfig, aR as SingleHooks, aS as SingleLabel, aT as StringFilterOperator, aU as TextFieldAdminOptions, aV as TextFieldConfig, aW as TextFieldValue, aX as TextareaFieldAdminOptions, aY as TextareaFieldConfig, aZ as TextareaFieldValue, a_ as UploadFieldAdminOptions, a$ as UploadFieldConfig, b0 as UploadFieldValue, b1 as UploadFilterOptions, b2 as UploadFilterOptionsArgs, b3 as UploadFilterOptionsFunction, b4 as UploadFilterQuery, b5 as UploadPolymorphicValue, b6 as UploadSingleValue, b7 as VIRTUAL_FIELD_TYPES, b8 as VirtualFieldConfig, b9 as VirtualFieldType, ba as defineCollection } from './_dts-chunks/collections-handler.d-DjgO74Wt.d.ts';
2
+ export { a as array, c as checkbox, b as chips, d as code, e as component, f as date, g as defineComponent, h as defineConfig, i as defineSingle, j as email, k as group, l as hasNestedFields, m as isCheckboxField, n as isChipsField, o as isCodeField, p as isComponentField, q as isDataField, r as isDateField, s as isEmailField, t as isGroupField, u as isJSONField, v as isNumberField, w as isPasswordField, x as isRadioField, y as isRelationalField, z as isRelationshipField, A as isRepeaterField, B as isRichTextField, C as isSelectField, D as isTextField, E as isTextareaField, F as isUploadField, G as json, H as number, I as option, J as password, K as radio, L as relationship, M as repeater, N as richText, O as select, P as text, Q as textarea, R as upload } from './_dts-chunks/define-component.d-BUgTHmt3.d.ts';
3
+ export { C as CollectionStorageConfig, a as CollectionStorageMap, S as StoragePlugin, b as StoragePluginConfig } from './_dts-chunks/image-processor.d-OO1PmMrv.d.ts';
4
+ export { D as DatabaseConfig, N as NextlyConfig, R as RateLimitRecord, a as RateLimitStore, b as RateLimitingConfig, S as SanitizedNextlyConfig, c as SanitizedRateLimitingConfig, T as TypeScriptConfig, s as sanitizeConfig } from './_dts-chunks/config.d-DNwsDnjs.d.ts';
5
+ import '@nextlyhq/adapter-drizzle';
6
+ import '@nextlyhq/adapter-drizzle/types';
7
+ import 'drizzle-orm/pg-core';
8
+ import 'react';
9
+ import './_dts-chunks/media.d-DjDOZo4B.d.ts';
10
+ import 'zod';
11
+ import 'drizzle-orm';
12
+ import './_dts-chunks/storage.d-BUhQ2we_.d.ts';
13
+
14
+ /**
15
+ * Generate a CSS string that sets admin branding custom properties on
16
+ * `.adminapp`. Intended to be injected as a `<style>` tag in the
17
+ * server-side layout so colors are present in the initial HTML —
18
+ * no FOUC while waiting for the client-side `/admin-meta` fetch.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * // app/admin/[[...params]]/layout.tsx (server component)
23
+ * import config from '../../../../nextly.config';
24
+ * import { getBrandingCss } from 'nextly/config';
25
+ *
26
+ * export default function AdminLayout({ children }) {
27
+ * const css = getBrandingCss(config.admin?.branding);
28
+ * return (
29
+ * <>
30
+ * {css && <style dangerouslySetInnerHTML={{ __html: css }} />}
31
+ * {children}
32
+ * </>
33
+ * );
34
+ * }
35
+ * ```
36
+ */
37
+ declare function getBrandingCss(branding: {
38
+ colors?: {
39
+ primary?: string;
40
+ accent?: string;
41
+ };
42
+ } | undefined): string | null;
43
+
44
+ export { getBrandingCss };
@@ -0,0 +1,109 @@
1
+ import {
2
+ array,
3
+ checkbox,
4
+ chips,
5
+ code,
6
+ component,
7
+ date,
8
+ defineCollection,
9
+ defineComponent,
10
+ defineSingle,
11
+ email,
12
+ group,
13
+ json,
14
+ number,
15
+ option,
16
+ password,
17
+ radio,
18
+ relationship,
19
+ repeater,
20
+ richText,
21
+ select,
22
+ text,
23
+ textarea,
24
+ upload
25
+ } from "./chunk-WD34YQ6T.mjs";
26
+ import {
27
+ defineConfig,
28
+ sanitizeConfig
29
+ } from "./chunk-GDBJ5JCU.mjs";
30
+ import {
31
+ getBrandingCss
32
+ } from "./chunk-PWS6XGJK.mjs";
33
+ import "./chunk-ERCNLX3V.mjs";
34
+ import "./chunk-APKKRD2G.mjs";
35
+ import "./chunk-FQULBZ53.mjs";
36
+ import "./chunk-VTJADRO3.mjs";
37
+ import {
38
+ hasNestedFields,
39
+ isCheckboxField,
40
+ isChipsField,
41
+ isCodeField,
42
+ isComponentField,
43
+ isDataField,
44
+ isDateField,
45
+ isEmailField,
46
+ isGroupField,
47
+ isJSONField,
48
+ isNumberField,
49
+ isPasswordField,
50
+ isRadioField,
51
+ isRelationalField,
52
+ isRelationshipField,
53
+ isRepeaterField,
54
+ isRichTextField,
55
+ isSelectField,
56
+ isTextField,
57
+ isTextareaField,
58
+ isUploadField
59
+ } from "./chunk-5APFUGAD.mjs";
60
+ import "./chunk-7P6ASYW6.mjs";
61
+ export {
62
+ array,
63
+ checkbox,
64
+ chips,
65
+ code,
66
+ component,
67
+ date,
68
+ defineCollection,
69
+ defineComponent,
70
+ defineConfig,
71
+ defineSingle,
72
+ email,
73
+ getBrandingCss,
74
+ group,
75
+ hasNestedFields,
76
+ isCheckboxField,
77
+ isChipsField,
78
+ isCodeField,
79
+ isComponentField,
80
+ isDataField,
81
+ isDateField,
82
+ isEmailField,
83
+ isGroupField,
84
+ isJSONField,
85
+ isNumberField,
86
+ isPasswordField,
87
+ isRadioField,
88
+ isRelationalField,
89
+ isRelationshipField,
90
+ isRepeaterField,
91
+ isRichTextField,
92
+ isSelectField,
93
+ isTextField,
94
+ isTextareaField,
95
+ isUploadField,
96
+ json,
97
+ number,
98
+ option,
99
+ password,
100
+ radio,
101
+ relationship,
102
+ repeater,
103
+ richText,
104
+ sanitizeConfig,
105
+ select,
106
+ text,
107
+ textarea,
108
+ upload
109
+ };
@@ -0,0 +1,9 @@
1
+ import {
2
+ Container,
3
+ container
4
+ } from "./chunk-D5HQBNUB.mjs";
5
+ import "./chunk-7P6ASYW6.mjs";
6
+ export {
7
+ Container,
8
+ container
9
+ };