@memberjunction/sql-parser 0.0.1 → 5.14.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.
@@ -0,0 +1,2 @@
1
+ export { SQLParser, SQLTableReference, SQLColumnReference, SQLParseResult } from './sql-parser.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { SQLParser } from './sql-parser.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyD,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * A single table/view reference extracted from SQL.
3
+ */
4
+ export interface SQLTableReference {
5
+ /** The table or view name as it appears in SQL */
6
+ TableName: string;
7
+ /** The schema name, defaults to 'dbo' if unspecified */
8
+ SchemaName: string;
9
+ /** The alias used in the query, or the table name if no alias */
10
+ Alias: string;
11
+ }
12
+ /**
13
+ * A column reference extracted from SQL expressions.
14
+ */
15
+ export interface SQLColumnReference {
16
+ /** Column name */
17
+ ColumnName: string;
18
+ /** Table alias or name prefix, if qualified (e.g. "t" in "t.Name") */
19
+ TableQualifier: string | null;
20
+ }
21
+ /**
22
+ * Complete result of parsing a SQL statement for table and column references.
23
+ */
24
+ export interface SQLParseResult {
25
+ /** All table/view references found (FROM, JOIN, subqueries, CTEs) */
26
+ Tables: SQLTableReference[];
27
+ /** All column references found (SELECT, WHERE, JOIN ON, GROUP BY, ORDER BY) */
28
+ Columns: SQLColumnReference[];
29
+ /** Whether parsing succeeded via AST (true) or fell back to regex (false) */
30
+ UsedASTParsing: boolean;
31
+ }
32
+ /**
33
+ * Reusable SQL parsing utility that extracts table/view references and column references
34
+ * from SQL statements using node-sql-parser with a regex fallback.
35
+ *
36
+ * This class has no dependency on MJ Metadata — it returns raw parse results.
37
+ * Callers are responsible for cross-referencing against entity metadata.
38
+ */
39
+ export declare class SQLParser {
40
+ /**
41
+ * Parse a plain SQL statement and extract all table and column references.
42
+ * Uses AST parsing with the specified dialect, falls back to regex on failure.
43
+ * @param sql The SQL statement to parse
44
+ * @param dialect The SQL dialect to use for AST parsing (default: 'TransactSQL')
45
+ */
46
+ static Parse(sql: string, dialect?: string): SQLParseResult;
47
+ /**
48
+ * Parse a SQL statement that may contain Nunjucks template syntax.
49
+ * Pre-processes templates into valid SQL before parsing.
50
+ * @param sql The SQL statement to parse
51
+ * @param dialect The SQL dialect to use for AST parsing (default: 'TransactSQL')
52
+ */
53
+ static ParseWithTemplatePreprocessing(sql: string, dialect?: string): SQLParseResult;
54
+ /**
55
+ * Attempt to parse SQL via node-sql-parser AST.
56
+ * Returns null if parsing fails (caller should fall back to regex).
57
+ */
58
+ private static ParseViaAST;
59
+ /**
60
+ * Regex-based fallback for extracting table references from SQL.
61
+ * Less accurate than AST but handles edge cases where the parser fails.
62
+ */
63
+ private static ParseViaRegex;
64
+ /**
65
+ * Converts internal maps into the public SQLParseResult shape.
66
+ */
67
+ private static BuildResult;
68
+ /**
69
+ * Deduplicates table references by schema.table key, keeping distinct entries.
70
+ */
71
+ private static DeduplicateTables;
72
+ /**
73
+ * Converts raw column reference strings into structured SQLColumnReference objects.
74
+ */
75
+ private static ParseColumnRefs;
76
+ /**
77
+ * Recursively extracts table references and column references from SQL AST.
78
+ */
79
+ private static ExtractFromAST;
80
+ /**
81
+ * Extracts table information from a FROM clause item, handling tables and JOINs.
82
+ */
83
+ private static ExtractTableFromItem;
84
+ /**
85
+ * Extracts column references from an expression node.
86
+ * Also extracts tables from subqueries found in expressions (e.g., EXISTS, IN).
87
+ */
88
+ private static ExtractColumnReferences;
89
+ /**
90
+ * Pre-processes Nunjucks templates in SQL to create valid SQL for parsing.
91
+ * Replaces Nunjucks syntax with placeholder values.
92
+ */
93
+ private static PreProcessNunjucksForParsing;
94
+ /**
95
+ * Regex fallback for Nunjucks preprocessing when rendering fails.
96
+ */
97
+ private static PreProcessNunjucksViaRegex;
98
+ }
99
+ //# sourceMappingURL=sql-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-parser.d.ts","sourceRoot":"","sources":["../src/sql-parser.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,qEAAqE;IACrE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,+EAA+E;IAC/E,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,6EAA6E;IAC7E,cAAc,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,qBAAa,SAAS;IAClB;;;;;OAKG;WACW,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,cAAc;IAajF;;;;;OAKG;WACW,8BAA8B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,cAAc;IAS1G;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAmB1B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAoB5B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAU1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAqBhC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAoB9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IA8F7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IA6CnC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IA6CtC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAwB3C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;CAuB5C"}
@@ -0,0 +1,317 @@
1
+ import NodeSqlParser from 'node-sql-parser';
2
+ const { Parser } = NodeSqlParser;
3
+ import * as nunjucks from 'nunjucks';
4
+ /**
5
+ * Reusable SQL parsing utility that extracts table/view references and column references
6
+ * from SQL statements using node-sql-parser with a regex fallback.
7
+ *
8
+ * This class has no dependency on MJ Metadata — it returns raw parse results.
9
+ * Callers are responsible for cross-referencing against entity metadata.
10
+ */
11
+ export class SQLParser {
12
+ /**
13
+ * Parse a plain SQL statement and extract all table and column references.
14
+ * Uses AST parsing with the specified dialect, falls back to regex on failure.
15
+ * @param sql The SQL statement to parse
16
+ * @param dialect The SQL dialect to use for AST parsing (default: 'TransactSQL')
17
+ */
18
+ static Parse(sql, dialect = 'TransactSQL') {
19
+ if (!sql || sql.trim().length === 0) {
20
+ return { Tables: [], Columns: [], UsedASTParsing: false };
21
+ }
22
+ const astResult = SQLParser.ParseViaAST(sql, dialect);
23
+ if (astResult) {
24
+ return astResult;
25
+ }
26
+ return SQLParser.ParseViaRegex(sql);
27
+ }
28
+ /**
29
+ * Parse a SQL statement that may contain Nunjucks template syntax.
30
+ * Pre-processes templates into valid SQL before parsing.
31
+ * @param sql The SQL statement to parse
32
+ * @param dialect The SQL dialect to use for AST parsing (default: 'TransactSQL')
33
+ */
34
+ static ParseWithTemplatePreprocessing(sql, dialect = 'TransactSQL') {
35
+ if (!sql || sql.trim().length === 0) {
36
+ return { Tables: [], Columns: [], UsedASTParsing: false };
37
+ }
38
+ const processedSQL = SQLParser.PreProcessNunjucksForParsing(sql);
39
+ return SQLParser.Parse(processedSQL, dialect);
40
+ }
41
+ /**
42
+ * Attempt to parse SQL via node-sql-parser AST.
43
+ * Returns null if parsing fails (caller should fall back to regex).
44
+ */
45
+ static ParseViaAST(sql, dialect) {
46
+ try {
47
+ const parser = new Parser();
48
+ const ast = parser.astify(sql, { database: dialect });
49
+ const tableAliasMap = new Map();
50
+ const columnRefs = new Set();
51
+ const statements = Array.isArray(ast) ? ast : [ast];
52
+ for (const statement of statements) {
53
+ SQLParser.ExtractFromAST(statement, tableAliasMap, columnRefs);
54
+ }
55
+ return SQLParser.BuildResult(tableAliasMap, columnRefs, true);
56
+ }
57
+ catch {
58
+ return null;
59
+ }
60
+ }
61
+ /**
62
+ * Regex-based fallback for extracting table references from SQL.
63
+ * Less accurate than AST but handles edge cases where the parser fails.
64
+ */
65
+ static ParseViaRegex(sql) {
66
+ const tableAliasMap = new Map();
67
+ const tablePattern = /(?:FROM|JOIN|INTO)\s+(?:\[?(\w+)\]?\.)?\[?(\w+)\]?(?:\s+(?:AS\s+)?(\w+))?/gi;
68
+ const matches = [...sql.matchAll(tablePattern)];
69
+ for (const match of matches) {
70
+ const schemaName = match[1] || 'dbo';
71
+ const tableName = match[2];
72
+ const alias = match[3] || tableName;
73
+ const key = alias;
74
+ if (!tableAliasMap.has(key)) {
75
+ tableAliasMap.set(key, { schemaName, tableName });
76
+ }
77
+ }
78
+ // Regex can't reliably extract column references, return empty
79
+ return SQLParser.BuildResult(tableAliasMap, new Set(), false);
80
+ }
81
+ /**
82
+ * Converts internal maps into the public SQLParseResult shape.
83
+ */
84
+ static BuildResult(tableAliasMap, columnRefs, usedAST) {
85
+ const tables = SQLParser.DeduplicateTables(tableAliasMap);
86
+ const columns = SQLParser.ParseColumnRefs(columnRefs);
87
+ return { Tables: tables, Columns: columns, UsedASTParsing: usedAST };
88
+ }
89
+ /**
90
+ * Deduplicates table references by schema.table key, keeping distinct entries.
91
+ */
92
+ static DeduplicateTables(tableAliasMap) {
93
+ const seen = new Set();
94
+ const tables = [];
95
+ for (const [alias, info] of tableAliasMap) {
96
+ const key = `${info.schemaName.toLowerCase()}.${info.tableName.toLowerCase()}`;
97
+ if (!seen.has(key)) {
98
+ seen.add(key);
99
+ tables.push({
100
+ TableName: info.tableName,
101
+ SchemaName: info.schemaName,
102
+ Alias: alias
103
+ });
104
+ }
105
+ }
106
+ return tables;
107
+ }
108
+ /**
109
+ * Converts raw column reference strings into structured SQLColumnReference objects.
110
+ */
111
+ static ParseColumnRefs(columnRefs) {
112
+ const columns = [];
113
+ for (const ref of columnRefs) {
114
+ const dotIndex = ref.lastIndexOf('.');
115
+ if (dotIndex >= 0) {
116
+ columns.push({
117
+ ColumnName: ref.substring(dotIndex + 1),
118
+ TableQualifier: ref.substring(0, dotIndex)
119
+ });
120
+ }
121
+ else {
122
+ columns.push({ ColumnName: ref, TableQualifier: null });
123
+ }
124
+ }
125
+ return columns;
126
+ }
127
+ // ─────────────────────────────────────────────────────
128
+ // AST Walking (moved from MJQueryEntityServer)
129
+ // ─────────────────────────────────────────────────────
130
+ /**
131
+ * Recursively extracts table references and column references from SQL AST.
132
+ */
133
+ static ExtractFromAST(node, tableAliasMap, referencedColumns) {
134
+ if (!node || typeof node !== 'object')
135
+ return;
136
+ // Handle CTEs (WITH clause)
137
+ if (node.with) {
138
+ const ctes = Array.isArray(node.with) ? node.with : [node.with];
139
+ for (const cte of ctes) {
140
+ const cteRecord = cte;
141
+ if (cteRecord.stmt) {
142
+ const stmtRecord = cteRecord.stmt;
143
+ const cteAst = (stmtRecord.ast || stmtRecord);
144
+ SQLParser.ExtractFromAST(cteAst, tableAliasMap, referencedColumns);
145
+ }
146
+ }
147
+ }
148
+ // Extract FROM clause tables (including JOINs)
149
+ if (node.from) {
150
+ const fromItems = Array.isArray(node.from) ? node.from : [node.from];
151
+ for (const fromItem of fromItems) {
152
+ SQLParser.ExtractTableFromItem(fromItem, tableAliasMap, referencedColumns);
153
+ }
154
+ }
155
+ // Extract column references from SELECT
156
+ if (node.columns) {
157
+ const cols = Array.isArray(node.columns) ? node.columns : [node.columns];
158
+ for (const col of cols) {
159
+ if (col === '*')
160
+ continue;
161
+ const colRecord = col;
162
+ if (colRecord.expr) {
163
+ SQLParser.ExtractColumnReferences(colRecord.expr, referencedColumns, tableAliasMap);
164
+ }
165
+ }
166
+ }
167
+ // Extract column references from WHERE
168
+ if (node.where) {
169
+ SQLParser.ExtractColumnReferences(node.where, referencedColumns, tableAliasMap);
170
+ }
171
+ // Extract column references from GROUP BY
172
+ if (node.groupby) {
173
+ const groupbyRecord = node.groupby;
174
+ const groupItems = groupbyRecord.columns || node.groupby;
175
+ const items = Array.isArray(groupItems) ? groupItems : [groupItems];
176
+ for (const group of items) {
177
+ SQLParser.ExtractColumnReferences(group, referencedColumns, tableAliasMap);
178
+ }
179
+ }
180
+ // Extract column references from ORDER BY
181
+ if (node.orderby) {
182
+ const orders = Array.isArray(node.orderby) ? node.orderby : [node.orderby];
183
+ for (const order of orders) {
184
+ const orderRecord = order;
185
+ SQLParser.ExtractColumnReferences((orderRecord.expr || orderRecord), referencedColumns, tableAliasMap);
186
+ }
187
+ }
188
+ // Handle UNION/INTERSECT/EXCEPT
189
+ if (node._next) {
190
+ SQLParser.ExtractFromAST(node._next, tableAliasMap, referencedColumns);
191
+ }
192
+ }
193
+ /**
194
+ * Extracts table information from a FROM clause item, handling tables and JOINs.
195
+ */
196
+ static ExtractTableFromItem(fromItem, tableAliasMap, referencedColumns) {
197
+ if (!fromItem)
198
+ return;
199
+ // Direct table reference
200
+ if (fromItem.table) {
201
+ const alias = (fromItem.as || fromItem.table);
202
+ tableAliasMap.set(alias, {
203
+ schemaName: fromItem.db || 'dbo',
204
+ tableName: fromItem.table
205
+ });
206
+ }
207
+ // Handle subqueries in FROM (derived tables)
208
+ if (fromItem.expr) {
209
+ const exprRecord = fromItem.expr;
210
+ const subqueryAst = (exprRecord.ast || exprRecord);
211
+ SQLParser.ExtractFromAST(subqueryAst, tableAliasMap, referencedColumns);
212
+ }
213
+ // Extract column references from ON conditions
214
+ if (fromItem.on) {
215
+ SQLParser.ExtractColumnReferences(fromItem.on, referencedColumns, tableAliasMap);
216
+ }
217
+ // Handle USING clause
218
+ if (fromItem.using) {
219
+ const usings = Array.isArray(fromItem.using) ? fromItem.using : [fromItem.using];
220
+ for (const col of usings) {
221
+ if (typeof col === 'string') {
222
+ referencedColumns.add(col);
223
+ }
224
+ else if (col && typeof col === 'object' && 'column' in col) {
225
+ referencedColumns.add(col.column);
226
+ }
227
+ }
228
+ }
229
+ }
230
+ /**
231
+ * Extracts column references from an expression node.
232
+ * Also extracts tables from subqueries found in expressions (e.g., EXISTS, IN).
233
+ */
234
+ static ExtractColumnReferences(expr, referencedColumns, tableAliasMap) {
235
+ if (!expr || typeof expr !== 'object')
236
+ return;
237
+ if (expr.type === 'column_ref') {
238
+ const colName = expr.table ? `${expr.table}.${expr.column}` : expr.column;
239
+ referencedColumns.add(colName);
240
+ }
241
+ // Handle subqueries in expressions (EXISTS, IN, scalar subqueries)
242
+ if (expr.ast && tableAliasMap) {
243
+ SQLParser.ExtractFromAST(expr.ast, tableAliasMap, referencedColumns);
244
+ }
245
+ // Recursively process nested expressions
246
+ if (expr.left) {
247
+ SQLParser.ExtractColumnReferences(expr.left, referencedColumns, tableAliasMap);
248
+ }
249
+ if (expr.right) {
250
+ SQLParser.ExtractColumnReferences(expr.right, referencedColumns, tableAliasMap);
251
+ }
252
+ if (expr.args) {
253
+ const argsRecord = expr.args;
254
+ const args = argsRecord.value || expr.args;
255
+ const argList = Array.isArray(args) ? args : [args];
256
+ for (const arg of argList) {
257
+ SQLParser.ExtractColumnReferences(arg, referencedColumns, tableAliasMap);
258
+ }
259
+ }
260
+ if (expr.expr) {
261
+ SQLParser.ExtractColumnReferences(expr.expr, referencedColumns, tableAliasMap);
262
+ }
263
+ }
264
+ // ─────────────────────────────────────────────────────
265
+ // Nunjucks Preprocessing (moved from MJQueryEntityServer)
266
+ // ─────────────────────────────────────────────────────
267
+ /**
268
+ * Pre-processes Nunjucks templates in SQL to create valid SQL for parsing.
269
+ * Replaces Nunjucks syntax with placeholder values.
270
+ */
271
+ static PreProcessNunjucksForParsing(sql) {
272
+ const env = new nunjucks.Environment(null, {
273
+ autoescape: false,
274
+ throwOnUndefined: false
275
+ });
276
+ // Add placeholder filters that return safe SQL values
277
+ env.addFilter('sqlString', () => "'placeholder'");
278
+ env.addFilter('sqlNumber', () => '0');
279
+ env.addFilter('sqlDate', () => "'2000-01-01'");
280
+ env.addFilter('sqlIn', () => "('placeholder')");
281
+ env.addFilter('sqlIdentifier', (val) => val || 'placeholder');
282
+ env.addFilter('sqlNoKeywordsExpression', (val) => val || 'placeholder');
283
+ env.addFilter('default', (val, defaultVal) => val || defaultVal || 'placeholder');
284
+ env.addFilter('safe', (val) => val || 'placeholder');
285
+ env.addFilter('dump', (val) => JSON.stringify(val || {}));
286
+ try {
287
+ return env.renderString(sql, {});
288
+ }
289
+ catch {
290
+ return SQLParser.PreProcessNunjucksViaRegex(sql);
291
+ }
292
+ }
293
+ /**
294
+ * Regex fallback for Nunjucks preprocessing when rendering fails.
295
+ */
296
+ static PreProcessNunjucksViaRegex(sql) {
297
+ let processed = sql;
298
+ // Replace {{ variable | filter }} patterns
299
+ processed = processed.replace(/\{\{\s*[\w.]+\s*\|\s*sqlString\s*\}\}/g, "'placeholder'");
300
+ processed = processed.replace(/\{\{\s*[\w.]+\s*\|\s*sqlNumber\s*\}\}/g, '0');
301
+ processed = processed.replace(/\{\{\s*[\w.]+\s*\|\s*sqlDate\s*\}\}/g, "'2000-01-01'");
302
+ processed = processed.replace(/\{\{\s*[\w.]+\s*\|\s*sqlIn\s*\}\}/g, "('placeholder')");
303
+ processed = processed.replace(/\{\{\s*[\w.]+\s*\|\s*sqlIdentifier\s*\}\}/g, 'placeholder');
304
+ processed = processed.replace(/\{\{\s*[\w.]+\s*[^}]*\}\}/g, "'placeholder'");
305
+ // Remove block tags but keep content between them
306
+ processed = processed.replace(/\{%\s*if\s+[^%]+%\}/g, '');
307
+ processed = processed.replace(/\{%\s*endif\s*%\}/g, '');
308
+ processed = processed.replace(/\{%\s*else\s*%\}/g, '');
309
+ processed = processed.replace(/\{%\s*elif\s+[^%]+%\}/g, '');
310
+ processed = processed.replace(/\{%\s*for\s+[^%]+%\}/g, '');
311
+ processed = processed.replace(/\{%\s*endfor\s*%\}/g, '');
312
+ processed = processed.replace(/\{%\s*set\s+[^%]+%\}/g, '');
313
+ processed = processed.replace(/\{#[^#]*#\}/g, ''); // Comments
314
+ return processed;
315
+ }
316
+ }
317
+ //# sourceMappingURL=sql-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-parser.js","sourceRoot":"","sources":["../src/sql-parser.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAoCrC;;;;;;GAMG;AACH,MAAM,OAAO,SAAS;IAClB;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,GAAW,EAAE,UAAkB,aAAa;QAC5D,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;QAC9D,CAAC;QAED,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAED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F,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,4CAA4C,EAAE,aAAa,CAAC,CAAC;QAC3F,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;QAE7E,kDAAkD;QAClD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;QAC1D,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;QACxD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QACvD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QAC5D,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;QAC3D,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;QACzD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;QAC3D,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW;QAE9D,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,10 +1,32 @@
1
1
  {
2
2
  "name": "@memberjunction/sql-parser",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @memberjunction/sql-parser",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
3
+ "type": "module",
4
+ "version": "5.14.0",
5
+ "description": "MemberJunction: SQL parsing utilities — table/column extraction with AST and regex fallback",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "/dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc && tsc-alias -f",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "test:coverage": "vitest run --coverage"
16
+ },
17
+ "author": "MemberJunction.com",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "node-sql-parser": "^5.4.0",
21
+ "nunjucks": "^3.2.4"
22
+ },
23
+ "devDependencies": {
24
+ "@types/nunjucks": "^3.2.6",
25
+ "typescript": "^5.9.3",
26
+ "vitest": "^3.1.1"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/MemberJunction/MJ"
31
+ }
10
32
  }
package/README.md DELETED
@@ -1,45 +0,0 @@
1
- # @memberjunction/sql-parser
2
-
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
4
-
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
6
-
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
8
-
9
- ## Purpose
10
-
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@memberjunction/sql-parser`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
15
-
16
- ## What is OIDC Trusted Publishing?
17
-
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
-
20
- ## Setup Instructions
21
-
22
- To properly configure OIDC trusted publishing for this package:
23
-
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
-
29
- ## DO NOT USE THIS PACKAGE
30
-
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**