@altimateai/altimate-core 0.3.1 → 0.5.0
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.
- package/index.d.ts +89 -2
- package/index.js +63 -54
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -396,6 +396,7 @@ export interface EquivalenceResult {
|
|
|
396
396
|
confidence: number
|
|
397
397
|
differences: EquivalenceDiff[]
|
|
398
398
|
output_compatible: boolean
|
|
399
|
+
decidable: boolean
|
|
399
400
|
validation_errors: string[]
|
|
400
401
|
}
|
|
401
402
|
|
|
@@ -894,8 +895,15 @@ export declare function analyzeMigration(sql: string, schema: Schema): Migration
|
|
|
894
895
|
/** Analyze SQL for anti-pattern tags using polyglot-sql-tags. */
|
|
895
896
|
export declare function analyzeTags(sql: string, dialect: string, skipTags?: Array<string> | undefined | null): any
|
|
896
897
|
|
|
897
|
-
/**
|
|
898
|
-
|
|
898
|
+
/**
|
|
899
|
+
* Check two SQL queries for semantic equivalence.
|
|
900
|
+
*
|
|
901
|
+
* `dialect` is an optional parsing-dialect hint (e.g. `"duckdb"`, `"snowflake"`,
|
|
902
|
+
* `"bigquery"`, `"postgres"`) that overrides the dialect declared on the schema.
|
|
903
|
+
* Pass it when comparing compiled warehouse SQL whose schema carries no dialect, so
|
|
904
|
+
* dialect-specific syntax parses and the pair is decidable instead of abstaining.
|
|
905
|
+
*/
|
|
906
|
+
export declare function checkEquivalence(sqlA: string, sqlB: string, schema: Schema, dialect?: string | undefined | null): Promise<EquivalenceResult>
|
|
899
907
|
|
|
900
908
|
/** Check SQL against policy guardrails. `policyJson` is a JSON string of PolicyConfig. */
|
|
901
909
|
export declare function checkPolicy(sql: string, schema: Schema, policyJson: string): Promise<PolicyResult>
|
|
@@ -934,6 +942,16 @@ export declare function complete(sql: string, cursorPos: number, schema: Schema)
|
|
|
934
942
|
/** Iterative correction protocol: propose-verify-refine loop. */
|
|
935
943
|
export declare function correct(sql: string, schema: Schema): Promise<CorrectionResult>
|
|
936
944
|
|
|
945
|
+
/** Diff two model versions' configs (the `*_change` rules, e.g. materialization flip). */
|
|
946
|
+
export declare function dbtConfigDiff(baseSql: string, headSql: string): string
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* dbt config/Jinja lint over a RAW model (parses `{{ config() }}` via minijinja).
|
|
950
|
+
* Returns JSON array of LintFindings (DBT001 incremental-no-guard, DBT002
|
|
951
|
+
* incremental-no-unique-key, DBT003 microbatch-lookahead, DBT004 contract, DBT005 var-no-default).
|
|
952
|
+
*/
|
|
953
|
+
export declare function dbtConfigLint(sql: string): string
|
|
954
|
+
|
|
937
955
|
/**
|
|
938
956
|
* Compute diff-aware column lineage between two SQL queries.
|
|
939
957
|
*
|
|
@@ -954,12 +972,25 @@ export declare function explain(sql: string, schema: Schema): Promise<Explanatio
|
|
|
954
972
|
/** Export schema as CREATE TABLE DDL statements. */
|
|
955
973
|
export declare function exportDdl(schema: Schema): string
|
|
956
974
|
|
|
975
|
+
/**
|
|
976
|
+
* Extract a model's grain key (final-SELECT GROUP BY + dedup PARTITION BY) from
|
|
977
|
+
* its compiled SQL, for grain-vs-declared-PK mismatch detection in PR review.
|
|
978
|
+
* Returns JSON: `{ "group_by": [...], "dedup_partition": [...] }`.
|
|
979
|
+
*/
|
|
980
|
+
export declare function extractGrain(sql: string): string
|
|
981
|
+
|
|
957
982
|
/** Extract metadata (tables, columns, functions) from SQL. */
|
|
958
983
|
export declare function extractMetadata(sql: string, dialect?: string | undefined | null): ExtractResult
|
|
959
984
|
|
|
960
985
|
/** Extract the output column names from a SQL SELECT list. */
|
|
961
986
|
export declare function extractOutputColumns(sql: string, dialect?: string | undefined | null): string[]
|
|
962
987
|
|
|
988
|
+
/**
|
|
989
|
+
* Per-upstream WHERE-filter columns of a model's SQL, for cross-model sibling
|
|
990
|
+
* filter-consistency. Returns JSON `{ "<upstream_table>": ["<filter col>", …] }`.
|
|
991
|
+
*/
|
|
992
|
+
export declare function extractSourceFilters(sql: string): string
|
|
993
|
+
|
|
963
994
|
/** Auto-fix SQL errors using fuzzy matching and iterative re-validation. */
|
|
964
995
|
export declare function fix(sql: string, schema: Schema, maxIterations?: number | undefined | null): Promise<FixResult>
|
|
965
996
|
|
|
@@ -996,6 +1027,21 @@ export declare function isSafe(sql: string): boolean
|
|
|
996
1027
|
/** Lint SQL for anti-patterns (SELECT *, missing WHERE, etc.). */
|
|
997
1028
|
export declare function lint(sql: string, schema: Schema): LintResult
|
|
998
1029
|
|
|
1030
|
+
/**
|
|
1031
|
+
* Lint `new_sql` and return ONLY findings introduced relative to `base_sql`.
|
|
1032
|
+
*
|
|
1033
|
+
* Pre-existing findings (present in `base_sql`) are removed via multiset
|
|
1034
|
+
* subtraction keyed on `(code, normalised_message)`, so line/column shifts
|
|
1035
|
+
* from reformatting do not cause false positives.
|
|
1036
|
+
*
|
|
1037
|
+
* `schema_context` — optional JSON string of a `SchemaDefinition` (same
|
|
1038
|
+
* format accepted by `Schema.fromJson`). Pass `null`/`undefined` to use a
|
|
1039
|
+
* dialect-agnostic empty schema.
|
|
1040
|
+
*
|
|
1041
|
+
* Returns a `LintResult` JSON object — same shape as `lint()`.
|
|
1042
|
+
*/
|
|
1043
|
+
export declare function lintDiff(newSql: string, baseSql: string, schemaContext?: string | undefined | null): LintResult
|
|
1044
|
+
|
|
999
1045
|
/** Optimize schema for context window (5-level progressive disclosure). */
|
|
1000
1046
|
export declare function optimizeContext(schema: Schema): ContextResult
|
|
1001
1047
|
|
|
@@ -1014,6 +1060,47 @@ export declare function resetSdk(): void
|
|
|
1014
1060
|
/** Resolve a business term to schema elements via fuzzy matching. */
|
|
1015
1061
|
export declare function resolveTerm(term: string, schema: Schema): GlossaryMatch
|
|
1016
1062
|
|
|
1063
|
+
/**
|
|
1064
|
+
* Parse raw LLM output from the AI reviewer into a JSON string of findings.
|
|
1065
|
+
*
|
|
1066
|
+
* `text` — raw model response (may contain `<think>` blocks, markdown fences, etc.)
|
|
1067
|
+
* `valid_files` — the set of file paths that appeared in the diff; findings for any
|
|
1068
|
+
* other path are dropped (the model hallucinated a path).
|
|
1069
|
+
*
|
|
1070
|
+
* Returns a JSON-serialized `Vec<AiReviewFinding>` — an array of objects, or `"[]"` if
|
|
1071
|
+
* nothing could be parsed. Matches the JSON-string convention used by `DataParitySession`
|
|
1072
|
+
* (`start()` / `step()` return strings) and by `exportDdl`.
|
|
1073
|
+
*/
|
|
1074
|
+
export declare function reviewAiParse(text: string, validFiles: Array<string>): string
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Return the AI reviewer system prompt string.
|
|
1078
|
+
*
|
|
1079
|
+
* The prompt is compiled into the binary from `altimate_core::review::AI_REVIEW_SYSTEM_PROMPT`.
|
|
1080
|
+
* Callers can embed this directly in LLM API calls without bundling any TypeScript assets.
|
|
1081
|
+
*/
|
|
1082
|
+
export declare function reviewAiSystemPrompt(): string
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Scan added diff lines for lexical portability issues.
|
|
1086
|
+
*
|
|
1087
|
+
* `added_lines` — the `+` lines from a SQL diff (without the leading `+`).
|
|
1088
|
+
*
|
|
1089
|
+
* Returns a JSON-serialized `Vec<LexicalFinding>` — an array of objects, or
|
|
1090
|
+
* `"[]"` if no issues are found. Each element has the shape:
|
|
1091
|
+
* `{"code":"LX01"|"LX02","rule":"...","severity":"info","message":"...","line":"..."}`.
|
|
1092
|
+
*
|
|
1093
|
+
* Results are deduplicated: the same reserved word or operator id across
|
|
1094
|
+
* multiple lines appears at most once in the output.
|
|
1095
|
+
*/
|
|
1096
|
+
export declare function reviewLexicalScan(addedLines: Array<string>): string
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* AST base-vs-head structural diff — the `*_change` SQL rules (DISTINCT/UNION flip,
|
|
1100
|
+
* GROUP BY grain, surrogate-key change, COALESCE removed, predicate removed, type narrowing).
|
|
1101
|
+
*/
|
|
1102
|
+
export declare function reviewStructuralDiff(baseSql: string, headSql: string): string
|
|
1103
|
+
|
|
1017
1104
|
/** Suggest query rewrites and optimizations. */
|
|
1018
1105
|
export declare function rewrite(sql: string, schema: Schema): RewriteResult
|
|
1019
1106
|
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@altimateai/altimate-core-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@altimateai/altimate-core-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
80
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@altimateai/altimate-core-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@altimateai/altimate-core-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
96
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@altimateai/altimate-core-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@altimateai/altimate-core-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
117
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@altimateai/altimate-core-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@altimateai/altimate-core-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
133
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@altimateai/altimate-core-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@altimateai/altimate-core-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@altimateai/altimate-core-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@altimateai/altimate-core-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
166
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@altimateai/altimate-core-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@altimateai/altimate-core-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
185
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@altimateai/altimate-core-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@altimateai/altimate-core-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
201
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@altimateai/altimate-core-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@altimateai/altimate-core-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
217
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@altimateai/altimate-core-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@altimateai/altimate-core-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
237
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@altimateai/altimate-core-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@altimateai/altimate-core-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
253
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@altimateai/altimate-core-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
274
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@altimateai/altimate-core-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
290
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@altimateai/altimate-core-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
308
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@altimateai/altimate-core-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
324
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@altimateai/altimate-core-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
342
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@altimateai/altimate-core-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
358
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@altimateai/altimate-core-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
376
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@altimateai/altimate-core-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
392
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@altimateai/altimate-core-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
410
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@altimateai/altimate-core-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
426
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@altimateai/altimate-core-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@altimateai/altimate-core-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@altimateai/altimate-core-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@altimateai/altimate-core-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@altimateai/altimate-core-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
479
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@altimateai/altimate-core-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@altimateai/altimate-core-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
495
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@altimateai/altimate-core-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@altimateai/altimate-core-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
511
|
+
if (bindingPackageVersion !== '0.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -581,11 +581,11 @@ module.exports = nativeBinding
|
|
|
581
581
|
// Catches stale platform binaries that load successfully but are missing
|
|
582
582
|
// functions added in newer versions. Without this, missing exports silently
|
|
583
583
|
// become `undefined` and produce cryptic "X is not a function" errors.
|
|
584
|
-
const _requiredExports = ["analyzeMigration","analyzeTags","checkEquivalence","checkPolicy","checkQueryPii","checkSemantics","classifyPii","columnLineage","compareQueries","complete","correct","diffLineage","diffSchemas","evaluate","explain","exportDdl","extractMetadata","extractOutputColumns","fix","flushSdk","formatSql","generateTests","getStatementTypes","importDdl","initSdk","introspectionSql","isSafe","lint","optimizeContext","optimizeForQuery","parseDbtProject","pruneSchema","resetSdk","resolveTerm","rewrite","scanSql","schemaFingerprint","trackLineage","transpile","validate"]
|
|
584
|
+
const _requiredExports = ["analyzeMigration","analyzeTags","checkEquivalence","checkPolicy","checkQueryPii","checkSemantics","classifyPii","columnLineage","compareQueries","complete","correct","dbtConfigDiff","dbtConfigLint","diffLineage","diffSchemas","evaluate","explain","exportDdl","extractGrain","extractMetadata","extractOutputColumns","extractSourceFilters","fix","flushSdk","formatSql","generateTests","getStatementTypes","importDdl","initSdk","introspectionSql","isSafe","lint","lintDiff","optimizeContext","optimizeForQuery","parseDbtProject","pruneSchema","resetSdk","resolveTerm","reviewAiParse","reviewAiSystemPrompt","reviewLexicalScan","reviewStructuralDiff","rewrite","scanSql","schemaFingerprint","trackLineage","transpile","validate"]
|
|
585
585
|
const _missing = _requiredExports.filter(name => typeof nativeBinding[name] !== 'function')
|
|
586
586
|
if (_missing.length > 0) {
|
|
587
587
|
throw new Error(
|
|
588
|
-
`@altimateai/altimate-core@0.
|
|
588
|
+
`@altimateai/altimate-core@0.5.0: platform binary is missing ${_missing.length} export(s): ` +
|
|
589
589
|
`${_missing.slice(0, 5).join(', ')}${_missing.length > 5 ? '...' : ''}. ` +
|
|
590
590
|
`The installed native binary may be from an older version. ` +
|
|
591
591
|
`Fix: delete node_modules and reinstall dependencies`
|
|
@@ -606,13 +606,17 @@ module.exports.columnLineage = nativeBinding.columnLineage
|
|
|
606
606
|
module.exports.compareQueries = nativeBinding.compareQueries
|
|
607
607
|
module.exports.complete = nativeBinding.complete
|
|
608
608
|
module.exports.correct = nativeBinding.correct
|
|
609
|
+
module.exports.dbtConfigDiff = nativeBinding.dbtConfigDiff
|
|
610
|
+
module.exports.dbtConfigLint = nativeBinding.dbtConfigLint
|
|
609
611
|
module.exports.diffLineage = nativeBinding.diffLineage
|
|
610
612
|
module.exports.diffSchemas = nativeBinding.diffSchemas
|
|
611
613
|
module.exports.evaluate = nativeBinding.evaluate
|
|
612
614
|
module.exports.explain = nativeBinding.explain
|
|
613
615
|
module.exports.exportDdl = nativeBinding.exportDdl
|
|
616
|
+
module.exports.extractGrain = nativeBinding.extractGrain
|
|
614
617
|
module.exports.extractMetadata = nativeBinding.extractMetadata
|
|
615
618
|
module.exports.extractOutputColumns = nativeBinding.extractOutputColumns
|
|
619
|
+
module.exports.extractSourceFilters = nativeBinding.extractSourceFilters
|
|
616
620
|
module.exports.fix = nativeBinding.fix
|
|
617
621
|
module.exports.flushSdk = nativeBinding.flushSdk
|
|
618
622
|
module.exports.formatSql = nativeBinding.formatSql
|
|
@@ -623,12 +627,17 @@ module.exports.initSdk = nativeBinding.initSdk
|
|
|
623
627
|
module.exports.introspectionSql = nativeBinding.introspectionSql
|
|
624
628
|
module.exports.isSafe = nativeBinding.isSafe
|
|
625
629
|
module.exports.lint = nativeBinding.lint
|
|
630
|
+
module.exports.lintDiff = nativeBinding.lintDiff
|
|
626
631
|
module.exports.optimizeContext = nativeBinding.optimizeContext
|
|
627
632
|
module.exports.optimizeForQuery = nativeBinding.optimizeForQuery
|
|
628
633
|
module.exports.parseDbtProject = nativeBinding.parseDbtProject
|
|
629
634
|
module.exports.pruneSchema = nativeBinding.pruneSchema
|
|
630
635
|
module.exports.resetSdk = nativeBinding.resetSdk
|
|
631
636
|
module.exports.resolveTerm = nativeBinding.resolveTerm
|
|
637
|
+
module.exports.reviewAiParse = nativeBinding.reviewAiParse
|
|
638
|
+
module.exports.reviewAiSystemPrompt = nativeBinding.reviewAiSystemPrompt
|
|
639
|
+
module.exports.reviewLexicalScan = nativeBinding.reviewLexicalScan
|
|
640
|
+
module.exports.reviewStructuralDiff = nativeBinding.reviewStructuralDiff
|
|
632
641
|
module.exports.rewrite = nativeBinding.rewrite
|
|
633
642
|
module.exports.scanSql = nativeBinding.scanSql
|
|
634
643
|
module.exports.schemaFingerprint = nativeBinding.schemaFingerprint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altimateai/altimate-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Type-check your SQL. No database required.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"test": "node --test validate-exports.test.js"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@altimateai/altimate-core-darwin-arm64": "0.
|
|
39
|
-
"@altimateai/altimate-core-darwin-x64": "0.
|
|
40
|
-
"@altimateai/altimate-core-linux-arm64-gnu": "0.
|
|
41
|
-
"@altimateai/altimate-core-linux-x64-gnu": "0.
|
|
42
|
-
"@altimateai/altimate-core-win32-x64-msvc": "0.
|
|
38
|
+
"@altimateai/altimate-core-darwin-arm64": "0.5.0",
|
|
39
|
+
"@altimateai/altimate-core-darwin-x64": "0.5.0",
|
|
40
|
+
"@altimateai/altimate-core-linux-arm64-gnu": "0.5.0",
|
|
41
|
+
"@altimateai/altimate-core-linux-x64-gnu": "0.5.0",
|
|
42
|
+
"@altimateai/altimate-core-win32-x64-msvc": "0.5.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@napi-rs/cli": "^3"
|