@memberjunction/codegen-lib 6.1.4 → 6.2.0-edge.1

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 (216) hide show
  1. package/dist/Angular/angular-codegen.d.ts +6 -0
  2. package/dist/Angular/angular-codegen.d.ts.map +1 -1
  3. package/dist/Angular/angular-codegen.js +26 -14
  4. package/dist/Angular/angular-codegen.js.map +1 -1
  5. package/dist/Config/config.d.ts +45 -2
  6. package/dist/Config/config.d.ts.map +1 -1
  7. package/dist/Config/config.js +116 -39
  8. package/dist/Config/config.js.map +1 -1
  9. package/dist/Config/db-connection.d.ts +4 -0
  10. package/dist/Config/db-connection.d.ts.map +1 -1
  11. package/dist/Config/db-connection.js +11 -3
  12. package/dist/Config/db-connection.js.map +1 -1
  13. package/dist/Config/pg-connection.d.ts +2 -0
  14. package/dist/Config/pg-connection.d.ts.map +1 -1
  15. package/dist/Config/pg-connection.js +5 -1
  16. package/dist/Config/pg-connection.js.map +1 -1
  17. package/dist/Config/schema-output.d.ts +8 -0
  18. package/dist/Config/schema-output.d.ts.map +1 -1
  19. package/dist/Config/schema-output.js +19 -7
  20. package/dist/Config/schema-output.js.map +1 -1
  21. package/dist/Database/__tests__/exclude-schema-permissions.test.js +3 -3
  22. package/dist/Database/codeGenDatabaseProvider.d.ts +40 -1
  23. package/dist/Database/codeGenDatabaseProvider.d.ts.map +1 -1
  24. package/dist/Database/codeGenDatabaseProvider.js +65 -7
  25. package/dist/Database/codeGenDatabaseProvider.js.map +1 -1
  26. package/dist/Database/dbSchema.d.ts +4 -0
  27. package/dist/Database/dbSchema.d.ts.map +1 -1
  28. package/dist/Database/dbSchema.js +17 -9
  29. package/dist/Database/dbSchema.js.map +1 -1
  30. package/dist/Database/entity-field-change-tracking.d.ts +4 -0
  31. package/dist/Database/entity-field-change-tracking.d.ts.map +1 -1
  32. package/dist/Database/entity-field-change-tracking.js +12 -4
  33. package/dist/Database/entity-field-change-tracking.js.map +1 -1
  34. package/dist/Database/exclude-tables.d.ts +2 -0
  35. package/dist/Database/exclude-tables.d.ts.map +1 -1
  36. package/dist/Database/exclude-tables.js +5 -1
  37. package/dist/Database/exclude-tables.js.map +1 -1
  38. package/dist/Database/field-metadata-lock.d.ts +8 -6
  39. package/dist/Database/field-metadata-lock.d.ts.map +1 -1
  40. package/dist/Database/field-metadata-lock.js +29 -25
  41. package/dist/Database/field-metadata-lock.js.map +1 -1
  42. package/dist/Database/heal-schema-params.d.ts +14 -2
  43. package/dist/Database/heal-schema-params.d.ts.map +1 -1
  44. package/dist/Database/heal-schema-params.js +21 -5
  45. package/dist/Database/heal-schema-params.js.map +1 -1
  46. package/dist/Database/manage-metadata.d.ts +227 -4
  47. package/dist/Database/manage-metadata.d.ts.map +1 -1
  48. package/dist/Database/manage-metadata.js +883 -384
  49. package/dist/Database/manage-metadata.js.map +1 -1
  50. package/dist/Database/materializationAnalysis.d.ts +61 -2
  51. package/dist/Database/materializationAnalysis.d.ts.map +1 -1
  52. package/dist/Database/materializationAnalysis.js +43 -23
  53. package/dist/Database/materializationAnalysis.js.map +1 -1
  54. package/dist/Database/materializationBroadRender.d.ts +5 -3
  55. package/dist/Database/materializationBroadRender.d.ts.map +1 -1
  56. package/dist/Database/materializationBroadRender.js +17 -13
  57. package/dist/Database/materializationBroadRender.js.map +1 -1
  58. package/dist/Database/materializationDrift.d.ts +2 -0
  59. package/dist/Database/materializationDrift.d.ts.map +1 -1
  60. package/dist/Database/materializationDrift.js +5 -1
  61. package/dist/Database/materializationDrift.js.map +1 -1
  62. package/dist/Database/materializationParamClassifier.d.ts +17 -2
  63. package/dist/Database/materializationParamClassifier.d.ts.map +1 -1
  64. package/dist/Database/materializationParamClassifier.js +22 -10
  65. package/dist/Database/materializationParamClassifier.js.map +1 -1
  66. package/dist/Database/materializationParamVerifier.d.ts +2 -0
  67. package/dist/Database/materializationParamVerifier.d.ts.map +1 -1
  68. package/dist/Database/materializationParamVerifier.js +18 -14
  69. package/dist/Database/materializationParamVerifier.js.map +1 -1
  70. package/dist/Database/materializationSqlAst.d.ts +19 -1
  71. package/dist/Database/materializationSqlAst.d.ts.map +1 -1
  72. package/dist/Database/materializationSqlAst.js +53 -17
  73. package/dist/Database/materializationSqlAst.js.map +1 -1
  74. package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.d.ts +18 -0
  75. package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.d.ts.map +1 -1
  76. package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.js +76 -30
  77. package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.js.map +1 -1
  78. package/dist/Database/providers/postgresql/metadataSupportObjects.d.ts +2 -0
  79. package/dist/Database/providers/postgresql/metadataSupportObjects.d.ts.map +1 -1
  80. package/dist/Database/providers/postgresql/metadataSupportObjects.js +5 -1
  81. package/dist/Database/providers/postgresql/metadataSupportObjects.js.map +1 -1
  82. package/dist/Database/providers/postgresql/viewDependencyCapture.d.ts +10 -0
  83. package/dist/Database/providers/postgresql/viewDependencyCapture.d.ts.map +1 -1
  84. package/dist/Database/providers/postgresql/viewDependencyCapture.js +25 -5
  85. package/dist/Database/providers/postgresql/viewDependencyCapture.js.map +1 -1
  86. package/dist/Database/providers/postgresql/viewFallback.d.ts +11 -7
  87. package/dist/Database/providers/postgresql/viewFallback.d.ts.map +1 -1
  88. package/dist/Database/providers/postgresql/viewFallback.js +18 -12
  89. package/dist/Database/providers/postgresql/viewFallback.js.map +1 -1
  90. package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.d.ts +9 -0
  91. package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.d.ts.map +1 -1
  92. package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.js +27 -13
  93. package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.js.map +1 -1
  94. package/dist/Database/reconcileFieldLevelSecurity.d.ts +2 -0
  95. package/dist/Database/reconcileFieldLevelSecurity.d.ts.map +1 -1
  96. package/dist/Database/reconcileFieldLevelSecurity.js +5 -1
  97. package/dist/Database/reconcileFieldLevelSecurity.js.map +1 -1
  98. package/dist/Database/reorder-columns.d.ts +2 -0
  99. package/dist/Database/reorder-columns.d.ts.map +1 -1
  100. package/dist/Database/reorder-columns.js +5 -1
  101. package/dist/Database/reorder-columns.js.map +1 -1
  102. package/dist/Database/schema-filters.d.ts +6 -0
  103. package/dist/Database/schema-filters.d.ts.map +1 -1
  104. package/dist/Database/schema-filters.js +17 -5
  105. package/dist/Database/schema-filters.js.map +1 -1
  106. package/dist/Database/schema-scope.d.ts +4 -0
  107. package/dist/Database/schema-scope.d.ts.map +1 -1
  108. package/dist/Database/schema-scope.js +13 -5
  109. package/dist/Database/schema-scope.js.map +1 -1
  110. package/dist/Database/search-guardrails.d.ts +52 -0
  111. package/dist/Database/search-guardrails.d.ts.map +1 -1
  112. package/dist/Database/search-guardrails.js +77 -18
  113. package/dist/Database/search-guardrails.js.map +1 -1
  114. package/dist/Database/sql.d.ts +20 -0
  115. package/dist/Database/sql.d.ts.map +1 -1
  116. package/dist/Database/sql.js +72 -32
  117. package/dist/Database/sql.js.map +1 -1
  118. package/dist/Database/sql_codegen.d.ts +92 -0
  119. package/dist/Database/sql_codegen.d.ts.map +1 -1
  120. package/dist/Database/sql_codegen.js +197 -113
  121. package/dist/Database/sql_codegen.js.map +1 -1
  122. package/dist/EntityNameScanner/EntityNameScanner.d.ts +16 -0
  123. package/dist/EntityNameScanner/EntityNameScanner.d.ts.map +1 -1
  124. package/dist/EntityNameScanner/EntityNameScanner.js +47 -15
  125. package/dist/EntityNameScanner/EntityNameScanner.js.map +1 -1
  126. package/dist/EntityNameScanner/HtmlEntityNameScanner.d.ts +6 -0
  127. package/dist/EntityNameScanner/HtmlEntityNameScanner.d.ts.map +1 -1
  128. package/dist/EntityNameScanner/HtmlEntityNameScanner.js +19 -7
  129. package/dist/EntityNameScanner/HtmlEntityNameScanner.js.map +1 -1
  130. package/dist/EntityNameScanner/MetadataNameScanner.d.ts +6 -0
  131. package/dist/EntityNameScanner/MetadataNameScanner.d.ts.map +1 -1
  132. package/dist/EntityNameScanner/MetadataNameScanner.js +19 -7
  133. package/dist/EntityNameScanner/MetadataNameScanner.js.map +1 -1
  134. package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts +6 -0
  135. package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts.map +1 -1
  136. package/dist/Manifest/GenerateClassRegistrationsManifest.js +16 -4
  137. package/dist/Manifest/GenerateClassRegistrationsManifest.js.map +1 -1
  138. package/dist/Misc/action_subclasses_codegen.d.ts +4 -0
  139. package/dist/Misc/action_subclasses_codegen.d.ts.map +1 -1
  140. package/dist/Misc/action_subclasses_codegen.js +11 -3
  141. package/dist/Misc/action_subclasses_codegen.js.map +1 -1
  142. package/dist/Misc/advanced_generation.d.ts +48 -2
  143. package/dist/Misc/advanced_generation.d.ts.map +1 -1
  144. package/dist/Misc/advanced_generation.js +53 -15
  145. package/dist/Misc/advanced_generation.js.map +1 -1
  146. package/dist/Misc/codegen-reporter.d.ts +53 -0
  147. package/dist/Misc/codegen-reporter.d.ts.map +1 -1
  148. package/dist/Misc/codegen-reporter.js +106 -22
  149. package/dist/Misc/codegen-reporter.js.map +1 -1
  150. package/dist/Misc/createNewUser.d.ts +6 -0
  151. package/dist/Misc/createNewUser.d.ts.map +1 -1
  152. package/dist/Misc/createNewUser.js +5 -1
  153. package/dist/Misc/createNewUser.js.map +1 -1
  154. package/dist/Misc/entity_subclasses_codegen.d.ts +8 -0
  155. package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
  156. package/dist/Misc/entity_subclasses_codegen.js +52 -36
  157. package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
  158. package/dist/Misc/externalTypeMapping.d.ts +2 -0
  159. package/dist/Misc/externalTypeMapping.d.ts.map +1 -1
  160. package/dist/Misc/externalTypeMapping.js +5 -1
  161. package/dist/Misc/externalTypeMapping.js.map +1 -1
  162. package/dist/Misc/file-write.d.ts +2 -0
  163. package/dist/Misc/file-write.d.ts.map +1 -1
  164. package/dist/Misc/file-write.js +5 -1
  165. package/dist/Misc/file-write.js.map +1 -1
  166. package/dist/Misc/graphql_server_codegen.d.ts +14 -0
  167. package/dist/Misc/graphql_server_codegen.d.ts.map +1 -1
  168. package/dist/Misc/graphql_server_codegen.js +51 -27
  169. package/dist/Misc/graphql_server_codegen.js.map +1 -1
  170. package/dist/Misc/remote_operations_codegen.d.ts +12 -0
  171. package/dist/Misc/remote_operations_codegen.d.ts.map +1 -1
  172. package/dist/Misc/remote_operations_codegen.js +21 -5
  173. package/dist/Misc/remote_operations_codegen.js.map +1 -1
  174. package/dist/Misc/runCommand.d.ts +6 -0
  175. package/dist/Misc/runCommand.d.ts.map +1 -1
  176. package/dist/Misc/runCommand.js +16 -4
  177. package/dist/Misc/runCommand.js.map +1 -1
  178. package/dist/Misc/schema-emit.d.ts +28 -0
  179. package/dist/Misc/schema-emit.d.ts.map +1 -1
  180. package/dist/Misc/schema-emit.js +75 -23
  181. package/dist/Misc/schema-emit.js.map +1 -1
  182. package/dist/Misc/sql_logging.d.ts +44 -11
  183. package/dist/Misc/sql_logging.d.ts.map +1 -1
  184. package/dist/Misc/sql_logging.js +132 -51
  185. package/dist/Misc/sql_logging.js.map +1 -1
  186. package/dist/Misc/sql_text.d.ts +22 -0
  187. package/dist/Misc/sql_text.d.ts.map +1 -0
  188. package/dist/Misc/sql_text.js +46 -0
  189. package/dist/Misc/sql_text.js.map +1 -0
  190. package/dist/Misc/status_logging.d.ts +36 -0
  191. package/dist/Misc/status_logging.d.ts.map +1 -1
  192. package/dist/Misc/status_logging.js +95 -23
  193. package/dist/Misc/status_logging.js.map +1 -1
  194. package/dist/Misc/system_integrity.js +4 -4
  195. package/dist/Misc/system_integrity.js.map +1 -1
  196. package/dist/Misc/temp_batch_file.d.ts +12 -0
  197. package/dist/Misc/temp_batch_file.d.ts.map +1 -1
  198. package/dist/Misc/temp_batch_file.js +35 -11
  199. package/dist/Misc/temp_batch_file.js.map +1 -1
  200. package/dist/Misc/util.d.ts +33 -0
  201. package/dist/Misc/util.d.ts.map +1 -1
  202. package/dist/Misc/util.js +53 -13
  203. package/dist/Misc/util.js.map +1 -1
  204. package/dist/index.d.ts +1 -1
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +1 -1
  207. package/dist/index.js.map +1 -1
  208. package/dist/plugins/index.d.ts +11 -1
  209. package/dist/plugins/index.d.ts.map +1 -1
  210. package/dist/plugins/index.js +9 -1
  211. package/dist/plugins/index.js.map +1 -1
  212. package/dist/runCodeGen.d.ts +6 -0
  213. package/dist/runCodeGen.d.ts.map +1 -1
  214. package/dist/runCodeGen.js +150 -138
  215. package/dist/runCodeGen.js.map +1 -1
  216. package/package.json +29 -29
@@ -12,19 +12,31 @@
12
12
  * - `includeSchemas` as `@IncludedSchemaNames` when set
13
13
  */
14
14
  export interface HealSchemaRoutineParams {
15
- values: string[];
16
- names: string[];
15
+ Values: string[];
16
+ Names: string[];
17
17
  }
18
18
  /** Capture the config exclude list before `applyIncludeSchemaScope` mutates it. Idempotent. */
19
+ export declare function SnapshotAuthoredExcludeSchemas(excludeSchemas: string[] | undefined): void;
20
+ /** @deprecated Use {@link SnapshotAuthoredExcludeSchemas}. */
19
21
  export declare function snapshotAuthoredExcludeSchemas(excludeSchemas: string[] | undefined): void;
20
22
  /** Test-only: reset the snapshot between cases. */
23
+ export declare function ResetAuthoredExcludeSnapshot(): void;
24
+ /** @deprecated Use {@link ResetAuthoredExcludeSnapshot}. */
21
25
  export declare function resetAuthoredExcludeSnapshot(): void;
26
+ export declare function GetAuthoredExcludeSchemas(fallback?: string[]): string[];
27
+ /** @deprecated Use {@link GetAuthoredExcludeSchemas}. */
22
28
  export declare function getAuthoredExcludeSchemas(fallback?: string[]): string[];
23
29
  /**
24
30
  * Named-parameter lists for a heal SP call.
25
31
  * `@IncludedSchemaNames` is omitted when `includeSchemas` is empty so classic
26
32
  * MJ (no include list) keeps the historical EXEC shape.
27
33
  */
34
+ export declare function BuildHealSchemaRoutineParams(options: {
35
+ authoredExclude: string[];
36
+ includeSchemas?: string[] | null;
37
+ entityIDs?: string[];
38
+ }): HealSchemaRoutineParams;
39
+ /** @deprecated Use {@link BuildHealSchemaRoutineParams}. */
28
40
  export declare function buildHealSchemaRoutineParams(options: {
29
41
  authoredExclude: string[];
30
42
  includeSchemas?: string[] | null;
@@ -1 +1 @@
1
- {"version":3,"file":"heal-schema-params.d.ts","sourceRoot":"","sources":["../../src/Database/heal-schema-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAID,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAIzF;AAED,mDAAmD;AACnD,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAKvE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IAClD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,uBAAuB,CAiB1B"}
1
+ {"version":3,"file":"heal-schema-params.d.ts","sourceRoot":"","sources":["../../src/Database/heal-schema-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAID,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAIzF;AAED,8DAA8D;AAC9D,wBAAgB,8BAA8B,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAEzF;AAED,mDAAmD;AACnD,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED,4DAA4D;AAC5D,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAKvE;AAED,yDAAyD;AACzD,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IAClD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,uBAAuB,CAiB1B;AAED,4DAA4D;AAC5D,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IAClD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,uBAAuB,CAE1B"}
@@ -13,27 +13,39 @@
13
13
  */
14
14
  let authoredExcludeSchemas = null;
15
15
  /** Capture the config exclude list before `applyIncludeSchemaScope` mutates it. Idempotent. */
16
- export function snapshotAuthoredExcludeSchemas(excludeSchemas) {
16
+ export function SnapshotAuthoredExcludeSchemas(excludeSchemas) {
17
17
  if (authoredExcludeSchemas === null) {
18
18
  authoredExcludeSchemas = [...(excludeSchemas ?? [])];
19
19
  }
20
20
  }
21
+ /** @deprecated Use {@link SnapshotAuthoredExcludeSchemas}. */
22
+ export function snapshotAuthoredExcludeSchemas(excludeSchemas) {
23
+ return SnapshotAuthoredExcludeSchemas(excludeSchemas);
24
+ }
21
25
  /** Test-only: reset the snapshot between cases. */
22
- export function resetAuthoredExcludeSnapshot() {
26
+ export function ResetAuthoredExcludeSnapshot() {
23
27
  authoredExcludeSchemas = null;
24
28
  }
25
- export function getAuthoredExcludeSchemas(fallback) {
29
+ /** @deprecated Use {@link ResetAuthoredExcludeSnapshot}. */
30
+ export function resetAuthoredExcludeSnapshot() {
31
+ return ResetAuthoredExcludeSnapshot();
32
+ }
33
+ export function GetAuthoredExcludeSchemas(fallback) {
26
34
  if (authoredExcludeSchemas !== null) {
27
35
  return authoredExcludeSchemas;
28
36
  }
29
37
  return [...(fallback ?? [])];
30
38
  }
39
+ /** @deprecated Use {@link GetAuthoredExcludeSchemas}. */
40
+ export function getAuthoredExcludeSchemas(fallback) {
41
+ return GetAuthoredExcludeSchemas(fallback);
42
+ }
31
43
  /**
32
44
  * Named-parameter lists for a heal SP call.
33
45
  * `@IncludedSchemaNames` is omitted when `includeSchemas` is empty so classic
34
46
  * MJ (no include list) keeps the historical EXEC shape.
35
47
  */
36
- export function buildHealSchemaRoutineParams(options) {
48
+ export function BuildHealSchemaRoutineParams(options) {
37
49
  const exclude = options.authoredExclude.join(',');
38
50
  const values = [`'${exclude}'`];
39
51
  const names = ['ExcludedSchemaNames'];
@@ -46,6 +58,10 @@ export function buildHealSchemaRoutineParams(options) {
46
58
  values.push(`'${include.join(',')}'`);
47
59
  names.push('IncludedSchemaNames');
48
60
  }
49
- return { values, names };
61
+ return { Values: values, Names: names };
62
+ }
63
+ /** @deprecated Use {@link BuildHealSchemaRoutineParams}. */
64
+ export function buildHealSchemaRoutineParams(options) {
65
+ return BuildHealSchemaRoutineParams(options);
50
66
  }
51
67
  //# sourceMappingURL=heal-schema-params.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"heal-schema-params.js","sourceRoot":"","sources":["../../src/Database/heal-schema-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,IAAI,sBAAsB,GAAoB,IAAI,CAAC;AAEnD,+F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FieldIdentificationResult, FormLayoutResult, VirtualEntityDecorationResult } from "../Misc/advanced_generation.js";
9
9
  import { FieldChangeReason, EntityFieldSnapshotRow } from './entity-field-change-tracking.js';
10
- export { TRACKED_FIELD_COLUMNS, FieldChangeReason, DISPLAYNAME_REOPEN_REASONS, TYPE_REOPEN_REASONS, EntityFieldSnapshotRow, EntityFieldChange, diffEntityFieldSnapshots, } from './entity-field-change-tracking.js';
10
+ export { TRACKED_FIELD_COLUMNS, FieldChangeReason, DISPLAYNAME_REOPEN_REASONS, TYPE_REOPEN_REASONS, EntityFieldSnapshotRow, EntityFieldChange, DiffEntityFieldSnapshots, diffEntityFieldSnapshots, } from './entity-field-change-tracking.js';
11
11
  export declare class ValidatorResult {
12
12
  entityName: string;
13
13
  fieldName?: string;
@@ -150,7 +150,12 @@ export interface OrganicKeyTransitiveViewConfig {
150
150
  Name: string;
151
151
  /** The schema to create the view in (defaults to the related entity's schema if not specified) */
152
152
  SchemaName?: string;
153
- /** Raw SQL for the view body (the SELECT statement). CodeGen emits CREATE OR ALTER VIEW wrapping this. */
153
+ /**
154
+ * Raw SQL for the view body (the SELECT statement), written in the target platform's dialect.
155
+ * CodeGen wraps it in the platform's create-or-replace DDL (`CREATE OR ALTER VIEW` on SQL Server,
156
+ * `CREATE OR REPLACE VIEW` on PostgreSQL). On PostgreSQL the body is not auto-quoted, so
157
+ * mixed-case identifiers must be double-quoted.
158
+ */
154
159
  SQL: string;
155
160
  }
156
161
  /**
@@ -334,31 +339,63 @@ export declare class ManageMetadataBase {
334
339
  /**
335
340
  * Globally scoped list of entities that have been created during the metadata management process.
336
341
  */
342
+ static get NewEntityList(): string[];
343
+ static set NewEntityList(value: string[]);
344
+ /** @deprecated Use {@link NewEntityList}. */
337
345
  static get newEntityList(): string[];
346
+ /** @deprecated Use {@link NewEntityList}. */
338
347
  static set newEntityList(value: string[]);
339
348
  private static _modifiedEntityList;
340
349
  /**
341
350
  * Globally scoped list of entities that have been modified during the metadata management process.
342
351
  */
352
+ static get ModifiedEntityList(): string[];
353
+ static set ModifiedEntityList(value: string[]);
354
+ /** @deprecated Use {@link ModifiedEntityList}. */
343
355
  static get modifiedEntityList(): string[];
356
+ /** @deprecated Use {@link ModifiedEntityList}. */
344
357
  static set modifiedEntityList(value: string[]);
345
358
  private static _newFieldSet;
346
359
  private static _changedFields;
347
360
  private static _changedFieldReport;
348
361
  private static fieldKey;
362
+ static RegisterNewField(entityID: string, name: string): void;
363
+ /** @deprecated Use {@link RegisterNewField}. */
349
364
  static registerNewField(entityID: string, name: string): void;
365
+ static RegisterFieldChange(entityID: string, name: string, reasons: Iterable<FieldChangeReason>): void;
366
+ /** @deprecated Use {@link RegisterFieldChange}. */
350
367
  static registerFieldChange(entityID: string, name: string, reasons: Iterable<FieldChangeReason>): void;
368
+ static IsFieldNew(entityID: string, name: string): boolean;
369
+ /** @deprecated Use {@link IsFieldNew}. */
351
370
  static isFieldNew(entityID: string, name: string): boolean;
371
+ static FieldChangeReasons(entityID: string, name: string): ReadonlySet<FieldChangeReason>;
372
+ /** @deprecated Use {@link FieldChangeReasons}. */
352
373
  static fieldChangeReasons(entityID: string, name: string): ReadonlySet<FieldChangeReason>;
374
+ static IsDisplayNameReopened(entityID: string, name: string): boolean;
375
+ /** @deprecated Use {@link IsDisplayNameReopened}. */
353
376
  static isDisplayNameReopened(entityID: string, name: string): boolean;
377
+ static IsTypeReopened(entityID: string, name: string): boolean;
378
+ /** @deprecated Use {@link IsTypeReopened}. */
354
379
  static isTypeReopened(entityID: string, name: string): boolean;
380
+ static get NewFieldCount(): number;
381
+ /** @deprecated Use {@link NewFieldCount}. */
355
382
  static get newFieldCount(): number;
383
+ static get ChangedFieldCount(): number;
384
+ /** @deprecated Use {@link ChangedFieldCount}. */
356
385
  static get changedFieldCount(): number;
386
+ static get ChangedFieldReport(): ReadonlyArray<{
387
+ entityName: string;
388
+ fieldName: string;
389
+ reasons: FieldChangeReason[];
390
+ }>;
391
+ /** @deprecated Use {@link ChangedFieldReport}. */
357
392
  static get changedFieldReport(): ReadonlyArray<{
358
393
  entityName: string;
359
394
  fieldName: string;
360
395
  reasons: FieldChangeReason[];
361
396
  }>;
397
+ static ClearFieldTracking(): void;
398
+ /** @deprecated Use {@link ClearFieldTracking}. */
362
399
  static clearFieldTracking(): void;
363
400
  /**
364
401
  * Takes a snapshot of EntityField rows from vwEntityFields for diffing.
@@ -381,6 +418,8 @@ export declare class ManageMetadataBase {
381
418
  * the dead class keeps a live `@RegisterClass` registration on disk. The old monolith could
382
419
  * not drift this way: it was rewritten in full every run.
383
420
  */
421
+ static get DeletedEntitySchemaList(): string[];
422
+ /** @deprecated Use {@link DeletedEntitySchemaList}. */
384
423
  static get deletedEntitySchemaList(): string[];
385
424
  private static _entitiesRequiringViewRegen;
386
425
  /**
@@ -394,6 +433,8 @@ export declare class ManageMetadataBase {
394
433
  /**
395
434
  * Globally scoped list of validators that have been generated during the metadata management process.
396
435
  */
436
+ static get GeneratedValidators(): ValidatorResult[];
437
+ /** @deprecated Use {@link GeneratedValidators}. */
397
438
  static get generatedValidators(): ValidatorResult[];
398
439
  private static _softPKFKConfigCache;
399
440
  private static _softPKFKConfigPath;
@@ -409,12 +450,16 @@ export declare class ManageMetadataBase {
409
450
  * Deterministic + event-driven (no mtime/TOCTOU race). The CLI `Run()` path does not call this, so its
410
451
  * load-once-per-process behavior is unchanged.
411
452
  */
453
+ static InvalidateSoftPKFKConfigCache(): void;
454
+ /** @deprecated Use {@link InvalidateSoftPKFKConfigCache}. */
412
455
  static invalidateSoftPKFKConfigCache(): void;
413
456
  /**
414
457
  * Loads and caches the soft PK/FK configuration from the additionalSchemaInfo file.
415
458
  * Cached per process to avoid repeated I/O within a CodeGen run; the in-process (RSU) path calls
416
459
  * {@link invalidateSoftPKFKConfigCache} at the start of each run so a rewritten file is picked up.
417
460
  */
461
+ static GetSoftPKFKConfig(): Record<string, unknown> | null;
462
+ /** @deprecated Use {@link GetSoftPKFKConfig}. */
418
463
  static getSoftPKFKConfig(): Record<string, unknown> | null;
419
464
  /**
420
465
  * Extracts a flat array of table configs from the config file, handling both formats:
@@ -479,7 +524,19 @@ export declare class ManageMetadataBase {
479
524
  success: boolean;
480
525
  createdCount: number;
481
526
  updatedCount: number;
527
+ failedCount: number;
482
528
  }>;
529
+ /**
530
+ * Finds the entity an organic-key config names: by base table + schema, else by entity name.
531
+ * Returns `null` when neither matches.
532
+ */
533
+ private findOrganicKeyEntity;
534
+ /**
535
+ * Resolves every related entity of an organic key, in config order. Logs each one that doesn't
536
+ * resolve and returns `null` if any is missing, so the caller can skip the key before writing any
537
+ * of it.
538
+ */
539
+ private resolveOrganicKeyRelatedEntities;
483
540
  /**
484
541
  * Builds the entity lookup behind {@link processISARelationshipConfig}: match on Name first, else
485
542
  * on BaseTable, optionally constrained to a schema.
@@ -683,6 +740,8 @@ export declare class ManageMetadataBase {
683
740
  * @param pool - the ConnectionPool object to use for querying and updating the database
684
741
  * @returns
685
742
  */
743
+ ManageMetadata(pool: CodeGenConnection, currentUser: UserInfo): Promise<boolean>;
744
+ /** @deprecated Use {@link ManageMetadata}. */
686
745
  manageMetadata(pool: CodeGenConnection, currentUser: UserInfo): Promise<boolean>;
687
746
  /**
688
747
  * INTEGRITY CHECK — in a well-formed entity every base (non-virtual) field sequences BEFORE the
@@ -950,6 +1009,8 @@ export declare class ManageMetadataBase {
950
1009
  * @param pool - database connection
951
1010
  * @param excludeSchemas - schemas to exclude from FK field lookup
952
1011
  */
1012
+ CleanupStaleEntityRelationships(pool: CodeGenConnection, excludeSchemas: string[]): Promise<boolean>;
1013
+ /** @deprecated Use {@link CleanupStaleEntityRelationships}. */
953
1014
  cleanupStaleEntityRelationships(pool: CodeGenConnection, excludeSchemas: string[]): Promise<boolean>;
954
1015
  /**
955
1016
  * Removes stale One-To-Many EntityRelationship records whose RelatedEntityJoinField no longer
@@ -1002,6 +1063,8 @@ export declare class ManageMetadataBase {
1002
1063
  * which is the typical "no schema changes since last run" case in Pass 2.
1003
1064
  * `undefined` (default) preserves prior full-scan behavior.
1004
1065
  */
1066
+ ManageEntityFields(pool: CodeGenConnection, excludeSchemas: string[], skipCreatedAtUpdatedAtDeletedAtFieldValidation: boolean, skipEntityFieldValues: boolean, currentUser: UserInfo, skipAdvancedGeneration: boolean, skipDeleteUnneededFields?: boolean, entityFilter?: string[]): Promise<boolean>;
1067
+ /** @deprecated Use {@link ManageEntityFields}. */
1005
1068
  manageEntityFields(pool: CodeGenConnection, excludeSchemas: string[], skipCreatedAtUpdatedAtDeletedAtFieldValidation: boolean, skipEntityFieldValues: boolean, currentUser: UserInfo, skipAdvancedGeneration: boolean, skipDeleteUnneededFields?: boolean, entityFilter?: string[]): Promise<boolean>;
1006
1069
  /**
1007
1070
  * This method ensures that the __mj_DeletedAt field exists in each entity that has DeleteType=Soft. If the field does not exist, it is created.
@@ -1125,11 +1188,15 @@ export declare class ManageMetadataBase {
1125
1188
  * @param relatedEntityNameFieldMap
1126
1189
  * @returns
1127
1190
  */
1191
+ UpdateEntityFieldRelatedEntityNameFieldMap(pool: CodeGenConnection, entityFieldID: string, relatedEntityNameFieldMap: string): Promise<boolean>;
1192
+ /** @deprecated Use {@link UpdateEntityFieldRelatedEntityNameFieldMap}. */
1128
1193
  updateEntityFieldRelatedEntityNameFieldMap(pool: CodeGenConnection, entityFieldID: string, relatedEntityNameFieldMap: string): Promise<boolean>;
1129
1194
  protected updateExistingEntitiesFromSchema(pool: CodeGenConnection, excludeSchemas: string[]): Promise<boolean>;
1130
1195
  /**
1131
1196
  * Adds a list of entity names to the modified entity list if they're not already in there
1132
1197
  */
1198
+ static AddNewEntitiesToModifiedList(entityNames: string[]): void;
1199
+ /** @deprecated Use {@link AddNewEntitiesToModifiedList}. */
1133
1200
  static addNewEntitiesToModifiedList(entityNames: string[]): void;
1134
1201
  protected updateExistingEntityFieldsFromSchema(pool: CodeGenConnection, excludeSchemas: string[], entityIDs?: string[]): Promise<boolean>;
1135
1202
  /**
@@ -1170,6 +1237,8 @@ export declare class ManageMetadataBase {
1170
1237
  * @param pool
1171
1238
  * @param currentUser
1172
1239
  */
1240
+ LoadGeneratedCode(pool: CodeGenConnection, currentUser: UserInfo): Promise<boolean>;
1241
+ /** @deprecated Use {@link LoadGeneratedCode}. */
1173
1242
  loadGeneratedCode(pool: CodeGenConnection, currentUser: UserInfo): Promise<boolean>;
1174
1243
  private runValidationGeneration;
1175
1244
  /**
@@ -1182,7 +1251,66 @@ export declare class ManageMetadataBase {
1182
1251
  */
1183
1252
  protected generateValidatorFunctionFromCheckConstraint(data: any, allEntityFields: any[], currentUser: UserInfo, generateNewCode: boolean): Promise<ValidatorResult>;
1184
1253
  protected syncEntityFieldValues(ds: CodeGenConnection, entityFieldID: number, possibleValues: string[], allEntityFieldValues: any): Promise<boolean>;
1254
+ /**
1255
+ * Parses a column-level CHECK constraint into the list of values it permits, or returns null when the
1256
+ * constraint is not a simple value list (a range, a `LEN()` predicate, a mixed condition, and so on).
1257
+ *
1258
+ * Both of the ways `IN (...)` is rendered by SQL Server are handled. String, date and GUID literals come
1259
+ * back quoted — `([Status]='Active' OR [Status]='Inactive')` — but numeric and `bit` literals come back
1260
+ * **unquoted and parenthesized**: `([Level]=(3) OR [Level]=(2) OR [Level]=(1))`. Matching only the quoted
1261
+ * form left a numeric IN-list with no value list at all, and so no dropdown in Explorer either (#3978).
1262
+ * PostgreSQL's `= ANY (ARRAY[...])` rendering is handled separately, by parsePgArrayConstraint.
1263
+ *
1264
+ * A single-value list is captured too: `CHECK (Status='Active')` — which is also how SQL Server renders
1265
+ * `IN ('Active')` — permits exactly one value, which is a one-item list.
1266
+ *
1267
+ * This is a parser, not a policy: it reports what the constraint permits. WHICH fields get a value list
1268
+ * out of that is decided after the fact, by valueListForField.
1269
+ */
1185
1270
  protected parseCheckConstraintValues(constraintDefinition: string, fieldName: string, entityName: string): string[] | null;
1271
+ /**
1272
+ * The value list to actually store for a field, or null when a parsed list should NOT become
1273
+ * EntityFieldValue rows (and so should not become a dropdown in Explorer either).
1274
+ *
1275
+ * Runs AFTER parsing rather than gating it, so each exclusion is no broader than its own reason and
1276
+ * neither one can drop a list that was captured before #3978:
1277
+ *
1278
+ * - `bit`: `IN (0,1)` is vacuous — bit already permits exactly 0 and 1 — and `= 1` is a validator,
1279
+ * not a two-item dropdown over what renders as a checkbox. Every bit list is rendered unquoted, so
1280
+ * none of them was reachable before this change and nothing regresses.
1281
+ * - a PRIMARY KEY carrying a SINGLE value: `CHECK (ID=1)` is the single-row-table guard MJ's own
1282
+ * sequence tables use — a structural invariant, not a set of values a user picks from. A
1283
+ * MULTI-value list on a primary key is left alone: `CHECK (Code IN ('US','CA'))` on a natural-key
1284
+ * PK is a real domain list, it was captured before this change, and CodeGen also runs over customer
1285
+ * schemas where natural-key primary keys are ordinary.
1286
+ *
1287
+ * A field whose metadata row was not found keeps whatever parsed, which is the pre-#3978 behaviour.
1288
+ */
1289
+ protected static valueListForField(field: {
1290
+ Type?: string;
1291
+ IsPrimaryKey?: boolean;
1292
+ } | undefined, parsedValues: string[] | null): string[] | null;
1293
+ /**
1294
+ * Sorts a parsed value list in place, so the sequence a value gets is stable across databases and runs.
1295
+ * An all-numeric list is compared as numbers (1, 2, 10); anything else keeps the default lexical order.
1296
+ *
1297
+ * Keyed off the VALUES, not the column type — so a string column whose list happens to be all-numeric
1298
+ * (`CHECK (Code IN ('1','2','10'))` on nvarchar) would re-sequence too. Measured over every column CHECK
1299
+ * constraint in a live 6.x database (MJ core + BizApps accounting/orders): of the 431 lists the previous
1300
+ * parser already captured, ZERO re-sequence under this comparison. If one ever turns up and the churn is
1301
+ * unwanted, gate `allNumeric` on the field being numeric as well.
1302
+ */
1303
+ protected static sortCheckConstraintValues(values: string[]): string[];
1304
+ /**
1305
+ * A numeric literal as SQL Server renders it inside a CHECK constraint: parenthesized, unquoted, and
1306
+ * possibly signed, fractional or exponential — `(3)`, `(-1)`, `(1.00)`, `(2.5)`, `(1.0e+030)`.
1307
+ */
1308
+ private static readonly NUMERIC_CHECK_LITERAL;
1309
+ /**
1310
+ * Turns a matched numeric literal into the value to store: strips the wrapping parentheses, and the
1311
+ * trailing point SQL Server adds to a large integral literal (`(12345678901234567890.)`).
1312
+ */
1313
+ private static normalizeNumericCheckLiteral;
1186
1314
  /**
1187
1315
  * Parses PostgreSQL ANY (ARRAY[...]) CHECK constraint syntax.
1188
1316
  * PG's pg_get_constraintdef() returns constraints like:
@@ -1444,6 +1572,11 @@ export declare class ManageMetadataBase {
1444
1572
  * earlier in this run (which are not in metadata yet)
1445
1573
  * @returns the free name and the suffix used to reach it ('' when the name was already free)
1446
1574
  */
1575
+ ResolveUniqueEntityName(desiredName: string, schemaName: string, takenNames: string[]): {
1576
+ name: string;
1577
+ suffix: string;
1578
+ };
1579
+ /** @deprecated Use {@link ResolveUniqueEntityName}. */
1447
1580
  resolveUniqueEntityName(desiredName: string, schemaName: string, takenNames: string[]): {
1448
1581
  name: string;
1449
1582
  suffix: string;
@@ -1681,6 +1814,96 @@ export declare class ManageMetadataBase {
1681
1814
  newFieldNames: ReadonlySet<string>;
1682
1815
  typeReopenedNames: ReadonlySet<string>;
1683
1816
  }): void;
1817
+ /**
1818
+ * Build the two deterministic search-flag hygiene statements.
1819
+ *
1820
+ * These exist because the LLM-driven smart-field pipeline cannot be relied on to run at all:
1821
+ * `AdvancedGeneration.enabled` reads `enableAdvancedGeneration ?? false`, so on a default
1822
+ * configuration none of `applySearchableFieldUpdates` / `applyEntitySearchConfig` ever
1823
+ * executes — while every new entity is still INSERTed with `AllowUserSearchAPI = 1`
1824
+ * (see `createNewEntityInsertSQL`). The result is an entity flagged searchable with nothing
1825
+ * searchable on it, which is not a harmless default: `UserSearchString` against such an entity
1826
+ * is a documented no-op (MJ#4581/#4582), so the data provider ignores the term and returns the
1827
+ * UNFILTERED table. Global search then fans out to it on every keystroke and discards every row.
1828
+ *
1829
+ * Both statements are deterministic, need no model, and are safe to run on every pass:
1830
+ *
1831
+ * 1. **Seed** — an entity with NO searchable field gets its name-like columns flagged
1832
+ * (`NAME_LIKE_FIELD_NAMES`: Name, Title, FirstName, LastName, …). Those are what a person
1833
+ * types into a search box, so they are the one defensible default. Only fires when the
1834
+ * entity has nothing flagged at all, so it fills a gap rather than overriding anyone —
1835
+ * including the LLM, which has already run by this point when it is enabled.
1836
+ *
1837
+ * Note this keys on the field's NAME, not on `IsNameField`. That flag looks like the
1838
+ * obvious source and is the wrong one: measured against a real database, seeding from it
1839
+ * would flag 54 fields of which 41 are VIRTUAL — the denormalized FK display columns
1840
+ * CodeGen puts on views (`Action`, `Agent`, `Artifact`). Those are computed by JOIN, so a
1841
+ * LIKE against them cannot seek any index, and flagging them would push 49 junction
1842
+ * entities into the global-search fan-out with unindexable predicates — the exact cost
1843
+ * `search-guardrails.ts` exists to prevent. It also picked up identifiers (`RecordID`,
1844
+ * `Token`, `ExternalSystemRecordID`) and a `Description`, which `isNarrativeFieldName`
1845
+ * rejects on the LLM path. And it would still not have fixed `MJ: Employees`, whose only
1846
+ * `IsNameField` is the virtual `FirstLast`; keying on the name reaches its real
1847
+ * `FirstName` / `LastName` columns, which is what the reported bug needed.
1848
+ * 2. **Clear** — an entity STILL left with no searchable field has `AllowUserSearchAPI` turned
1849
+ * off, so it drops out of the search fan-out instead of contributing noise.
1850
+ *
1851
+ * Both honor the `AutoUpdate*` opt-outs, which is how an operator pins a hand-made decision —
1852
+ * and is exactly how the curated entries in `metadata/entities/.entity-search-exclusions.json`
1853
+ * protect themselves (they set `AutoUpdateAllowUserSearchAPI` to false alongside the flag).
1854
+ *
1855
+ * Full-text-search entities are exempt from both. An FTS entity is searchable through its
1856
+ * INDEX: `createViewUserSearchSQL` takes the full-text branch before it ever reads
1857
+ * `IncludeInUserSearchAPI`, so those flags are dead metadata there and the entity is a
1858
+ * perfectly valid search target without them.
1859
+ *
1860
+ * Written as `UPDATE ... WHERE <key> IN (subquery)` rather than `UPDATE ... FROM ... JOIN`,
1861
+ * which is T-SQL-only. The subquery form is ANSI and runs unchanged on both platforms.
1862
+ */
1863
+ protected buildSearchFlagHygieneSQL(excludeSchemas: string[]): {
1864
+ seedSQL: string;
1865
+ clearSQL: string;
1866
+ /** COUNT of the rows {@link seedSQL} would touch — see the compare-first note on the apply method. */
1867
+ seedProbeSQL: string;
1868
+ /** NAMES of the entities {@link clearSQL} would disable. Valid only AFTER the seed has run. */
1869
+ clearProbeSQL: string;
1870
+ };
1871
+ /**
1872
+ * Run the deterministic search-flag hygiene pass (see {@link buildSearchFlagHygieneSQL}).
1873
+ *
1874
+ * Runs OUTSIDE `applyAdvancedGeneration` and therefore regardless of whether advanced
1875
+ * generation is enabled — which is the whole point, since it is off by default and an entity
1876
+ * created under that default is exactly the one that needs this. Ordered after it so the
1877
+ * model's choices, when it did run, are already in place and the seed only fills a real gap.
1878
+ *
1879
+ * COMPARE FIRST, then write — the T20 contract every-run config writers are held to (see
1880
+ * `__tests__/idempotency/config-writers-compare-first.test.ts`). The two UPDATEs converge on
1881
+ * their own, because the first pass makes `noSearchableField` false for every row it touches,
1882
+ * so re-running them changes nothing. That is not sufficient: `LogSQLBatchAndExecute` writes
1883
+ * whatever it is handed into the run's `CodeGen_Run_*.sql` capture whether or not a row moves,
1884
+ * and the drift gate's warm-twice stage fails on ANY capture surviving a second run. Emitting
1885
+ * unconditionally therefore reddened the gate on every PR while the data was perfectly
1886
+ * idempotent — the data converged, the log did not. So each statement is emitted only when its
1887
+ * own candidate probe finds work.
1888
+ */
1889
+ protected applySearchFlagHygiene(pool: CodeGenConnection, excludeSchemas: string[]): Promise<boolean>;
1890
+ /**
1891
+ * Row count for one of the search-flag hygiene probes (see {@link applySearchFlagHygiene}).
1892
+ *
1893
+ * Reads the first column of the first row positionally rather than by name, because the alias
1894
+ * comes back cased differently across drivers. A probe that returns nothing is treated as no
1895
+ * work, which is the safe direction: the statement is skipped rather than emitted blind.
1896
+ */
1897
+ private searchFlagHygieneCandidateCount;
1898
+ /**
1899
+ * Names of the entities the clear would disable (see {@link applySearchFlagHygiene}).
1900
+ *
1901
+ * Valid only AFTER the seed has run, since seeding changes which entities still have nothing
1902
+ * searchable. Names rather than a count because this is the destructive half: the run output
1903
+ * is the only place an operator can see which entities lost search, and getting it back is
1904
+ * manual.
1905
+ */
1906
+ private searchFlagHygieneClearCandidates;
1684
1907
  /**
1685
1908
  * Returns true if the field is a sensible target for LIKE-based user search.
1686
1909
  * Mirrors the runtime guard in GenericDatabaseProvider.isTextSearchableType /
@@ -1836,7 +2059,7 @@ export declare class ManageMetadataBase {
1836
2059
  * @param isRecurringScript - if set to true tells the logger that the provided SQL represents a recurring script meaning it is something that is executed, generally, for all CodeGen runs. In these cases, the Config settings can result in omitting these recurring scripts from being logged because the configuration environment may have those recurring scripts already set to run after all run-specific migrations get run.
1837
2060
  * @returns - The result of the query execution.
1838
2061
  */
1839
- private LogSQLAndExecute;
2062
+ private logSQLAndExecute;
1840
2063
  /**
1841
2064
  * Logs and executes a sequence of SQL statements as a single batch.
1842
2065
  *
@@ -1853,6 +2076,6 @@ export declare class ManageMetadataBase {
1853
2076
  * Empty / whitespace-only statements are filtered out. Returns
1854
2077
  * `undefined` (no execution) when nothing remains.
1855
2078
  */
1856
- private LogSQLBatchAndExecute;
2079
+ private logSQLBatchAndExecute;
1857
2080
  }
1858
2081
  //# sourceMappingURL=manage-metadata.d.ts.map