nextly 0.0.2-alpha.4 → 0.0.2-alpha.6

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 (70) hide show
  1. package/dist/_dts-chunks/{collections-handler.d-nXHXeVJG.d.ts → collections-handler.d-bFf_q7vE.d.ts} +8 -0
  2. package/dist/_dts-chunks/{config.d-CWOwFVLW.d.ts → config.d-JFN2O3Ky.d.ts} +13 -1
  3. package/dist/_dts-chunks/{define-component.d-DptZZAGj.d.ts → define-component.d-CawT3n6q.d.ts} +2 -2
  4. package/dist/_dts-chunks/{index.d-DutLjyet.d.ts → index.d-C5qBciiQ.d.ts} +1 -1
  5. package/dist/actions/index.mjs +4 -4
  6. package/dist/api/auth-state.mjs +10 -10
  7. package/dist/api/collections-schema-detail.mjs +10 -10
  8. package/dist/api/collections-schema-export.mjs +10 -10
  9. package/dist/api/collections-schema.mjs +10 -10
  10. package/dist/api/components-detail.mjs +10 -10
  11. package/dist/api/components.mjs +10 -10
  12. package/dist/api/email-providers-default.mjs +10 -10
  13. package/dist/api/email-providers-detail.mjs +10 -10
  14. package/dist/api/email-providers-test.mjs +10 -10
  15. package/dist/api/email-providers.mjs +10 -10
  16. package/dist/api/email-send-template.mjs +11 -11
  17. package/dist/api/email-send.mjs +11 -11
  18. package/dist/api/email-templates-detail.mjs +10 -10
  19. package/dist/api/email-templates-layout.mjs +10 -10
  20. package/dist/api/email-templates-preview.mjs +10 -10
  21. package/dist/api/email-templates.mjs +10 -10
  22. package/dist/api/media-bulk.mjs +6 -6
  23. package/dist/api/media-folders.mjs +10 -10
  24. package/dist/api/media-handlers.d.ts +2 -2
  25. package/dist/api/media-handlers.mjs +10 -10
  26. package/dist/api/media.mjs +10 -10
  27. package/dist/api/singles-detail.mjs +10 -10
  28. package/dist/api/singles-schema-detail.mjs +10 -10
  29. package/dist/api/singles.mjs +10 -10
  30. package/dist/api/storage-upload-url.mjs +10 -10
  31. package/dist/api/uploads.mjs +10 -10
  32. package/dist/{boot-apply-QKGHS5BL.mjs → boot-apply-CRCAJASG.mjs} +1 -1
  33. package/dist/{chunk-DK77CLFT.mjs → chunk-5YT7PIAB.mjs} +2 -2
  34. package/dist/{chunk-IU7BK3OH.mjs → chunk-66ZNVKTF.mjs} +1 -1
  35. package/dist/{chunk-3FA7FKAV.mjs → chunk-D72XH3BG.mjs} +57 -3
  36. package/dist/{chunk-VFGZI4F5.mjs → chunk-D7L6Q3ND.mjs} +27 -9
  37. package/dist/{chunk-SKPLPSPW.mjs → chunk-FQH647CT.mjs} +1 -1
  38. package/dist/{chunk-WUX2XAR5.mjs → chunk-GJ5LPGUZ.mjs} +1 -1
  39. package/dist/{chunk-JTMTJQTO.mjs → chunk-GTSKUAWD.mjs} +2 -2
  40. package/dist/{chunk-4D7MFRPN.mjs → chunk-IS2K53B6.mjs} +5 -5
  41. package/dist/{chunk-V4EQTOA4.mjs → chunk-JXZITQPZ.mjs} +1 -1
  42. package/dist/{chunk-YX2SV35I.mjs → chunk-MNCUO7XG.mjs} +1 -1
  43. package/dist/{chunk-NHM5NCLU.mjs → chunk-O4EYLAXB.mjs} +1 -1
  44. package/dist/{chunk-BQRGVU32.mjs → chunk-PCOFNPRJ.mjs} +3 -3
  45. package/dist/{chunk-GZCKHDYS.mjs → chunk-PR35VWKA.mjs} +1 -1
  46. package/dist/{chunk-RSRVIF5S.mjs → chunk-QBLIKULS.mjs} +9 -9
  47. package/dist/{chunk-NYUB4YDK.mjs → chunk-QOH5I67F.mjs} +2 -2
  48. package/dist/{chunk-BJ2YQ6IQ.mjs → chunk-TDQS6AFE.mjs} +1 -1
  49. package/dist/{chunk-SNBXPBVC.mjs → chunk-V4WYFBQW.mjs} +141 -68
  50. package/dist/cli/nextly.mjs +1 -1
  51. package/dist/cli/utils/index.d.ts +2 -2
  52. package/dist/{component-schema-service-5577KVW6.mjs → component-schema-service-JOQIBQGK.mjs} +1 -1
  53. package/dist/config.d.ts +3 -3
  54. package/dist/database/index.d.ts +2 -2
  55. package/dist/database/seeders/index.mjs +7 -7
  56. package/dist/{db-sync-demote-LJGKLB3S.mjs → db-sync-demote-Z2HOXRZN.mjs} +1 -1
  57. package/dist/{db-sync-promote-B26VSYQF.mjs → db-sync-promote-FKWZSRYC.mjs} +1 -1
  58. package/dist/index.d.ts +6 -6
  59. package/dist/index.mjs +11 -11
  60. package/dist/{permissions-7VJ6623I.mjs → permissions-2E32PO5S.mjs} +5 -5
  61. package/dist/{pipeline-M2RINZTN.mjs → pipeline-2DWG7LSN.mjs} +4 -4
  62. package/dist/{program-SCS5WDD7.mjs → program-CNY7TIZY.mjs} +12 -12
  63. package/dist/{register-LQG76RZE.mjs → register-XRO522H5.mjs} +6 -6
  64. package/dist/{reload-config-NYCSWFLT.mjs → reload-config-IS25NM4M.mjs} +4 -4
  65. package/dist/{routeHandler-YREUKCTQ.mjs → routeHandler-FY23GB7Q.mjs} +13 -13
  66. package/dist/runtime.d.ts +2 -2
  67. package/dist/runtime.mjs +13 -13
  68. package/dist/{super-admin-M66UMUAZ.mjs → super-admin-3R2R57B7.mjs} +5 -5
  69. package/dist/{users-HVZAXVWC.mjs → users-KOSQUELL.mjs} +4 -4
  70. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CollectionRegistryService
3
- } from "./chunk-3FA7FKAV.mjs";
3
+ } from "./chunk-D72XH3BG.mjs";
4
4
  import {
5
5
  getAdapterFromDI,
6
6
  getCollectionRegistryFromDI,
@@ -27,7 +27,7 @@ import {
27
27
  getProductionNotifier,
28
28
  noopMigrationJournal,
29
29
  noopPreRenameExecutor
30
- } from "./chunk-IU7BK3OH.mjs";
30
+ } from "./chunk-66ZNVKTF.mjs";
31
31
  import {
32
32
  previewDesiredSchema
33
33
  } from "./chunk-JWAH6ROD.mjs";
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-J4KHGYOM.mjs";
40
40
  import {
41
41
  ComponentSchemaService
42
- } from "./chunk-V4EQTOA4.mjs";
42
+ } from "./chunk-JXZITQPZ.mjs";
43
43
  import {
44
44
  resolveSingleTableName
45
45
  } from "./chunk-I4JMR3UR.mjs";
@@ -288,7 +288,7 @@ var AuthService = class extends BaseService {
288
288
  }
289
289
  let newUser;
290
290
  try {
291
- const userService = new (await import("./users-HVZAXVWC.mjs")).UsersService(this.adapter, this.logger);
291
+ const userService = new (await import("./users-KOSQUELL.mjs")).UsersService(this.adapter, this.logger);
292
292
  newUser = await userService.createLocalUser({
293
293
  email: userData.email,
294
294
  name: userData.name ?? "User",
@@ -3912,10 +3912,7 @@ var CollectionFileManager = class {
3912
3912
  this.metadataFetcher = fetcher;
3913
3913
  }
3914
3914
  registerSchema(collectionName, schema) {
3915
- this.schemaRegistry.set(
3916
- `dc_${collectionName.replace(/-/g, "_")}`,
3917
- schema
3918
- );
3915
+ this.schemaRegistry.set(`dc_${collectionName.replace(/-/g, "_")}`, schema);
3919
3916
  }
3920
3917
  registerSchemas(schemas) {
3921
3918
  console.log(
@@ -3945,6 +3942,15 @@ var CollectionFileManager = class {
3945
3942
  refreshSchema(tableName, freshTable) {
3946
3943
  this.schemaRegistry.set(tableName, freshTable);
3947
3944
  }
3945
+ /**
3946
+ * Drop the slug-keyed cache entry so the lazy fetcher rebuilds the Drizzle
3947
+ * table from current `dynamic_collections` state. See `refreshSchema` for
3948
+ * the tableName-keyed variant used when the new table is already built.
3949
+ */
3950
+ invalidateSchemaForSlug(collectionName) {
3951
+ const schemaKey = `dc_${collectionName.replace(/-/g, "_")}`;
3952
+ this.schemaRegistry.delete(schemaKey);
3953
+ }
3948
3954
  async saveArtifacts(artifacts) {
3949
3955
  await fs.mkdir(this.schemasDir, { recursive: true });
3950
3956
  await fs.mkdir(this.migrationsDir, { recursive: true });
@@ -4162,6 +4168,10 @@ var CollectionService = class extends BaseService {
4162
4168
  registerDynamicSchemas(schemas) {
4163
4169
  this.metadataService.registerDynamicSchemas(schemas);
4164
4170
  }
4171
+ /** Drop the cached Drizzle schema for one slug so the next load rebuilds it. */
4172
+ invalidateSchemaForSlug(collectionName) {
4173
+ this.metadataService.invalidateSchemaForSlug(collectionName);
4174
+ }
4165
4175
  /**
4166
4176
  * Create a new collection
4167
4177
  *
@@ -5434,10 +5444,7 @@ var SchemaGenerator = class {
5434
5444
  lines.push(`}, (table) => [`);
5435
5445
  for (const field of indexedFields) {
5436
5446
  if (!isDataField(field)) continue;
5437
- const indexDef = this.generateIndexDefinition(
5438
- field,
5439
- tableName
5440
- );
5447
+ const indexDef = this.generateIndexDefinition(field, tableName);
5441
5448
  if (indexDef) {
5442
5449
  lines.push(indexDef);
5443
5450
  }
@@ -5490,8 +5497,8 @@ var SchemaGenerator = class {
5490
5497
  ].join("\n");
5491
5498
  }
5492
5499
  return [
5493
- ` createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),`,
5494
- ` updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow().$onUpdate(() => new Date()),`
5500
+ ` createdAt: timestamp("created_at", { withTimezone: false }).notNull().defaultNow(),`,
5501
+ ` updatedAt: timestamp("updated_at", { withTimezone: false }).notNull().defaultNow().$onUpdate(() => new Date()),`
5495
5502
  ].join("\n");
5496
5503
  }
5497
5504
  /**
@@ -5758,7 +5765,7 @@ var SchemaGenerator = class {
5758
5765
  const tsOptions = tsType.options ? `, ${tsType.options}` : "";
5759
5766
  return ` updatedAt: ${tsType.fn}("updated_at"${tsOptions}).notNull().$defaultFn(() => new Date()).$onUpdate(() => new Date()),`;
5760
5767
  }
5761
- return ` updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow().$onUpdate(() => new Date()),`;
5768
+ return ` updatedAt: timestamp("updated_at", { withTimezone: false }).notNull().defaultNow().$onUpdate(() => new Date()),`;
5762
5769
  }
5763
5770
  // ============================================================
5764
5771
  // Singles Relations Generation
@@ -7755,6 +7762,10 @@ var CollectionMetadataService = class extends BaseService {
7755
7762
  registerDynamicSchemas(schemas) {
7756
7763
  this.fileManager.registerSchemas(schemas);
7757
7764
  }
7765
+ /** Drop the cached Drizzle schema for one slug so the next load rebuilds it. */
7766
+ invalidateSchemaForSlug(collectionName) {
7767
+ this.fileManager.invalidateSchemaForSlug(collectionName);
7768
+ }
7758
7769
  /**
7759
7770
  * Create a new collection.
7760
7771
  * Generates schema, migration files, and registers the collection.
@@ -10299,6 +10310,10 @@ var CollectionMutationService = class extends BaseService {
10299
10310
  }
10300
10311
  }
10301
10312
  }
10313
+ /** Resolve the physical table for a collection, honoring `dbName` overrides. */
10314
+ resolveTableName(collection, slug) {
10315
+ return collection?.tableName || getTableName(slug);
10316
+ }
10302
10317
  /**
10303
10318
  * Wrapper around checkFieldUniqueness that matches the QueryDatabaseParams
10304
10319
  * signature expected by CollectionHookService.buildPrebuiltHookContext.
@@ -10405,6 +10420,10 @@ var CollectionMutationService = class extends BaseService {
10405
10420
  const storedHooks = this.hookService.getStoredHooks(
10406
10421
  collection
10407
10422
  );
10423
+ const tableName = this.resolveTableName(
10424
+ collection,
10425
+ params.collectionName
10426
+ );
10408
10427
  const sharedContext = { ...params.context };
10409
10428
  const beforeOpArgs = await this.hookService.hookRegistry.executeBeforeOperation({
10410
10429
  collection: params.collectionName,
@@ -10568,11 +10587,9 @@ var CollectionMutationService = class extends BaseService {
10568
10587
  }
10569
10588
  const entry = {};
10570
10589
  await this.adapter.transaction(async (tx) => {
10571
- const rawEntry = await tx.insert(
10572
- getTableName(params.collectionName),
10573
- entryData,
10574
- { returning: "*" }
10575
- );
10590
+ const rawEntry = await tx.insert(tableName, entryData, {
10591
+ returning: "*"
10592
+ });
10576
10593
  for (const [key, value] of Object.entries(
10577
10594
  rawEntry
10578
10595
  )) {
@@ -10581,7 +10598,7 @@ var CollectionMutationService = class extends BaseService {
10581
10598
  if (this.componentDataService && Object.keys(componentFieldData).length > 0) {
10582
10599
  await this.componentDataService.saveComponentDataInTransaction(tx, {
10583
10600
  parentId: entry.id,
10584
- parentTable: getTableName(params.collectionName),
10601
+ parentTable: tableName,
10585
10602
  fields,
10586
10603
  data: componentFieldData
10587
10604
  });
@@ -10701,6 +10718,10 @@ var CollectionMutationService = class extends BaseService {
10701
10718
  const storedHooks = this.hookService.getStoredHooks(
10702
10719
  collection
10703
10720
  );
10721
+ const tableName = this.resolveTableName(
10722
+ collection,
10723
+ params.collectionName
10724
+ );
10704
10725
  const sharedContext = { ...params.context };
10705
10726
  const beforeOpArgs = await this.hookService.hookRegistry.executeBeforeOperation({
10706
10727
  collection: params.collectionName,
@@ -10859,7 +10880,6 @@ var CollectionMutationService = class extends BaseService {
10859
10880
  })
10860
10881
  );
10861
10882
  }
10862
- const tableName = getTableName(params.collectionName);
10863
10883
  await this.adapter.transaction(async (tx) => {
10864
10884
  const updatePayload = { ...finalData, updatedAt: /* @__PURE__ */ new Date() };
10865
10885
  const isMysql = this.dialect === "mysql";
@@ -11013,6 +11033,10 @@ var CollectionMutationService = class extends BaseService {
11013
11033
  const storedHooks = this.hookService.getStoredHooks(
11014
11034
  collection
11015
11035
  );
11036
+ const tableName = this.resolveTableName(
11037
+ collection,
11038
+ params.collectionName
11039
+ );
11016
11040
  const sharedContext = { ...params.context };
11017
11041
  await this.hookService.hookRegistry.executeBeforeOperation({
11018
11042
  collection: params.collectionName,
@@ -11048,7 +11072,7 @@ var CollectionMutationService = class extends BaseService {
11048
11072
  const collectionFields = collection.schemaDefinition?.fields || collection.fields || [];
11049
11073
  await this.componentDataService.deleteComponentData({
11050
11074
  parentId: params.entryId,
11051
- parentTable: getTableName(params.collectionName),
11075
+ parentTable: tableName,
11052
11076
  fields: collectionFields
11053
11077
  });
11054
11078
  }
@@ -11128,7 +11152,6 @@ var CollectionMutationService = class extends BaseService {
11128
11152
  if (accessDenied) {
11129
11153
  return accessDenied;
11130
11154
  }
11131
- const tableName = getTableName(params.collectionName);
11132
11155
  const collection = await this.collectionService.getCollection(
11133
11156
  params.collectionName
11134
11157
  );
@@ -11136,6 +11159,10 @@ var CollectionMutationService = class extends BaseService {
11136
11159
  const storedHooks = this.hookService.getStoredHooks(
11137
11160
  collection
11138
11161
  );
11162
+ const tableName = this.resolveTableName(
11163
+ collection,
11164
+ params.collectionName
11165
+ );
11139
11166
  const sharedContext = {};
11140
11167
  const beforeOpArgs = await this.hookService.hookRegistry.executeBeforeOperation({
11141
11168
  collection: params.collectionName,
@@ -11274,7 +11301,17 @@ var CollectionMutationService = class extends BaseService {
11274
11301
  */
11275
11302
  async updateEntryInTransaction(tx, params, body) {
11276
11303
  try {
11277
- const tableName = getTableName(params.collectionName);
11304
+ const collection = await this.collectionService.getCollection(
11305
+ params.collectionName
11306
+ );
11307
+ const fields = collection.schemaDefinition?.fields || collection.fields || [];
11308
+ const storedHooks = this.hookService.getStoredHooks(
11309
+ collection
11310
+ );
11311
+ const tableName = this.resolveTableName(
11312
+ collection,
11313
+ params.collectionName
11314
+ );
11278
11315
  const existingEntry = await tx.selectOne(
11279
11316
  tableName,
11280
11317
  {
@@ -11299,13 +11336,6 @@ var CollectionMutationService = class extends BaseService {
11299
11336
  if (accessDenied) {
11300
11337
  return accessDenied;
11301
11338
  }
11302
- const collection = await this.collectionService.getCollection(
11303
- params.collectionName
11304
- );
11305
- const fields = collection.schemaDefinition?.fields || collection.fields || [];
11306
- const storedHooks = this.hookService.getStoredHooks(
11307
- collection
11308
- );
11309
11339
  const sharedContext = {};
11310
11340
  const beforeOpArgs = await this.hookService.hookRegistry.executeBeforeOperation({
11311
11341
  collection: params.collectionName,
@@ -11459,7 +11489,16 @@ var CollectionMutationService = class extends BaseService {
11459
11489
  */
11460
11490
  async deleteEntryInTransaction(tx, params) {
11461
11491
  try {
11462
- const tableName = getTableName(params.collectionName);
11492
+ const collection = await this.collectionService.getCollection(
11493
+ params.collectionName
11494
+ );
11495
+ const storedHooks = this.hookService.getStoredHooks(
11496
+ collection
11497
+ );
11498
+ const tableName = this.resolveTableName(
11499
+ collection,
11500
+ params.collectionName
11501
+ );
11463
11502
  const entry = await tx.selectOne(tableName, {
11464
11503
  where: this.whereEq("id", params.entryId)
11465
11504
  });
@@ -11475,12 +11514,6 @@ var CollectionMutationService = class extends BaseService {
11475
11514
  if (accessDenied) {
11476
11515
  return accessDenied;
11477
11516
  }
11478
- const collection = await this.collectionService.getCollection(
11479
- params.collectionName
11480
- );
11481
- const storedHooks = this.hookService.getStoredHooks(
11482
- collection
11483
- );
11484
11517
  const sharedContext = {};
11485
11518
  await this.hookService.hookRegistry.executeBeforeOperation({
11486
11519
  collection: params.collectionName,
@@ -11586,7 +11619,6 @@ var CollectionMutationService = class extends BaseService {
11586
11619
  */
11587
11620
  async createSingleEntryInTransaction(tx, params, body, skipHooks) {
11588
11621
  try {
11589
- const tableName = getTableName(params.collectionName);
11590
11622
  const collection = await this.collectionService.getCollection(
11591
11623
  params.collectionName
11592
11624
  );
@@ -11594,6 +11626,10 @@ var CollectionMutationService = class extends BaseService {
11594
11626
  const storedHooks = this.hookService.getStoredHooks(
11595
11627
  collection
11596
11628
  );
11629
+ const tableName = this.resolveTableName(
11630
+ collection,
11631
+ params.collectionName
11632
+ );
11597
11633
  let currentData = { ...body };
11598
11634
  const sharedContext = {};
11599
11635
  if (!skipHooks) {
@@ -11747,13 +11783,26 @@ var CollectionMutationService = class extends BaseService {
11747
11783
  */
11748
11784
  async updateSingleEntryInTransaction(tx, params, entryId, body, skipHooks) {
11749
11785
  try {
11750
- const tableName = getTableName(params.collectionName);
11786
+ const collection = await this.collectionService.getCollection(
11787
+ params.collectionName
11788
+ );
11789
+ const fields = collection.schemaDefinition?.fields || collection.fields || [];
11790
+ const storedHooks = this.hookService.getStoredHooks(
11791
+ collection
11792
+ );
11793
+ const tableName = this.resolveTableName(
11794
+ collection,
11795
+ params.collectionName
11796
+ );
11751
11797
  const ownerConstraint = await this.accessService.getOwnerConstraint(
11752
11798
  params.collectionName,
11753
11799
  "update",
11754
11800
  params.user
11755
11801
  );
11756
- const fetchWhere = ownerConstraint ? this.whereAnd({ id: entryId, [ownerConstraint.field]: ownerConstraint.value }) : this.whereEq("id", entryId);
11802
+ const fetchWhere = ownerConstraint ? this.whereAnd({
11803
+ id: entryId,
11804
+ [ownerConstraint.field]: ownerConstraint.value
11805
+ }) : this.whereEq("id", entryId);
11757
11806
  const existingEntry = await tx.selectOne(
11758
11807
  tableName,
11759
11808
  { where: fetchWhere }
@@ -11766,9 +11815,6 @@ var CollectionMutationService = class extends BaseService {
11766
11815
  data: null
11767
11816
  };
11768
11817
  }
11769
- const collection = await this.collectionService.getCollection(
11770
- params.collectionName
11771
- );
11772
11818
  const accessRules = this.accessService.getAccessRules(
11773
11819
  collection
11774
11820
  );
@@ -11784,10 +11830,6 @@ var CollectionMutationService = class extends BaseService {
11784
11830
  };
11785
11831
  }
11786
11832
  }
11787
- const fields = collection.schemaDefinition?.fields || collection.fields || [];
11788
- const storedHooks = this.hookService.getStoredHooks(
11789
- collection
11790
- );
11791
11833
  let currentData = { ...body };
11792
11834
  const sharedContext = {};
11793
11835
  if (!skipHooks) {
@@ -11956,13 +11998,22 @@ var CollectionMutationService = class extends BaseService {
11956
11998
  */
11957
11999
  async deleteSingleEntryInTransaction(tx, params, entryId, skipHooks) {
11958
12000
  try {
11959
- const tableName = getTableName(params.collectionName);
12001
+ const collection = await this.collectionService.getCollection(
12002
+ params.collectionName
12003
+ );
12004
+ const tableName = this.resolveTableName(
12005
+ collection,
12006
+ params.collectionName
12007
+ );
11960
12008
  const ownerConstraint = await this.accessService.getOwnerConstraint(
11961
12009
  params.collectionName,
11962
12010
  "delete",
11963
12011
  params.user
11964
12012
  );
11965
- const fetchWhere = ownerConstraint ? this.whereAnd({ id: entryId, [ownerConstraint.field]: ownerConstraint.value }) : this.whereEq("id", entryId);
12013
+ const fetchWhere = ownerConstraint ? this.whereAnd({
12014
+ id: entryId,
12015
+ [ownerConstraint.field]: ownerConstraint.value
12016
+ }) : this.whereEq("id", entryId);
11966
12017
  const entry = await tx.selectOne(tableName, {
11967
12018
  where: fetchWhere
11968
12019
  });
@@ -11974,9 +12025,6 @@ var CollectionMutationService = class extends BaseService {
11974
12025
  data: null
11975
12026
  };
11976
12027
  }
11977
- const collection = await this.collectionService.getCollection(
11978
- params.collectionName
11979
- );
11980
12028
  const accessRules = this.accessService.getAccessRules(
11981
12029
  collection
11982
12030
  );
@@ -15753,7 +15801,8 @@ var CollectionsHandler = class {
15753
15801
  const fields = typeof result.fields === "string" ? JSON.parse(result.fields) : result.fields;
15754
15802
  return {
15755
15803
  fields,
15756
- tableName: result.table_name,
15804
+ tableName: result.tableName,
15805
+ // SQLite returns 0/1 for booleans; PG/MySQL return real booleans.
15757
15806
  status: result.status === true || result.status === 1
15758
15807
  };
15759
15808
  }
@@ -20156,7 +20205,7 @@ var COLLECTIONS_METHODS = {
20156
20205
  );
20157
20206
  }
20158
20207
  try {
20159
- const { bumpSchemaVersion } = await import("./routeHandler-YREUKCTQ.mjs");
20208
+ const { bumpSchemaVersion } = await import("./routeHandler-FY23GB7Q.mjs");
20160
20209
  bumpSchemaVersion();
20161
20210
  } catch {
20162
20211
  }
@@ -20453,11 +20502,24 @@ function registerComponentRuntimeSchema(adapter, dialect, tableName, fields) {
20453
20502
  tableName,
20454
20503
  fields
20455
20504
  );
20505
+ const registry = getSchemaRegistryFromDI();
20506
+ if (registry) {
20507
+ registry.registerDynamicSchema(tableName, runtimeTable);
20508
+ return;
20509
+ }
20456
20510
  const resolver = adapter.tableResolver;
20457
20511
  if (resolver && typeof resolver.registerDynamicSchema === "function") {
20458
20512
  resolver.registerDynamicSchema(tableName, runtimeTable);
20513
+ return;
20459
20514
  }
20460
- } catch {
20515
+ console.warn(
20516
+ `[registerComponentRuntimeSchema] No SchemaRegistry available for '${tableName}'. Component queries may reference old column names until next server restart.`
20517
+ );
20518
+ } catch (err) {
20519
+ const msg = err instanceof Error ? err.message : String(err);
20520
+ console.warn(
20521
+ `[registerComponentRuntimeSchema] In-memory schema refresh failed for '${tableName}': ${msg}. Component queries may reference old column names until next server restart.`
20522
+ );
20461
20523
  }
20462
20524
  }
20463
20525
  var COMPONENTS_METHODS = {
@@ -20586,10 +20648,7 @@ var COMPONENTS_METHODS = {
20586
20648
  );
20587
20649
  }
20588
20650
  }
20589
- const updated = await svc.registry.updateComponent(
20590
- slug,
20591
- updateData
20592
- );
20651
+ const updated = await svc.registry.updateComponent(slug, updateData);
20593
20652
  return respondMutation(`Component "${slug}" updated.`, updated);
20594
20653
  }
20595
20654
  },
@@ -20619,14 +20678,21 @@ var COMPONENTS_METHODS = {
20619
20678
  tableName,
20620
20679
  fields
20621
20680
  };
20622
- const pipelinePreview = await previewDesiredSchema({ desired, db, dialect });
20623
- const legacyShape = await translatePipelinePreviewToLegacy(pipelinePreview, {
20624
- tableName,
20625
- currentFields,
20626
- newFields: fields,
20681
+ const pipelinePreview = await previewDesiredSchema({
20682
+ desired,
20627
20683
  db,
20628
20684
  dialect
20629
20685
  });
20686
+ const legacyShape = await translatePipelinePreviewToLegacy(
20687
+ pipelinePreview,
20688
+ {
20689
+ tableName,
20690
+ currentFields,
20691
+ newFields: fields,
20692
+ db,
20693
+ dialect
20694
+ }
20695
+ );
20630
20696
  const renamed = pipelinePreview.candidates.map((c) => ({
20631
20697
  table: c.tableName,
20632
20698
  from: c.fromColumn,
@@ -20706,7 +20772,9 @@ var COMPONENTS_METHODS = {
20706
20772
  uiTargetSlug: slug
20707
20773
  });
20708
20774
  if (!result.success) {
20709
- throw new Error(result.error?.message ?? "Failed to apply schema changes");
20775
+ throw new Error(
20776
+ result.error?.message ?? "Failed to apply schema changes"
20777
+ );
20710
20778
  }
20711
20779
  try {
20712
20780
  await adapter.update(
@@ -20725,7 +20793,12 @@ var COMPONENTS_METHODS = {
20725
20793
  `[applyComponentSchemaChanges] Post-apply metadata write failed for '${slug}': ${msg}.`
20726
20794
  );
20727
20795
  }
20728
- registerComponentRuntimeSchema(adapter, dialect, tableName, fields);
20796
+ registerComponentRuntimeSchema(
20797
+ adapter,
20798
+ dialect,
20799
+ tableName,
20800
+ fields
20801
+ );
20729
20802
  const newSchemaVersion = currentVersion + 1;
20730
20803
  void schemaVersion;
20731
20804
  return respondAction(`Schema applied for component '${slug}'`, {
@@ -9,7 +9,7 @@ if (existsSync(envPath)) {
9
9
  config({ path: envPath });
10
10
  }
11
11
  async function main() {
12
- const { createProgram } = await import("../program-SCS5WDD7.mjs");
12
+ const { createProgram } = await import("../program-CNY7TIZY.mjs");
13
13
  const { createLogger } = await import("../logger-NU46DXNY.mjs");
14
14
  const { NextlyError } = await import("../errors/index.mjs");
15
15
  const telemetry = await import("../dist-M2NOU37V.mjs");
@@ -1,5 +1,5 @@
1
- import { S as SanitizedNextlyConfig } from '../../_dts-chunks/config.d-CWOwFVLW.d.ts';
2
- import '../../_dts-chunks/collections-handler.d-nXHXeVJG.d.ts';
1
+ import { S as SanitizedNextlyConfig } from '../../_dts-chunks/config.d-JFN2O3Ky.d.ts';
2
+ import '../../_dts-chunks/collections-handler.d-bFf_q7vE.d.ts';
3
3
  import '@nextlyhq/adapter-drizzle';
4
4
  import '@nextlyhq/adapter-drizzle/types';
5
5
  import 'drizzle-orm/pg-core';
@@ -1,7 +1,7 @@
1
1
  import "./chunk-RJLLGGPG.mjs";
2
2
  import {
3
3
  ComponentSchemaService
4
- } from "./chunk-V4EQTOA4.mjs";
4
+ } from "./chunk-JXZITQPZ.mjs";
5
5
  import "./chunk-DV6WVX2Q.mjs";
6
6
  import "./chunk-UJ2IMJ4W.mjs";
7
7
  import "./chunk-5APFUGAD.mjs";
package/dist/config.d.ts CHANGED
@@ -1,7 +1,7 @@
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-nXHXeVJG.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-DptZZAGj.d.ts';
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-bFf_q7vE.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-CawT3n6q.d.ts';
3
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-CWOwFVLW.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-JFN2O3Ky.d.ts';
5
5
  import '@nextlyhq/adapter-drizzle';
6
6
  import '@nextlyhq/adapter-drizzle/types';
7
7
  import 'drizzle-orm/pg-core';
@@ -1,7 +1,7 @@
1
- export { A as AdapterConfig, a as AdapterType, D as DbError, b as DbErrorKind, H as HealthCheckResult, i as checkAdapterHealth, j as createAdapter, k as createAdapterFromEnv, o as env, p as getDialectTables, q as healthCheck, r as isDbError, s as schema, t as toDbError, v as validateDatabaseEnv, w as withDbErrors } from '../_dts-chunks/index.d-DutLjyet.d.ts';
1
+ export { A as AdapterConfig, a as AdapterType, D as DbError, b as DbErrorKind, H as HealthCheckResult, i as checkAdapterHealth, j as createAdapter, k as createAdapterFromEnv, o as env, p as getDialectTables, q as healthCheck, r as isDbError, s as schema, t as toDbError, v as validateDatabaseEnv, w as withDbErrors } from '../_dts-chunks/index.d-C5qBciiQ.d.ts';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/pg-core';
4
- import '../_dts-chunks/collections-handler.d-nXHXeVJG.d.ts';
4
+ import '../_dts-chunks/collections-handler.d-bFf_q7vE.d.ts';
5
5
  import '@nextlyhq/adapter-drizzle';
6
6
  import '@nextlyhq/adapter-drizzle/types';
7
7
  import 'react';
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  seedAll
3
- } from "../../chunk-JTMTJQTO.mjs";
3
+ } from "../../chunk-GTSKUAWD.mjs";
4
4
  import {
5
5
  seedPermissions
6
- } from "../../chunk-YX2SV35I.mjs";
6
+ } from "../../chunk-MNCUO7XG.mjs";
7
7
  import {
8
8
  seedSuperAdmin
9
- } from "../../chunk-WUX2XAR5.mjs";
10
- import "../../chunk-SNBXPBVC.mjs";
11
- import "../../chunk-3FA7FKAV.mjs";
9
+ } from "../../chunk-GJ5LPGUZ.mjs";
10
+ import "../../chunk-V4WYFBQW.mjs";
11
+ import "../../chunk-D72XH3BG.mjs";
12
12
  import "../../chunk-AGJ6F2T3.mjs";
13
13
  import "../../chunk-KIMNCZGV.mjs";
14
- import "../../chunk-IU7BK3OH.mjs";
14
+ import "../../chunk-66ZNVKTF.mjs";
15
15
  import "../../chunk-INV7QKLG.mjs";
16
16
  import "../../chunk-JWAH6ROD.mjs";
17
17
  import "../../chunk-J4KHGYOM.mjs";
18
18
  import "../../chunk-RJLLGGPG.mjs";
19
- import "../../chunk-V4EQTOA4.mjs";
19
+ import "../../chunk-JXZITQPZ.mjs";
20
20
  import "../../chunk-I4JMR3UR.mjs";
21
21
  import "../../chunk-LP2CDTCR.mjs";
22
22
  import "../../chunk-UB4CALU5.mjs";
@@ -12,7 +12,7 @@ import "./chunk-GDBJ5JCU.mjs";
12
12
  import "./chunk-FQULBZ53.mjs";
13
13
  import {
14
14
  CollectionRegistryService
15
- } from "./chunk-3FA7FKAV.mjs";
15
+ } from "./chunk-D72XH3BG.mjs";
16
16
  import "./chunk-5HMZ644B.mjs";
17
17
  import "./chunk-2W3DVD7S.mjs";
18
18
  import "./chunk-TS7GHTG2.mjs";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-M52VMPGA.mjs";
8
8
  import {
9
9
  CollectionRegistryService
10
- } from "./chunk-3FA7FKAV.mjs";
10
+ } from "./chunk-D72XH3BG.mjs";
11
11
  import "./chunk-5HMZ644B.mjs";
12
12
  import "./chunk-2W3DVD7S.mjs";
13
13
  import "./chunk-TS7GHTG2.mjs";