@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
@@ -1 +1 @@
1
- {"version":3,"file":"search-guardrails.d.ts","sourceRoot":"","sources":["../../src/Database/search-guardrails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM/D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAIhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAG9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAIhF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAItE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,SAAS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I,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAU9E;AAED,4DAA4D;AAC5D,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACjD,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAClD,6BAA6B,EAAE,MAAM,CAAC;CACzC,GAAG,MAAM,GAAG,IAAI,CAchB;AAED,8DAA8D;AAC9D,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACjD,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAClD,6BAA6B,EAAE,MAAM,CAAC;CACzC,GAAG,MAAM,GAAG,IAAI,CAEhB"}
@@ -43,7 +43,7 @@ export const MAX_SEARCHABLE_FIELDS_PER_ENTITY = 3;
43
43
  * unfairly, an operator can set `AutoUpdateIncludeInUserSearchAPI=0`
44
44
  * on that field to opt out of LLM-driven flips.
45
45
  */
46
- export function isNarrativeFieldName(fieldName) {
46
+ export function IsNarrativeFieldName(fieldName) {
47
47
  if (!fieldName)
48
48
  return false;
49
49
  const exact = /^(Comments?|Notes?|Description|Bio|Body|Memo|Summary|Content|Remarks?|Details)$/i;
@@ -52,24 +52,55 @@ export function isNarrativeFieldName(fieldName) {
52
52
  const suffix = /(Comment|Note|Description|Bio|Body|Memo|Summary|Content|Remark)s?$/i;
53
53
  return suffix.test(fieldName);
54
54
  }
55
+ /** @deprecated Use {@link IsNarrativeFieldName}. */
56
+ export function isNarrativeFieldName(fieldName) {
57
+ return IsNarrativeFieldName(fieldName);
58
+ }
55
59
  /**
56
60
  * Identifier-shaped field names — values users type in full, where `Exact`
57
61
  * is the right predicate by default.
58
62
  */
59
- export function isIdentifierFieldName(fieldName) {
63
+ export function IsIdentifierFieldName(fieldName) {
60
64
  if (!fieldName)
61
65
  return false;
62
66
  return /^(Email|SKU|SSN|ISBN|ZipCode|PostalCode|Phone(Number)?|.+(Number|Code|ID))$/i.test(fieldName)
63
67
  && !/^ID$/i.test(fieldName); // bare "ID" is the PK, not an identifier
64
68
  }
69
+ /** @deprecated Use {@link IsIdentifierFieldName}. */
70
+ export function isIdentifierFieldName(fieldName) {
71
+ return IsIdentifierFieldName(fieldName);
72
+ }
73
+ /**
74
+ * The field names considered "name-like": human-readable labels a person types into a search
75
+ * box, as opposed to identifiers they type in full or narrative text they never type at all.
76
+ *
77
+ * Exported as data, not just as the predicate below, because the deterministic search-flag
78
+ * hygiene pass needs the same set inside generated SQL (`buildSearchFlagHygieneSQL`) where a
79
+ * JavaScript regex cannot run. One list, two consumers — so the SQL cannot drift from the
80
+ * predicate the LLM path applies.
81
+ */
82
+ export const NAME_LIKE_FIELD_NAMES = [
83
+ 'Name',
84
+ 'Title',
85
+ 'FirstName',
86
+ 'LastName',
87
+ 'MiddleName',
88
+ 'DisplayName',
89
+ 'FullName',
90
+ 'Label',
91
+ ];
65
92
  /**
66
93
  * Name-like field names — human-readable prefixes where `BeginsWith` is the
67
94
  * right predicate by default.
68
95
  */
69
- export function isNameLikeFieldName(fieldName) {
96
+ export function IsNameLikeFieldName(fieldName) {
70
97
  if (!fieldName)
71
98
  return false;
72
- return /^(Name|Title|FirstName|LastName|MiddleName|DisplayName|FullName|Label)$/i.test(fieldName);
99
+ return new RegExp(`^(${NAME_LIKE_FIELD_NAMES.join('|')})$`, 'i').test(fieldName);
100
+ }
101
+ /** @deprecated Use {@link IsNameLikeFieldName}. */
102
+ export function isNameLikeFieldName(fieldName) {
103
+ return IsNameLikeFieldName(fieldName);
73
104
  }
74
105
  /**
75
106
  * Match entity names that are detail / line-item / step / param / mapping
@@ -80,23 +111,31 @@ export function isNameLikeFieldName(fieldName) {
80
111
  * want to false-positive on entities like `Stepford Cities` (silly example,
81
112
  * but the principle holds).
82
113
  */
83
- export function isDetailOrLineItemEntity(entityName) {
114
+ export function IsDetailOrLineItemEntity(entityName) {
84
115
  if (!entityName)
85
116
  return false;
86
117
  const n = entityName.trim();
87
118
  return /(\b|\s)(Details?|Lines?|Items?|Steps?|Params?|Mappings?)$/i.test(n);
88
119
  }
120
+ /** @deprecated Use {@link IsDetailOrLineItemEntity}. */
121
+ export function isDetailOrLineItemEntity(entityName) {
122
+ return IsDetailOrLineItemEntity(entityName);
123
+ }
89
124
  /**
90
125
  * Default predicate for a searchable field when the LLM didn't supply one
91
126
  * (or supplied an inappropriate `Contains` we had to reject).
92
127
  */
93
- export function defaultPredicateFor(fieldName) {
94
- if (isIdentifierFieldName(fieldName))
128
+ export function DefaultPredicateFor(fieldName) {
129
+ if (IsIdentifierFieldName(fieldName))
95
130
  return 'Exact';
96
- if (isNameLikeFieldName(fieldName))
131
+ if (IsNameLikeFieldName(fieldName))
97
132
  return 'BeginsWith';
98
133
  return 'BeginsWith';
99
134
  }
135
+ /** @deprecated Use {@link DefaultPredicateFor}. */
136
+ export function defaultPredicateFor(fieldName) {
137
+ return DefaultPredicateFor(fieldName);
138
+ }
100
139
  /**
101
140
  * Normalize a single LLM-proposed predicate against the field context.
102
141
  *
@@ -109,26 +148,30 @@ export function defaultPredicateFor(fieldName) {
109
148
  * - If the LLM didn't propose a predicate at all (or proposed one we
110
149
  * rejected), fall back to `defaultPredicateFor()`.
111
150
  */
112
- export function normalizePredicate(opts) {
151
+ export function NormalizePredicate(opts) {
113
152
  const { fieldName, proposed, isInFullTextSearchFields, entityFullTextSearchEnabled } = opts;
114
153
  if (proposed === 'Contains') {
115
154
  const ftsEligible = isInFullTextSearchFields && entityFullTextSearchEnabled;
116
155
  if (ftsEligible) {
117
156
  return { predicate: 'Contains', rewritten: false };
118
157
  }
119
- return { predicate: defaultPredicateFor(fieldName), rewritten: true };
158
+ return { predicate: DefaultPredicateFor(fieldName), rewritten: true };
120
159
  }
121
160
  if (proposed === 'Exact' || proposed === 'EndsWith' || proposed === 'BeginsWith') {
122
161
  return { predicate: proposed, rewritten: false };
123
162
  }
124
- return { predicate: defaultPredicateFor(fieldName), rewritten: false };
163
+ return { predicate: DefaultPredicateFor(fieldName), rewritten: false };
164
+ }
165
+ /** @deprecated Use {@link NormalizePredicate}. */
166
+ export function normalizePredicate(opts) {
167
+ return NormalizePredicate(opts);
125
168
  }
126
169
  /**
127
170
  * Per-entity cap. Given an already-eligible list of field names (PK / type /
128
171
  * narrative guardrails have already run), trim to the configured cap,
129
172
  * preferring name-like and identifier-shaped fields over ambiguous matches.
130
173
  */
131
- export function applySearchableFieldsCap(eligibleFieldNames) {
174
+ export function ApplySearchableFieldsCap(eligibleFieldNames) {
132
175
  if (eligibleFieldNames.length <= MAX_SEARCHABLE_FIELDS_PER_ENTITY) {
133
176
  return { accepted: [...eligibleFieldNames], dropped: [] };
134
177
  }
@@ -137,7 +180,7 @@ export function applySearchableFieldsCap(eligibleFieldNames) {
137
180
  const ranked = eligibleFieldNames.map((name, idx) => ({
138
181
  name,
139
182
  idx,
140
- rank: isNameLikeFieldName(name) ? 0 : isIdentifierFieldName(name) ? 1 : 2,
183
+ rank: IsNameLikeFieldName(name) ? 0 : IsIdentifierFieldName(name) ? 1 : 2,
141
184
  }));
142
185
  ranked.sort((a, b) => a.rank - b.rank || a.idx - b.idx);
143
186
  const accepted = ranked.slice(0, MAX_SEARCHABLE_FIELDS_PER_ENTITY).map(r => r.name);
@@ -145,6 +188,10 @@ export function applySearchableFieldsCap(eligibleFieldNames) {
145
188
  const dropped = eligibleFieldNames.filter(n => !acceptedSet.has(n));
146
189
  return { accepted, dropped };
147
190
  }
191
+ /** @deprecated Use {@link ApplySearchableFieldsCap}. */
192
+ export function applySearchableFieldsCap(eligibleFieldNames) {
193
+ return ApplySearchableFieldsCap(eligibleFieldNames);
194
+ }
148
195
  /**
149
196
  * First-pass cleanup of the raw LLM result, applied immediately after the
150
197
  * model returns. Catches contradictory shapes the LLM occasionally emits.
@@ -157,7 +204,7 @@ export function applySearchableFieldsCap(eligibleFieldNames) {
157
204
  *
158
205
  * Returns a NEW object (does not mutate the input).
159
206
  */
160
- export function normalizeSmartFieldResultShape(result) {
207
+ export function NormalizeSmartFieldResultShape(result) {
161
208
  const out = { ...result };
162
209
  const fields = Array.isArray(out.searchableFields) ? out.searchableFields : [];
163
210
  // Dedupe while preserving order.
@@ -180,13 +227,17 @@ export function normalizeSmartFieldResultShape(result) {
180
227
  }
181
228
  return out;
182
229
  }
230
+ /** @deprecated Use {@link NormalizeSmartFieldResultShape}. */
231
+ export function normalizeSmartFieldResultShape(result) {
232
+ return NormalizeSmartFieldResultShape(result);
233
+ }
183
234
  /**
184
235
  * Heuristic: does the entity name match an audit / log / run-history /
185
236
  * change-tracking shape? Mirrors the existing `isLikelyLogOrAuditEntity`
186
237
  * heuristic on `ManageMetadataBase` so callers outside the class (e.g.
187
238
  * tests) can ask the same question without having to subclass.
188
239
  */
189
- export function isLikelyLogOrAuditEntityName(name) {
240
+ export function IsLikelyLogOrAuditEntityName(name) {
190
241
  if (!name)
191
242
  return false;
192
243
  const n = name.trim();
@@ -204,6 +255,10 @@ export function isLikelyLogOrAuditEntityName(name) {
204
255
  return true;
205
256
  return false;
206
257
  }
258
+ /** @deprecated Use {@link IsLikelyLogOrAuditEntityName}. */
259
+ export function isLikelyLogOrAuditEntityName(name) {
260
+ return IsLikelyLogOrAuditEntityName(name);
261
+ }
207
262
  /**
208
263
  * Decide whether an LLM-proposed entity-level enable (0 → 1 flip on
209
264
  * `AllowUserSearchAPI`) should be allowed through. Returns a reason string
@@ -215,19 +270,23 @@ export function isLikelyLogOrAuditEntityName(name) {
215
270
  * - entity is NOT log/audit-shaped
216
271
  * - entity is NOT detail/line-item-shaped
217
272
  */
218
- export function entityLevelEnableBlockedReason(opts) {
273
+ export function EntityLevelEnableBlockedReason(opts) {
219
274
  if (opts.confidence !== 'high') {
220
275
  return `confidence is '${opts.confidence ?? 'unknown'}' (need 'high')`;
221
276
  }
222
277
  if (opts.acceptedSearchableFieldsCount < 1) {
223
278
  return 'no searchable fields survived guardrails';
224
279
  }
225
- if (isLikelyLogOrAuditEntityName(opts.entityName)) {
280
+ if (IsLikelyLogOrAuditEntityName(opts.entityName)) {
226
281
  return 'entity name matches log/audit/run-history shape';
227
282
  }
228
- if (isDetailOrLineItemEntity(opts.entityName)) {
283
+ if (IsDetailOrLineItemEntity(opts.entityName)) {
229
284
  return 'entity name matches detail/line-item/step/param/mapping shape';
230
285
  }
231
286
  return null;
232
287
  }
288
+ /** @deprecated Use {@link EntityLevelEnableBlockedReason}. */
289
+ export function entityLevelEnableBlockedReason(opts) {
290
+ return EntityLevelEnableBlockedReason(opts);
291
+ }
233
292
  //# sourceMappingURL=search-guardrails.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-guardrails.js","sourceRoot":"","sources":["../../src/Database/search-guardrails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IAClD,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7B,MAAM,KAAK,GAAG,kFAAkF,CAAC;IACjG,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,MAAM,MAAM,GAAG,qEAAqE,CAAC;IACrF,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACnD,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7B,OAAO,8EAA8E,CAAC,IAAI,CAAC,SAAS,CAAC;WAC9F,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,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,UAAU,KAAK,MAAM,EAAE,CAAC;QAC7B,OAAO,kBAAkB,IAAI,CAAC,UAAU,IAAI,SAAS,iBAAiB,CAAC;IAC3E,CAAC;IACD,IAAI,IAAI,CAAC,6BAA6B,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,0CAA0C,CAAC;IACtD,CAAC;IACD,IAAI,4BAA4B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAChD,OAAO,iDAAiD,CAAC;IAC7D,CAAC;IACD,IAAI,wBAAwB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5C,OAAO,+DAA+D,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,8BAA8B,CAAC,IAI9C;IACG,OAAO,8BAA8B,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC"}
@@ -31,12 +31,16 @@ export declare class SQLUtilityBase {
31
31
  * @param schema
32
32
  * @param objectName
33
33
  */
34
+ GetDBObjectFileName(type: 'view' | 'sp' | 'function' | 'full_text_search_function' | 'index', schema: string, objectName: string, isPermissions: boolean, isGenerated: boolean): string;
35
+ /** @deprecated Use {@link GetDBObjectFileName}. */
34
36
  getDBObjectFileName(type: 'view' | 'sp' | 'function' | 'full_text_search_function' | 'index', schema: string, objectName: string, isPermissions: boolean, isGenerated: boolean): string;
35
37
  /**
36
38
  * This method will build a two dimensional array of EntityInfo objects. The first dimension of the array is the level of the entity in the dependency tree.
37
39
  * The second dimension of the array is the entities at that level. The entities at each level are NOT dependent on any other entity in that level or any level below it.
38
40
  * This method uses the foreign key information witin the Entity Fields array to find these dependencies. self-referencing foreign keys are ignored.
39
41
  */
42
+ BuildEntityLevelsTree(entities: EntityInfo[]): EntityInfo[][];
43
+ /** @deprecated Use {@link BuildEntityLevelsTree}. */
40
44
  buildEntityLevelsTree(entities: EntityInfo[]): EntityInfo[][];
41
45
  /**
42
46
  * Emits the cyclical-dependency warning for buildEntityLevelsTree's stuck branch. Rather than dumping every
@@ -51,9 +55,17 @@ export declare class SQLUtilityBase {
51
55
  * (they are also excluded from the dependency map upstream).
52
56
  */
53
57
  private describeCycleEdges;
58
+ RecompileAllBaseViews(ds: CodeGenConnection, excludeSchemas: string[], applyPermissions: boolean, excludeEntities?: string[]): Promise<boolean>;
59
+ /** @deprecated Use {@link RecompileAllBaseViews}. */
54
60
  recompileAllBaseViews(ds: CodeGenConnection, excludeSchemas: string[], applyPermissions: boolean, excludeEntities?: string[]): Promise<boolean>;
61
+ GetBaseViewFiles(entity: EntityInfo): string[];
62
+ /** @deprecated Use {@link GetBaseViewFiles}. */
55
63
  getBaseViewFiles(entity: EntityInfo): string[];
64
+ CombineMultipleSQLFiles(files: string[]): string;
65
+ /** @deprecated Use {@link CombineMultipleSQLFiles}. */
56
66
  combineMultipleSQLFiles(files: string[]): string;
67
+ RecompileSingleBaseView(ds: CodeGenConnection, entity: EntityInfo, applyPermissions: boolean): Promise<boolean>;
68
+ /** @deprecated Use {@link RecompileSingleBaseView}. */
57
69
  recompileSingleBaseView(ds: CodeGenConnection, entity: EntityInfo, applyPermissions: boolean): Promise<boolean>;
58
70
  /**
59
71
  * Identifies which entities had views that failed to refresh by checking if their base views are still valid
@@ -77,10 +89,18 @@ export declare class SQLUtilityBase {
77
89
  * @throws Error when `MJ_CODEGEN_STRICT_VIEW_REGEN=true` and any regeneration failed
78
90
  */
79
91
  private regenerateFailedBaseViews;
92
+ ExecuteSQLFiles(filePaths: string[], outputMessages: boolean): Promise<boolean>;
93
+ /** @deprecated Use {@link ExecuteSQLFiles}. */
80
94
  executeSQLFiles(filePaths: string[], outputMessages: boolean): Promise<boolean>;
81
95
  private static _batchScriptCounter;
96
+ ExecuteSQLFile(filePath: string): Promise<boolean>;
97
+ /** @deprecated Use {@link ExecuteSQLFile}. */
82
98
  executeSQLFile(filePath: string): Promise<boolean>;
99
+ ExecuteBatchSQLScript(scriptText: string): Promise<boolean>;
100
+ /** @deprecated Use {@link ExecuteBatchSQLScript}. */
83
101
  executeBatchSQLScript(scriptText: string): Promise<boolean>;
102
+ ExecuteSQLScript(ds: CodeGenConnection, scriptText: string, inChunks: boolean): Promise<boolean>;
103
+ /** @deprecated Use {@link ExecuteSQLScript}. */
84
104
  executeSQLScript(ds: CodeGenConnection, scriptText: string, inChunks: boolean): Promise<boolean>;
85
105
  }
86
106
  //# sourceMappingURL=sql.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../src/Database/sql.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAKvF,OAAO,gDAAgD,CAAC;AAYxD;;GAEG;AACH,qBAAa,cAAc;IAC3B,OAAO,CAAC,WAAW,CAAwC;IAE3D;;;;;;;;;;OAUG;IACH,SAAS,KAAK,UAAU,IAAI,uBAAuB,CAgBlD;IAED;;;;;;;;;;;;OAYG;IACI,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,2BAA2B,GAAG,OAAO,EAC/D,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,OAAO,EACtB,WAAW,EAAE,OAAO,GAAG,MAAM;IAUjE;;;;OAIG;IACI,qBAAqB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,EAAE;IAgEpE;;;;;OAKG;IACH,OAAO,CAAC,gCAAgC;IAexC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAiBb,qBAAqB,CAAC,EAAE,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IA+FpJ,gBAAgB,CAAC,MAAM,EAAE,UAAU,GA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5H,uDAAuD;IAC1C,uBAAuB,CAAC,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5H;;;;;OAKG;YACW,2BAA2B;IAmBzC;;;;;;;;;;;;;OAaG;YACW,yBAAyB;IAwD1B,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAY5F,+CAA+C;IAClC,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5F,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAa;IAClC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/D,8CAA8C;IACjC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlD,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBxE,qDAAqD;IACxC,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D,gBAAgB,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAe9G,gDAAgD;IACnC,gBAAgB,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAG9G"}
@@ -1,4 +1,4 @@
1
- import { logError, logMessage } from "../Misc/status_logging.js";
1
+ import { logError, LogMessage } from "../Misc/status_logging.js";
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
4
  import { Metadata } from "@memberjunction/core";
@@ -8,14 +8,14 @@ import { CodeGenDatabaseProvider } from './codeGenDatabaseProvider.js';
8
8
  // `ClassFactory.CreateInstance(CodeGenDatabaseProvider, 'sqlserver')` returns nothing
9
9
  // and the SS code path silently fails.
10
10
  import './providers/sqlserver/SQLServerCodeGenProvider.js';
11
- import { configInfo, outputDir } from "../Config/config.js";
11
+ import { configInfo, OutputDir } from "../Config/config.js";
12
12
  import { ManageMetadataBase } from "../Database/manage-metadata.js";
13
13
  import { FindTrueCycles } from "./entity-level-tree-cycles.js";
14
14
  import { MJGlobal } from "@memberjunction/global";
15
15
  import { SQLCodeGenBase } from './sql_codegen.js';
16
16
  import * as crypto from 'crypto';
17
17
  import { mkdirSync } from "fs";
18
- import { attemptDeleteFile, logIf } from "../Misc/util.js";
18
+ import { AttemptDeleteFile, LogIf } from "../Misc/util.js";
19
19
  /**
20
20
  * Base class for SQL Utility functions, you can sub-class this class to create your own SQL Utility functions/override existing functionality.
21
21
  */
@@ -59,7 +59,7 @@ export class SQLUtilityBase {
59
59
  * @param schema
60
60
  * @param objectName
61
61
  */
62
- getDBObjectFileName(type, schema, objectName, isPermissions, isGenerated) {
62
+ GetDBObjectFileName(type, schema, objectName, isPermissions, isGenerated) {
63
63
  let extraText = '';
64
64
  switch (type) {
65
65
  case 'full_text_search_function':
@@ -68,12 +68,16 @@ export class SQLUtilityBase {
68
68
  }
69
69
  return path.join(schema, `${objectName}.${type}${extraText}${isPermissions ? '.permissions' : ''}${isGenerated ? '.generated' : ''}.sql`);
70
70
  }
71
+ /** @deprecated Use {@link GetDBObjectFileName}. */
72
+ getDBObjectFileName(type, schema, objectName, isPermissions, isGenerated) {
73
+ return this.GetDBObjectFileName(type, schema, objectName, isPermissions, isGenerated);
74
+ }
71
75
  /**
72
76
  * This method will build a two dimensional array of EntityInfo objects. The first dimension of the array is the level of the entity in the dependency tree.
73
77
  * The second dimension of the array is the entities at that level. The entities at each level are NOT dependent on any other entity in that level or any level below it.
74
78
  * This method uses the foreign key information witin the Entity Fields array to find these dependencies. self-referencing foreign keys are ignored.
75
79
  */
76
- buildEntityLevelsTree(entities) {
80
+ BuildEntityLevelsTree(entities) {
77
81
  const entityLevelTree = [];
78
82
  const entityMap = new Map();
79
83
  const dependencyMap = new Map();
@@ -125,6 +129,10 @@ export class SQLUtilityBase {
125
129
  }
126
130
  return entityLevelTree;
127
131
  }
132
+ /** @deprecated Use {@link BuildEntityLevelsTree}. */
133
+ buildEntityLevelsTree(entities) {
134
+ return this.BuildEntityLevelsTree(entities);
135
+ }
128
136
  /**
129
137
  * Emits the cyclical-dependency warning for buildEntityLevelsTree's stuck branch. Rather than dumping every
130
138
  * remaining entity's dependency list (most of which are merely downstream of a cycle), this computes the true
@@ -165,11 +173,11 @@ export class SQLUtilityBase {
165
173
  }
166
174
  return edges;
167
175
  }
168
- async recompileAllBaseViews(ds, excludeSchemas, applyPermissions, excludeEntities) {
176
+ async RecompileAllBaseViews(ds, excludeSchemas, applyPermissions, excludeEntities) {
169
177
  let bSuccess = true; // start off true
170
178
  const md = new Metadata(); // global-provider-ok: codegen runs offline against a single provider
171
179
  // Build the dependency order tree, provide ALL entities for this process
172
- const entityLevelTree = this.buildEntityLevelsTree(md.Entities);
180
+ const entityLevelTree = this.BuildEntityLevelsTree(md.Entities);
173
181
  // Process each level sequentially, but entities within a level in parallel
174
182
  for (const level of entityLevelTree) {
175
183
  // now filter out each LEVEL to only include entities that are not needed for recompilation
@@ -223,13 +231,13 @@ export class SQLUtilityBase {
223
231
  }
224
232
  }
225
233
  // Execute the initial refresh attempts (custom views + generated views together)
226
- bSuccess = await this.executeSQLScript(ds, sqlCommand, false) && bSuccess;
234
+ bSuccess = await this.ExecuteSQLScript(ds, sqlCommand, false) && bSuccess;
227
235
  // Now check which CodeGen-OWNED views failed to refresh and regenerate them. A fully custom
228
236
  // view is not in this list — we can't regenerate one. A layered entity IS, because the view
229
237
  // CodeGen writes for it is the inner one, and `GeneratedViewName` resolves to exactly that.
230
238
  const failedEntities = await this.identifyFailedViewRefreshes(ds, [...l, ...layeredEntities]);
231
239
  if (failedEntities.length > 0) {
232
- logMessage(`Detected ${failedEntities.length} views that failed to refresh. Attempting to regenerate view definitions...`, 'Info');
240
+ LogMessage(`Detected ${failedEntities.length} views that failed to refresh. Attempting to regenerate view definitions...`, 'Info');
233
241
  // Regenerate the failed views using the SQL CodeGen approach
234
242
  const regenerateSuccess = await this.regenerateFailedBaseViews(ds, failedEntities);
235
243
  if (!regenerateSuccess) {
@@ -245,15 +253,19 @@ export class SQLUtilityBase {
245
253
  }
246
254
  return bSuccess;
247
255
  }
248
- getBaseViewFiles(entity) {
256
+ /** @deprecated Use {@link RecompileAllBaseViews}. */
257
+ async recompileAllBaseViews(ds, excludeSchemas, applyPermissions, excludeEntities) {
258
+ return this.RecompileAllBaseViews(ds, excludeSchemas, applyPermissions, excludeEntities);
259
+ }
260
+ GetBaseViewFiles(entity) {
249
261
  const files = [];
250
262
  // The VIEW file holds what CodeGen wrote — the inner view for a layered entity. The PERMISSIONS
251
263
  // file targets the PUBLIC view, because that is the object consumers read.
252
264
  const isGenerated = entity.BaseViewGenerated || entity.HasLayeredBaseView;
253
- const baseViewFile = this.getDBObjectFileName('view', entity.SchemaName, entity.GeneratedViewName, false, isGenerated);
254
- const baseViewPermissionsFile = this.getDBObjectFileName('view', entity.SchemaName, entity.BaseView, true, isGenerated);
255
- const baseViewFilePath = path.join(outputDir('SQL', true), baseViewFile);
256
- const baseViewPermissionsFilePath = path.join(outputDir('SQL', true), baseViewPermissionsFile);
265
+ const baseViewFile = this.GetDBObjectFileName('view', entity.SchemaName, entity.GeneratedViewName, false, isGenerated);
266
+ const baseViewPermissionsFile = this.GetDBObjectFileName('view', entity.SchemaName, entity.BaseView, true, isGenerated);
267
+ const baseViewFilePath = path.join(OutputDir('SQL', true), baseViewFile);
268
+ const baseViewPermissionsFilePath = path.join(OutputDir('SQL', true), baseViewPermissionsFile);
257
269
  if (fs.existsSync(baseViewFilePath)) {
258
270
  files.push(baseViewFile);
259
271
  }
@@ -262,10 +274,14 @@ export class SQLUtilityBase {
262
274
  }
263
275
  return files;
264
276
  }
265
- combineMultipleSQLFiles(files) {
277
+ /** @deprecated Use {@link GetBaseViewFiles}. */
278
+ getBaseViewFiles(entity) {
279
+ return this.GetBaseViewFiles(entity);
280
+ }
281
+ CombineMultipleSQLFiles(files) {
266
282
  let combinedSQL = "";
267
283
  for (const file of files) {
268
- const filePath = path.join(outputDir('SQL', true), file);
284
+ const filePath = path.join(OutputDir('SQL', true), file);
269
285
  if (fs.existsSync(filePath)) {
270
286
  combinedSQL += (combinedSQL.length === 0 ? "" : "\n\nGO\n\n") + fs.readFileSync(filePath, 'utf-8');
271
287
  }
@@ -275,13 +291,17 @@ export class SQLUtilityBase {
275
291
  }
276
292
  return combinedSQL;
277
293
  }
278
- async recompileSingleBaseView(ds, entity, applyPermissions) {
294
+ /** @deprecated Use {@link CombineMultipleSQLFiles}. */
295
+ combineMultipleSQLFiles(files) {
296
+ return this.CombineMultipleSQLFiles(files);
297
+ }
298
+ async RecompileSingleBaseView(ds, entity, applyPermissions) {
279
299
  try {
280
300
  if (!this.dbProvider.NeedsViewRefresh) {
281
301
  return true;
282
302
  }
283
303
  const refreshSQL = this.dbProvider.generateViewRefreshSQL(entity.SchemaName, entity.BaseView);
284
- await this.executeSQLScript(ds, refreshSQL, false);
304
+ await this.ExecuteSQLScript(ds, refreshSQL, false);
285
305
  return true;
286
306
  }
287
307
  catch (e) {
@@ -289,6 +309,10 @@ export class SQLUtilityBase {
289
309
  return false;
290
310
  }
291
311
  }
312
+ /** @deprecated Use {@link RecompileSingleBaseView}. */
313
+ async recompileSingleBaseView(ds, entity, applyPermissions) {
314
+ return this.RecompileSingleBaseView(ds, entity, applyPermissions);
315
+ }
292
316
  /**
293
317
  * Identifies which entities had views that failed to refresh by checking if their base views are still valid
294
318
  * @param ds DataSource for database queries
@@ -306,7 +330,7 @@ export class SQLUtilityBase {
306
330
  await ds.query(testQuery);
307
331
  }
308
332
  catch (e) {
309
- logMessage(`View ${entity.SchemaName}.${entity.GeneratedViewName} is invalid and will be regenerated`, 'Warning');
333
+ LogMessage(`View ${entity.SchemaName}.${entity.GeneratedViewName} is invalid and will be regenerated`, 'Warning');
310
334
  failedEntities.push(entity);
311
335
  }
312
336
  }
@@ -339,7 +363,7 @@ export class SQLUtilityBase {
339
363
  const willRegenerate = new Set(entities.map(e => `${e.SchemaName}.${e.GeneratedViewName}`));
340
364
  for (const entity of entities) {
341
365
  try {
342
- logMessage(`Regenerating base view for ${entity.Name}...`, 'Info');
366
+ LogMessage(`Regenerating base view for ${entity.Name}...`, 'Info');
343
367
  // Generate the new view definition using the CodeGen approach
344
368
  const viewSQL = await sqlCodeGen.generateBaseView(ds, entity);
345
369
  // Route through the provider's dialect-specific fast path when present
@@ -349,9 +373,9 @@ export class SQLUtilityBase {
349
373
  await this.dbProvider.regenerateBaseView(entity, viewSQL, willRegenerate);
350
374
  }
351
375
  else {
352
- await this.executeSQLScript(ds, viewSQL, false);
376
+ await this.ExecuteSQLScript(ds, viewSQL, false);
353
377
  }
354
- logMessage(`Successfully regenerated base view for ${entity.Name}`, 'Info');
378
+ LogMessage(`Successfully regenerated base view for ${entity.Name}`, 'Info');
355
379
  }
356
380
  catch (e) {
357
381
  logError(`Failed to regenerate base view for ${entity.Name}: ${e}`);
@@ -373,10 +397,10 @@ export class SQLUtilityBase {
373
397
  }
374
398
  return failures.length === 0;
375
399
  }
376
- async executeSQLFiles(filePaths, outputMessages) {
400
+ async ExecuteSQLFiles(filePaths, outputMessages) {
377
401
  for (const filePath of filePaths) {
378
402
  const startTime = Date.now();
379
- if (!await this.executeSQLFile(filePath))
403
+ if (!await this.ExecuteSQLFile(filePath))
380
404
  return false;
381
405
  const endTime = Date.now();
382
406
  if (outputMessages)
@@ -384,11 +408,19 @@ export class SQLUtilityBase {
384
408
  }
385
409
  return true;
386
410
  }
411
+ /** @deprecated Use {@link ExecuteSQLFiles}. */
412
+ async executeSQLFiles(filePaths, outputMessages) {
413
+ return this.ExecuteSQLFiles(filePaths, outputMessages);
414
+ }
387
415
  static { this._batchScriptCounter = 0; }
388
- async executeSQLFile(filePath) {
416
+ async ExecuteSQLFile(filePath) {
389
417
  return this.dbProvider.executeSQLFileViaShell(filePath);
390
418
  }
391
- async executeBatchSQLScript(scriptText) {
419
+ /** @deprecated Use {@link ExecuteSQLFile}. */
420
+ async executeSQLFile(filePath) {
421
+ return this.ExecuteSQLFile(filePath);
422
+ }
423
+ async ExecuteBatchSQLScript(scriptText) {
392
424
  try {
393
425
  if (!scriptText || scriptText.length === 0)
394
426
  return true; // nothing to do
@@ -398,10 +430,10 @@ export class SQLUtilityBase {
398
430
  mkdirSync(tempDir, { recursive: true });
399
431
  const scriptFilePath = path.join(tempDir, uniqueFileName);
400
432
  fs.writeFileSync(scriptFilePath, scriptText);
401
- logIf(configInfo.verboseOutput, `Executing batch SQL script: ${scriptFilePath}`);
402
- await this.executeSQLFile(scriptFilePath);
433
+ LogIf(configInfo.verboseOutput, `Executing batch SQL script: ${scriptFilePath}`);
434
+ await this.ExecuteSQLFile(scriptFilePath);
403
435
  // Remove the temporary file
404
- attemptDeleteFile(scriptFilePath, 3, 2000); // don't await this, just fire and forget
436
+ AttemptDeleteFile(scriptFilePath, 3, 2000); // don't await this, just fire and forget
405
437
  return true;
406
438
  }
407
439
  catch (error) {
@@ -409,17 +441,25 @@ export class SQLUtilityBase {
409
441
  return false;
410
442
  }
411
443
  }
412
- async executeSQLScript(ds, scriptText, inChunks) {
444
+ /** @deprecated Use {@link ExecuteBatchSQLScript}. */
445
+ async executeBatchSQLScript(scriptText) {
446
+ return this.ExecuteBatchSQLScript(scriptText);
447
+ }
448
+ async ExecuteSQLScript(ds, scriptText, inChunks) {
413
449
  try {
414
450
  if (!scriptText || scriptText.length == 0)
415
451
  return true; // nothing to do
416
- logIf(configInfo.verboseOutput, `Executing SQL Script: ${scriptText?.length > 100 ? scriptText.substring(0, 100) + '...' : scriptText}`);
417
- return this.executeBatchSQLScript(scriptText);
452
+ LogIf(configInfo.verboseOutput, `Executing SQL Script: ${scriptText?.length > 100 ? scriptText.substring(0, 100) + '...' : scriptText}`);
453
+ return this.ExecuteBatchSQLScript(scriptText);
418
454
  }
419
455
  catch (e) {
420
456
  logError(e);
421
457
  return false;
422
458
  }
423
459
  }
460
+ /** @deprecated Use {@link ExecuteSQLScript}. */
461
+ async executeSQLScript(ds, scriptText, inChunks) {
462
+ return this.ExecuteSQLScript(ds, scriptText, inChunks);
463
+ }
424
464
  }
425
465
  //# sourceMappingURL=sql.js.map