nextly 0.0.2-alpha.1 → 0.0.2-alpha.10

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 (93) hide show
  1. package/dist/_dts-chunks/{collections-handler.d-DjgO74Wt.d.ts → collections-handler.d-B3iNFGJv.d.ts} +135 -120
  2. package/dist/_dts-chunks/{config.d-DNwsDnjs.d.ts → config.d-D8eInFE5.d.ts} +13 -1
  3. package/dist/_dts-chunks/{define-component.d-BUgTHmt3.d.ts → define-component.d-COeEsUOT.d.ts} +2 -2
  4. package/dist/_dts-chunks/{index.d-axCAzZ7m.d.ts → index.d-qjDq8N63.d.ts} +5 -5
  5. package/dist/actions/index.mjs +15 -15
  6. package/dist/api/auth-state.mjs +21 -21
  7. package/dist/api/collections-schema-detail.mjs +21 -21
  8. package/dist/api/collections-schema-export.mjs +21 -21
  9. package/dist/api/collections-schema.mjs +21 -21
  10. package/dist/api/components-detail.mjs +21 -21
  11. package/dist/api/components.mjs +21 -21
  12. package/dist/api/email-providers-default.mjs +21 -21
  13. package/dist/api/email-providers-detail.mjs +21 -21
  14. package/dist/api/email-providers-test.mjs +21 -21
  15. package/dist/api/email-providers.mjs +21 -21
  16. package/dist/api/email-send-template.mjs +23 -23
  17. package/dist/api/email-send.mjs +23 -23
  18. package/dist/api/email-templates-detail.mjs +21 -21
  19. package/dist/api/email-templates-layout.mjs +21 -21
  20. package/dist/api/email-templates-preview.mjs +21 -21
  21. package/dist/api/email-templates.mjs +21 -21
  22. package/dist/api/media-bulk.mjs +17 -17
  23. package/dist/api/media-folders.mjs +21 -21
  24. package/dist/api/media-handlers.d.ts +2 -2
  25. package/dist/api/media-handlers.mjs +21 -21
  26. package/dist/api/media.mjs +21 -21
  27. package/dist/api/singles-detail.mjs +21 -21
  28. package/dist/api/singles-schema-detail.mjs +21 -21
  29. package/dist/api/singles.mjs +21 -21
  30. package/dist/api/storage-upload-url.mjs +21 -21
  31. package/dist/api/uploads.mjs +27 -26
  32. package/dist/auth/index.mjs +6 -6
  33. package/dist/{boot-apply-PQSYLDIN.mjs → boot-apply-OE3D3KNU.mjs} +1 -1
  34. package/dist/{chunk-IZWPRDC3.mjs → chunk-2QSGNGOB.mjs} +1 -1
  35. package/dist/{chunk-DP3G27G5.mjs → chunk-35LAHTCU.mjs} +12 -2
  36. package/dist/{chunk-DNNG377Z.mjs → chunk-463A2UDH.mjs} +79 -13
  37. package/dist/{chunk-V4EQTOA4.mjs → chunk-4HUQNXVM.mjs} +2 -2
  38. package/dist/{chunk-VJ66NCL4.mjs → chunk-6C3CST4Q.mjs} +53 -4
  39. package/dist/{chunk-PKMABBB5.mjs → chunk-6GWK77EN.mjs} +1 -1
  40. package/dist/{chunk-XZKLBMN6.mjs → chunk-A75OLKXP.mjs} +44 -16
  41. package/dist/{chunk-TS7GHTG2.mjs → chunk-A7GGVOIV.mjs} +1 -1
  42. package/dist/{chunk-INV7QKLG.mjs → chunk-BZ2EOLXR.mjs} +1 -1
  43. package/dist/{chunk-X7TXCYYN.mjs → chunk-DQGQMP5F.mjs} +46 -26
  44. package/dist/{chunk-2W3DVD7S.mjs → chunk-ERTNRSP3.mjs} +1 -1
  45. package/dist/{chunk-UJ2IMJ4W.mjs → chunk-HREB7UR4.mjs} +10 -4
  46. package/dist/{chunk-NSEFNNU4.mjs → chunk-ILETUFUD.mjs} +302 -105
  47. package/dist/{chunk-A3WPLSDT.mjs → chunk-INTLFB63.mjs} +1 -1
  48. package/dist/{chunk-SBACDPNX.mjs → chunk-JCQMC6HH.mjs} +216 -27
  49. package/dist/{chunk-3FA7FKAV.mjs → chunk-JGVOZSXS.mjs} +58 -4
  50. package/dist/{chunk-M52VMPGA.mjs → chunk-KZFYCMBL.mjs} +1 -1
  51. package/dist/{chunk-W5KKPZT5.mjs → chunk-L7BXB5H3.mjs} +2 -2
  52. package/dist/{chunk-B2GV2BWH.mjs → chunk-MF4S2WSM.mjs} +2 -2
  53. package/dist/{chunk-R6JJQHFC.mjs → chunk-NXA6FD7R.mjs} +1 -1
  54. package/dist/{chunk-XGI4EMS3.mjs → chunk-OPACR7PX.mjs} +3 -3
  55. package/dist/{chunk-2OALJTK6.mjs → chunk-OV4WR3EC.mjs} +22 -42
  56. package/dist/{chunk-YZNBLFIW.mjs → chunk-RH3QV6E6.mjs} +3 -3
  57. package/dist/{chunk-LDKCUMHK.mjs → chunk-RQ3N4DIB.mjs} +2 -2
  58. package/dist/{chunk-YV4Y7SDL.mjs → chunk-TGBLNY5L.mjs} +2 -2
  59. package/dist/{chunk-GZ6DCQKC.mjs → chunk-TVG3WU6C.mjs} +5 -3
  60. package/dist/{chunk-AK6Z23OX.mjs → chunk-UGB6MLR6.mjs} +274 -45
  61. package/dist/{chunk-2Q2SX2CS.mjs → chunk-V5DUKEYT.mjs} +2 -2
  62. package/dist/{chunk-UOP63Q54.mjs → chunk-WRGCEERR.mjs} +1 -1
  63. package/dist/{chunk-O3QHXMOX.mjs → chunk-XCT6CROA.mjs} +23 -19
  64. package/dist/{chunk-P7NH2OSC.mjs → chunk-ZDNGCKSZ.mjs} +78 -49
  65. package/dist/cli/nextly.mjs +1 -1
  66. package/dist/cli/utils/index.d.ts +2 -2
  67. package/dist/cli/utils/index.mjs +1 -1
  68. package/dist/{component-schema-service-5577KVW6.mjs → component-schema-service-HUAQQ4H5.mjs} +2 -2
  69. package/dist/config.d.ts +3 -3
  70. package/dist/database/index.d.ts +2 -2
  71. package/dist/database/index.mjs +3 -3
  72. package/dist/database/seeders/index.mjs +18 -18
  73. package/dist/{db-sync-demote-LJGKLB3S.mjs → db-sync-demote-M7IEFD6N.mjs} +6 -6
  74. package/dist/{db-sync-promote-B26VSYQF.mjs → db-sync-promote-2MCB5JRZ.mjs} +6 -6
  75. package/dist/{dynamic-collection-schema-service-IEXTPIZ7.mjs → dynamic-collection-schema-service-FIRWOXZI.mjs} +2 -2
  76. package/dist/{factory-IWMBKUJM.mjs → factory-UGJGOZZ7.mjs} +2 -2
  77. package/dist/index.d.ts +16 -11
  78. package/dist/index.mjs +24 -55
  79. package/dist/{permissions-3DZZQZMI.mjs → permissions-KH3WCGAR.mjs} +16 -16
  80. package/dist/{pipeline-YOML7SWF.mjs → pipeline-JLANATHU.mjs} +10 -10
  81. package/dist/{preview-ZZTR3QGS.mjs → preview-3RSMZITY.mjs} +3 -3
  82. package/dist/{program-PW6UB2ZC.mjs → program-6V6HLEUI.mjs} +27 -27
  83. package/dist/{register-SF6E6FVU.mjs → register-FCUTHDS5.mjs} +17 -17
  84. package/dist/{reload-config-HWQ4G5MM.mjs → reload-config-52GWTPZG.mjs} +10 -10
  85. package/dist/{routeHandler-UNMMJIBM.mjs → routeHandler-FP26UQPJ.mjs} +26 -26
  86. package/dist/{runtime-schema-generator-NRA6A6Z6.mjs → runtime-schema-generator-NQOLDUDG.mjs} +2 -2
  87. package/dist/runtime.d.ts +2 -2
  88. package/dist/runtime.mjs +26 -26
  89. package/dist/{super-admin-G5ZK5F4T.mjs → super-admin-XZAU4VQM.mjs} +16 -16
  90. package/dist/{system-table-service-WGSRVEGT.mjs → system-table-service-5FIVIALU.mjs} +5 -5
  91. package/dist/{users-7KELGRYJ.mjs → users-K2NJTF55.mjs} +15 -15
  92. package/package.json +8 -8
  93. /package/dist/{first-run-QIVKWJIF.mjs → first-run-2UDWZK5X.mjs} +0 -0
@@ -1979,8 +1979,10 @@ declare class EmailService extends BaseService {
1979
1979
  */
1980
1980
  private createAdapterFromConfig;
1981
1981
  /**
1982
- * Get the base URL for email links.
1983
- * Priority: emailConfig.baseUrl > NEXT_PUBLIC_APP_URL > localhost
1982
+ * Get the base URL for email links. Delegates to the shared `getBaseUrl`
1983
+ * helper so email templates and absolutized media URLs resolve through
1984
+ * the same priority chain (emailConfig.baseUrl > NEXT_PUBLIC_APP_URL >
1985
+ * localhost).
1984
1986
  */
1985
1987
  private getBaseUrl;
1986
1988
  /**
@@ -5662,7 +5664,7 @@ interface SendEmailResult {
5662
5664
  * Display prefix : first 16 chars ("nx_live_abcdefgh") for masked UI display
5663
5665
  * ```
5664
5666
  *
5665
- * @module services/auth/api-key-service
5667
+ * @module domains/auth/services/api-key-service
5666
5668
  * @since 1.0.0
5667
5669
  */
5668
5670
 
@@ -6400,7 +6402,7 @@ interface CheckApiKeyResult {
6400
6402
  * and `registerSingleAccess()`. The service auto-resolves them during `checkAccess()`
6401
6403
  * when no explicit `codeAccess` parameter is provided.
6402
6404
  *
6403
- * @module services/auth/rbac-access-control-service
6405
+ * @module domains/auth/services/rbac-access-control-service
6404
6406
  * @since 1.0.0
6405
6407
  *
6406
6408
  * @example
@@ -14152,6 +14154,120 @@ interface CollectionConfig {
14152
14154
  */
14153
14155
  declare function defineCollection(config: CollectionConfig): CollectionConfig;
14154
14156
 
14157
+ /**
14158
+ * Result from a seeding operation.
14159
+ */
14160
+ interface SeedResult {
14161
+ /** Number of permissions newly created */
14162
+ created: number;
14163
+ /** Number of permissions that already existed (skipped) */
14164
+ skipped: number;
14165
+ /** Number of errors encountered */
14166
+ errors: number;
14167
+ /** Total permissions processed */
14168
+ total: number;
14169
+ /** IDs of newly created permissions (for super_admin assignment) */
14170
+ newPermissionIds: string[];
14171
+ }
14172
+ /**
14173
+ * PermissionSeedService auto-generates CRUD permissions for collections,
14174
+ * singles, and system resources.
14175
+ *
14176
+ * All operations are idempotent — permissions are checked for existence
14177
+ * before insertion. Newly created permissions are returned so they can
14178
+ * be assigned to the super_admin role.
14179
+ *
14180
+ * @example
14181
+ * ```typescript
14182
+ * const seedService = new PermissionSeedService(db, tables);
14183
+ * const result = await seedService.seedAllCollectionPermissions();
14184
+ * await seedService.assignNewPermissionsToSuperAdmin(result.newPermissionIds);
14185
+ * ```
14186
+ */
14187
+ declare class PermissionSeedService extends BaseService {
14188
+ private _permissionService?;
14189
+ private _rolePermissionService?;
14190
+ constructor(adapter: DrizzleAdapter, logger: Logger);
14191
+ private get permissionService();
14192
+ private get rolePermissionService();
14193
+ /**
14194
+ * Seed all system resource permissions.
14195
+ *
14196
+ * Ensures all permissions from the SYSTEM_PERMISSIONS constant exist.
14197
+ * System permissions cover: users, roles, permissions, media, settings,
14198
+ * email-providers, email-templates.
14199
+ */
14200
+ seedSystemPermissions(): Promise<SeedResult>;
14201
+ /**
14202
+ * Seed CRUD permissions for a single collection.
14203
+ *
14204
+ * Creates 4 permissions: create, read, update, delete for the given slug.
14205
+ *
14206
+ * @param collectionSlug - The collection slug (e.g., "posts", "products")
14207
+ */
14208
+ seedCollectionPermissions(collectionSlug: string): Promise<SeedResult>;
14209
+ /**
14210
+ * Seed read/update permissions for a single (global document).
14211
+ *
14212
+ * Singles have no create/delete lifecycle — they are auto-created on first
14213
+ * access and cannot be deleted. Only read and update permissions are generated.
14214
+ *
14215
+ * @param singleSlug - The single slug (e.g., "site-settings", "header")
14216
+ */
14217
+ seedSinglePermissions(singleSlug: string): Promise<SeedResult>;
14218
+ /**
14219
+ * Seed permissions for ALL dynamic collections.
14220
+ *
14221
+ * Reads all collection slugs from the `dynamic_collections` table
14222
+ * (including plugin-registered collections) and seeds 4 CRUD permissions
14223
+ * for each.
14224
+ */
14225
+ seedAllCollectionPermissions(): Promise<SeedResult>;
14226
+ /**
14227
+ * Seed permissions for ALL registered singles.
14228
+ *
14229
+ * Reads all single slugs from the `dynamic_singles` table and seeds
14230
+ * read/update permissions for each.
14231
+ */
14232
+ seedAllSinglePermissions(): Promise<SeedResult>;
14233
+ /**
14234
+ * Assign newly created permissions to the super_admin role.
14235
+ *
14236
+ * Ensures the super_admin role retains full access when new permissions
14237
+ * are generated. Only assigns permissions that aren't already assigned.
14238
+ *
14239
+ * @param permissionIds - IDs of newly created permissions to assign
14240
+ */
14241
+ assignNewPermissionsToSuperAdmin(permissionIds: string[]): Promise<void>;
14242
+ /**
14243
+ * Delete all permissions for a specific collection or single.
14244
+ *
14245
+ * Removes all permissions where the resource matches the given slug.
14246
+ * First removes the permissions from all roles, then deletes the permissions.
14247
+ * This is typically called when a collection or single is deleted.
14248
+ *
14249
+ * @param resourceSlug - The collection or single slug (e.g., "posts", "site-settings")
14250
+ * @returns Result with count of deleted permissions
14251
+ */
14252
+ deletePermissionsForResource(resourceSlug: string): Promise<SeedResult>;
14253
+ /**
14254
+ * Remove permissions for dynamic resources that no longer exist.
14255
+ *
14256
+ * This is NOT auto-run — it must be called explicitly to prevent
14257
+ * accidental permission loss. Removes permissions whose resource is not
14258
+ * a system resource and not found in dynamic_collections,
14259
+ * dynamic_singles, or dynamic_components.
14260
+ * First removes permissions from all roles, then deletes the permissions.
14261
+ */
14262
+ cleanupOrphanedPermissions(): Promise<SeedResult>;
14263
+ private getAllCollectionSlugs;
14264
+ private getAllSingleSlugs;
14265
+ private getAllComponentSlugs;
14266
+ private slugToLabel;
14267
+ private emptySeedResult;
14268
+ private mergeSeedResult;
14269
+ }
14270
+
14155
14271
  /**
14156
14272
  * Access Control Type Definitions
14157
14273
  *
@@ -15035,120 +15151,6 @@ interface DynamicSingleRecord extends DynamicSingleInsert {
15035
15151
  updatedAt: Date;
15036
15152
  }
15037
15153
 
15038
- /**
15039
- * Result from a seeding operation.
15040
- */
15041
- interface SeedResult {
15042
- /** Number of permissions newly created */
15043
- created: number;
15044
- /** Number of permissions that already existed (skipped) */
15045
- skipped: number;
15046
- /** Number of errors encountered */
15047
- errors: number;
15048
- /** Total permissions processed */
15049
- total: number;
15050
- /** IDs of newly created permissions (for super_admin assignment) */
15051
- newPermissionIds: string[];
15052
- }
15053
- /**
15054
- * PermissionSeedService auto-generates CRUD permissions for collections,
15055
- * singles, and system resources.
15056
- *
15057
- * All operations are idempotent — permissions are checked for existence
15058
- * before insertion. Newly created permissions are returned so they can
15059
- * be assigned to the super_admin role.
15060
- *
15061
- * @example
15062
- * ```typescript
15063
- * const seedService = new PermissionSeedService(db, tables);
15064
- * const result = await seedService.seedAllCollectionPermissions();
15065
- * await seedService.assignNewPermissionsToSuperAdmin(result.newPermissionIds);
15066
- * ```
15067
- */
15068
- declare class PermissionSeedService extends BaseService {
15069
- private _permissionService?;
15070
- private _rolePermissionService?;
15071
- constructor(adapter: DrizzleAdapter, logger: Logger);
15072
- private get permissionService();
15073
- private get rolePermissionService();
15074
- /**
15075
- * Seed all system resource permissions.
15076
- *
15077
- * Ensures all permissions from the SYSTEM_PERMISSIONS constant exist.
15078
- * System permissions cover: users, roles, permissions, media, settings,
15079
- * email-providers, email-templates.
15080
- */
15081
- seedSystemPermissions(): Promise<SeedResult>;
15082
- /**
15083
- * Seed CRUD permissions for a single collection.
15084
- *
15085
- * Creates 4 permissions: create, read, update, delete for the given slug.
15086
- *
15087
- * @param collectionSlug - The collection slug (e.g., "posts", "products")
15088
- */
15089
- seedCollectionPermissions(collectionSlug: string): Promise<SeedResult>;
15090
- /**
15091
- * Seed read/update permissions for a single (global document).
15092
- *
15093
- * Singles have no create/delete lifecycle — they are auto-created on first
15094
- * access and cannot be deleted. Only read and update permissions are generated.
15095
- *
15096
- * @param singleSlug - The single slug (e.g., "site-settings", "header")
15097
- */
15098
- seedSinglePermissions(singleSlug: string): Promise<SeedResult>;
15099
- /**
15100
- * Seed permissions for ALL dynamic collections.
15101
- *
15102
- * Reads all collection slugs from the `dynamic_collections` table
15103
- * (including plugin-registered collections) and seeds 4 CRUD permissions
15104
- * for each.
15105
- */
15106
- seedAllCollectionPermissions(): Promise<SeedResult>;
15107
- /**
15108
- * Seed permissions for ALL registered singles.
15109
- *
15110
- * Reads all single slugs from the `dynamic_singles` table and seeds
15111
- * read/update permissions for each.
15112
- */
15113
- seedAllSinglePermissions(): Promise<SeedResult>;
15114
- /**
15115
- * Assign newly created permissions to the super_admin role.
15116
- *
15117
- * Ensures the super_admin role retains full access when new permissions
15118
- * are generated. Only assigns permissions that aren't already assigned.
15119
- *
15120
- * @param permissionIds - IDs of newly created permissions to assign
15121
- */
15122
- assignNewPermissionsToSuperAdmin(permissionIds: string[]): Promise<void>;
15123
- /**
15124
- * Delete all permissions for a specific collection or single.
15125
- *
15126
- * Removes all permissions where the resource matches the given slug.
15127
- * First removes the permissions from all roles, then deletes the permissions.
15128
- * This is typically called when a collection or single is deleted.
15129
- *
15130
- * @param resourceSlug - The collection or single slug (e.g., "posts", "site-settings")
15131
- * @returns Result with count of deleted permissions
15132
- */
15133
- deletePermissionsForResource(resourceSlug: string): Promise<SeedResult>;
15134
- /**
15135
- * Remove permissions for dynamic resources that no longer exist.
15136
- *
15137
- * This is NOT auto-run — it must be called explicitly to prevent
15138
- * accidental permission loss. Removes permissions whose resource is not
15139
- * a system resource and not found in dynamic_collections,
15140
- * dynamic_singles, or dynamic_components.
15141
- * First removes permissions from all roles, then deletes the permissions.
15142
- */
15143
- cleanupOrphanedPermissions(): Promise<SeedResult>;
15144
- private getAllCollectionSlugs;
15145
- private getAllSingleSlugs;
15146
- private getAllComponentSlugs;
15147
- private slugToLabel;
15148
- private emptySeedResult;
15149
- private mergeSeedResult;
15150
- }
15151
-
15152
15154
  /**
15153
15155
  * Single Registry Service
15154
15156
  *
@@ -15404,6 +15406,8 @@ declare class CollectionMetadataService extends BaseService {
15404
15406
  * @param schemas - Map of schema names to schema objects
15405
15407
  */
15406
15408
  registerDynamicSchemas(schemas: Record<string, unknown>): void;
15409
+ /** Drop the cached Drizzle schema for one slug so the next load rebuilds it. */
15410
+ invalidateSchemaForSlug(collectionName: string): void;
15407
15411
  /**
15408
15412
  * Create a new collection.
15409
15413
  * Generates schema, migration files, and registers the collection.
@@ -17588,9 +17592,14 @@ declare class DynamicCollectionSchemaService {
17588
17592
  */
17589
17593
  private areFieldTypesCompatible;
17590
17594
  /**
17591
- * Generate TypeScript/Drizzle schema code for a collection
17595
+ * Generate TypeScript/Drizzle schema code for a collection. Pass
17596
+ * `hasStatus: true` for Draft/Published collections so the generated
17597
+ * file includes the `status` column — without it, `drizzle-kit
17598
+ * pushSchema` later sees the live `status` column as extra and drops it.
17592
17599
  */
17593
- generateSchemaCode(tableName: string, collectionName: string, fields: FieldDefinition[]): string;
17600
+ generateSchemaCode(tableName: string, collectionName: string, fields: FieldDefinition[], options?: {
17601
+ hasStatus?: boolean;
17602
+ }): string;
17594
17603
  /**
17595
17604
  * Get dialect-specific configuration for schema generation
17596
17605
  */
@@ -17815,6 +17824,12 @@ declare class CollectionFileManager {
17815
17824
  registerSchema(collectionName: string, schema: unknown): void;
17816
17825
  registerSchemas(schemas: Record<string, unknown>): void;
17817
17826
  refreshSchema(tableName: string, freshTable: unknown): void;
17827
+ /**
17828
+ * Drop the slug-keyed cache entry so the lazy fetcher rebuilds the Drizzle
17829
+ * table from current `dynamic_collections` state. See `refreshSchema` for
17830
+ * the tableName-keyed variant used when the new table is already built.
17831
+ */
17832
+ invalidateSchemaForSlug(collectionName: string): void;
17818
17833
  saveArtifacts(artifacts: CollectionArtifacts): Promise<void>;
17819
17834
  saveUpdateArtifacts(migrationSQL: string, migrationFileName: string, schemaCode: string, schemaFileName: string): Promise<void>;
17820
17835
  deleteSchemaFile(schemaFileName: string, tableName: string): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { bc as BaseService, bd as Logger, be as BaseRegistryService, bf as DynamicCollectionRecord, bg as MigrationStatus, bh as PermissionSeedService, bi as BaseListOptions, bj as CollectionSource, bk as BaseListResult, bl as DynamicCollectionInsert, bm as FieldDefinition, bn as CollectionMetadataService, bo as CollectionEntryService, bp as RequestContext, bq as PaginatedResult, br as QueryOptions, P as FieldConfig, bs as HookRegistry, o as CollectionConfig, aQ as SingleConfig, t as ComponentConfig, bt as UserConfig, bu as EmailConfig, bv as UserService, bw as MediaService, bx as SingleRegistryService, by as SingleEntryService, bz as ComponentRegistryService, bA as ComponentDataService, bB as CollectionRelationshipService, bC as UserExtSchemaService, bD as EmailProviderService, bE as EmailTemplateService, bF as EmailService, bG as UserFieldDefinitionService, bH as RBACAccessControlService, bI as ApiKeyService, bJ as AuthService, bK as DatabaseInstance, bL as HookType, $ as HookHandler } from './collections-handler.d-DjgO74Wt.d.ts';
1
+ import { bc as BaseService, bd as Logger, be as BaseRegistryService, bf as DynamicCollectionRecord, bg as MigrationStatus, bh as PermissionSeedService, bi as BaseListOptions, bj as CollectionSource, bk as BaseListResult, bl as DynamicCollectionInsert, bm as FieldDefinition, bn as CollectionMetadataService, bo as CollectionEntryService, bp as RequestContext, bq as PaginatedResult, br as QueryOptions, P as FieldConfig, bs as HookRegistry, o as CollectionConfig, aQ as SingleConfig, t as ComponentConfig, bt as UserConfig, bu as EmailConfig, bv as UserService, bw as MediaService, bx as SingleRegistryService, by as SingleEntryService, bz as ComponentRegistryService, bA as ComponentDataService, bB as CollectionRelationshipService, bC as UserExtSchemaService, bD as EmailProviderService, bE as EmailTemplateService, bF as EmailService, bG as UserFieldDefinitionService, bH as RBACAccessControlService, bI as ApiKeyService, bJ as AuthService, bK as DatabaseInstance, bL as HookType, $ as HookHandler } from './collections-handler.d-B3iNFGJv.d.ts';
2
2
  import { DrizzleAdapter } from '@nextlyhq/adapter-drizzle';
3
3
  import { z } from 'zod';
4
4
  import { S as StoragePlugin, g as ImageProcessor } from './image-processor.d-OO1PmMrv.d.ts';
@@ -627,10 +627,14 @@ declare class CollectionRegistryService extends BaseRegistryService<DynamicColle
627
627
  protected readonly resourceType = "Collection";
628
628
  protected readonly tableNamePrefix = "dc_";
629
629
  private permissionSeedService?;
630
+ /** Invoked when code-first sync resolves a new `tableName` for an existing slug. */
631
+ private onTableNameChanged?;
630
632
  constructor(adapter: DrizzleAdapter, logger: Logger);
631
633
  protected getSearchColumns(): string[];
632
634
  /** Set the PermissionSeedService for auto-seeding permissions on collection sync. */
633
635
  setPermissionSeedService(service: PermissionSeedService): void;
636
+ /** Register a callback fired when sync resolves a new `tableName` for a slug. */
637
+ setOnTableNameChanged(callback: (slug: string) => void): void;
634
638
  getCollectionBySlug(slug: string): Promise<DynamicCollectionRecord | null>;
635
639
  getCollection(slug: string): Promise<DynamicCollectionRecord>;
636
640
  getAllCollections(options?: ListCollectionsOptions$1): Promise<DynamicCollectionRecord[]>;
@@ -647,6 +651,12 @@ declare class CollectionRegistryService extends BaseRegistryService<DynamicColle
647
651
  deleteCollection(slug: string): Promise<void>;
648
652
  syncCodeFirstCollections(configs: CodeFirstCollectionConfig[]): Promise<SyncResult>;
649
653
  registerCollectionInTransaction(tx: TransactionContext, data: DynamicCollectionInsert): Promise<DynamicCollectionRecord>;
654
+ /**
655
+ * Rename the physical table when a code-first collection's `dbName` changes.
656
+ * Renames only when old exists and new doesn't; warns when both exist; no-op
657
+ * otherwise (boot auto-create handles the missing-table case).
658
+ */
659
+ private renamePhysicalTable;
650
660
  private seedPermissionsForCollection;
651
661
  private labelsChanged;
652
662
  protected deserializeRecord(record: DynamicCollectionRecord | Record<string, unknown>): DynamicCollectionRecord;
@@ -793,6 +803,8 @@ declare class CollectionService extends BaseService {
793
803
  * ```
794
804
  */
795
805
  registerDynamicSchemas(schemas: Record<string, unknown>): void;
806
+ /** Drop the cached Drizzle schema for one slug so the next load rebuilds it. */
807
+ invalidateSchemaForSlug(collectionName: string): void;
796
808
  /**
797
809
  * Create a new collection
798
810
  *
@@ -1,5 +1,5 @@
1
- import { P as FieldConfig, ay as RepeaterFieldConfig, X as GroupFieldConfig, c as CheckboxFieldConfig, f as ChipsFieldConfig, j as CodeFieldConfig, u as ComponentFieldConfig, x as DataFieldConfig, E as DateFieldConfig, J as EmailFieldConfig, a3 as JSONFieldConfig, ac as NumberFieldConfig, ag as PasswordFieldConfig, aj as RadioFieldConfig, ao as RelationshipFieldConfig, a$ as UploadFieldConfig, aG as RichTextFieldConfig, aL as SelectFieldConfig, aV as TextFieldConfig, aY as TextareaFieldConfig, aN as SelectOption, aQ as SingleConfig, t as ComponentConfig } from './collections-handler.d-DjgO74Wt.d.ts';
2
- import { N as NextlyConfig, S as SanitizedNextlyConfig } from './config.d-DNwsDnjs.d.ts';
1
+ import { P as FieldConfig, ay as RepeaterFieldConfig, X as GroupFieldConfig, c as CheckboxFieldConfig, f as ChipsFieldConfig, j as CodeFieldConfig, u as ComponentFieldConfig, x as DataFieldConfig, E as DateFieldConfig, J as EmailFieldConfig, a3 as JSONFieldConfig, ac as NumberFieldConfig, ag as PasswordFieldConfig, aj as RadioFieldConfig, ao as RelationshipFieldConfig, a$ as UploadFieldConfig, aG as RichTextFieldConfig, aL as SelectFieldConfig, aV as TextFieldConfig, aY as TextareaFieldConfig, aN as SelectOption, aQ as SingleConfig, t as ComponentConfig } from './collections-handler.d-B3iNFGJv.d.ts';
2
+ import { N as NextlyConfig, S as SanitizedNextlyConfig } from './config.d-D8eInFE5.d.ts';
3
3
 
4
4
  /**
5
5
  * Field Type Guards
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
2
  import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
3
- import { P as FieldConfig, s as ComponentAdminOptions, bM as ComponentSource, bN as ComponentMigrationStatus, aP as SingleAdminOptions, bO as SingleAccessRules, bP as SingleSource, bQ as SingleMigrationStatus, bR as UserFieldType, bS as UserFieldSource, bT as EmailProviderType, bU as EmailTemplateVariable, bV as EmailAttachmentInput } from './collections-handler.d-DjgO74Wt.d.ts';
3
+ import { P as FieldConfig, s as ComponentAdminOptions, bM as ComponentSource, bN as ComponentMigrationStatus, aP as SingleAdminOptions, bO as SingleAccessRules, bP as SingleSource, bQ as SingleMigrationStatus, bR as UserFieldType, bS as UserFieldSource, bT as EmailProviderType, bU as EmailTemplateVariable, bV as EmailAttachmentInput } from './collections-handler.d-B3iNFGJv.d.ts';
4
4
  import * as drizzle_orm_mysql_core from 'drizzle-orm/mysql-core';
5
5
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
6
6
  import { TableDefinition, SupportedDialect as SupportedDialect$1, BaseAdapterConfig } from '@nextlyhq/adapter-drizzle/types';
@@ -17601,10 +17601,10 @@ declare const _envSchema: z.ZodObject<{
17601
17601
  }>>;
17602
17602
  DATABASE_URL: z.ZodOptional<z.ZodString>;
17603
17603
  SQLITE_PATH: z.ZodOptional<z.ZodString>;
17604
- DB_POOL_MAX: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17605
- DB_POOL_MIN: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17606
- DB_POOL_IDLE_TIMEOUT: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17607
- DB_QUERY_TIMEOUT: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17604
+ DB_POOL_MAX: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
17605
+ DB_POOL_MIN: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
17606
+ DB_POOL_IDLE_TIMEOUT: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
17607
+ DB_QUERY_TIMEOUT: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
17608
17608
  DB_HEALTHCHECK_INTERVAL_MS: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17609
17609
  DB_SNAKE_CASE: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
17610
17610
  NEXT_PUBLIC_APP_URL: z.ZodOptional<z.ZodString>;
@@ -10,29 +10,29 @@ import {
10
10
  import {
11
11
  ServiceContainer,
12
12
  UploadMediaInputSchema
13
- } from "../chunk-NSEFNNU4.mjs";
14
- import "../chunk-3FA7FKAV.mjs";
13
+ } from "../chunk-ILETUFUD.mjs";
14
+ import "../chunk-JGVOZSXS.mjs";
15
15
  import "../chunk-AGJ6F2T3.mjs";
16
16
  import "../chunk-KIMNCZGV.mjs";
17
- import "../chunk-AK6Z23OX.mjs";
18
- import "../chunk-INV7QKLG.mjs";
19
- import "../chunk-GZ6DCQKC.mjs";
20
- import "../chunk-SBACDPNX.mjs";
17
+ import "../chunk-UGB6MLR6.mjs";
18
+ import "../chunk-BZ2EOLXR.mjs";
19
+ import "../chunk-TVG3WU6C.mjs";
20
+ import "../chunk-JCQMC6HH.mjs";
21
21
  import "../chunk-RJLLGGPG.mjs";
22
- import "../chunk-V4EQTOA4.mjs";
22
+ import "../chunk-4HUQNXVM.mjs";
23
23
  import "../chunk-I4JMR3UR.mjs";
24
- import "../chunk-XZKLBMN6.mjs";
25
- import "../chunk-IZWPRDC3.mjs";
26
- import "../chunk-DNNG377Z.mjs";
24
+ import "../chunk-A75OLKXP.mjs";
25
+ import "../chunk-2QSGNGOB.mjs";
26
+ import "../chunk-463A2UDH.mjs";
27
27
  import "../chunk-5HMZ644B.mjs";
28
- import "../chunk-W5KKPZT5.mjs";
28
+ import "../chunk-L7BXB5H3.mjs";
29
29
  import "../chunk-56WO4WX7.mjs";
30
- import "../chunk-2W3DVD7S.mjs";
31
- import "../chunk-TS7GHTG2.mjs";
30
+ import "../chunk-ERTNRSP3.mjs";
31
+ import "../chunk-A7GGVOIV.mjs";
32
32
  import "../chunk-H26B4FYG.mjs";
33
- import "../chunk-DP3G27G5.mjs";
33
+ import "../chunk-35LAHTCU.mjs";
34
34
  import "../chunk-DV6WVX2Q.mjs";
35
- import "../chunk-UJ2IMJ4W.mjs";
35
+ import "../chunk-HREB7UR4.mjs";
36
36
  import "../chunk-EGXBZCGC.mjs";
37
37
  import "../chunk-G2AA4QLC.mjs";
38
38
  import "../chunk-4MJLT6PZ.mjs";
@@ -7,44 +7,44 @@ import {
7
7
  } from "../chunk-TO5AFLVQ.mjs";
8
8
  import {
9
9
  getCachedNextly
10
- } from "../chunk-P7NH2OSC.mjs";
11
- import "../chunk-2OALJTK6.mjs";
12
- import "../chunk-VJ66NCL4.mjs";
13
- import "../chunk-R6JJQHFC.mjs";
10
+ } from "../chunk-ZDNGCKSZ.mjs";
11
+ import "../chunk-OV4WR3EC.mjs";
12
+ import "../chunk-6C3CST4Q.mjs";
13
+ import "../chunk-NXA6FD7R.mjs";
14
14
  import "../chunk-X23WKS3Z.mjs";
15
- import "../chunk-X7TXCYYN.mjs";
16
- import "../chunk-YZNBLFIW.mjs";
15
+ import "../chunk-DQGQMP5F.mjs";
16
+ import "../chunk-RH3QV6E6.mjs";
17
17
  import "../chunk-FQULBZ53.mjs";
18
18
  import "../chunk-67GXH6PR.mjs";
19
19
  import "../chunk-2TFX4ND3.mjs";
20
20
  import "../chunk-W4MGXIRR.mjs";
21
- import "../chunk-NSEFNNU4.mjs";
22
- import "../chunk-3FA7FKAV.mjs";
21
+ import "../chunk-ILETUFUD.mjs";
22
+ import "../chunk-JGVOZSXS.mjs";
23
23
  import "../chunk-AGJ6F2T3.mjs";
24
24
  import "../chunk-KIMNCZGV.mjs";
25
- import "../chunk-AK6Z23OX.mjs";
26
- import "../chunk-INV7QKLG.mjs";
27
- import "../chunk-GZ6DCQKC.mjs";
28
- import "../chunk-SBACDPNX.mjs";
25
+ import "../chunk-UGB6MLR6.mjs";
26
+ import "../chunk-BZ2EOLXR.mjs";
27
+ import "../chunk-TVG3WU6C.mjs";
28
+ import "../chunk-JCQMC6HH.mjs";
29
29
  import "../chunk-RJLLGGPG.mjs";
30
- import "../chunk-V4EQTOA4.mjs";
30
+ import "../chunk-4HUQNXVM.mjs";
31
31
  import "../chunk-I4JMR3UR.mjs";
32
- import "../chunk-XZKLBMN6.mjs";
33
- import "../chunk-IZWPRDC3.mjs";
34
- import "../chunk-DNNG377Z.mjs";
32
+ import "../chunk-A75OLKXP.mjs";
33
+ import "../chunk-2QSGNGOB.mjs";
34
+ import "../chunk-463A2UDH.mjs";
35
35
  import "../chunk-5HMZ644B.mjs";
36
- import "../chunk-W5KKPZT5.mjs";
36
+ import "../chunk-L7BXB5H3.mjs";
37
37
  import "../chunk-56WO4WX7.mjs";
38
- import "../chunk-2W3DVD7S.mjs";
38
+ import "../chunk-ERTNRSP3.mjs";
39
39
  import {
40
40
  getDialectTables
41
- } from "../chunk-TS7GHTG2.mjs";
41
+ } from "../chunk-A7GGVOIV.mjs";
42
42
  import "../chunk-H26B4FYG.mjs";
43
- import "../chunk-DP3G27G5.mjs";
43
+ import "../chunk-35LAHTCU.mjs";
44
44
  import "../chunk-DV6WVX2Q.mjs";
45
45
  import {
46
46
  env
47
- } from "../chunk-UJ2IMJ4W.mjs";
47
+ } from "../chunk-HREB7UR4.mjs";
48
48
  import "../chunk-EGXBZCGC.mjs";
49
49
  import "../chunk-G2AA4QLC.mjs";
50
50
  import "../chunk-4MJLT6PZ.mjs";
@@ -9,51 +9,51 @@ import {
9
9
  } from "../chunk-TO5AFLVQ.mjs";
10
10
  import {
11
11
  getCachedNextly
12
- } from "../chunk-P7NH2OSC.mjs";
13
- import "../chunk-2OALJTK6.mjs";
14
- import "../chunk-VJ66NCL4.mjs";
15
- import "../chunk-R6JJQHFC.mjs";
12
+ } from "../chunk-ZDNGCKSZ.mjs";
13
+ import "../chunk-OV4WR3EC.mjs";
14
+ import "../chunk-6C3CST4Q.mjs";
15
+ import "../chunk-NXA6FD7R.mjs";
16
16
  import "../chunk-X23WKS3Z.mjs";
17
17
  import {
18
18
  getService
19
- } from "../chunk-X7TXCYYN.mjs";
20
- import "../chunk-YZNBLFIW.mjs";
19
+ } from "../chunk-DQGQMP5F.mjs";
20
+ import "../chunk-RH3QV6E6.mjs";
21
21
  import "../chunk-FQULBZ53.mjs";
22
22
  import "../chunk-67GXH6PR.mjs";
23
23
  import "../chunk-2TFX4ND3.mjs";
24
24
  import {
25
25
  getNextlyLogger
26
26
  } from "../chunk-W4MGXIRR.mjs";
27
- import "../chunk-NSEFNNU4.mjs";
28
- import "../chunk-3FA7FKAV.mjs";
27
+ import "../chunk-ILETUFUD.mjs";
28
+ import "../chunk-JGVOZSXS.mjs";
29
29
  import "../chunk-AGJ6F2T3.mjs";
30
30
  import "../chunk-KIMNCZGV.mjs";
31
- import "../chunk-AK6Z23OX.mjs";
32
- import "../chunk-INV7QKLG.mjs";
33
- import "../chunk-GZ6DCQKC.mjs";
34
- import "../chunk-SBACDPNX.mjs";
31
+ import "../chunk-UGB6MLR6.mjs";
32
+ import "../chunk-BZ2EOLXR.mjs";
33
+ import "../chunk-TVG3WU6C.mjs";
34
+ import "../chunk-JCQMC6HH.mjs";
35
35
  import "../chunk-RJLLGGPG.mjs";
36
- import "../chunk-V4EQTOA4.mjs";
36
+ import "../chunk-4HUQNXVM.mjs";
37
37
  import "../chunk-I4JMR3UR.mjs";
38
- import "../chunk-XZKLBMN6.mjs";
39
- import "../chunk-IZWPRDC3.mjs";
40
- import "../chunk-DNNG377Z.mjs";
38
+ import "../chunk-A75OLKXP.mjs";
39
+ import "../chunk-2QSGNGOB.mjs";
40
+ import "../chunk-463A2UDH.mjs";
41
41
  import {
42
42
  calculateSchemaHash
43
43
  } from "../chunk-5HMZ644B.mjs";
44
44
  import {
45
45
  hasPermission,
46
46
  isSuperAdmin
47
- } from "../chunk-W5KKPZT5.mjs";
47
+ } from "../chunk-L7BXB5H3.mjs";
48
48
  import "../chunk-56WO4WX7.mjs";
49
- import "../chunk-2W3DVD7S.mjs";
50
- import "../chunk-TS7GHTG2.mjs";
49
+ import "../chunk-ERTNRSP3.mjs";
50
+ import "../chunk-A7GGVOIV.mjs";
51
51
  import "../chunk-H26B4FYG.mjs";
52
- import "../chunk-DP3G27G5.mjs";
52
+ import "../chunk-35LAHTCU.mjs";
53
53
  import "../chunk-DV6WVX2Q.mjs";
54
54
  import {
55
55
  env
56
- } from "../chunk-UJ2IMJ4W.mjs";
56
+ } from "../chunk-HREB7UR4.mjs";
57
57
  import "../chunk-EGXBZCGC.mjs";
58
58
  import "../chunk-G2AA4QLC.mjs";
59
59
  import "../chunk-4MJLT6PZ.mjs";
@@ -9,49 +9,49 @@ import {
9
9
  } from "../chunk-TO5AFLVQ.mjs";
10
10
  import {
11
11
  getCachedNextly
12
- } from "../chunk-P7NH2OSC.mjs";
13
- import "../chunk-2OALJTK6.mjs";
14
- import "../chunk-VJ66NCL4.mjs";
15
- import "../chunk-R6JJQHFC.mjs";
12
+ } from "../chunk-ZDNGCKSZ.mjs";
13
+ import "../chunk-OV4WR3EC.mjs";
14
+ import "../chunk-6C3CST4Q.mjs";
15
+ import "../chunk-NXA6FD7R.mjs";
16
16
  import "../chunk-X23WKS3Z.mjs";
17
17
  import {
18
18
  getService
19
- } from "../chunk-X7TXCYYN.mjs";
20
- import "../chunk-YZNBLFIW.mjs";
19
+ } from "../chunk-DQGQMP5F.mjs";
20
+ import "../chunk-RH3QV6E6.mjs";
21
21
  import "../chunk-FQULBZ53.mjs";
22
22
  import "../chunk-67GXH6PR.mjs";
23
23
  import "../chunk-2TFX4ND3.mjs";
24
24
  import "../chunk-W4MGXIRR.mjs";
25
25
  import {
26
26
  CollectionExportService
27
- } from "../chunk-NSEFNNU4.mjs";
28
- import "../chunk-3FA7FKAV.mjs";
27
+ } from "../chunk-ILETUFUD.mjs";
28
+ import "../chunk-JGVOZSXS.mjs";
29
29
  import "../chunk-AGJ6F2T3.mjs";
30
30
  import "../chunk-KIMNCZGV.mjs";
31
- import "../chunk-AK6Z23OX.mjs";
32
- import "../chunk-INV7QKLG.mjs";
33
- import "../chunk-GZ6DCQKC.mjs";
34
- import "../chunk-SBACDPNX.mjs";
31
+ import "../chunk-UGB6MLR6.mjs";
32
+ import "../chunk-BZ2EOLXR.mjs";
33
+ import "../chunk-TVG3WU6C.mjs";
34
+ import "../chunk-JCQMC6HH.mjs";
35
35
  import "../chunk-RJLLGGPG.mjs";
36
- import "../chunk-V4EQTOA4.mjs";
36
+ import "../chunk-4HUQNXVM.mjs";
37
37
  import "../chunk-I4JMR3UR.mjs";
38
- import "../chunk-XZKLBMN6.mjs";
39
- import "../chunk-IZWPRDC3.mjs";
40
- import "../chunk-DNNG377Z.mjs";
38
+ import "../chunk-A75OLKXP.mjs";
39
+ import "../chunk-2QSGNGOB.mjs";
40
+ import "../chunk-463A2UDH.mjs";
41
41
  import "../chunk-5HMZ644B.mjs";
42
42
  import {
43
43
  hasPermission,
44
44
  isSuperAdmin
45
- } from "../chunk-W5KKPZT5.mjs";
45
+ } from "../chunk-L7BXB5H3.mjs";
46
46
  import "../chunk-56WO4WX7.mjs";
47
- import "../chunk-2W3DVD7S.mjs";
48
- import "../chunk-TS7GHTG2.mjs";
47
+ import "../chunk-ERTNRSP3.mjs";
48
+ import "../chunk-A7GGVOIV.mjs";
49
49
  import "../chunk-H26B4FYG.mjs";
50
- import "../chunk-DP3G27G5.mjs";
50
+ import "../chunk-35LAHTCU.mjs";
51
51
  import "../chunk-DV6WVX2Q.mjs";
52
52
  import {
53
53
  env
54
- } from "../chunk-UJ2IMJ4W.mjs";
54
+ } from "../chunk-HREB7UR4.mjs";
55
55
  import "../chunk-EGXBZCGC.mjs";
56
56
  import "../chunk-G2AA4QLC.mjs";
57
57
  import "../chunk-4MJLT6PZ.mjs";