@memberjunction/query-gen 0.0.1 → 2.126.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.
- package/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +34 -0
- package/COORDINATOR.md +768 -0
- package/IMPLEMENTATION_PLAN.md +1753 -0
- package/LLM_ENTITY_GROUPING_PLAN.md +977 -0
- package/README.md +675 -29
- package/dist/cli/commands/export.d.ts +15 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +178 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +19 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +282 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +17 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +193 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/config.d.ts +51 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +142 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +57 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/EntityGrouper.d.ts +74 -0
- package/dist/core/EntityGrouper.d.ts.map +1 -0
- package/dist/core/EntityGrouper.js +246 -0
- package/dist/core/EntityGrouper.js.map +1 -0
- package/dist/core/MetadataExporter.d.ts +59 -0
- package/dist/core/MetadataExporter.d.ts.map +1 -0
- package/dist/core/MetadataExporter.js +151 -0
- package/dist/core/MetadataExporter.js.map +1 -0
- package/dist/core/QueryDatabaseWriter.d.ts +50 -0
- package/dist/core/QueryDatabaseWriter.d.ts.map +1 -0
- package/dist/core/QueryDatabaseWriter.js +152 -0
- package/dist/core/QueryDatabaseWriter.js.map +1 -0
- package/dist/core/QueryFixer.d.ts +48 -0
- package/dist/core/QueryFixer.d.ts.map +1 -0
- package/dist/core/QueryFixer.js +115 -0
- package/dist/core/QueryFixer.js.map +1 -0
- package/dist/core/QueryRefiner.d.ts +94 -0
- package/dist/core/QueryRefiner.d.ts.map +1 -0
- package/dist/core/QueryRefiner.js +267 -0
- package/dist/core/QueryRefiner.js.map +1 -0
- package/dist/core/QueryTester.d.ts +70 -0
- package/dist/core/QueryTester.d.ts.map +1 -0
- package/dist/core/QueryTester.js +243 -0
- package/dist/core/QueryTester.js.map +1 -0
- package/dist/core/QueryWriter.d.ts +57 -0
- package/dist/core/QueryWriter.d.ts.map +1 -0
- package/dist/core/QueryWriter.js +184 -0
- package/dist/core/QueryWriter.js.map +1 -0
- package/dist/core/QuestionGenerator.d.ts +58 -0
- package/dist/core/QuestionGenerator.d.ts.map +1 -0
- package/dist/core/QuestionGenerator.js +145 -0
- package/dist/core/QuestionGenerator.js.map +1 -0
- package/dist/data/schema.d.ts +230 -0
- package/dist/data/schema.d.ts.map +1 -0
- package/dist/data/schema.js +6 -0
- package/dist/data/schema.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/PromptNames.d.ts +32 -0
- package/dist/prompts/PromptNames.d.ts.map +1 -0
- package/dist/prompts/PromptNames.js +35 -0
- package/dist/prompts/PromptNames.js.map +1 -0
- package/dist/utils/category-builder.d.ts +28 -0
- package/dist/utils/category-builder.d.ts.map +1 -0
- package/dist/utils/category-builder.js +90 -0
- package/dist/utils/category-builder.js.map +1 -0
- package/dist/utils/entity-helpers.d.ts +49 -0
- package/dist/utils/entity-helpers.d.ts.map +1 -0
- package/dist/utils/entity-helpers.js +189 -0
- package/dist/utils/entity-helpers.js.map +1 -0
- package/dist/utils/error-handlers.d.ts +19 -0
- package/dist/utils/error-handlers.d.ts.map +1 -0
- package/dist/utils/error-handlers.js +41 -0
- package/dist/utils/error-handlers.js.map +1 -0
- package/dist/utils/graph-helpers.d.ts +51 -0
- package/dist/utils/graph-helpers.d.ts.map +1 -0
- package/dist/utils/graph-helpers.js +82 -0
- package/dist/utils/graph-helpers.js.map +1 -0
- package/dist/utils/prompt-helpers.d.ts +25 -0
- package/dist/utils/prompt-helpers.d.ts.map +1 -0
- package/dist/utils/prompt-helpers.js +66 -0
- package/dist/utils/prompt-helpers.js.map +1 -0
- package/dist/utils/query-helpers.d.ts +23 -0
- package/dist/utils/query-helpers.d.ts.map +1 -0
- package/dist/utils/query-helpers.js +34 -0
- package/dist/utils/query-helpers.js.map +1 -0
- package/dist/utils/user-helpers.d.ts +15 -0
- package/dist/utils/user-helpers.d.ts.map +1 -0
- package/dist/utils/user-helpers.js +32 -0
- package/dist/utils/user-helpers.js.map +1 -0
- package/dist/vectors/EmbeddingService.d.ts +58 -0
- package/dist/vectors/EmbeddingService.d.ts.map +1 -0
- package/dist/vectors/EmbeddingService.js +90 -0
- package/dist/vectors/EmbeddingService.js.map +1 -0
- package/dist/vectors/SimilaritySearch.d.ts +51 -0
- package/dist/vectors/SimilaritySearch.d.ts.map +1 -0
- package/dist/vectors/SimilaritySearch.js +85 -0
- package/dist/vectors/SimilaritySearch.js.map +1 -0
- package/docs/API.md +1040 -0
- package/docs/ARCHITECTURE.md +1120 -0
- package/examples/advanced-usage.ts +401 -0
- package/examples/basic-usage.ts +285 -0
- package/package.json +48 -6
- package/src/cli/commands/export.ts +173 -0
- package/src/cli/commands/generate.ts +330 -0
- package/src/cli/commands/validate.ts +185 -0
- package/src/cli/config.ts +203 -0
- package/src/cli/index.ts +63 -0
- package/src/core/EntityGrouper.ts +318 -0
- package/src/core/MetadataExporter.ts +148 -0
- package/src/core/QueryDatabaseWriter.ts +187 -0
- package/src/core/QueryFixer.ts +153 -0
- package/src/core/QueryRefiner.ts +382 -0
- package/src/core/QueryTester.ts +264 -0
- package/src/core/QueryWriter.ts +239 -0
- package/src/core/QuestionGenerator.ts +199 -0
- package/src/data/golden-queries.json +1371 -0
- package/src/data/schema.ts +252 -0
- package/src/index.ts +49 -0
- package/src/prompts/PromptNames.ts +36 -0
- package/src/utils/category-builder.ts +97 -0
- package/src/utils/entity-helpers.ts +203 -0
- package/src/utils/error-handlers.ts +41 -0
- package/src/utils/graph-helpers.ts +99 -0
- package/src/utils/prompt-helpers.ts +79 -0
- package/src/utils/query-helpers.ts +32 -0
- package/src/utils/user-helpers.ts +39 -0
- package/src/vectors/EmbeddingService.ts +109 -0
- package/src/vectors/SimilaritySearch.ts +108 -0
- package/tsconfig.json +39 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QueryGen package main entry point
|
|
3
|
+
*
|
|
4
|
+
* @memberjunction/query-gen
|
|
5
|
+
*
|
|
6
|
+
* AI-powered generation of domain-specific SQL query templates with
|
|
7
|
+
* automatic testing, refinement, and metadata export.
|
|
8
|
+
*/
|
|
9
|
+
export { EntityGrouper } from './core/EntityGrouper';
|
|
10
|
+
export { QuestionGenerator } from './core/QuestionGenerator';
|
|
11
|
+
export { QueryWriter } from './core/QueryWriter';
|
|
12
|
+
export { QueryTester } from './core/QueryTester';
|
|
13
|
+
export { QueryFixer } from './core/QueryFixer';
|
|
14
|
+
export { QueryRefiner } from './core/QueryRefiner';
|
|
15
|
+
export { MetadataExporter } from './core/MetadataExporter';
|
|
16
|
+
export { QueryDatabaseWriter } from './core/QueryDatabaseWriter';
|
|
17
|
+
export { SimilaritySearch } from './vectors/SimilaritySearch';
|
|
18
|
+
export { EmbeddingService } from './vectors/EmbeddingService';
|
|
19
|
+
export * from './data/schema';
|
|
20
|
+
export * from './prompts/PromptNames';
|
|
21
|
+
export { QueryGenConfig, loadConfig } from './cli/config';
|
|
22
|
+
export { generateCommand } from './cli/commands/generate';
|
|
23
|
+
export { validateCommand } from './cli/commands/validate';
|
|
24
|
+
export { exportCommand } from './cli/commands/export';
|
|
25
|
+
export { extractErrorMessage, requireValue, getPropertyOrDefault } from './utils/error-handlers';
|
|
26
|
+
export { formatEntityMetadataForPrompt, formatEntityGroupForPrompt, findEntityById, getPrimaryKeyFields, getForeignKeyFields, hasRelationships, getRelationshipCount } from './utils/entity-helpers';
|
|
27
|
+
export { generateQueryName } from './utils/query-helpers';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,cAAc,eAAe,CAAC;AAG9B,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QueryGen package main entry point
|
|
4
|
+
*
|
|
5
|
+
* @memberjunction/query-gen
|
|
6
|
+
*
|
|
7
|
+
* AI-powered generation of domain-specific SQL query templates with
|
|
8
|
+
* automatic testing, refinement, and metadata export.
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.generateQueryName = exports.getRelationshipCount = exports.hasRelationships = exports.getForeignKeyFields = exports.getPrimaryKeyFields = exports.findEntityById = exports.formatEntityGroupForPrompt = exports.formatEntityMetadataForPrompt = exports.getPropertyOrDefault = exports.requireValue = exports.extractErrorMessage = exports.exportCommand = exports.validateCommand = exports.generateCommand = exports.loadConfig = exports.EmbeddingService = exports.SimilaritySearch = exports.QueryDatabaseWriter = exports.MetadataExporter = exports.QueryRefiner = exports.QueryFixer = exports.QueryTester = exports.QueryWriter = exports.QuestionGenerator = exports.EntityGrouper = void 0;
|
|
26
|
+
// Export core classes
|
|
27
|
+
var EntityGrouper_1 = require("./core/EntityGrouper");
|
|
28
|
+
Object.defineProperty(exports, "EntityGrouper", { enumerable: true, get: function () { return EntityGrouper_1.EntityGrouper; } });
|
|
29
|
+
var QuestionGenerator_1 = require("./core/QuestionGenerator");
|
|
30
|
+
Object.defineProperty(exports, "QuestionGenerator", { enumerable: true, get: function () { return QuestionGenerator_1.QuestionGenerator; } });
|
|
31
|
+
var QueryWriter_1 = require("./core/QueryWriter");
|
|
32
|
+
Object.defineProperty(exports, "QueryWriter", { enumerable: true, get: function () { return QueryWriter_1.QueryWriter; } });
|
|
33
|
+
var QueryTester_1 = require("./core/QueryTester");
|
|
34
|
+
Object.defineProperty(exports, "QueryTester", { enumerable: true, get: function () { return QueryTester_1.QueryTester; } });
|
|
35
|
+
var QueryFixer_1 = require("./core/QueryFixer");
|
|
36
|
+
Object.defineProperty(exports, "QueryFixer", { enumerable: true, get: function () { return QueryFixer_1.QueryFixer; } });
|
|
37
|
+
var QueryRefiner_1 = require("./core/QueryRefiner");
|
|
38
|
+
Object.defineProperty(exports, "QueryRefiner", { enumerable: true, get: function () { return QueryRefiner_1.QueryRefiner; } });
|
|
39
|
+
var MetadataExporter_1 = require("./core/MetadataExporter");
|
|
40
|
+
Object.defineProperty(exports, "MetadataExporter", { enumerable: true, get: function () { return MetadataExporter_1.MetadataExporter; } });
|
|
41
|
+
var QueryDatabaseWriter_1 = require("./core/QueryDatabaseWriter");
|
|
42
|
+
Object.defineProperty(exports, "QueryDatabaseWriter", { enumerable: true, get: function () { return QueryDatabaseWriter_1.QueryDatabaseWriter; } });
|
|
43
|
+
// Export utility classes
|
|
44
|
+
var SimilaritySearch_1 = require("./vectors/SimilaritySearch");
|
|
45
|
+
Object.defineProperty(exports, "SimilaritySearch", { enumerable: true, get: function () { return SimilaritySearch_1.SimilaritySearch; } });
|
|
46
|
+
var EmbeddingService_1 = require("./vectors/EmbeddingService");
|
|
47
|
+
Object.defineProperty(exports, "EmbeddingService", { enumerable: true, get: function () { return EmbeddingService_1.EmbeddingService; } });
|
|
48
|
+
// Export types
|
|
49
|
+
__exportStar(require("./data/schema"), exports);
|
|
50
|
+
// Export prompt names
|
|
51
|
+
__exportStar(require("./prompts/PromptNames"), exports);
|
|
52
|
+
// Export configuration
|
|
53
|
+
var config_1 = require("./cli/config");
|
|
54
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_1.loadConfig; } });
|
|
55
|
+
// Export CLI commands
|
|
56
|
+
var generate_1 = require("./cli/commands/generate");
|
|
57
|
+
Object.defineProperty(exports, "generateCommand", { enumerable: true, get: function () { return generate_1.generateCommand; } });
|
|
58
|
+
var validate_1 = require("./cli/commands/validate");
|
|
59
|
+
Object.defineProperty(exports, "validateCommand", { enumerable: true, get: function () { return validate_1.validateCommand; } });
|
|
60
|
+
var export_1 = require("./cli/commands/export");
|
|
61
|
+
Object.defineProperty(exports, "exportCommand", { enumerable: true, get: function () { return export_1.exportCommand; } });
|
|
62
|
+
// Export utilities
|
|
63
|
+
var error_handlers_1 = require("./utils/error-handlers");
|
|
64
|
+
Object.defineProperty(exports, "extractErrorMessage", { enumerable: true, get: function () { return error_handlers_1.extractErrorMessage; } });
|
|
65
|
+
Object.defineProperty(exports, "requireValue", { enumerable: true, get: function () { return error_handlers_1.requireValue; } });
|
|
66
|
+
Object.defineProperty(exports, "getPropertyOrDefault", { enumerable: true, get: function () { return error_handlers_1.getPropertyOrDefault; } });
|
|
67
|
+
var entity_helpers_1 = require("./utils/entity-helpers");
|
|
68
|
+
Object.defineProperty(exports, "formatEntityMetadataForPrompt", { enumerable: true, get: function () { return entity_helpers_1.formatEntityMetadataForPrompt; } });
|
|
69
|
+
Object.defineProperty(exports, "formatEntityGroupForPrompt", { enumerable: true, get: function () { return entity_helpers_1.formatEntityGroupForPrompt; } });
|
|
70
|
+
Object.defineProperty(exports, "findEntityById", { enumerable: true, get: function () { return entity_helpers_1.findEntityById; } });
|
|
71
|
+
Object.defineProperty(exports, "getPrimaryKeyFields", { enumerable: true, get: function () { return entity_helpers_1.getPrimaryKeyFields; } });
|
|
72
|
+
Object.defineProperty(exports, "getForeignKeyFields", { enumerable: true, get: function () { return entity_helpers_1.getForeignKeyFields; } });
|
|
73
|
+
Object.defineProperty(exports, "hasRelationships", { enumerable: true, get: function () { return entity_helpers_1.hasRelationships; } });
|
|
74
|
+
Object.defineProperty(exports, "getRelationshipCount", { enumerable: true, get: function () { return entity_helpers_1.getRelationshipCount; } });
|
|
75
|
+
var query_helpers_1 = require("./utils/query-helpers");
|
|
76
|
+
Object.defineProperty(exports, "generateQueryName", { enumerable: true, get: function () { return query_helpers_1.generateQueryName; } });
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AAEH,sBAAsB;AACtB,sDAAqD;AAA5C,8GAAA,aAAa,OAAA;AACtB,8DAA6D;AAApD,sHAAA,iBAAiB,OAAA;AAC1B,kDAAiD;AAAxC,0GAAA,WAAW,OAAA;AACpB,kDAAiD;AAAxC,0GAAA,WAAW,OAAA;AACpB,gDAA+C;AAAtC,wGAAA,UAAU,OAAA;AACnB,oDAAmD;AAA1C,4GAAA,YAAY,OAAA;AACrB,4DAA2D;AAAlD,oHAAA,gBAAgB,OAAA;AACzB,kEAAiE;AAAxD,0HAAA,mBAAmB,OAAA;AAE5B,yBAAyB;AACzB,+DAA8D;AAArD,oHAAA,gBAAgB,OAAA;AACzB,+DAA8D;AAArD,oHAAA,gBAAgB,OAAA;AAEzB,eAAe;AACf,gDAA8B;AAE9B,sBAAsB;AACtB,wDAAsC;AAEtC,uBAAuB;AACvB,uCAA0D;AAAjC,oGAAA,UAAU,OAAA;AAEnC,sBAAsB;AACtB,oDAA0D;AAAjD,2GAAA,eAAe,OAAA;AACxB,oDAA0D;AAAjD,2GAAA,eAAe,OAAA;AACxB,gDAAsD;AAA7C,uGAAA,aAAa,OAAA;AAEtB,mBAAmB;AACnB,yDAAiG;AAAxF,qHAAA,mBAAmB,OAAA;AAAE,8GAAA,YAAY,OAAA;AAAE,sHAAA,oBAAoB,OAAA;AAChE,yDAQgC;AAP9B,+HAAA,6BAA6B,OAAA;AAC7B,4HAAA,0BAA0B,OAAA;AAC1B,gHAAA,cAAc,OAAA;AACd,qHAAA,mBAAmB,OAAA;AACnB,qHAAA,mBAAmB,OAAA;AACnB,kHAAA,gBAAgB,OAAA;AAChB,sHAAA,oBAAoB,OAAA;AAEtB,uDAA0D;AAAjD,kHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static prompt name constants for QueryGen
|
|
3
|
+
*
|
|
4
|
+
* All AI prompts used by QueryGen system with their exact names
|
|
5
|
+
* as defined in the AI Prompt metadata.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Business Question Generator prompt
|
|
9
|
+
* Generates 1-2 business questions per entity group
|
|
10
|
+
*/
|
|
11
|
+
export declare const PROMPT_BUSINESS_QUESTION_GENERATOR = "Business Question Generator";
|
|
12
|
+
/**
|
|
13
|
+
* SQL Query Writer prompt
|
|
14
|
+
* Generates Nunjucks SQL templates from business questions
|
|
15
|
+
*/
|
|
16
|
+
export declare const PROMPT_SQL_QUERY_WRITER = "SQL Query Writer";
|
|
17
|
+
/**
|
|
18
|
+
* SQL Query Fixer prompt
|
|
19
|
+
* Fixes SQL syntax and logic errors in generated queries
|
|
20
|
+
*/
|
|
21
|
+
export declare const PROMPT_SQL_QUERY_FIXER = "SQL Query Fixer";
|
|
22
|
+
/**
|
|
23
|
+
* Query Result Evaluator prompt
|
|
24
|
+
* Evaluates if a query correctly answers the business question
|
|
25
|
+
*/
|
|
26
|
+
export declare const PROMPT_QUERY_EVALUATOR = "Query Result Evaluator";
|
|
27
|
+
/**
|
|
28
|
+
* Query Refiner prompt
|
|
29
|
+
* Refines queries based on evaluation feedback
|
|
30
|
+
*/
|
|
31
|
+
export declare const PROMPT_QUERY_REFINER = "Query Refiner";
|
|
32
|
+
//# sourceMappingURL=PromptNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptNames.d.ts","sourceRoot":"","sources":["../../src/prompts/PromptNames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,kCAAkC,gCAAgC,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Static prompt name constants for QueryGen
|
|
4
|
+
*
|
|
5
|
+
* All AI prompts used by QueryGen system with their exact names
|
|
6
|
+
* as defined in the AI Prompt metadata.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PROMPT_QUERY_REFINER = exports.PROMPT_QUERY_EVALUATOR = exports.PROMPT_SQL_QUERY_FIXER = exports.PROMPT_SQL_QUERY_WRITER = exports.PROMPT_BUSINESS_QUESTION_GENERATOR = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Business Question Generator prompt
|
|
12
|
+
* Generates 1-2 business questions per entity group
|
|
13
|
+
*/
|
|
14
|
+
exports.PROMPT_BUSINESS_QUESTION_GENERATOR = 'Business Question Generator';
|
|
15
|
+
/**
|
|
16
|
+
* SQL Query Writer prompt
|
|
17
|
+
* Generates Nunjucks SQL templates from business questions
|
|
18
|
+
*/
|
|
19
|
+
exports.PROMPT_SQL_QUERY_WRITER = 'SQL Query Writer';
|
|
20
|
+
/**
|
|
21
|
+
* SQL Query Fixer prompt
|
|
22
|
+
* Fixes SQL syntax and logic errors in generated queries
|
|
23
|
+
*/
|
|
24
|
+
exports.PROMPT_SQL_QUERY_FIXER = 'SQL Query Fixer';
|
|
25
|
+
/**
|
|
26
|
+
* Query Result Evaluator prompt
|
|
27
|
+
* Evaluates if a query correctly answers the business question
|
|
28
|
+
*/
|
|
29
|
+
exports.PROMPT_QUERY_EVALUATOR = 'Query Result Evaluator';
|
|
30
|
+
/**
|
|
31
|
+
* Query Refiner prompt
|
|
32
|
+
* Refines queries based on evaluation feedback
|
|
33
|
+
*/
|
|
34
|
+
exports.PROMPT_QUERY_REFINER = 'Query Refiner';
|
|
35
|
+
//# sourceMappingURL=PromptNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptNames.js","sourceRoot":"","sources":["../../src/prompts/PromptNames.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;;GAGG;AACU,QAAA,kCAAkC,GAAG,6BAA6B,CAAC;AAEhF;;;GAGG;AACU,QAAA,uBAAuB,GAAG,kBAAkB,CAAC;AAE1D;;;GAGG;AACU,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AAExD;;;GAGG;AACU,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D;;;GAGG;AACU,QAAA,oBAAoB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CategoryBuilder - Builds QueryCategoryInfo from configuration and entity groups
|
|
3
|
+
*
|
|
4
|
+
* Centralizes the logic for determining what categories should be created
|
|
5
|
+
* for queries based on the QueryGen configuration.
|
|
6
|
+
*/
|
|
7
|
+
import { QueryCategoryInfo, EntityGroup } from '../data/schema';
|
|
8
|
+
import { QueryGenConfig } from '../cli/config';
|
|
9
|
+
/**
|
|
10
|
+
* Build category information for a query based on configuration
|
|
11
|
+
*
|
|
12
|
+
* @param config - QueryGen configuration
|
|
13
|
+
* @param entityGroup - Entity group for the query
|
|
14
|
+
* @returns QueryCategoryInfo with full category details
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildQueryCategory(config: QueryGenConfig, entityGroup: EntityGroup): QueryCategoryInfo;
|
|
17
|
+
/**
|
|
18
|
+
* Extract all unique categories from validated queries
|
|
19
|
+
* Returns categories in hierarchical order (root first, then children)
|
|
20
|
+
*
|
|
21
|
+
* IMPORTANT: Also creates parent categories for any child categories
|
|
22
|
+
* (e.g., if "Golden-Queries/Members" is provided, also creates "Golden-Queries")
|
|
23
|
+
*
|
|
24
|
+
* @param categories - Array of QueryCategoryInfo from validated queries
|
|
25
|
+
* @returns Unique categories sorted hierarchically (includes auto-generated parents)
|
|
26
|
+
*/
|
|
27
|
+
export declare function extractUniqueCategories(categories: QueryCategoryInfo[]): QueryCategoryInfo[];
|
|
28
|
+
//# sourceMappingURL=category-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category-builder.d.ts","sourceRoot":"","sources":["../../src/utils/category-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,WAAW,GACvB,iBAAiB,CAgCnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAgC5F"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CategoryBuilder - Builds QueryCategoryInfo from configuration and entity groups
|
|
4
|
+
*
|
|
5
|
+
* Centralizes the logic for determining what categories should be created
|
|
6
|
+
* for queries based on the QueryGen configuration.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.extractUniqueCategories = exports.buildQueryCategory = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Build category information for a query based on configuration
|
|
12
|
+
*
|
|
13
|
+
* @param config - QueryGen configuration
|
|
14
|
+
* @param entityGroup - Entity group for the query
|
|
15
|
+
* @returns QueryCategoryInfo with full category details
|
|
16
|
+
*/
|
|
17
|
+
function buildQueryCategory(config, entityGroup) {
|
|
18
|
+
const rootCategoryName = config.rootQueryCategory || 'Auto-Generated';
|
|
19
|
+
if (config.autoCreateEntityQueryCategories) {
|
|
20
|
+
// Create entity-specific category under root
|
|
21
|
+
const entityName = entityGroup?.primaryEntity?.Name;
|
|
22
|
+
if (!entityName) {
|
|
23
|
+
console.warn('buildQueryCategory: primaryEntity.Name is undefined, falling back to root category');
|
|
24
|
+
return {
|
|
25
|
+
name: rootCategoryName,
|
|
26
|
+
parentName: null,
|
|
27
|
+
description: 'Automatically generated queries from query-gen tool',
|
|
28
|
+
path: rootCategoryName
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
name: entityName,
|
|
33
|
+
parentName: rootCategoryName,
|
|
34
|
+
description: `Queries for the ${entityName} entity`,
|
|
35
|
+
path: `${rootCategoryName}/${entityName}`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Use root category only
|
|
40
|
+
return {
|
|
41
|
+
name: rootCategoryName,
|
|
42
|
+
parentName: null,
|
|
43
|
+
description: 'Automatically generated queries from query-gen tool',
|
|
44
|
+
path: rootCategoryName
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.buildQueryCategory = buildQueryCategory;
|
|
49
|
+
/**
|
|
50
|
+
* Extract all unique categories from validated queries
|
|
51
|
+
* Returns categories in hierarchical order (root first, then children)
|
|
52
|
+
*
|
|
53
|
+
* IMPORTANT: Also creates parent categories for any child categories
|
|
54
|
+
* (e.g., if "Golden-Queries/Members" is provided, also creates "Golden-Queries")
|
|
55
|
+
*
|
|
56
|
+
* @param categories - Array of QueryCategoryInfo from validated queries
|
|
57
|
+
* @returns Unique categories sorted hierarchically (includes auto-generated parents)
|
|
58
|
+
*/
|
|
59
|
+
function extractUniqueCategories(categories) {
|
|
60
|
+
const uniqueMap = new Map();
|
|
61
|
+
// Collect all unique categories (by path)
|
|
62
|
+
for (const cat of categories) {
|
|
63
|
+
if (!uniqueMap.has(cat.path)) {
|
|
64
|
+
uniqueMap.set(cat.path, cat);
|
|
65
|
+
}
|
|
66
|
+
// If this is a child category, ensure parent category exists
|
|
67
|
+
if (cat.parentName && !uniqueMap.has(cat.parentName)) {
|
|
68
|
+
uniqueMap.set(cat.parentName, {
|
|
69
|
+
name: cat.parentName,
|
|
70
|
+
parentName: null,
|
|
71
|
+
description: 'Automatically generated queries from query-gen tool',
|
|
72
|
+
path: cat.parentName
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Convert to array and sort: root categories first, then children
|
|
77
|
+
const result = Array.from(uniqueMap.values());
|
|
78
|
+
result.sort((a, b) => {
|
|
79
|
+
// Root categories (no parent) come first
|
|
80
|
+
if (a.parentName === null && b.parentName !== null)
|
|
81
|
+
return -1;
|
|
82
|
+
if (a.parentName !== null && b.parentName === null)
|
|
83
|
+
return 1;
|
|
84
|
+
// Then sort alphabetically by path
|
|
85
|
+
return a.path.localeCompare(b.path);
|
|
86
|
+
});
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
exports.extractUniqueCategories = extractUniqueCategories;
|
|
90
|
+
//# sourceMappingURL=category-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category-builder.js","sourceRoot":"","sources":["../../src/utils/category-builder.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6D;QAC7D,IAAI,GAAG,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACrD,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE;gBAC5B,IAAI,EAAE,GAAG,CAAC,UAAU;gBACpB,UAAU,EAAE,IAAI;gBAChB,WAAW,EAAE,qDAAqD;gBAClE,IAAI,EAAE,GAAG,CAAC,UAAU;aACrB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACnB,yCAAyC;QACzC,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI;YAAE,OAAO,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI;YAAE,OAAO,CAAC,CAAC;QAE7D,mCAAmC;QACnC,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAhCD,0DAgCC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity helper utilities
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for working with entity metadata and formatting for AI prompts
|
|
5
|
+
*/
|
|
6
|
+
import { EntityInfo, EntityFieldInfo } from '@memberjunction/core';
|
|
7
|
+
import { EntityMetadataForPrompt, EntityGroup } from '../data/schema';
|
|
8
|
+
/**
|
|
9
|
+
* Format entity metadata for AI prompt consumption
|
|
10
|
+
* Includes schema name, base view, fields, and relationships
|
|
11
|
+
*
|
|
12
|
+
* CRITICAL: Must include schemaName and baseView for functional SQL generation
|
|
13
|
+
*
|
|
14
|
+
* @param entity - Entity to format
|
|
15
|
+
* @param allEntities - All available entities for relationship lookups
|
|
16
|
+
* @returns Formatted entity metadata ready for AI prompts
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatEntityMetadataForPrompt(entity: EntityInfo, allEntities: EntityInfo[]): EntityMetadataForPrompt;
|
|
19
|
+
/**
|
|
20
|
+
* Find entity by ID in array
|
|
21
|
+
*/
|
|
22
|
+
export declare function findEntityById(id: string, entities: EntityInfo[]): EntityInfo | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get primary key field(s) for an entity
|
|
25
|
+
*/
|
|
26
|
+
export declare function getPrimaryKeyFields(entity: EntityInfo): EntityFieldInfo[];
|
|
27
|
+
/**
|
|
28
|
+
* Get foreign key fields for an entity
|
|
29
|
+
*/
|
|
30
|
+
export declare function getForeignKeyFields(entity: EntityInfo): EntityFieldInfo[];
|
|
31
|
+
/**
|
|
32
|
+
* Check if an entity has any relationships
|
|
33
|
+
* Uses EntityInfo.RelatedEntities getter
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasRelationships(entity: EntityInfo, allEntities: EntityInfo[]): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Get count of relationships for an entity
|
|
38
|
+
* Uses EntityInfo.RelatedEntities getter
|
|
39
|
+
*/
|
|
40
|
+
export declare function getRelationshipCount(entity: EntityInfo, allEntities: EntityInfo[]): number;
|
|
41
|
+
/**
|
|
42
|
+
* Format an entire entity group for AI prompt consumption
|
|
43
|
+
* Converts all entities in the group to structured metadata
|
|
44
|
+
*
|
|
45
|
+
* @param entityGroup - Entity group to format
|
|
46
|
+
* @returns Array of formatted entity metadata for Nunjucks template
|
|
47
|
+
*/
|
|
48
|
+
export declare function formatEntityGroupForPrompt(entityGroup: EntityGroup): EntityMetadataForPrompt[];
|
|
49
|
+
//# sourceMappingURL=entity-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/entity-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACL,uBAAuB,EAGvB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,uBAAuB,CAUpH;AAwHD;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,GAAG,SAAS,CAEzF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,EAAE,CAEzE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,EAAE,CAEzE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAEvF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAE1F;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,WAAW,GAAG,uBAAuB,EAAE,CAI9F"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Entity helper utilities
|
|
4
|
+
*
|
|
5
|
+
* Helper functions for working with entity metadata and formatting for AI prompts
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.formatEntityGroupForPrompt = exports.getRelationshipCount = exports.hasRelationships = exports.getForeignKeyFields = exports.getPrimaryKeyFields = exports.findEntityById = exports.formatEntityMetadataForPrompt = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Format entity metadata for AI prompt consumption
|
|
11
|
+
* Includes schema name, base view, fields, and relationships
|
|
12
|
+
*
|
|
13
|
+
* CRITICAL: Must include schemaName and baseView for functional SQL generation
|
|
14
|
+
*
|
|
15
|
+
* @param entity - Entity to format
|
|
16
|
+
* @param allEntities - All available entities for relationship lookups
|
|
17
|
+
* @returns Formatted entity metadata ready for AI prompts
|
|
18
|
+
*/
|
|
19
|
+
function formatEntityMetadataForPrompt(entity, allEntities) {
|
|
20
|
+
return {
|
|
21
|
+
entityName: entity.Name,
|
|
22
|
+
description: entity.Description || '',
|
|
23
|
+
schemaName: entity.SchemaName || 'dbo',
|
|
24
|
+
baseTable: entity.BaseTable || entity.Name,
|
|
25
|
+
baseView: entity.BaseView || `vw${entity.Name}`,
|
|
26
|
+
fields: formatEntityFields(entity),
|
|
27
|
+
relationships: formatEntityRelationships(entity, allEntities),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
exports.formatEntityMetadataForPrompt = formatEntityMetadataForPrompt;
|
|
31
|
+
/**
|
|
32
|
+
* Format entity fields for AI prompt
|
|
33
|
+
* Includes field metadata with types, descriptions, and relationship info
|
|
34
|
+
* Labels internal (__mj_*) and virtual fields appropriately
|
|
35
|
+
*/
|
|
36
|
+
function formatEntityFields(entity) {
|
|
37
|
+
return entity.Fields.map((field) => {
|
|
38
|
+
const isInternalField = field.Name.startsWith('__mj_');
|
|
39
|
+
const isVirtualField = field.IsVirtual || false;
|
|
40
|
+
let description = field.Description || '';
|
|
41
|
+
// Add labels for special fields
|
|
42
|
+
if (isInternalField) {
|
|
43
|
+
description = `[INTERNAL] ${description}`;
|
|
44
|
+
}
|
|
45
|
+
else if (isVirtualField) {
|
|
46
|
+
description = `[VIRTUAL] ${description}`;
|
|
47
|
+
}
|
|
48
|
+
// Extract possible values from EntityFieldValues if available
|
|
49
|
+
const possibleValues = field.EntityFieldValues && field.EntityFieldValues.length > 0
|
|
50
|
+
? field.EntityFieldValues.map(efv => efv.Value)
|
|
51
|
+
: undefined;
|
|
52
|
+
return {
|
|
53
|
+
name: field.Name,
|
|
54
|
+
displayName: field.DisplayName || field.Name,
|
|
55
|
+
type: field.Type,
|
|
56
|
+
sqlFullType: field.SQLFullType,
|
|
57
|
+
description,
|
|
58
|
+
isPrimaryKey: field.IsPrimaryKey || false,
|
|
59
|
+
isForeignKey: field.RelatedEntityID != null && field.RelatedEntityID.trim().length > 0,
|
|
60
|
+
isVirtual: isVirtualField,
|
|
61
|
+
allowsNull: field.AllowsNull,
|
|
62
|
+
relatedEntity: field.RelatedEntity || undefined,
|
|
63
|
+
isRequired: !field.AllowsNull,
|
|
64
|
+
defaultValue: field.DefaultValue || undefined,
|
|
65
|
+
possibleValues,
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Format entity relationships for AI prompt
|
|
71
|
+
* Includes schema and view names for proper JOIN generation
|
|
72
|
+
* Only includes relationships to entities in the current entity group
|
|
73
|
+
* Uses EntityInfo.RelatedEntities getter for pre-computed relationships
|
|
74
|
+
*/
|
|
75
|
+
function formatEntityRelationships(entity, allEntities) {
|
|
76
|
+
// Create set of entity names in the group for filtering
|
|
77
|
+
const entityNamesInGroup = new Set(allEntities.map(e => e.Name));
|
|
78
|
+
// Use entity.RelatedEntities getter which returns EntityRelationshipInfo[]
|
|
79
|
+
return entity.RelatedEntities
|
|
80
|
+
.filter(rel => entityNamesInGroup.has(rel.RelatedEntity)) // Only include relationships within the group
|
|
81
|
+
.map(rel => {
|
|
82
|
+
const relatedEntity = findEntityById(rel.RelatedEntityID, allEntities);
|
|
83
|
+
// Determine the foreign key field based on relationship type and available fields
|
|
84
|
+
let foreignKeyField;
|
|
85
|
+
let joinDescription;
|
|
86
|
+
const currentSchema = entity.SchemaName || 'dbo';
|
|
87
|
+
const currentView = entity.BaseView || `vw${entity.Name}`;
|
|
88
|
+
const relatedSchema = relatedEntity?.SchemaName || 'dbo';
|
|
89
|
+
const relatedView = relatedEntity?.BaseView || `vw${rel.RelatedEntity}`;
|
|
90
|
+
if (rel.EntityKeyField && rel.EntityKeyField.trim() !== '') {
|
|
91
|
+
// Current entity has the foreign key
|
|
92
|
+
foreignKeyField = rel.EntityKeyField;
|
|
93
|
+
const relatedJoinField = rel.RelatedEntityJoinField || 'ID';
|
|
94
|
+
joinDescription = `${currentSchema}.${currentView}.${foreignKeyField} = ${relatedSchema}.${relatedView}.${relatedJoinField}`;
|
|
95
|
+
}
|
|
96
|
+
else if (rel.RelatedEntityJoinField && rel.RelatedEntityJoinField.trim() !== '') {
|
|
97
|
+
// Related entity has the foreign key pointing back to this entity
|
|
98
|
+
foreignKeyField = rel.RelatedEntityJoinField;
|
|
99
|
+
joinDescription = `${relatedSchema}.${relatedView}.${foreignKeyField} = ${currentSchema}.${currentView}.ID`;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// No foreign key field specified (possibly many-to-many through join table)
|
|
103
|
+
foreignKeyField = '';
|
|
104
|
+
joinDescription = `Related via ${rel.JoinView || 'join table'}`;
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
type: mapRelationshipType(rel.Type),
|
|
108
|
+
relatedEntity: rel.RelatedEntity,
|
|
109
|
+
relatedEntityView: relatedEntity?.BaseView || `vw${rel.RelatedEntity}`,
|
|
110
|
+
relatedEntitySchema: relatedEntity?.SchemaName || 'dbo',
|
|
111
|
+
foreignKeyField,
|
|
112
|
+
description: joinDescription,
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Map MJ relationship types to QueryGen types
|
|
118
|
+
*/
|
|
119
|
+
function mapRelationshipType(mjType) {
|
|
120
|
+
const normalized = mjType.toLowerCase().replace(/\s+/g, '-');
|
|
121
|
+
if (normalized === 'many-to-one')
|
|
122
|
+
return 'many-to-one';
|
|
123
|
+
if (normalized === 'one-to-many')
|
|
124
|
+
return 'one-to-many';
|
|
125
|
+
if (normalized === 'many-to-many')
|
|
126
|
+
return 'many-to-many';
|
|
127
|
+
return 'many-to-one'; // Default fallback
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Check if a field is a foreign key field
|
|
131
|
+
*/
|
|
132
|
+
function isForeignKeyField(field) {
|
|
133
|
+
return field.RelatedEntityID != null && field.RelatedEntityID.trim().length > 0;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Find entity by name in array
|
|
137
|
+
*/
|
|
138
|
+
function findEntityByName(name, entities) {
|
|
139
|
+
return entities.find((e) => e.Name === name);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Find entity by ID in array
|
|
143
|
+
*/
|
|
144
|
+
function findEntityById(id, entities) {
|
|
145
|
+
return entities.find((e) => e.ID === id);
|
|
146
|
+
}
|
|
147
|
+
exports.findEntityById = findEntityById;
|
|
148
|
+
/**
|
|
149
|
+
* Get primary key field(s) for an entity
|
|
150
|
+
*/
|
|
151
|
+
function getPrimaryKeyFields(entity) {
|
|
152
|
+
return entity.Fields.filter((f) => f.IsPrimaryKey);
|
|
153
|
+
}
|
|
154
|
+
exports.getPrimaryKeyFields = getPrimaryKeyFields;
|
|
155
|
+
/**
|
|
156
|
+
* Get foreign key fields for an entity
|
|
157
|
+
*/
|
|
158
|
+
function getForeignKeyFields(entity) {
|
|
159
|
+
return entity.Fields.filter((f) => isForeignKeyField(f));
|
|
160
|
+
}
|
|
161
|
+
exports.getForeignKeyFields = getForeignKeyFields;
|
|
162
|
+
/**
|
|
163
|
+
* Check if an entity has any relationships
|
|
164
|
+
* Uses EntityInfo.RelatedEntities getter
|
|
165
|
+
*/
|
|
166
|
+
function hasRelationships(entity, allEntities) {
|
|
167
|
+
return entity.RelatedEntities.length > 0;
|
|
168
|
+
}
|
|
169
|
+
exports.hasRelationships = hasRelationships;
|
|
170
|
+
/**
|
|
171
|
+
* Get count of relationships for an entity
|
|
172
|
+
* Uses EntityInfo.RelatedEntities getter
|
|
173
|
+
*/
|
|
174
|
+
function getRelationshipCount(entity, allEntities) {
|
|
175
|
+
return entity.RelatedEntities.length;
|
|
176
|
+
}
|
|
177
|
+
exports.getRelationshipCount = getRelationshipCount;
|
|
178
|
+
/**
|
|
179
|
+
* Format an entire entity group for AI prompt consumption
|
|
180
|
+
* Converts all entities in the group to structured metadata
|
|
181
|
+
*
|
|
182
|
+
* @param entityGroup - Entity group to format
|
|
183
|
+
* @returns Array of formatted entity metadata for Nunjucks template
|
|
184
|
+
*/
|
|
185
|
+
function formatEntityGroupForPrompt(entityGroup) {
|
|
186
|
+
return entityGroup.entities.map((entity) => formatEntityMetadataForPrompt(entity, entityGroup.entities));
|
|
187
|
+
}
|
|
188
|
+
exports.formatEntityGroupForPrompt = formatEntityGroupForPrompt;
|
|
189
|
+
//# sourceMappingURL=entity-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-helpers.js","sourceRoot":"","sources":["../../src/utils/entity-helpers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAUH;;;;;;;;;GASG;AACH,SAAgB,6BAA6B,CAAC,MAAkB,EAAE,WAAyB;IACzF,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,IAAI;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;QACrC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,KAAK;QACtC,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI;QAC1C,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,KAAK,MAAM,CAAC,IAAI,EAAE;QAC/C,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;QAClC,aAAa,EAAE,yBAAyB,CAAC,MAAM,EAAE,WAAW,CAAC;KAC9D,CAAC;AACJ,CAAC;AAVD,sEAUC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,MAAkB;I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C,QAAQ,CAAC,CAC5D,CAAC;AACJ,CAAC;AAJD,gEAIC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error handling utilities
|
|
3
|
+
*
|
|
4
|
+
* Standardized error handling functions following MJ patterns
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Extract error message from unknown error type
|
|
8
|
+
* Uses MJ's extractErrorMessage pattern
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractErrorMessage(error: unknown, context: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Validate required value is not null/undefined
|
|
13
|
+
*/
|
|
14
|
+
export declare function requireValue<T>(value: T | null | undefined, fieldName: string): T;
|
|
15
|
+
/**
|
|
16
|
+
* Get property with fallback value
|
|
17
|
+
*/
|
|
18
|
+
export declare function getPropertyOrDefault<T>(obj: Record<string, unknown>, key: string, defaultValue: T): T;
|
|
19
|
+
//# sourceMappingURL=error-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../../src/utils/error-handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ3E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,CAKjF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,GACd,CAAC,CAGH"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Error handling utilities
|
|
4
|
+
*
|
|
5
|
+
* Standardized error handling functions following MJ patterns
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getPropertyOrDefault = exports.requireValue = exports.extractErrorMessage = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Extract error message from unknown error type
|
|
11
|
+
* Uses MJ's extractErrorMessage pattern
|
|
12
|
+
*/
|
|
13
|
+
function extractErrorMessage(error, context) {
|
|
14
|
+
if (error instanceof Error) {
|
|
15
|
+
return `${context}: ${error.message}`;
|
|
16
|
+
}
|
|
17
|
+
if (typeof error === 'string') {
|
|
18
|
+
return `${context}: ${error}`;
|
|
19
|
+
}
|
|
20
|
+
return `${context}: Unknown error occurred`;
|
|
21
|
+
}
|
|
22
|
+
exports.extractErrorMessage = extractErrorMessage;
|
|
23
|
+
/**
|
|
24
|
+
* Validate required value is not null/undefined
|
|
25
|
+
*/
|
|
26
|
+
function requireValue(value, fieldName) {
|
|
27
|
+
if (value === null || value === undefined) {
|
|
28
|
+
throw new Error(`Required value '${fieldName}' is missing`);
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
exports.requireValue = requireValue;
|
|
33
|
+
/**
|
|
34
|
+
* Get property with fallback value
|
|
35
|
+
*/
|
|
36
|
+
function getPropertyOrDefault(obj, key, defaultValue) {
|
|
37
|
+
const value = obj[key];
|
|
38
|
+
return value !== undefined ? value : defaultValue;
|
|
39
|
+
}
|
|
40
|
+
exports.getPropertyOrDefault = getPropertyOrDefault;
|
|
41
|
+
//# sourceMappingURL=error-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handlers.js","sourceRoot":"","sources":["../../src/utils/error-handlers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAAc,EAAE,OAAe;IACjE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,GAAG,OAAO,KAAK,KAAK,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,GAAG,OAAO,0BAA0B,CAAC;AAC9C,CAAC;AARD,kDAQC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAI,KAA2B,EAAE,SAAiB;IAC5E,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,mBAAmB,SAAS,cAAc,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,oCAKC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,GAA4B,EAC5B,GAAW,EACX,YAAe;IAEf,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAE,KAAW,CAAC,CAAC,CAAC,YAAY,CAAC;AAC3D,CAAC;AAPD,oDAOC"}
|