nextly 0.0.2-alpha.7 → 0.0.2-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/_dts-chunks/{index.d-CknEcQSu.d.ts → index.d-BhMtxT6M.d.ts} +4 -4
  2. package/dist/actions/index.mjs +16 -16
  3. package/dist/api/auth-state.mjs +23 -23
  4. package/dist/api/collections-schema-detail.mjs +23 -23
  5. package/dist/api/collections-schema-export.mjs +23 -23
  6. package/dist/api/collections-schema.mjs +24 -24
  7. package/dist/api/components-detail.mjs +24 -24
  8. package/dist/api/components.mjs +24 -24
  9. package/dist/api/email-providers-default.mjs +24 -24
  10. package/dist/api/email-providers-detail.mjs +25 -25
  11. package/dist/api/email-providers-test.mjs +25 -25
  12. package/dist/api/email-providers.mjs +26 -26
  13. package/dist/api/email-send-template.mjs +26 -26
  14. package/dist/api/email-send.mjs +26 -26
  15. package/dist/api/email-templates-detail.mjs +25 -25
  16. package/dist/api/email-templates-layout.mjs +25 -25
  17. package/dist/api/email-templates-preview.mjs +26 -26
  18. package/dist/api/email-templates.mjs +26 -26
  19. package/dist/api/health.mjs +2 -2
  20. package/dist/api/index.mjs +2 -2
  21. package/dist/api/media-bulk.mjs +20 -20
  22. package/dist/api/media-folders.mjs +24 -24
  23. package/dist/api/media-handlers.mjs +25 -25
  24. package/dist/api/media.mjs +25 -25
  25. package/dist/api/singles-detail.mjs +25 -25
  26. package/dist/api/singles-schema-detail.mjs +24 -24
  27. package/dist/api/singles.mjs +23 -23
  28. package/dist/api/storage-upload-url.mjs +24 -24
  29. package/dist/api/uploads.mjs +23 -23
  30. package/dist/auth/index.mjs +7 -7
  31. package/dist/{boot-apply-5EFSWAMW.mjs → boot-apply-NOFBZ5QY.mjs} +1 -1
  32. package/dist/{chunk-UB4CALU5.mjs → chunk-2QSGNGOB.mjs} +1 -1
  33. package/dist/{chunk-DP3G27G5.mjs → chunk-35LAHTCU.mjs} +12 -2
  34. package/dist/{chunk-KSKKIZDP.mjs → chunk-3IX2NDII.mjs} +4 -4
  35. package/dist/{chunk-3NUAFSDX.mjs → chunk-44JO5BSR.mjs} +1 -1
  36. package/dist/{chunk-L5FA2FAY.mjs → chunk-463A2UDH.mjs} +6 -3
  37. package/dist/{chunk-JXZITQPZ.mjs → chunk-4HUQNXVM.mjs} +1 -1
  38. package/dist/{chunk-NRUWQ5Z7.mjs → chunk-5WWWJCKI.mjs} +3 -5
  39. package/dist/{chunk-SSRCS4NR.mjs → chunk-7KXJ66OR.mjs} +5 -5
  40. package/dist/{chunk-L3SZUFF4.mjs → chunk-7PLW6Z3L.mjs} +1 -1
  41. package/dist/{chunk-LP2CDTCR.mjs → chunk-A75OLKXP.mjs} +1 -1
  42. package/dist/{chunk-D72XH3BG.mjs → chunk-ERJGWWPB.mjs} +2 -2
  43. package/dist/{chunk-UJ2IMJ4W.mjs → chunk-HREB7UR4.mjs} +10 -4
  44. package/dist/{chunk-66ZNVKTF.mjs → chunk-HSIAXEYF.mjs} +274 -45
  45. package/dist/{chunk-QOH5I67F.mjs → chunk-JAOH2TTZ.mjs} +3 -3
  46. package/dist/{chunk-J4KHGYOM.mjs → chunk-JCQMC6HH.mjs} +69 -2
  47. package/dist/{chunk-EBDAFQUX.mjs → chunk-KTGUSU23.mjs} +2 -2
  48. package/dist/{chunk-M52VMPGA.mjs → chunk-KZFYCMBL.mjs} +1 -1
  49. package/dist/{chunk-LPVOTXNV.mjs → chunk-LDUSTBVC.mjs} +1 -1
  50. package/dist/{chunk-FQH647CT.mjs → chunk-NJ3LXLSJ.mjs} +53 -4
  51. package/dist/{chunk-CLBPXLO3.mjs → chunk-NJIUNZVY.mjs} +27 -23
  52. package/dist/{chunk-INV7QKLG.mjs → chunk-PAWMG5BR.mjs} +1 -1
  53. package/dist/{chunk-RKXTA5KC.mjs → chunk-PDMNLA74.mjs} +79 -50
  54. package/dist/{chunk-2W3DVD7S.mjs → chunk-PFRMIEJ3.mjs} +1 -1
  55. package/dist/{chunk-HVH4J6S6.mjs → chunk-QIGAYTZD.mjs} +21 -21
  56. package/dist/{chunk-WZBYMYVW.mjs → chunk-QPYR3TC4.mjs} +1 -1
  57. package/dist/{chunk-ZVN3JILF.mjs → chunk-QSE7KMHI.mjs} +18 -18
  58. package/dist/{chunk-NAP3TDS6.mjs → chunk-SWVNFKWD.mjs} +2 -2
  59. package/dist/{chunk-RNKZALZE.mjs → chunk-TSFCJP57.mjs} +5 -5
  60. package/dist/{chunk-JWAH6ROD.mjs → chunk-TVG3WU6C.mjs} +1 -1
  61. package/dist/{chunk-7YKKCBOC.mjs → chunk-V2W7G5GC.mjs} +3 -3
  62. package/dist/{chunk-TK76W55J.mjs → chunk-X3OHQBMZ.mjs} +6 -2
  63. package/dist/{chunk-TO5AFLVQ.mjs → chunk-XIKEJO27.mjs} +1 -1
  64. package/dist/{chunk-MWW7OUDL.mjs → chunk-XYV27NZL.mjs} +23 -43
  65. package/dist/{chunk-ZE6A3FYH.mjs → chunk-YG2HSZC4.mjs} +1 -1
  66. package/dist/{chunk-VQJQHVEV.mjs → chunk-YLRZTPSK.mjs} +1 -1
  67. package/dist/{chunk-TS7GHTG2.mjs → chunk-YXZH65YV.mjs} +2 -2
  68. package/dist/{chunk-GJNSJU4S.mjs → chunk-Z52OQOZH.mjs} +1 -1
  69. package/dist/cli/nextly.mjs +1 -1
  70. package/dist/cli/utils/index.mjs +3 -3
  71. package/dist/{component-schema-service-JOQIBQGK.mjs → component-schema-service-HUAQQ4H5.mjs} +2 -2
  72. package/dist/{config-loader-23YEMC3Z.mjs → config-loader-MUFY6UMU.mjs} +2 -2
  73. package/dist/database/index.d.ts +1 -1
  74. package/dist/database/index.mjs +4 -4
  75. package/dist/database/seeders/index.mjs +19 -19
  76. package/dist/{db-sync-demote-Z2HOXRZN.mjs → db-sync-demote-2DAQZXLD.mjs} +8 -8
  77. package/dist/{db-sync-promote-FKWZSRYC.mjs → db-sync-promote-SBTPSUEJ.mjs} +7 -7
  78. package/dist/{dynamic-collection-schema-service-KMOP5PGD.mjs → dynamic-collection-schema-service-FIRWOXZI.mjs} +2 -2
  79. package/dist/errors/index.d.ts +2 -0
  80. package/dist/errors/index.mjs +1 -1
  81. package/dist/{factory-IWMBKUJM.mjs → factory-UGJGOZZ7.mjs} +2 -2
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.mjs +23 -23
  84. package/dist/observability/index.mjs +1 -1
  85. package/dist/{permissions-YZSSFHU4.mjs → permissions-ONWRZAQO.mjs} +17 -17
  86. package/dist/{pipeline-2DWG7LSN.mjs → pipeline-URL33V42.mjs} +11 -11
  87. package/dist/{preview-H6CJBMCP.mjs → preview-3RSMZITY.mjs} +3 -3
  88. package/dist/{program-CEFDADQM.mjs → program-DWF3GBYR.mjs} +29 -29
  89. package/dist/{register-G6I4N6QM.mjs → register-CQU3Z4SW.mjs} +18 -18
  90. package/dist/reload-config-RWRAPMQG.mjs +23 -0
  91. package/dist/{routeHandler-ROBRMRZA.mjs → routeHandler-7JQSAJFL.mjs} +30 -30
  92. package/dist/{runtime-schema-generator-MOPQWGJP.mjs → runtime-schema-generator-NQOLDUDG.mjs} +2 -2
  93. package/dist/runtime.mjs +30 -30
  94. package/dist/{super-admin-WSTXAZSS.mjs → super-admin-ZPB2YQDQ.mjs} +17 -17
  95. package/dist/{system-table-service-WGSRVEGT.mjs → system-table-service-FIX3AVKW.mjs} +6 -6
  96. package/dist/{users-NFD7IUFT.mjs → users-OA643XPO.mjs} +16 -16
  97. package/package.json +8 -8
  98. package/dist/reload-config-VUEIQP5W.mjs +0 -23
  99. /package/dist/{first-run-QIVKWJIF.mjs → first-run-2JTNWFEG.mjs} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CollectionRegistryService
3
- } from "./chunk-D72XH3BG.mjs";
3
+ } from "./chunk-ERJGWWPB.mjs";
4
4
  import {
5
5
  getAdapterFromDI,
6
6
  getCollectionRegistryFromDI,
@@ -27,29 +27,29 @@ import {
27
27
  getProductionNotifier,
28
28
  noopMigrationJournal,
29
29
  noopPreRenameExecutor
30
- } from "./chunk-66ZNVKTF.mjs";
30
+ } from "./chunk-HSIAXEYF.mjs";
31
31
  import {
32
32
  previewDesiredSchema
33
- } from "./chunk-JWAH6ROD.mjs";
33
+ } from "./chunk-TVG3WU6C.mjs";
34
34
  import {
35
35
  RealClassifier,
36
36
  RegexRenameDetector,
37
37
  countNulls,
38
38
  countRows
39
- } from "./chunk-J4KHGYOM.mjs";
39
+ } from "./chunk-JCQMC6HH.mjs";
40
40
  import {
41
41
  ComponentSchemaService
42
- } from "./chunk-JXZITQPZ.mjs";
42
+ } from "./chunk-4HUQNXVM.mjs";
43
43
  import {
44
44
  resolveSingleTableName
45
45
  } from "./chunk-I4JMR3UR.mjs";
46
46
  import {
47
47
  DynamicCollectionSchemaService,
48
48
  DynamicCollectionValidationService
49
- } from "./chunk-LP2CDTCR.mjs";
49
+ } from "./chunk-A75OLKXP.mjs";
50
50
  import {
51
51
  generateRuntimeSchema
52
- } from "./chunk-UB4CALU5.mjs";
52
+ } from "./chunk-2QSGNGOB.mjs";
53
53
  import {
54
54
  calculateSchemaHash
55
55
  } from "./chunk-5HMZ644B.mjs";
@@ -65,11 +65,11 @@ import {
65
65
  listRoleSlugsForUser,
66
66
  validatePasswordStrength,
67
67
  verifyPassword
68
- } from "./chunk-NAP3TDS6.mjs";
68
+ } from "./chunk-SWVNFKWD.mjs";
69
69
  import {
70
70
  BaseService,
71
71
  normalizeDbTimestamp
72
- } from "./chunk-2W3DVD7S.mjs";
72
+ } from "./chunk-PFRMIEJ3.mjs";
73
73
  import {
74
74
  apiKeys,
75
75
  apiKeys2,
@@ -90,13 +90,13 @@ import {
90
90
  userRoles,
91
91
  userRoles2,
92
92
  userRoles3
93
- } from "./chunk-TS7GHTG2.mjs";
93
+ } from "./chunk-YXZH65YV.mjs";
94
94
  import {
95
95
  createAdapterFromEnv
96
- } from "./chunk-DP3G27G5.mjs";
96
+ } from "./chunk-35LAHTCU.mjs";
97
97
  import {
98
98
  env
99
- } from "./chunk-UJ2IMJ4W.mjs";
99
+ } from "./chunk-HREB7UR4.mjs";
100
100
  import {
101
101
  deleteImageSizes,
102
102
  generateImageSizes,
@@ -120,7 +120,7 @@ import {
120
120
  import {
121
121
  NextlyError,
122
122
  toDbError
123
- } from "./chunk-NRUWQ5Z7.mjs";
123
+ } from "./chunk-5WWWJCKI.mjs";
124
124
  import {
125
125
  toPluralLabel,
126
126
  toSingularLabel
@@ -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-NFD7IUFT.mjs")).UsersService(this.adapter, this.logger);
291
+ const userService = new (await import("./users-OA643XPO.mjs")).UsersService(this.adapter, this.logger);
292
292
  newUser = await userService.createLocalUser({
293
293
  email: userData.email,
294
294
  name: userData.name ?? "User",
@@ -7728,7 +7728,7 @@ var CollectionMetadataService = class extends BaseService {
7728
7728
  */
7729
7729
  async registerRuntimeSchema(tableName, fields, options) {
7730
7730
  try {
7731
- const { generateRuntimeSchema: generateRuntimeSchema2 } = await import("./runtime-schema-generator-MOPQWGJP.mjs");
7731
+ const { generateRuntimeSchema: generateRuntimeSchema2 } = await import("./runtime-schema-generator-NQOLDUDG.mjs");
7732
7732
  const dialect = this.adapter.getCapabilities().dialect;
7733
7733
  const { table } = generateRuntimeSchema2(tableName, fields, dialect, {
7734
7734
  status: options?.hasStatus === true
@@ -20205,7 +20205,7 @@ var COLLECTIONS_METHODS = {
20205
20205
  );
20206
20206
  }
20207
20207
  try {
20208
- const { bumpSchemaVersion } = await import("./routeHandler-ROBRMRZA.mjs");
20208
+ const { bumpSchemaVersion } = await import("./routeHandler-7JQSAJFL.mjs");
20209
20209
  bumpSchemaVersion();
20210
20210
  } catch {
20211
20211
  }
@@ -21291,7 +21291,7 @@ var SINGLES_METHODS = {
21291
21291
  if (tableExists) {
21292
21292
  migrationStatus = "applied";
21293
21293
  try {
21294
- const { generateRuntimeSchema: generateRuntimeSchema2 } = await import("./runtime-schema-generator-MOPQWGJP.mjs");
21294
+ const { generateRuntimeSchema: generateRuntimeSchema2 } = await import("./runtime-schema-generator-NQOLDUDG.mjs");
21295
21295
  const dialect = adapter.getCapabilities().dialect;
21296
21296
  const { table: runtimeTable } = generateRuntimeSchema2(
21297
21297
  tableName,
@@ -21569,7 +21569,7 @@ var SINGLES_METHODS = {
21569
21569
  if (tableExistsAfter) {
21570
21570
  migrationStatus = "applied";
21571
21571
  try {
21572
- const { generateRuntimeSchema: generateRuntimeSchema2 } = await import("./runtime-schema-generator-MOPQWGJP.mjs");
21572
+ const { generateRuntimeSchema: generateRuntimeSchema2 } = await import("./runtime-schema-generator-NQOLDUDG.mjs");
21573
21573
  const dialect = adapter.getCapabilities().dialect;
21574
21574
  const { table: runtimeTable } = generateRuntimeSchema2(
21575
21575
  tableName,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BaseService
3
- } from "./chunk-2W3DVD7S.mjs";
3
+ } from "./chunk-PFRMIEJ3.mjs";
4
4
  import {
5
5
  getDialectTables
6
- } from "./chunk-TS7GHTG2.mjs";
6
+ } from "./chunk-YXZH65YV.mjs";
7
7
  import {
8
8
  getAuthLogger
9
9
  } from "./chunk-LAZXX4HR.mjs";
@@ -2,16 +2,16 @@ import {
2
2
  isErrorResponse,
3
3
  requireAuthentication,
4
4
  toNextlyAuthError
5
- } from "./chunk-7YKKCBOC.mjs";
5
+ } from "./chunk-V2W7G5GC.mjs";
6
6
  import {
7
7
  nextlyValidationFromZod
8
- } from "./chunk-GJNSJU4S.mjs";
8
+ } from "./chunk-Z52OQOZH.mjs";
9
9
  import {
10
10
  withErrorHandler
11
- } from "./chunk-TO5AFLVQ.mjs";
11
+ } from "./chunk-XIKEJO27.mjs";
12
12
  import {
13
13
  getCachedNextly
14
- } from "./chunk-RKXTA5KC.mjs";
14
+ } from "./chunk-PDMNLA74.mjs";
15
15
  import {
16
16
  respondAction
17
17
  } from "./chunk-IUDOC7N7.mjs";
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-D5HQBNUB.mjs";
21
21
  import {
22
22
  NextlyError
23
- } from "./chunk-NRUWQ5Z7.mjs";
23
+ } from "./chunk-5WWWJCKI.mjs";
24
24
 
25
25
  // src/api/email-send-template.ts
26
26
  import { z } from "zod";
@@ -7,7 +7,7 @@ import {
7
7
  countRows,
8
8
  diffSnapshots,
9
9
  introspectLiveSnapshot
10
- } from "./chunk-J4KHGYOM.mjs";
10
+ } from "./chunk-JCQMC6HH.mjs";
11
11
 
12
12
  // src/domains/schema/pipeline/preview.ts
13
13
  async function previewDesiredSchema(args, deps = {}) {
@@ -7,16 +7,16 @@ import {
7
7
  import {
8
8
  hasAnyPermission,
9
9
  hasPermission
10
- } from "./chunk-NAP3TDS6.mjs";
10
+ } from "./chunk-SWVNFKWD.mjs";
11
11
  import {
12
12
  env
13
- } from "./chunk-UJ2IMJ4W.mjs";
13
+ } from "./chunk-HREB7UR4.mjs";
14
14
  import {
15
15
  container
16
16
  } from "./chunk-D5HQBNUB.mjs";
17
17
  import {
18
18
  NextlyError
19
- } from "./chunk-NRUWQ5Z7.mjs";
19
+ } from "./chunk-5WWWJCKI.mjs";
20
20
 
21
21
  // src/auth/middleware/index.ts
22
22
  var DEFAULT_RATE_LIMIT = 1e3;
@@ -35,14 +35,14 @@ import {
35
35
  PasswordSchema,
36
36
  validatePasswordStrength,
37
37
  verifyPassword
38
- } from "./chunk-NAP3TDS6.mjs";
38
+ } from "./chunk-SWVNFKWD.mjs";
39
39
  import {
40
40
  respondAction,
41
41
  respondData
42
42
  } from "./chunk-IUDOC7N7.mjs";
43
43
  import {
44
44
  NextlyError
45
- } from "./chunk-NRUWQ5Z7.mjs";
45
+ } from "./chunk-5WWWJCKI.mjs";
46
46
 
47
47
  // src/auth/cookies/refresh-token-cookie.ts
48
48
  function setRefreshTokenCookie(token, ttlSeconds, isProduction) {
@@ -373,11 +373,15 @@ async function verifyCredentials(input, deps) {
373
373
  }
374
374
  if (deps.requireEmailVerification && !user.emailVerified) {
375
375
  throw NextlyError.invalidCredentials({
376
+ code: "AUTH_UNVERIFIED",
377
+ publicMessage: "Invalid email or password.",
376
378
  logContext: { userId: user.id, reason: "unverified" }
377
379
  });
378
380
  }
379
381
  if (!user.isActive) {
380
382
  throw NextlyError.invalidCredentials({
383
+ code: "AUTH_INACTIVE",
384
+ publicMessage: "Invalid email or password.",
381
385
  logContext: { userId: user.id, reason: "inactive" }
382
386
  });
383
387
  }
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  NextlyError,
12
12
  isDbError
13
- } from "./chunk-NRUWQ5Z7.mjs";
13
+ } from "./chunk-5WWWJCKI.mjs";
14
14
 
15
15
  // src/api/with-error-handler.ts
16
16
  import { createRequire } from "module";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ClackTerminalPromptDispatcher
3
- } from "./chunk-FQH647CT.mjs";
3
+ } from "./chunk-NJ3LXLSJ.mjs";
4
4
  import {
5
5
  extractDatabaseNameFromUrl
6
6
  } from "./chunk-KIMNCZGV.mjs";
@@ -8,21 +8,23 @@ import {
8
8
  DrizzleStatementExecutor,
9
9
  PushSchemaPipeline,
10
10
  RealPreCleanupExecutor,
11
+ clearLiveSnapshots,
11
12
  createApplyDesiredSchema,
12
13
  getProductionNotifier,
13
14
  noopMigrationJournal,
14
- noopPreRenameExecutor
15
- } from "./chunk-66ZNVKTF.mjs";
15
+ noopPreRenameExecutor,
16
+ setLiveSnapshot
17
+ } from "./chunk-HSIAXEYF.mjs";
16
18
  import {
17
19
  RealClassifier,
18
20
  RegexRenameDetector,
19
21
  buildDesiredTableFromFields,
20
22
  diffSnapshots,
21
23
  introspectLiveSnapshot
22
- } from "./chunk-J4KHGYOM.mjs";
24
+ } from "./chunk-JCQMC6HH.mjs";
23
25
  import {
24
26
  generateRuntimeSchema
25
- } from "./chunk-UB4CALU5.mjs";
27
+ } from "./chunk-2QSGNGOB.mjs";
26
28
 
27
29
  // src/domains/schema/utils/resolve-table-name.ts
28
30
  function resolveCollectionTableName(slug, dbName) {
@@ -33,7 +35,7 @@ function resolveCollectionTableName(slug, dbName) {
33
35
 
34
36
  // src/init/reload-config.ts
35
37
  async function defaultResolver(name) {
36
- const { getService } = await import("./register-G6I4N6QM.mjs");
38
+ const { getService } = await import("./register-CQU3Z4SW.mjs");
37
39
  return getService(name);
38
40
  }
39
41
  async function reloadNextlyConfig(opts) {
@@ -41,7 +43,7 @@ async function reloadNextlyConfig(opts) {
41
43
  const resolve = (name) => resolverArg ? resolverArg(name) : defaultResolver(name);
42
44
  let newConfig;
43
45
  try {
44
- const { loadConfig, clearConfigCache } = await import("./config-loader-23YEMC3Z.mjs");
46
+ const { loadConfig, clearConfigCache } = await import("./config-loader-MUFY6UMU.mjs");
45
47
  clearConfigCache();
46
48
  const result = await loadConfig();
47
49
  newConfig = result.config;
@@ -99,18 +101,17 @@ async function reloadNextlyConfig(opts) {
99
101
  fields: c.fields ?? []
100
102
  });
101
103
  }
102
- if (targets.length === 0 && singleTargets.length === 0 && componentTargets.length === 0) return;
104
+ if (targets.length === 0 && singleTargets.length === 0 && componentTargets.length === 0)
105
+ return;
106
+ const managedTableNames = [
107
+ ...targets.map((t) => t.tableName),
108
+ ...singleTargets.map((t) => t.tableName),
109
+ ...componentTargets.map((t) => t.tableName)
110
+ ];
111
+ clearLiveSnapshots();
103
112
  let liveSnapshot;
104
113
  try {
105
- liveSnapshot = await introspectLiveSnapshot(
106
- db,
107
- dialect,
108
- [
109
- ...targets.map((t) => t.tableName),
110
- ...singleTargets.map((t) => t.tableName),
111
- ...componentTargets.map((t) => t.tableName)
112
- ]
113
- );
114
+ liveSnapshot = await introspectLiveSnapshot(db, dialect, managedTableNames);
114
115
  } catch (err) {
115
116
  const msg = err instanceof Error ? err.message : String(err);
116
117
  logger?.error(
@@ -118,6 +119,7 @@ async function reloadNextlyConfig(opts) {
118
119
  );
119
120
  return;
120
121
  }
122
+ setLiveSnapshot(managedTableNames, liveSnapshot);
121
123
  const liveByTable = /* @__PURE__ */ new Map();
122
124
  for (const t of liveSnapshot.tables) liveByTable.set(t.name, t);
123
125
  let hasChanges = false;
@@ -383,7 +385,9 @@ async function reloadNextlyConfig(opts) {
383
385
  } catch {
384
386
  }
385
387
  try {
386
- const schemaReg = await resolve("schemaRegistry");
388
+ const schemaReg = await resolve(
389
+ "schemaRegistry"
390
+ );
387
391
  for (const [tableName, table] of collectionFreshTables) {
388
392
  schemaReg.registerDynamicSchema(tableName, table);
389
393
  }
@@ -413,10 +417,7 @@ async function reloadNextlyConfig(opts) {
413
417
  if (!applyResult.success) {
414
418
  const code = applyResult.error.code;
415
419
  if (code === "CONFIRMATION_REQUIRED_NO_TTY") {
416
- const detail = applyResult.error.message.replace(/^TTY required for schema confirmation\.\s*/i, "").replace(
417
- /\s*Run from an interactive terminal,.*$/i,
418
- ""
419
- ).trim();
420
+ const detail = applyResult.error.message.replace(/^TTY required for schema confirmation\.\s*/i, "").replace(/\s*Run from an interactive terminal,.*$/i, "").trim();
420
421
  console.warn(
421
422
  `
422
423
  [Nextly] Schema change needs your confirmation:
@@ -442,28 +443,7 @@ explicit confirmation.
442
443
  }
443
444
  function classifyForCodeFirst(operations, _dialect) {
444
445
  if (operations.length === 0) return { safe: true };
445
- const dropsPerTable = /* @__PURE__ */ new Map();
446
- const addsPerTable = /* @__PURE__ */ new Map();
447
- for (const op of operations) {
448
- if (op.type === "drop_column") {
449
- dropsPerTable.set(
450
- op.tableName,
451
- (dropsPerTable.get(op.tableName) ?? 0) + 1
452
- );
453
- } else if (op.type === "add_column") {
454
- addsPerTable.set(op.tableName, (addsPerTable.get(op.tableName) ?? 0) + 1);
455
- }
456
- }
457
446
  const reasons = [];
458
- for (const [t, drops] of dropsPerTable) {
459
- const adds = addsPerTable.get(t) ?? 0;
460
- if (drops > adds) {
461
- const surplus = drops - adds;
462
- reasons.push(
463
- adds === 0 ? `drops ${drops} column(s) from '${t}' with no replacement(s); ${surplus} cannot be renamed without data loss` : `drops ${drops} columns from '${t}' but only ${adds} replacement(s); at least ${surplus} cannot be renamed without data loss`
464
- );
465
- }
466
- }
467
447
  for (const op of operations) {
468
448
  if (op.type === "drop_table") {
469
449
  reasons.push(`drops table '${op.tableName}'`);
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GDBJ5JCU.mjs";
4
4
  import {
5
5
  NextlyError
6
- } from "./chunk-NRUWQ5Z7.mjs";
6
+ } from "./chunk-5WWWJCKI.mjs";
7
7
 
8
8
  // src/cli/utils/config-loader.ts
9
9
  import { existsSync, watch } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NextlyError
3
- } from "./chunk-NRUWQ5Z7.mjs";
3
+ } from "./chunk-5WWWJCKI.mjs";
4
4
 
5
5
  // src/api/read-json-body.ts
6
6
  async function readJsonBody(req, extraLogContext) {
@@ -5,11 +5,11 @@ import {
5
5
  } from "./chunk-H26B4FYG.mjs";
6
6
  import {
7
7
  env
8
- } from "./chunk-UJ2IMJ4W.mjs";
8
+ } from "./chunk-HREB7UR4.mjs";
9
9
  import {
10
10
  NextlyError,
11
11
  isDbError
12
- } from "./chunk-NRUWQ5Z7.mjs";
12
+ } from "./chunk-5WWWJCKI.mjs";
13
13
  import {
14
14
  __export
15
15
  } from "./chunk-7P6ASYW6.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NextlyError
3
- } from "./chunk-NRUWQ5Z7.mjs";
3
+ } from "./chunk-5WWWJCKI.mjs";
4
4
 
5
5
  // src/api/zod-to-nextly-error.ts
6
6
  function nextlyValidationFromZod(err) {
@@ -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-CEFDADQM.mjs");
12
+ const { createProgram } = await import("../program-DWF3GBYR.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");
@@ -12,7 +12,7 @@ import {
12
12
  getDialectDisplayName,
13
13
  validateDatabaseEnv,
14
14
  withAdapter
15
- } from "../../chunk-M52VMPGA.mjs";
15
+ } from "../../chunk-KZFYCMBL.mjs";
16
16
  import {
17
17
  SEARCH_DIRECTORIES,
18
18
  SUPPORTED_EXTENSIONS,
@@ -21,11 +21,11 @@ import {
21
21
  getCachedConfig,
22
22
  loadConfig,
23
23
  watchConfig
24
- } from "../../chunk-ZE6A3FYH.mjs";
24
+ } from "../../chunk-YG2HSZC4.mjs";
25
25
  import "../../chunk-GDBJ5JCU.mjs";
26
26
  import "../../chunk-FQULBZ53.mjs";
27
27
  import "../../chunk-4MJLT6PZ.mjs";
28
- import "../../chunk-NRUWQ5Z7.mjs";
28
+ import "../../chunk-5WWWJCKI.mjs";
29
29
  import "../../chunk-7P6ASYW6.mjs";
30
30
  export {
31
31
  SEARCH_DIRECTORIES,
@@ -1,9 +1,9 @@
1
1
  import "./chunk-RJLLGGPG.mjs";
2
2
  import {
3
3
  ComponentSchemaService
4
- } from "./chunk-JXZITQPZ.mjs";
4
+ } from "./chunk-4HUQNXVM.mjs";
5
5
  import "./chunk-DV6WVX2Q.mjs";
6
- import "./chunk-UJ2IMJ4W.mjs";
6
+ import "./chunk-HREB7UR4.mjs";
7
7
  import "./chunk-5APFUGAD.mjs";
8
8
  import "./chunk-7P6ASYW6.mjs";
9
9
  export {
@@ -6,11 +6,11 @@ import {
6
6
  getCachedConfig,
7
7
  loadConfig,
8
8
  watchConfig
9
- } from "./chunk-ZE6A3FYH.mjs";
9
+ } from "./chunk-YG2HSZC4.mjs";
10
10
  import "./chunk-GDBJ5JCU.mjs";
11
11
  import "./chunk-FQULBZ53.mjs";
12
12
  import "./chunk-4MJLT6PZ.mjs";
13
- import "./chunk-NRUWQ5Z7.mjs";
13
+ import "./chunk-5WWWJCKI.mjs";
14
14
  import "./chunk-7P6ASYW6.mjs";
15
15
  export {
16
16
  SEARCH_DIRECTORIES,
@@ -1,4 +1,4 @@
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-CknEcQSu.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-BhMtxT6M.d.ts';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/pg-core';
4
4
  import '../_dts-chunks/collections-handler.d-DAGa4oyr.d.ts';
@@ -2,18 +2,18 @@ import {
2
2
  getDialectTables,
3
3
  schema_exports,
4
4
  withDbErrors
5
- } from "../chunk-TS7GHTG2.mjs";
5
+ } from "../chunk-YXZH65YV.mjs";
6
6
  import "../chunk-H26B4FYG.mjs";
7
7
  import {
8
8
  checkAdapterHealth,
9
9
  createAdapter,
10
10
  createAdapterFromEnv,
11
11
  validateDatabaseEnv
12
- } from "../chunk-DP3G27G5.mjs";
12
+ } from "../chunk-35LAHTCU.mjs";
13
13
  import "../chunk-DV6WVX2Q.mjs";
14
14
  import {
15
15
  env
16
- } from "../chunk-UJ2IMJ4W.mjs";
16
+ } from "../chunk-HREB7UR4.mjs";
17
17
  import {
18
18
  healthCheck
19
19
  } from "../chunk-LAZXX4HR.mjs";
@@ -22,7 +22,7 @@ import {
22
22
  DbError,
23
23
  isDbError,
24
24
  toDbError
25
- } from "../chunk-NRUWQ5Z7.mjs";
25
+ } from "../chunk-5WWWJCKI.mjs";
26
26
  import "../chunk-7P6ASYW6.mjs";
27
27
  export {
28
28
  DbError,
@@ -1,42 +1,42 @@
1
1
  import {
2
2
  seedAll
3
- } from "../../chunk-EBDAFQUX.mjs";
3
+ } from "../../chunk-KTGUSU23.mjs";
4
4
  import {
5
5
  seedPermissions
6
- } from "../../chunk-LPVOTXNV.mjs";
6
+ } from "../../chunk-LDUSTBVC.mjs";
7
7
  import {
8
8
  seedSuperAdmin
9
- } from "../../chunk-3NUAFSDX.mjs";
10
- import "../../chunk-ZVN3JILF.mjs";
11
- import "../../chunk-D72XH3BG.mjs";
9
+ } from "../../chunk-44JO5BSR.mjs";
10
+ import "../../chunk-QSE7KMHI.mjs";
11
+ import "../../chunk-ERJGWWPB.mjs";
12
12
  import "../../chunk-AGJ6F2T3.mjs";
13
13
  import "../../chunk-KIMNCZGV.mjs";
14
- import "../../chunk-66ZNVKTF.mjs";
15
- import "../../chunk-INV7QKLG.mjs";
16
- import "../../chunk-JWAH6ROD.mjs";
17
- import "../../chunk-J4KHGYOM.mjs";
14
+ import "../../chunk-HSIAXEYF.mjs";
15
+ import "../../chunk-PAWMG5BR.mjs";
16
+ import "../../chunk-TVG3WU6C.mjs";
17
+ import "../../chunk-JCQMC6HH.mjs";
18
18
  import "../../chunk-RJLLGGPG.mjs";
19
- import "../../chunk-JXZITQPZ.mjs";
19
+ import "../../chunk-4HUQNXVM.mjs";
20
20
  import "../../chunk-I4JMR3UR.mjs";
21
- import "../../chunk-LP2CDTCR.mjs";
22
- import "../../chunk-UB4CALU5.mjs";
23
- import "../../chunk-L5FA2FAY.mjs";
21
+ import "../../chunk-A75OLKXP.mjs";
22
+ import "../../chunk-2QSGNGOB.mjs";
23
+ import "../../chunk-463A2UDH.mjs";
24
24
  import "../../chunk-5HMZ644B.mjs";
25
- import "../../chunk-NAP3TDS6.mjs";
25
+ import "../../chunk-SWVNFKWD.mjs";
26
26
  import "../../chunk-56WO4WX7.mjs";
27
- import "../../chunk-2W3DVD7S.mjs";
28
- import "../../chunk-TS7GHTG2.mjs";
27
+ import "../../chunk-PFRMIEJ3.mjs";
28
+ import "../../chunk-YXZH65YV.mjs";
29
29
  import "../../chunk-H26B4FYG.mjs";
30
- import "../../chunk-DP3G27G5.mjs";
30
+ import "../../chunk-35LAHTCU.mjs";
31
31
  import "../../chunk-DV6WVX2Q.mjs";
32
- import "../../chunk-UJ2IMJ4W.mjs";
32
+ import "../../chunk-HREB7UR4.mjs";
33
33
  import "../../chunk-EGXBZCGC.mjs";
34
34
  import "../../chunk-G2AA4QLC.mjs";
35
35
  import "../../chunk-4MJLT6PZ.mjs";
36
36
  import "../../chunk-IUDOC7N7.mjs";
37
37
  import "../../chunk-LAZXX4HR.mjs";
38
38
  import "../../chunk-D5HQBNUB.mjs";
39
- import "../../chunk-NRUWQ5Z7.mjs";
39
+ import "../../chunk-5WWWJCKI.mjs";
40
40
  import "../../chunk-VTJADRO3.mjs";
41
41
  import "../../chunk-5APFUGAD.mjs";
42
42
  import "../../chunk-7P6ASYW6.mjs";
@@ -4,26 +4,26 @@ import {
4
4
  import {
5
5
  createAdapter,
6
6
  validateDatabaseEnv
7
- } from "./chunk-M52VMPGA.mjs";
7
+ } from "./chunk-KZFYCMBL.mjs";
8
8
  import {
9
9
  loadConfig
10
- } from "./chunk-ZE6A3FYH.mjs";
10
+ } from "./chunk-YG2HSZC4.mjs";
11
11
  import "./chunk-GDBJ5JCU.mjs";
12
12
  import "./chunk-FQULBZ53.mjs";
13
13
  import {
14
14
  CollectionRegistryService
15
- } from "./chunk-D72XH3BG.mjs";
15
+ } from "./chunk-ERJGWWPB.mjs";
16
16
  import "./chunk-5HMZ644B.mjs";
17
- import "./chunk-2W3DVD7S.mjs";
18
- import "./chunk-TS7GHTG2.mjs";
17
+ import "./chunk-PFRMIEJ3.mjs";
18
+ import "./chunk-YXZH65YV.mjs";
19
19
  import "./chunk-H26B4FYG.mjs";
20
- import "./chunk-DP3G27G5.mjs";
20
+ import "./chunk-35LAHTCU.mjs";
21
21
  import "./chunk-DV6WVX2Q.mjs";
22
- import "./chunk-UJ2IMJ4W.mjs";
22
+ import "./chunk-HREB7UR4.mjs";
23
23
  import "./chunk-4MJLT6PZ.mjs";
24
24
  import "./chunk-LAZXX4HR.mjs";
25
25
  import "./chunk-D5HQBNUB.mjs";
26
- import "./chunk-NRUWQ5Z7.mjs";
26
+ import "./chunk-5WWWJCKI.mjs";
27
27
  import "./chunk-7P6ASYW6.mjs";
28
28
 
29
29
  // src/cli/commands/db-sync-demote.ts
@@ -4,21 +4,21 @@ import {
4
4
  import {
5
5
  createAdapter,
6
6
  validateDatabaseEnv
7
- } from "./chunk-M52VMPGA.mjs";
7
+ } from "./chunk-KZFYCMBL.mjs";
8
8
  import {
9
9
  CollectionRegistryService
10
- } from "./chunk-D72XH3BG.mjs";
10
+ } from "./chunk-ERJGWWPB.mjs";
11
11
  import "./chunk-5HMZ644B.mjs";
12
- import "./chunk-2W3DVD7S.mjs";
13
- import "./chunk-TS7GHTG2.mjs";
12
+ import "./chunk-PFRMIEJ3.mjs";
13
+ import "./chunk-YXZH65YV.mjs";
14
14
  import "./chunk-H26B4FYG.mjs";
15
- import "./chunk-DP3G27G5.mjs";
15
+ import "./chunk-35LAHTCU.mjs";
16
16
  import "./chunk-DV6WVX2Q.mjs";
17
- import "./chunk-UJ2IMJ4W.mjs";
17
+ import "./chunk-HREB7UR4.mjs";
18
18
  import "./chunk-4MJLT6PZ.mjs";
19
19
  import "./chunk-LAZXX4HR.mjs";
20
20
  import "./chunk-D5HQBNUB.mjs";
21
- import "./chunk-NRUWQ5Z7.mjs";
21
+ import "./chunk-5WWWJCKI.mjs";
22
22
  import "./chunk-7P6ASYW6.mjs";
23
23
 
24
24
  // src/cli/commands/db-sync-promote.ts